help with forums block ! .. plz

  Post new topicReply to topicPrintable Version
<< View previous topic View next topic >>
Share: Del.icio.us  Digg  Google  Spurl  Blink  Furl  Y! MyWeb  
#1   help with forums block ! .. plz
jhcrash
CZ Newbie
 Codezwiz Site Donator
jhcrash has been a member for over 20 year's 20 Year Member
Status: Offline
Joined: Nov 13, 2004
0.00 posts per day
Posts: 6
Points: 2,388
   
Hello folks icon_smile.gif
Im using a non scrolling forum post veiw block on my phphuke site
... it does every thing i want it to do .. except display the forum where it was posted ..
ie .. in forum "members lounge" !
The code i'm using is below .. if anyone can add "furum details" i would be very greatful icon_wink.gif


<?php

/************************************************************************************/
/*                                                                                  */
/* CENTER BLOCK: block-phpBB_Forums.php                                             */
/* For PHP-Nuke 6.5                                                                 */
/* v1.5  06-04-2003                                                                 */
/*                                                                                  */
/* by: Maty Scripts (webmaster@matyscripts.com)                                     */
/* http://www.matyscripts.com                                                       */
/*                                                                                  */
/* This program is free software. You can redistribute it and/or modify             */
/* it under the terms of the GNU General Public License as published by             */
/* the Free Software Foundation; either version 2 of the License.                   */
/*                                                                                  */
/************************************************************************************/


if( eregi( "block-phpBB_Forums.php", $_SERVER['PHP_SELF'])) {
   Header("Location: index.html");
   die();
}

global $prefix, $user_prefix, $db, $sitename, $bgcolor1, $bgcolor2;


/**********************************/
/*                                */
/* Configuration parameters       */
/*                                */
/**********************************/
// When set to 1 then Forums permissions which View and/or Read are NOT set to 'ALL' will NOT be displayed in the center block
$HideViewReadOnly = 0;
// Show only 5 last new topics
$Last_New_Topics  = 20;
// Icon that is displayed in Center Block in front of Topic
$IconPath         = "modules/Forums/templates/subSilver/images/icon_mini_message.gif";

/**********************************/
/*                                */
/* Don't Edit Below !             */
/*                                */
/**********************************/
$border           = 0;
$cellspacing      = 0;
$cellstyle        = "style=\"border-left-width: 1; border-right-width: 1; border-top-width: 1; border-bottom-style: dotted; border-bottom-width: 1\"";

/* Total Amount of Topics */
$result = $db->sql_query( "SELECT * FROM ".$prefix."_bbtopics" );
$Amount_Of_Topics = $db->sql_numrows( $result );

/* Total Amount of Posts */
$result = $db->sql_query( "SELECT * FROM ".$prefix."_bbposts" );
$Amount_Of_Posts = $db->sql_numrows( $result );

/* Total Amount of Topic Views */
$Amount_Of_Topic_Views = 0;
$result = $db->sql_query( "SELECT topic_views FROM ".$prefix."_bbtopics" );
while( list( $topic_views ) = $db->sql_fetchrow( $result ) )
{
   $Amount_Of_Topic_Views = $Amount_Of_Topic_Views + $topic_views;
}

/* Total Amount of Topic Replies */
$Amount_Of_Topic_Replies = 0;
$result = $db->sql_query( "SELECT topic_replies FROM ".$prefix."_bbtopics" );
while( list( $topic_replies ) = $db->sql_fetchrow( $result ) )
{
   $Amount_Of_Topic_Replies = $Amount_Of_Topic_Replies + $topic_replies;
}

/* Total Amount of Members */
$result = $db->sql_query( "SELECT * FROM ".$user_prefix."_users" );
$Amount_Of_Members = $db->sql_numrows( $result ) - 1;

/* Last X New Topics */
$Count_Topics = 0;
$Topic_Buffer = "";
$result1 = $db->sql_query( "SELECT topic_id, forum_id, topic_last_post_id, topic_title, topic_poster, topic_views, topic_replies, topic_moved_id FROM ".$prefix."_bbtopics ORDER BY topic_last_post_id DESC" );
while( list( $topic_id, $forum_id, $topic_last_post_id, $topic_title, $topic_poster, $topic_views, $topic_replies, $topic_moved_id ) = sql_fetch_row( $result1, $dbi ) )
{
   $skip_display = 0;
   if( $HideViewReadOnly == 1 )
   {
      $result5 = $db->sql_query( "SELECT auth_view, auth_read FROM ".$prefix."_bbforums where forum_id = '$forum_id'" );
      list( $auth_view, $auth_read ) = $db->sql_fetchrow( $result5 );
      if( ( $auth_view != 0 ) or ( $auth_read != 0 ) ) { $skip_display = 1; }
   }

   if( $topic_moved_id != 0 )
   {
     // Shadow Topic !!
      $skip_display = 1;
   }

   if( $skip_display == 0 )
   {
     $Count_Topics += 1;
      $result2 = $db->sql_query( "SELECT topic_id, poster_id, FROM_UNIXTIME( post_time,'%b %d, %Y at %T') as post_time FROM ".$prefix."_bbposts where post_id = '$topic_last_post_id'" );
      list( $topic_id, $poster_id, $post_time ) = $db->sql_fetchrow( $result2 );

      $result3 = $db->sql_query( "SELECT username, user_id FROM ".$user_prefix."_users where user_id='$poster_id'" );
      list( $uname, $uid ) = $db->sql_fetchrow( $result3 );
      $LastPoster = "<A HREF=\"forum-userprofile-.html$uid\"STYLE=\"text-decoration: none\"> $uname </a>";

      $result4 = $db->sql_query( "SELECT username, user_id FROM ".$user_prefix."_users where user_id='$topic_poster'" );
      list( $uname, $uid ) = $db->sql_fetchrow( $result4 );
      $OrigPoster = "<A HREF=\"forum-userprofile-.html$uid\"STYLE=\"text-decoration: none\"> $uname </a>";

      $TopicImage = "<img src=\"$IconPath\" border=\"0\" alt=\"\">";
      $TopicTitleShow = "<a href=\"modules.php?name=Forums&amp;file=viewtopic&amp;p=$topic_last_post_id#$topic_last_post_id\"STYLE=\"text-decoration: none\">$topic_title</a>";

      $Topic_Buffer .= "<tr height=20 onmouseover=\"this.style.backgroundColor='#eeeeee'\" onmouseout=\"this.style.backgroundColor=''\"><td $cellstyle>$TopicImage&nbsp;&nbsp;</td><td $cellstyle>$TopicTitleShow</td><td $cellstyle><div align=\"center\">$OrigPoster</div></td><td $cellstyle><div align=\"center\"><b>$topic_views</b></div></td><td $cellstyle><div align=\"center\"><b>$topic_replies</b></div></td><td $cellstyle align=\"center\">$LastPoster<br><font size=\"-2\"><i>$post_time</i></font></td></tr>";
   }

   if( $Last_New_Topics == $Count_Topics ) { break 1; }

}

/* Write Table to Screen */
$content  = "<table width=\"100%\" border=\"$border\"  cellspacing=\"$cellspacing\" bordercolor=\"$bgcolor2\" bgcolor=\"#FFFFFF\">";
$content .= "<tr><td height=\"21\" align=\"center\" colspan=\"6\" bgcolor=\"#D5D5D5\"><b>$sitename</b></td></tr>";
$content .= "<tr><td>&nbsp;&nbsp;</td><td align=\"center\">"._BBFORUM_NEWTOPICS."</td><td align=\"center\">"._BBFORUM_POSTER."</td><td align=\"center\">"._BBFORUM_VIEWS."</td><td align=\"center\">"._BBFORUM_REPLIES."</td><td align=\"center\">"._BBFORUM_LASTPOSTER."</td></tr>";
$content .= "$Topic_Buffer";
$content .= "</table>";

?>


Many thanks in advance icon_wink.gif

Johnny


Back to top Reply with quote
#2   re: help with forums block ! .. plz
webshark
PayPal Donation
CZ Moderator
 Codezwiz Site Donator
webshark has been a member for over 20 year's 20 Year Member
turkey.gif
Age: 56
Gender: Male
Website:
Status: Offline
Joined: Mar 23, 2004
0.08 posts per day
Posts: 643
Points: 57,200
   
hey

not good at coding but if you like the scrolling side block here at codezwiz Telli also has a non scrooling version as for center block icon_cool.gif
[ Register or login to view links on this board. ]




_________________
[ Register or login to view links on this board.]
Back to top Reply with quote
#3   re: help with forums block ! .. plz
jhcrash
CZ Newbie
 Codezwiz Site Donator
jhcrash has been a member for over 20 year's 20 Year Member
Status: Offline
Joined: Nov 13, 2004
0.00 posts per day
Posts: 6
Points: 2,388
   
I really like the block on this site, it does show Last posts
And forum ie " General PHP Nuke Help" and date

but it would be great if it also displayed the name of the original topic creator !

jhcrash



Back to top Reply with quote
#4   
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
   
WHich block are you refering to?




_________________
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
#5   re: help with forums block ! .. plz
jhcrash
CZ Newbie
 Codezwiz Site Donator
jhcrash has been a member for over 20 year's 20 Year Member
Status: Offline
Joined: Nov 13, 2004
0.00 posts per day
Posts: 6
Points: 2,388
   
The forums block ! which displays last posts etc..



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