cant get the forum name to appear in my last post block

  Post new topicReply to topicPrintable Version
<< View previous topic View next topic >>
Share: Del.icio.us  Digg  Google  Spurl  Blink  Furl  Y! MyWeb  
#1   cant get the forum name to appear in my last post block
stuart
CZ Newbie
stuart has been a member for over 18 year's 18 Year Member
Gender: Male
Status: Offline
Joined: Jun 11, 2006
0.00 posts per day
Posts: 1
Points: 52
   
i am trying to get the forum name in the last 15 posts block i have (nuke 7.icon_cool.gif, i cant see what is wrong with the code i have tried. can anyone brainstorm it?

global $prefix, $dbi, $sitename, $user, $cookie, $group_id;
$count = 1;
$amount = 15;
$content = "<A name= \"scrollingCode\"></A>";
$content .="<MARQUEE behavior= \"scroll\" align= \"center\" direction= \"up\" height=\"220\" scrollamount= \"2\" scrolldelay= \"25\" onmouseover='this.stop()' onmouseout='this.start()'>";
$content .="<center> <STYLE=\"text-decoration: none\"><font color=\"#666666\"><b>Last $amount Forum Messages</b></center>";
$result1 = sql_query("SELECT topic_id, topic_last_post_id, topic_title, forum_id FROM ".$prefix."_bbtopics ORDER BY topic_last_post_id DESC LIMIT $amount", $dbi);
$content .= "<br>";
while(list($topic_id, $topic_last_post_id, $topic_title, $forum_id) = sql_fetch_row($result1, $dbi)) {
$result2 = sql_query("SELECT topic_id, poster_id, FROM_UNIXTIME(post_time,'%b %d, %Y at %T') as post_time, forum_id FROM ".$prefix."_bbposts where post_id='$topic_last_post_id'", $dbi);
list($topic_id, $poster_id, $post_time, $forum_id)=sql_fetch_row($result2, $dbi);

$result3 = sql_query("SELECT username, user_id FROM ".$prefix."_users where user_id='$poster_id'", $dbi);
list($username, $user_id)=sql_fetch_row($result3, $dbi);

$result4 = sql_query("SELECT forum_name FROM".$prefix."_bbforums where forum_id='$forum_id'", $dbi);
list($forumname)=sql_fetch_row($result4, $dbi);

//$topic_title = substr("$topic_title", 0,17);
//$topic_title=parseEmoticons($topic_title);
// Remove the comment below to add the counter
//$content .="<STYLE=\"text-decoration: none\"><font color=\"#666666\"><b>Message: $count<br></b>";

$content .= "<img src=\"modules/Forums/templates/subSilver/images/icon_mini_message.gif\" border=\"0\"alt=\"\"><a href=\"modules.php?name=Forums&amp;file=viewtopic&amp;p=$topic_last_post_id#$topic_last_post_id\"STYLE=\"text-decoration: none\"><b> $topic_title </b></a><br><font color=\"#666666\"><i>Last post by <A HREF=\"forum-userprofile-.html$user_id\"STYLE=\"text-decoration: none\"> $username </a> on $post_time in $forumname</i></font><br><br>";
$count = $count + 1;
}


I thought it would be quite simple as older versions of nuke i used to use had loads of blocks with this in..... icon_rolleyes.gif


Back to top Reply with quote
#2   
Telli
Site Admin
Occupation: Self Employed
Age: 46
Gender: Male
Fav. Sports Team: Detroit Red Wings
Website:
Status: Offline
Joined: May 26, 2003
1.03 posts per day
Posts: 8089
Points: 494,475
   
Try this one see if it makes a differance:


global $prefix, $db, $sitename, $user, $cookie;
$count = 1;
$amount = 15;
$content = "<A name= \"scrollingCode\"></A>";
$content .="<MARQUEE behavior= \"scroll\" align= \"center\" direction= \"up\" height=\"220\" scrollamount= \"2\" scrolldelay= \"25\" onmouseover='this.stop()' onmouseout='this.start()'>";
$content .="<center> <STYLE=\"text-decoration: none\"><font color=\"#666666\"><b>Last $amount Forum Messages</b></center>";
$result1 = $db->sql_query("SELECT topic_id, topic_last_post_id, topic_title, forum_id FROM ".$prefix."_bbtopics ORDER BY topic_last_post_id DESC LIMIT $amount");
$content .= "<br>";
while(list($topic_id, $topic_last_post_id, $topic_title, $forum_id) = $db->sql_fetchrow($result1)) {
$result2 = $db->sql_query("SELECT topic_id, poster_id, FROM_UNIXTIME(post_time,'%b %d, %Y at %T') as post_time, forum_id FROM ".$prefix."_bbposts where post_id='$topic_last_post_id'");
list($topic_id, $poster_id, $post_time, $forum_id) = $db->sql_fetchrow($result2);

$result3 = $db->sql_query("SELECT username, user_id FROM ".$prefix."_users where user_id='$poster_id'");
list($username, $user_id) = $db->sql_fetchrow($result3);

$result4 = $db->sql_query("SELECT forum_name FROM ".$prefix."_bbforums where forum_id='$forum_id'");
list($forumname) = $db->sql_fetchrow($result4);

//$topic_title = substr("$topic_title", 0,17);
//$topic_title=parseEmoticons($topic_title);
// Remove the comment below to add the counter
//$content .="<STYLE=\"text-decoration: none\"><font color=\"#666666\"><b>Message: $count<br></b>";

$content .= "<img src=\"modules/Forums/templates/subSilver/images/icon_mini_message.gif\" border=\"0\"alt=\"\"><a href=\"modules.php?name=Forums&amp;file=viewtopic&amp;p=$topic_last_post_id#$topic_last_post_id\"STYLE=\"text-decoration: none\"><b> $topic_title </b></a><br><font color=\"#666666\"><i>Last post by <A HREF=\"forum-userprofile-.html$user_id\"STYLE=\"text-decoration: none\"> $username </a> on $post_time in $forumname</i></font><br><br>";
$count = $count + 1;
}




_________________
The path of the righteous man is beset on all sides by the inequities of the selfish and the tyranny of evil men. Blessed is he, who in the name of charity and good will, shepherds the weak through the valley of darkness, for he is truly his brother's keeper and the finder of lost children. And I will strike down upon thee with great vengeance and furious anger those who would attempt to poison and destroy my brothers. And you will know my name is the Lord when I lay my vengeance upon thee. Ezekiel 25:17
Back to top Reply with quote
Display posts from previous:      
Add To: Del.icio.us  Digg  Google  Spurl  Blink  Furl  Y! MyWeb  
<< View previous topic View next topic >>
Post new topicReply to topic

Jump to 
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
You cannot attach files in this forum
You cannot download files in this forum