I try to create a block to display the stories submitted by the members that are online on the website on that moment. So, if there is logged in user1, user2, and user3 this module has to display all the stories submitted by user1, user2 and userr3.
Here is what I did, but is not working... cand you please give me a tip:
Code:
<?php
if ( !defined('BLOCK_FILE') ) {
Header("Location: ../index.php");
die();
}
$content = "";
global $user, $cookie, $prefix, $user_prefix, $db, $anonymous, $sitekey, $gfx_chk, $locale;
$sql3 = "SELECT uname, guest FROM ".$prefix."_session WHERE guest='0'";
$result = $db->sql_query($sql3);
$sql7 = "SELECT sid, title FROM ".$prefix."_stories WHERE informant='$uname' ORDER BY sid DESC LIMIT 0,10";
$result7 = $db->sql_query($sql7);
while($row7 = $db->sql_fetchrow($result7)) {
$sid = intval($row7['sid']);
$title = stripslashes(check_html($row7['title'], "nohtml"));
$content .= "<li><a href=\"modules.php?name=News&file=article&sid=$sid\">$title</a><br>";
}
?>
_________________ AdSense Sucks !!!
sting Site Admin
Joined: Jul 24, 2003
Posts: 1985
Location: Apparently ALWAYS Online. . .
Posted:
Tue Aug 21, 2007 10:59 am
Is it giving you any kind of error message?
And also, I am admittedly a little rusty with my block code, but doesn't the variable have to be separated from the quotes?
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum