This forum is for module development and code related questions, not general module support. For general support, use the Post installation forum.

Generating a Teaser View

I wanted to know how to generate a teaser view of a node? is there a function node_teaser_view() or something like that which can generate a teaser given its $nid? I do nor want to use views to generate teaser

Seeking tutorial to programm views for content area.

Hi all,

I just worked through the handbook Creating modules - a tutorial: Drupal 5.x and drupal starts to make a lot of fun to me as newbie! I was programming my first block here. It is an "image cart" where the user can put an image. The image information is availiable only during the user's session, so it is hold in the $_SESSION context.

How can I include HTML code in the head?

How can I include HTML or PHP code in the head () with a module?

How to debug MySQL database code not working?

I have some code that is loaded as a custom mail sending handler. The idea is to get around the "web server can't send e-mail" rule of SourceForge.net, for user registrations. The mail sending handler gets called with some data for e-mails (I test this with the contact page), but the db_query() fails. When I attempt to write the query to a readable file, the mysql error string is empty.

How do I debug this? (Code follows)

<?php
/*
CREATE TABLE 'outgoing_mail' (
'mailkey' VARCHAR( 100 ) NOT NULL ,
'mailto' VARCHAR( 100 ) NOT NULL ,
'subject' VARCHAR( 100 ) NOT NULL ,
'body' TEXT NOT NULL ,
'from' VARCHAR( 100 ) NOT NULL ,
'headers' TEXT NOT NULL ,
'inserttime' TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP ,
'sendtime' TIMESTAMP NULL ,
'id' INT( 11 ) NOT NULL AUTO_INCREMENT PRIMARY KEY ,
INDEX ( 'sendtime' )
) ENGINE = MYISAM ;
*/
function drupal_mail_wrapper($mailkey, $to, $subject, $body, $from, $headers) {
db_set_active();
if (!db_query("insert into outgoing_mail values('%s', '%s', '%s', '%s', '%s', '%s')",
$mailkey, $to, $subject, $body, $from, $headers)) {
$f = fopen("/tmp/persistent/kwxport-files/error-$mailkey", "wb");
fwrite($f, "Error to: $to\n".mysql_error($active_db)."\n");
fclose($f);
}
return true;
}

function drupal_send_mail() {
include_once "./sites/default/settings.php";

Interested users and i love this users

I want 2 make 2 module

*** Interested user

This user click the Interested link and interested with that node

*** I love this user

This user click the i love link and listed in loved users this node

Sory for my bad english.

Pages

Subscribe with RSS Subscribe to RSS - Module development and code questions