[support] Inserting php block snippet into a standard node

Neil: esl-lounge.com neil at esl-lounge.com
Fri May 4 10:30:21 UTC 2007


I am creating a dynamic newsletter using the simplenews module and php block snippets. I've got the overall mechanics working well. 

I create the newsletter, say /newsletter/05-may-07 which has standard header and footer text which goes out to every person. Then my idea is to insert location-based content into it so that Jane from Texas sees "Last five members from Texas", "Last five posts from Houston", "Five members who go to your school" and so on. Chris from London would see different content.

The problem I've hit though is that when I insert the block snippet into the node, choose PHP as input format and press "Submit", none of the content below the snippet shows. Here is my snippet:

<?php
global $user;
$result=db_query("SELECT dru_users.uid, dru_users.init FROM dru_users WHERE (dru_users.uid = $user->uid)");
while ($u = db_fetch_object($result)) {
$items[]=l($u->init, "user/" . $u->uid);
}
return theme('item_list',$items);
?>

This is just a test snippet to test the concept....in a block, it shows the current user's e-mail address. It also does this in a node, but as I say, the rest of the content below this code doesn't come through.

Any idea what the problem is?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.drupal.org/pipermail/support/attachments/20070504/d8894691/attachment.htm 


More information about the support mailing list