Clan Adverts

www.afgserv.com

 

www.clan-themes.co.uk :: View topic - Forums center block question

 Welcome To Clan Themes 

As the board grows please remember the Search Option and we hope you find our community useful.

We also monitor Private Messages to stop members from abusing our sites system.
If you are asking for assistance please provide your site link and nuke version, Thanks.

Forums center block question
Goto page Previous  1, 2, 3, 4, 5, 6, 7  Next

74 Replies / 8095 Views


Post new topic   Reply to topic  

   www.clan-themes.co.uk Forum Index » General PhpNuke

View previous topic :: View next topic


floppy
Reputation: 1791.9
votes: 10
Local time: 7:07 AM
Location: Jackson Mississippi
usa.gif

Status: Offline
2.78 posts per day
Medals: 1 (View more...)
Dedicated User (Amount: 1)
Clan Themes Scripts/Coder
Clan Themes Scripts/Coder
Joined: Nov 14, 2006
Last Visit: 19 Nov 2008
Posts: 2052
Points: 2525 

Post Forums center block question Posted: Mon Jul 30, 2007 9:21 pm   

Shop Purchases:
Clan Roster 2.0

Found another bug

Fresh Code
Code:
<?php
if( eregi("block-Forums_Center.php",$PHP_SELF ) )
{
   Header("Location: index.php");
   die();
}

$server = 'localhost';
$username = ;
$password = '';
$database = 'weaser31_forum';
$link = mysql_connect($server,$username,$password) OR DIE("BAD 1");
mysql_select_db($database) OR DIE("BAD 2");

//Language Defines
define("_BBFORUM_TOTTHREAD","Thread :: Post");
define("_BBFORUM_TOTTOPICS","Topics");
define("_BBFORUM_TOTPOSTS","Posts");
define("_BBFORUM_TOTVIEWS","Views");
define("_BBFORUM_TOTREPLIES","Total Replies");
define("_BBFORUM_TOTMEMBERS","Members");
define("_BBFORUM_POSTER","Posted by");
define("_BBFORUM_VIEWS","Views");
define("_BBFORUM_REPLIES","Replies");
define("_BBFORUM_LASTPOSTER","Last Post");
//End Language

// 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 = 'ALL';
// Show only 5 last new topics
$Last_New_Topics  = 5;                           
// Icon that is displayed in Center Block in front of Topic
$IconPath ="images/msg.png";
//size of the outer border
$border = 1;
//cell spacing around the tables
$cellspacing = 0;

/* Total Amount of Topics */
$result = mysql_query("SELECT * FROM phpbb_topics");
echo mysql_error();
$Amount_Of_Topics = mysql_num_rows( $result );

/* Total Amount of Posts */
$result = mysql_query ("SELECT * FROM phpbb_posts");
echo mysql_error();
$Amount_Of_Posts = mysql_num_rows( $result );

/* Total Amount of Topic Views */
$Amount_Of_Topic_Views = 0;
$result = mysql_query("SELECT topic_views FROM phpbb_topics");
echo mysql_error();
while( list( $topic_views ) = mysql_fetch_row($result) )
{
   $Amount_Of_Topic_Views = $Amount_Of_Topic_Views + $topic_views;
}

/* Total Amount of Topic Replies */
$Amount_Of_Topic_Replies = 0;
$result = mysql_query("SELECT topic_replies FROM phpbb_topics");
echo mysql_error();
while( list( $topic_replies ) = mysql_fetch_row( $result ) )
{
   $Amount_Of_Topic_Replies = $Amount_Of_Topic_Replies + $topic_replies;
}

/* Total Amount of Members */
$result = mysql_query("SELECT * FROM phpbb_users");
echo mysql_error();
$Amount_Of_Members = mysql_num_rows ( $result );

/* Last X New Topics */
$Count_Topics = 0;
$Topic_Buffer ="";
$result1 = mysql_query("SELECT topic_id, forum_id, topic_last_post_id, topic_title, topic_poster, topic_views, topic_replies, topic_moved_id FROM phpbb_bbtopics ORDER BY topic_last_post_id DESC");
echo mysql_error();
while( list( $topic_id, $forum_id, $topic_last_post_id, $topic_title, $topic_poster, $topic_views, $topic_replies, $topic_moved_id ) = mysql_fetch_row( $result1 ) )
{
   $skip_display = 0;
   if( $HideViewReadOnly == 1 )
   {
      $result5 = mysql_query("SELECT auth_view, auth_read FROM phpbb_bbforums where forum_id = '$forum_id'");
      echo mysql_error();
      list( $auth_view, $auth_read ) = mysql_fetch_row( $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 = mysql_query("SELECT topic_id, poster_id, FROM_UNIXTIME( post_time,'%b %d, %Y at %T') as post_time FROM phpbb_bbposts where post_id = '$topic_last_post_id'");
      echo mysql_error();
      list( $topic_id, $poster_id, $post_time ) = mysql_fetch_row( $result2 );

      $result3 = mysql_query("SELECT username, user_id FROM phpbb_users where user_id='$poster_id'");
      echo mysql_error();
      list( $username, $user_id ) = mysql_fetch_row( $result3 );
      $LastPoster ="<a href=\"forum-userprofile-.html$user_id\">$username</a>";
     
      $result4 = mysql_query("SELECT username, user_id FROM phpbb_users where user_id='$topic_poster'");
      echo mysql_error();
      list( $username, $user_id ) = mysql_fetch_row( $result4 );
      $OrigPoster ="<A HREF=\"forum-userprofile-.html$user_id\"STYLE=\"text-decoration: none\"> $username </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><td>$TopicImage  $TopicTitleShow</td><td><div align=\"center\">$OrigPoster</div></td><td><div align=\"center\"><b>$topic_views</b></div></td><td><div align=\"center\"><b>$topic_replies</b></div></td><td align=\"center\">$LastPoster <a href=\"modules.php?name=Forums&file=viewtopic&p=$topic_last_post_id#$topic_last_post_id\"><img src=\"images/icon_latest_reply.gif\" border=\"0\"></a><br><font size=\"-2\"><i>$post_time</i></font></td></tr>";
   }
   
   if( $Last_New_Topics == $Count_Topics ) { break 1; }
   
}

$cat = mysql_query("SELECT * FROM phpbb_bbcategories");
echo mysql_error();
$content ="";


/* Write Table to Screen */
$content  .="<center><table width=\"100%\" border=\"$border\"  cellspacing=\"$cellspacing\" bordercolor=\"#292929\">";
$content .="<td width=\"100%\" height=\"21\" colspan=\"6\" align=\"center\"><STRONG>Last 5 Forum Posts</STRONG></td></tr>";
$content .="<td rowspan=\"0\" >";
$content .="<table width=\"100%\" cellpadding=\"$cellspacing\" bordercolor=\"$bgcolor1\" cellspacing=\"1\" border=\"$border\" vAlign=\"top\">";

      $forum_id = $forum_row[0];
      $forum_title = $forum_row[5];
      $for_count ++;
   
   

$content .="</table>";
$content .="<tr><td align=\"center\" >"._BBFORUM_TOTTHREAD."</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 .="<tr><td align=\"center\" colspan=\"6\">"._BBFORUM_TOTTOPICS."<b>$Amount_Of_Topics</b> <b>|</b>"._BBFORUM_TOTPOSTS."<b>$Amount_Of_Posts</b> <b>|</b>"._BBFORUM_TOTVIEWS."<b>$Amount_Of_Topic_Views</b> <b>|</b>"._BBFORUM_TOTREPLIES."<b>$Amount_Of_Topic_Replies</b> <b>|</b> <a href=\"modules.php?name=Members_List\">"._BBFORUM_TOTMEMBERS."</a> <b>$Amount_Of_Members</b></center></td></tr>";
$content .="<tr><td colspan=\"6\">";
$content .="<table width=\"100%\" cellpadding=\"0\" bordercolor=\"$bgcolor1\" cellspacing=\"$cellspacing\" border=\"0\" vAlign=\"top\" height=\"32\">";
$content .="<tr>";
$a = 1;
    global $user, $cookie, $sitename, $prefix, $user_prefix, $admin, $module_name;
    $result=mysql_query("SELECT user_id, username, user_posts, user_avatar FROM phpbb_users ORDER BY user_posts DESC LIMIT 0,5");
    echo mysql_error();
    while(list($user_id, $username, $user_posts, $user_avatar) = mysql_fetch_row($result)) {

$content .="<td width=\"32\" vAlign=\"middle\">";
if (eregi("http://", $user_avatar)) {
$content .="  <a href=\"modules.php?name=Forums&amp;file=profile&amp;mode=viewprofile&amp;u=$user_id\"><img alt src=\"$user_avatar\" border =\"0\" width=\"32\" height=\"32\"></a></td>";
}
else
{
$content .="  <a href=\"modules.php?name=Forums&amp;file=profile&amp;mode=viewprofile&amp;u=$user_id\"><img alt src=\"modules/Forums/images/avatars/$user_avatar\" border =\"0\" width=\"32\" height=\"32\"></a></td>";
$content .="<td vAlign=\"middle\"> <a href=\"modules.php?name=Forums&amp;file=profile&amp;mode=viewprofile&amp;u=$user_id\"><b>$username</b></a> <br> <a href=\"modules.php?name=Forums&amp;file=search&amp;search_author=$username\">Posts:</a> ";
$content .=" <a href=\"modules.php?name=Forums&amp;file=search&amp;search_author=$username\">$user_posts</a> </td>";
}
$content .="</tr></table>";
$content .="</td><tr>";
$content .="</table>";
//Please leave the following link in place so other people can also share this block !!
$content .= "<p align=right><a href='http://www.clan-themes.co.uk'>Clan Themes ©</a></p>";
mysql_close($link);
?>
 

 
View user's profileSend private messageVisit poster's website Reply with quote

dakota
Reputation: 474.2
Local time: 5:07 AM

usa.gif

Status: Offline
0.13 posts per day
Medals: 0

Joined: Apr 07, 2007
Last Visit: 30 Oct 2008
Posts: 77
Points: 734 

View user's profileSend private messageVisit poster's website Reply with quote

floppy
Reputation: 1791.9
votes: 10
Local time: 7:07 AM
Location: Jackson Mississippi
usa.gif

Status: Offline
2.78 posts per day
Medals: 1 (View more...)
Dedicated User (Amount: 1)
Clan Themes Scripts/Coder
Clan Themes Scripts/Coder
Joined: Nov 14, 2006
Last Visit: 19 Nov 2008
Posts: 2052
Points: 2525 

View user's profileSend private messageVisit poster's website Reply with quote




dakota
Reputation: 474.2
Local time: 5:07 AM

usa.gif

Status: Offline
0.13 posts per day
Medals: 0

Joined: Apr 07, 2007
Last Visit: 30 Oct 2008
Posts: 77
Points: 734 

Post Forums center block question Posted: Mon Jul 30, 2007 9:32 pm   

Shop Purchases:
Counter Strike (Sabre) Theme · Clan Roster v1.7 Php Nuke Module

k this is the erro i am getting

[
Code:
Parse error: syntax error, unexpected '=', expecting ',' or ';' in /home/weaser31/public_html/blocks/block-Forums_Center.php on line 9
 

 
View user's profileSend private messageVisit poster's website Reply with quote

dakota
Reputation: 474.2
Local time: 5:07 AM

usa.gif

Status: Offline
0.13 posts per day
Medals: 0

Joined: Apr 07, 2007
Last Visit: 30 Oct 2008
Posts: 77
Points: 734 

View user's profileSend private messageVisit poster's website Reply with quote

floppy
Reputation: 1791.9
votes: 10
Local time: 7:07 AM
Location: Jackson Mississippi
usa.gif

Status: Offline
2.78 posts per day
Medals: 1 (View more...)
Dedicated User (Amount: 1)
Clan Themes Scripts/Coder
Clan Themes Scripts/Coder
Joined: Nov 14, 2006
Last Visit: 19 Nov 2008
Posts: 2052
Points: 2525 

Post Forums center block question Posted: Mon Jul 30, 2007 9:34 pm   

Shop Purchases:
Clan Roster 2.0

Here you go
Code:
<?php
if( eregi("block-Forums_Center.php",$PHP_SELF ) )
{
   Header("Location: index.php");
   die();
}

$server = 'localhost';
$username = '';
$password = '';
$database = '';
$link = mysql_connect($server,$username,$password) OR DIE("BAD 1");
mysql_select_db($database) OR DIE("BAD 2");

//Language Defines
define("_BBFORUM_TOTTHREAD","Thread :: Post");
define("_BBFORUM_TOTTOPICS","Topics");
define("_BBFORUM_TOTPOSTS","Posts");
define("_BBFORUM_TOTVIEWS","Views");
define("_BBFORUM_TOTREPLIES","Total Replies");
define("_BBFORUM_TOTMEMBERS","Members");
define("_BBFORUM_POSTER","Posted by");
define("_BBFORUM_VIEWS","Views");
define("_BBFORUM_REPLIES","Replies");
define("_BBFORUM_LASTPOSTER","Last Post");
//End Language

// 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 = 'ALL';
// Show only 5 last new topics
$Last_New_Topics  = 5;                           
// Icon that is displayed in Center Block in front of Topic
$IconPath ="images/msg.png";
//size of the outer border
$border = 1;
//cell spacing around the tables
$cellspacing = 0;

/* Total Amount of Topics */
$result = mysql_query("SELECT * FROM phpbb_topics");
echo mysql_error();
$Amount_Of_Topics = mysql_num_rows( $result );

/* Total Amount of Posts */
$result = mysql_query ("SELECT * FROM phpbb_posts");
echo mysql_error();
$Amount_Of_Posts = mysql_num_rows( $result );

/* Total Amount of Topic Views */
$Amount_Of_Topic_Views = 0;
$result = mysql_query("SELECT topic_views FROM phpbb_topics");
echo mysql_error();
while( list( $topic_views ) = mysql_fetch_row($result) )
{
   $Amount_Of_Topic_Views = $Amount_Of_Topic_Views + $topic_views;
}

/* Total Amount of Topic Replies */
$Amount_Of_Topic_Replies = 0;
$result = mysql_query("SELECT topic_replies FROM phpbb_topics");
echo mysql_error();
while( list( $topic_replies ) = mysql_fetch_row( $result ) )
{
   $Amount_Of_Topic_Replies = $Amount_Of_Topic_Replies + $topic_replies;
}

/* Total Amount of Members */
$result = mysql_query("SELECT * FROM phpbb_users");
echo mysql_error();
$Amount_Of_Members = mysql_num_rows ( $result );

/* Last X New Topics */
$Count_Topics = 0;
$Topic_Buffer ="";
$result1 = mysql_query("SELECT topic_id, forum_id, topic_last_post_id, topic_title, topic_poster, topic_views, topic_replies, topic_moved_id FROM phpbb_bbtopics ORDER BY topic_last_post_id DESC");
echo mysql_error();
while( list( $topic_id, $forum_id, $topic_last_post_id, $topic_title, $topic_poster, $topic_views, $topic_replies, $topic_moved_id ) = mysql_fetch_row( $result1 ) )
{
   $skip_display = 0;
   if( $HideViewReadOnly == 1 )
   {
      $result5 = mysql_query("SELECT auth_view, auth_read FROM phpbb_bbforums where forum_id = '$forum_id'");
      echo mysql_error();
      list( $auth_view, $auth_read ) = mysql_fetch_row( $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 = mysql_query("SELECT topic_id, poster_id, FROM_UNIXTIME( post_time,'%b %d, %Y at %T') as post_time FROM phpbb_bbposts where post_id = '$topic_last_post_id'");
      echo mysql_error();
      list( $topic_id, $poster_id, $post_time ) = mysql_fetch_row( $result2 );

      $result3 = mysql_query("SELECT username, user_id FROM phpbb_users where user_id='$poster_id'");
      echo mysql_error();
      list( $username, $user_id ) = mysql_fetch_row( $result3 );
      $LastPoster ="<a href=\"forum-userprofile-.html$user_id\">$username</a>";
     
      $result4 = mysql_query("SELECT username, user_id FROM phpbb_users where user_id='$topic_poster'");
      echo mysql_error();
      list( $username, $user_id ) = mysql_fetch_row( $result4 );
      $OrigPoster ="<A HREF=\"forum-userprofile-.html$user_id\"STYLE=\"text-decoration: none\"> $username </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><td>$TopicImage  $TopicTitleShow</td><td><div align=\"center\">$OrigPoster</div></td><td><div align=\"center\"><b>$topic_views</b></div></td><td><div align=\"center\"><b>$topic_replies</b></div></td><td align=\"center\">$LastPoster <a href=\"modules.php?name=Forums&file=viewtopic&p=$topic_last_post_id#$topic_last_post_id\"><img src=\"images/icon_latest_reply.gif\" border=\"0\"></a><br><font size=\"-2\"><i>$post_time</i></font></td></tr>";
   }
   
   if( $Last_New_Topics == $Count_Topics ) { break 1; }
   
}

$cat = mysql_query("SELECT * FROM phpbb_bbcategories");
echo mysql_error();
$content ="";


/* Write Table to Screen */
$content  .="<center><table width=\"100%\" border=\"$border\"  cellspacing=\"$cellspacing\" bordercolor=\"#292929\">";
$content .="<td width=\"100%\" height=\"21\" colspan=\"6\" align=\"center\"><STRONG>Last 5 Forum Posts</STRONG></td></tr>";
$content .="<td rowspan=\"0\" >";
$content .="<table width=\"100%\" cellpadding=\"$cellspacing\" bordercolor=\"$bgcolor1\" cellspacing=\"1\" border=\"$border\" vAlign=\"top\">";

      $forum_id = $forum_row[0];
      $forum_title = $forum_row[5];
      $for_count ++;
   
   

$content .="</table>";
$content .="<tr><td align=\"center\" >"._BBFORUM_TOTTHREAD."</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 .="<tr><td align=\"center\" colspan=\"6\">"._BBFORUM_TOTTOPICS."<b>$Amount_Of_Topics</b> <b>|</b>"._BBFORUM_TOTPOSTS."<b>$Amount_Of_Posts</b> <b>|</b>"._BBFORUM_TOTVIEWS."<b>$Amount_Of_Topic_Views</b> <b>|</b>"._BBFORUM_TOTREPLIES."<b>$Amount_Of_Topic_Replies</b> <b>|</b> <a href=\"modules.php?name=Members_List\">"._BBFORUM_TOTMEMBERS."</a> <b>$Amount_Of_Members</b></center></td></tr>";
$content .="<tr><td colspan=\"6\">";
$content .="<table width=\"100%\" cellpadding=\"0\" bordercolor=\"$bgcolor1\" cellspacing=\"$cellspacing\" border=\"0\" vAlign=\"top\" height=\"32\">";
$content .="<tr>";
$a = 1;
    $result=mysql_query("SELECT user_id, username, user_posts, user_avatar FROM phpbb_users ORDER BY user_posts DESC LIMIT 0,5");
    echo mysql_error();
    while(list($user_id, $username, $user_posts, $user_avatar) = mysql_fetch_row($result)) {

$content .="<td width=\"32\" vAlign=\"middle\">";
if (eregi("http://", $user_avatar)) {
$content .="  <a href=\"modules.php?name=Forums&amp;file=profile&amp;mode=viewprofile&amp;u=$user_id\"><img alt src=\"$user_avatar\" border =\"0\" width=\"32\" height=\"32\"></a></td>";
}
else
{
$content .="  <a href=\"modules.php?name=Forums&amp;file=profile&amp;mode=viewprofile&amp;u=$user_id\"><img alt src=\"modules/Forums/images/avatars/$user_avatar\" border =\"0\" width=\"32\" height=\"32\"></a></td>";
$content .="<td vAlign=\"middle\"> <a href=\"modules.php?name=Forums&amp;file=profile&amp;mode=viewprofile&amp;u=$user_id\"><b>$username</b></a> <br> <a href=\"modules.php?name=Forums&amp;file=search&amp;search_author=$username\">Posts:</a> ";
$content .=" <a href=\"modules.php?name=Forums&amp;file=search&amp;search_author=$username\">$user_posts</a> </td>";
}
}
$content .="</tr></table>";
$content .="</td><tr>";
$content .="</table>";
//Please leave the following link in place so other people can also share this block !!
$content .= "<p align=right><a href='http://www.clan-themes.co.uk'>Clan Themes ©</a></p>";
mysql_close($link);
?>
 

 
View user's profileSend private messageVisit poster's website Reply with quote




dakota
Reputation: 474.2
Local time: 5:07 AM

usa.gif

Status: Offline
0.13 posts per day
Medals: 0

Joined: Apr 07, 2007
Last Visit: 30 Oct 2008
Posts: 77
Points: 734 

Post Forums center block question Posted: Mon Jul 30, 2007 9:41 pm   

Shop Purchases:
Counter Strike (Sabre) Theme · Clan Roster v1.7 Php Nuke Module

k looks like we have a start the block is showing up here is the new error floppy

Code:
Table 'weaser31_forum.phpbb_bbtopics' doesn't exist
Warning: mysql_fetch_row(): supplied argument is not a valid MySQL result resource in /home/weaser31/public_html/blocks/block-Forums_Center.php on line 77
Table 'weaser31_forum.phpbb_bbcategories' doesn't exist
 

 
View user's profileSend private messageVisit poster's website Reply with quote

floppy
Reputation: 1791.9
votes: 10
Local time: 7:07 AM
Location: Jackson Mississippi
usa.gif

Status: Offline
2.78 posts per day
Medals: 1 (View more...)
Dedicated User (Amount: 1)
Clan Themes Scripts/Coder
Clan Themes Scripts/Coder
Joined: Nov 14, 2006
Last Visit: 19 Nov 2008
Posts: 2052
Points: 2525 

View user's profileSend private messageVisit poster's website Reply with quote

dakota
Reputation: 474.2
Local time: 5:07 AM

usa.gif

Status: Offline
0.13 posts per day
Medals: 0

Joined: Apr 07, 2007
Last Visit: 30 Oct 2008
Posts: 77
Points: 734 

View user's profileSend private messageVisit poster's website Reply with quote




floppy
Reputation: 1791.9
votes: 10
Local time: 7:07 AM
Location: Jackson Mississippi
usa.gif

Status: Offline
2.78 posts per day
Medals: 1 (View more...)
Dedicated User (Amount: 1)
Clan Themes Scripts/Coder
Clan Themes Scripts/Coder
Joined: Nov 14, 2006
Last Visit: 19 Nov 2008
Posts: 2052
Points: 2525