Theming custom module

Hi,

I'm developing a custom module. I have found this useful article about overriding theme functions. http://drupal.org/node/11811. It's working correctly for theme functions already in the drupal theme system. For example: theme_item_list();

The problem is: I have wrote my own code, but it seems drupal does not recognize it like a node theme:

function phptemplate_esorg_item($items = array(), $title = NULL) {
  return _phptemplate_callback('esorg_item', array('items' => $items, 'title' => $title));
}

I've wrote my template file: esorg_item.tpl.php

<div class="node<?php print ($sticky) ? " sticky" : ""; ?>">
  <? foreach ($items as $item) {?>
    <? print $item?>  
  <? } ?>
</div>

...and from my custom module I call the theme like this:

  $items = Array("Test1", "Test2", "Test3");
  print theme("esorg_item", $items, "Test page");

The output I get, when I navigate to my module in a webbrowser is:

  <div class="node">
  Test1  Test2  Test3
      <h2><a href="" title="Test page">Test page</a></h2>
    <div class="node-content">
     </div>
    </div>

So as you see, there is missing the full page template html code. It seems drupal recognize my module as a page template, like: page.tpl.php, but I would like to use my theme function output as a node.

If I modify the theme_item_list(); (or any other that is already in drupal) functions, like in the article, it is works correctly, but as I change the name of the theme function it is not.

how to have module write JS variable?

REALLY ANNOYING that the forum posts dump your post cuz you added something it didn't like... but i'll try again...

=================

I am trying to have a module add a VAR so that my JS code can access it. I thought perhaps drupal_to_js sounded like the right thing - but it doesn't seem to do anything.

anyone know how to do this?

alternatively.. simply some way to add text string to < h e a d> would be useable as well.

if drupal_to_js is the right thing to use here; can some point me to an example?

i tried the obvious

The account register mail can not send

Hi,all
I am new in drupal.I have installed drupal on server,everything seems ok.
But fail to sent the the when register account.
The error is "550 5.1.1 ... User unknown",
but the user is a valid user.

Where can I modify the mail properties,such as smtp server,from address etc..

Hope any one help me
Thanks very much.

Follow is the mail log:

----- The following addresses had permanent fatal errors -----

(reason: 553 Relay restriction.)

----- Transcript of session follows -----
... while talking to webmail.decisci.com.:
>>> RCPT To:
<<< 553 Relay restriction.
550 5.1.1 ... User unknown

--k1O1QFPG015670.1140744375/oodnadatta.decisci
Content-Type: message/delivery-status

Reporting-MTA: dns; oodnadatta.decisci
Received-From-MTA: DNS; localhost
Arrival-Date: Thu, 23 Feb 2006 17:26:11 -0800

Final-Recipient: RFC822; kaiyuan@decisci.com
Action: failed
Status: 5.1.3
Remote-MTA: DNS; webmail.decisci.com
Diagnostic-Code: SMTP; 553 Relay restriction.
Last-Attempt-Date: Thu, 23 Feb 2006 17:26:15 -0800

--k1O1QFPG015670.1140744375/oodnadatta.decisci
Content-Type: text/rfc822-headers

Return-Path:
Received: from decisci.com (localhost [127.0.0.1])
by oodnadatta.decisci (8.13.4/8.13.4/SuSE Linux 0.7) with ESMTP id k1O1Q9PE015668

Help with <code>, Themes, and CSS

I have been spending a lot of time the past couple of days modifying the bluemarine theme to my use. Things where going sooo well and I've been tweaking things to make it perfect. Then it broke.

The first issue is relatively minor: When I post blogs with < code > tags in them the font is very small. Also, it used to be shaded differently; but now it just appears white. I'm having difficulty identifying the .css tags for this attribute. I would love some help.

Also, and this is more serious and has me completely stumped: Now that I've made the theme changes, whenever I click on Logoff, or try and Logon (or change any setting) I come to a blank page. If I then go back to the home page I find that whatever action I took did in fact happen. The following error is displayed:

    * warning: Cannot modify header information - headers already sent by (output started at /home/webcdic/public_html/themes/webcdi/template.php:15) in /home/webcdic/public_html/includes/common.inc on line 233.
    * warning: Cannot modify header information - headers already sent by (output started at /home/webcdic/public_html/themes/webcdi/template.php:15) in /home/webcdic/public_html/includes/common.inc on line 233.

. Also, when I go to AcidFree the page is blank IF I'M Logged on. If I try as an anonymous user I can see the photo albums just fine. When I change back to the original bluemarine theme everything goes back to working fine. I wouldn't have expected this behavior in a theme and I'm really confused.

Did the moderation queue module used to come standard?

Did the moderation queue module used to come standard?

Strange login problem

I'm having a very strange problem with one of my sites running 4.7b4. Suddenly I couldn't log with the main user. So well, I thought that maybe it was a password issue. So I tried to reset it and the email says my new password is "%password". After searching I realised this is a reported bug, so I didn't panic.

Now I had to work out how to log in. I registered a new account, then via phpmyadmin, changed the uid of my main account to 955 and put uid 1 on my new account. This seemed to work fine. But then i logg'd out and tried to log in again and I couldnt.

Pages

Subscribe with RSS Subscribe to RSS - Drupal 4.7.x