Ravens PHP Scripts: Forums
 

 

View next topic
View previous topic
Post new topic   Reply to topic    Ravens PHP Scripts And Web Hosting Forum Index -> Converting/Creating Blocks
Author Message
v-tec
Hangin' Around



Joined: Jul 19, 2009
Posts: 33

PostPosted: Sat Aug 29, 2009 4:41 pm Reply with quote

i recently migrated from phpnuke 8.0 to raven nuke 2.30.02. Every thing is working so far so good. I am glad to have shortlinks and other security features .
i used to have Center Block for Forums in my old site but it doesnt work on ravennuke , the right blocks and other parts of the site dissapears when i try to activate this.
Pardon me for being a total idiot. But i would be very greatful if somebody here could take the hassle of converting the Forum Center block so it works with raven nuke without any errors. the code is below.

Code:
<?php

if( eregi( "block-Forums_Center.php",$PHP_SELF ) )
{
   Header("Location: index.php");
   die();
}
global $user, $cookie, $sitename, $prefix, $user_prefix, $dbi, $sitename, $admin, $module_name, $bgcolor1, $bgcolor2;

// 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  = 7;                           
// 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 = sql_query( "SELECT * FROM ".$prefix."_bbtopics", $dbi );
$Amount_Of_Topics = sql_num_rows( $result );

/* Total Amount of Posts */
$result = sql_query( "SELECT * FROM ".$prefix."_bbposts", $dbi );
$Amount_Of_Posts = sql_num_rows( $result );

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

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

/* Total Amount of Members */
$result = sql_query( "SELECT * FROM ".$prefix."_users", $dbi );
$Amount_Of_Members = sql_num_rows( $result );

/* Last X New Topics */
$Count_Topics = 0;
$Topic_Buffer = "";
$result1 = 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", $dbi );
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 = sql_query( "SELECT auth_view, auth_read FROM ".$prefix."_bbforums where forum_id = '$forum_id'", $dbi );
      list( $auth_view, $auth_read ) = sql_fetch_row( $result5, $dbi );
      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 = 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'", $dbi );
      list( $topic_id, $poster_id, $post_time ) = 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 );
      $LastPoster = "<a href=\"forum-userprofile-.html$user_id\">$username</a>";
     
      $result4 = sql_query( "SELECT username, user_id FROM ".$prefix."_users where user_id='$topic_poster'", $dbi );
      list( $username, $user_id ) = sql_fetch_row( $result4, $dbi );
      $OrigPoster = "<A HREF=\"forum-userprofile-.html$user_id\"STYLE=\"text-decoration: none\"> $username </a>";
   
      $TopicImage = "&nbsp;<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&nbsp;&nbsp;$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&nbsp;<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 = sql_query("SELECT * FROM ".$prefix."_bbcategories", $dbi);
$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>&nbsp;<bspacer/b>&nbsp;"._BBFORUM_TOTPOSTS."<b>$Amount_Of_Posts</b>&nbsp;<bspacer/b>&nbsp;"._BBFORUM_TOTVIEWS."<b>$Amount_Of_Topic_Views</b>&nbsp;<bspacer/b>&nbsp;"._BBFORUM_TOTREPLIES."<b>$Amount_Of_Topic_Replies</b>&nbsp;<bspacer/b>&nbsp;<a href=\"members.html\">"._BBFORUM_TOTMEMBERS."</a>&nbsp;<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, $dbi, $admin, $module_name;
    $result=sql_query("SELECT user_id, username, user_posts, user_avatar FROM ".$user_prefix."_users ORDER BY user_posts DESC LIMIT 0,5", $dbi);
    while(list($user_id, $username, $user_posts, $user_avatar) = sql_fetch_row($result, $dbi)) {

$content .= "<td width=\"32\" vAlign=\"middle\">";
if (eregi("http://", $user_avatar)) {
$content .= "&nbsp;&nbsp;<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 .= "&nbsp;&nbsp;<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\">&nbsp;<a href=\"modules.php?name=Forums&amp;file=profile&amp;mode=viewprofile&amp;u=$user_id\"><b>$username</b></a>&nbsp;<br>&nbsp;<a href=\"modules.php?name=Forums&amp;file=search&amp;search_author=$username\">Posts:</a>&nbsp; ";
$content .= "&nbsp;<a href=\"modules.php?name=Forums&amp;file=search&amp;search_author=$username\">$user_posts</a>&nbsp;</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://udesign.me.uk>©</a></p>";
?>

Thank you for reading.
I think raven nuke community is growing but there arent many raven nuke compatible blocks like there are for regular php nuke which is kind of frustrating.
Smile
 
View user's profile Send private message
Susann
Moderator



Joined: Dec 19, 2004
Posts: 3191
Location: Germany:Moderator German NukeSentinel Support

PostPosted: Sat Aug 29, 2009 5:14 pm Reply with quote

Search for $dbi here in the forums.
Also I had no problem to find a center block which isn´t so old and works in RavenNuke.
 
View user's profile Send private message
v-tec







PostPosted: Tue Sep 01, 2009 3:44 am Reply with quote

would changing $dbi to $db make the block work ??? or are there other changes to make as well ?? Question
 
Susann







PostPosted: Tue Sep 01, 2009 6:21 am Reply with quote

Check the sticky about how to change $dbi to $db:
[ Only registered users can see links on this board! Get registered or login! ]

You can found out more about blocks with the old $dbi here:
[ Only registered users can see links on this board! Get registered or login! ]
 
v-tec







PostPosted: Tue Sep 01, 2009 9:53 am Reply with quote

Susann wrote:
Check the sticky about how to change $dbi to $db:
[ Only registered users can see links on this board! Get registered or login! ]

You can found out more about blocks with the old $dbi here:
[ Only registered users can see links on this board! Get registered or login! ]


would changing $dbi to $db solve the problem ???
 
v-tec







PostPosted: Tue Sep 01, 2009 11:20 am Reply with quote

I have attempted to edit / convert the old forum center block used in phpnuke 8.0 to Raven nuke 2.30.02.

OLD CENTER FORUM BLOCK CODE
Code:
<?php

if( eregi( "block-Forums_Center.php",$PHP_SELF ) )
{
   Header("Location: index.php");
   die();
}
global $user, $cookie, $sitename, $prefix, $user_prefix, $dbi, $sitename, $admin, $module_name, $bgcolor1, $bgcolor2;

// 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  = 7;                           
// 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 = sql_query( "SELECT * FROM ".$prefix."_bbtopics", $dbi );
$Amount_Of_Topics = sql_num_rows( $result );

/* Total Amount of Posts */
$result = sql_query( "SELECT * FROM ".$prefix."_bbposts", $dbi );
$Amount_Of_Posts = sql_num_rows( $result );

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

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

/* Total Amount of Members */
$result = sql_query( "SELECT * FROM ".$prefix."_users", $dbi );
$Amount_Of_Members = sql_num_rows( $result );

/* Last X New Topics */
$Count_Topics = 0;
$Topic_Buffer = "";
$result1 = 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", $dbi );
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 = sql_query( "SELECT auth_view, auth_read FROM ".$prefix."_bbforums where forum_id = '$forum_id'", $dbi );
      list( $auth_view, $auth_read ) = sql_fetch_row( $result5, $dbi );
      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 = 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'", $dbi );
      list( $topic_id, $poster_id, $post_time ) = 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 );
      $LastPoster = "<a href=\"forum-userprofile-.html$user_id\">$username</a>";
     
      $result4 = sql_query( "SELECT username, user_id FROM ".$prefix."_users where user_id='$topic_poster'", $dbi );
      list( $username, $user_id ) = sql_fetch_row( $result4, $dbi );
      $OrigPoster = "<A HREF=\"forum-userprofile-.html$user_id\"STYLE=\"text-decoration: none\"> $username </a>";
   
      $TopicImage = "&nbsp;<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&nbsp;&nbsp;$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&nbsp;<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 = sql_query("SELECT * FROM ".$prefix."_bbcategories", $dbi);
$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>&nbsp;<bspacer/b>&nbsp;"._BBFORUM_TOTPOSTS."<b>$Amount_Of_Posts</b>&nbsp;<bspacer/b>&nbsp;"._BBFORUM_TOTVIEWS."<b>$Amount_Of_Topic_Views</b>&nbsp;<bspacer/b>&nbsp;"._BBFORUM_TOTREPLIES."<b>$Amount_Of_Topic_Replies</b>&nbsp;<bspacer/b>&nbsp;<a href=\"members.html\">"._BBFORUM_TOTMEMBERS."</a>&nbsp;<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, $dbi, $admin, $module_name;
    $result=sql_query("SELECT user_id, username, user_posts, user_avatar FROM ".$user_prefix."_users ORDER BY user_posts DESC LIMIT 0,5", $dbi);
    while(list($user_id, $username, $user_posts, $user_avatar) = sql_fetch_row($result, $dbi)) {

$content .= "<td width=\"32\" vAlign=\"middle\">";
if (eregi("http://", $user_avatar)) {
$content .= "&nbsp;&nbsp;<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 .= "&nbsp;&nbsp;<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\">&nbsp;<a href=\"modules.php?name=Forums&amp;file=profile&amp;mode=viewprofile&amp;u=$user_id\"><b>$username</b></a>&nbsp;<br>&nbsp;<a href=\"modules.php?name=Forums&amp;file=search&amp;search_author=$username\">Posts:</a>&nbsp; ";
$content .= "&nbsp;<a href=\"modules.php?name=Forums&amp;file=search&amp;search_author=$username\">$user_posts</a>&nbsp;</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://udesign.me.uk>©</a></p>";
?>


EDITED / CONVERTED Forums Center Block

Code:
<?php

if( eregi( "block-Forums_Center.php",$PHP_SELF ) )
{
   Header("Location: index.php");
   die();
}
global $user, $cookie, $sitename, $prefix, $user_prefix, $db, $sitename, $admin, $module_name, $bgcolor1, $bgcolor2;

// 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  = 7;                           
// 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 = $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 ".$prefix."_users");
$Amount_Of_Members = $db->sql_numrows( $result );

/* 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 ) = $db->sql_fetchrow( $result1 ) )
{
   $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 ".$prefix."_users where user_id='$poster_id'");
      list( $username, $user_id ) = $db->sql_fetchrow( $result3 );
      $LastPoster = "<a href=\"forum-userprofile-.html$user_id\">$username</a>";
     
      $result4 = $db->sql_query( "SELECT username, user_id FROM ".$prefix."_users where user_id='$topic_poster'");
      list( $username, $user_id ) = $db->sql_fetchrow( $result4 );
      $OrigPoster = "<A HREF=\"forum-userprofile-.html$user_id\"STYLE=\"text-decoration: none\"> $username </a>";
   
      $TopicImage = "&nbsp;<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&nbsp;&nbsp;$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&nbsp;<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 = $db->sql_query("SELECT * FROM ".$prefix."_bbcategories");
$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>&nbsp;<bspacer/b>&nbsp;"._BBFORUM_TOTPOSTS."<b>$Amount_Of_Posts</b>&nbsp;<bspacer/b>&nbsp;"._BBFORUM_TOTVIEWS."<b>$Amount_Of_Topic_Views</b>&nbsp;<bspacer/b>&nbsp;"._BBFORUM_TOTREPLIES."<b>$Amount_Of_Topic_Replies</b>&nbsp;<bspacer/b>&nbsp;<a href=\"members.html\">"._BBFORUM_TOTMEMBERS."</a>&nbsp;<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, $db, $admin, $module_name;
    $result=$db->sql_query("SELECT user_id, username, user_posts, user_avatar FROM ".$user_prefix."_users ORDER BY user_posts DESC LIMIT 0,5");
    while(list($user_id, $username, $user_posts, $user_avatar) = $db->sql_fetchrow($result)) {

$content .= "<td width=\"32\" vAlign=\"middle\">";
if (eregi("http://", $user_avatar)) {
$content .= "&nbsp;&nbsp;<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 .= "&nbsp;&nbsp;<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\">&nbsp;<a href=\"modules.php?name=Forums&amp;file=profile&amp;mode=viewprofile&amp;u=$user_id\"><b>$username</b></a>&nbsp;<br>&nbsp;<a href=\"modules.php?name=Forums&amp;file=search&amp;search_author=$username\">Posts:</a>&nbsp; ";
$content .= "&nbsp;<a href=\"modules.php?name=Forums&amp;file=search&amp;search_author=$username\">$user_posts</a>&nbsp;</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://udesign.me.uk>©</a></p>";
?>


Could someone be kind enough to give it a quick check and help me find out if the edited code is good to go Smile
 
spasticdonkey
RavenNuke(tm) Development Team



Joined: Dec 02, 2006
Posts: 1693
Location: Texas, USA

PostPosted: Tue Sep 01, 2009 2:24 pm Reply with quote

have you tried the one raven uses on his homepage? [ Only registered users can see links on this board! Get registered or login! ]

I assume you can download it somewhere on the site Smile
 
View user's profile Send private message Visit poster's website
v-tec







PostPosted: Thu Sep 03, 2009 6:08 am Reply with quote

The edited center forum code above isnt working at all, there is a major issue with block width and the links it is generating Bang Head
And the Block-forumcollapsing isnt working either ,the hide/show link isnt working i had selected the jumpoxes to be hidden.
Is there anything i missed ..
Code:


global $user_prefix, $db, $sitename, $admin, $user, $bgcolor1, $bgcolor2, $textcolor1, $textcolor2;

$hideLinksFromGuests       = FALSE;
$hideTheseForums           = '-1';  // use a comma delimited list of forum id's to hide like '1,5,8'
$tickerWidth               = '90%';
$tickerBGColor             = "$bgcolor2";
$tickDelay                 = 4000; // in miliseconds
$hideViewReadOnly          = TRUE;
$lastNewTopics             = 15; // Number of topics to show when list is expanded
$countTopics               = 0;
$showClosedNum             = 1; // Number of messages that are visible when collapsed - NOT IMPLEMENTED YET
$showJumpBoxes             = FALSE; // Display or don't display the 2 Jump Boxes
$showTopPosters            = 2;  // 0=None, 1=Username - no avatar,  2=Username and avatar
$showTopPostersRanks       = 3;  // 0=None, 1=Admin only, 2=Moderator only, 3=Admin and Moderator, 4=All
$showTopPostersNum         = 5;  // Total number of top posters to show
$showTopPostersPerRow      = 5;  // Number to show per line
$showTickerMessage         = TRUE; // show/hide the top ticker message
$skipTopPostersUserNames   = "','"; // use a comma separated list with each name in single quotes, like 'user1','user2'.
$backendForumsXML          = 'feeds-2-rss.xml';  //Filename of the xml script.  Assumed in root directory.

//////////////////////////////////////////////////////////////////
//

Or could it be the javascript.php
It says add the contents of javascript.txt before ?> but i have a feeling the show /hide link might need some javascript to work too
Bang Head HELP !!!
thank you ..
 
v-tec







PostPosted: Sat Sep 05, 2009 2:25 am Reply with quote

block-forumcollapsing downloaded from DOWNLOADS in this site is not working properly .
there is a  on the left hand top of the block and the show/hide link is not working .
what could be it ???? Shocked

you can see what i mean by visiting [ Only registered users can see links on this board! Get registered or login! ]
 
Susann







PostPosted: Sat Sep 05, 2009 2:59 am Reply with quote

To get rid of this:  you need to upload the original block or if you open the block on your server and you can see this before the open tag just delete it. This was caused through your own editor its called "BOM". Don´t know why the hide links don´t work.
 
v-tec







PostPosted: Sat Sep 05, 2009 1:37 pm Reply with quote

Susann wrote:
To get rid of this:  you need to upload the original block or if you open the block on your server and you can see this before the open tag just delete it. This was caused through your own editor its called "BOM". Don´t know why the hide links don´t work.

The rest of the block is showing up fine.
Its just the show hide button thats not working. It slightly moves the block when clicked on show hide link but doesnt actually display the forum posts and that ...
Wonder what it could be
 
spasticdonkey







PostPosted: Sat Sep 05, 2009 2:05 pm Reply with quote

try disabling the shoutbox block and see if that fixes the show/hide on the forums block. seem to remember there was some slight tweak that was required to run them both... js issue.... there is mention of it in the shoutbox install.txt too.
try this thread or one of the other threads mentioned in this thread [ Only registered users can see links on this board! Get registered or login! ]
 
v-tec







PostPosted: Sat Sep 05, 2009 8:04 pm Reply with quote

Disabled the Shout Box and Show hide is working now eventyally Wink
But it doesnt seem to be showing the latest post ..
Instead of showing the posts made today its showing posts from 2 days ago..
 
spasticdonkey







PostPosted: Sun Sep 06, 2009 11:17 am Reply with quote

it may be in your forum permissions... i tried one of your forums "New Members / Introduce Yourself To us" and I couldnt view without registration. keep in mind it wont show posts from private forums, for obvious reasons Smile
 
v-tec







PostPosted: Sun Sep 06, 2009 12:03 pm Reply with quote

wonder if this is the case even if the member is logged in, and so has the permission to view the forum.
Question

Plus i was also wondering if there is a way the show/hide button could be removed and have the block free of JAVASCRIPT which is conflicting with shout box scrolling block.
 
v-tec







PostPosted: Sun Sep 06, 2009 3:43 pm Reply with quote

problem sorted

just edited

Code:
 window.onload=start_ticking    to  window.onload=start_ticking () 
at the end of the page and shout box and the forums collapsing block both working a treat..
Thanks for support folks Smile
 
v-tec







PostPosted: Tue Sep 08, 2009 3:26 pm Reply with quote

when i did the edit and changed start_ticking to start_ticking() , it did work for few hours now the show hide area has disappeared again.
I dont know whats the problem .
Wonder if some one can help me to convert the blocks - forumscollapsing to block- forums non collapsing. I mean the same block but without the javascript show / hide feature.
Help .. me to convert the collapsing block into non collapsing block .. thank you
 
spasticdonkey







PostPosted: Tue Sep 08, 2009 7:56 pm Reply with quote

im not getting into converting that block..... Smile
i know it's possible to run them both because i do, under the same theme too.

where did you edit window.onload=start_ticking?

the problem is you have two scripts using window onload.

this is from the shoutbox install, you try this?
Code:
8) JAVASCRIPT:

    -It is a known fact that, if two or more javascript apps use window.onload=, that one or more will fail.
    -I have provided an area within the shoutbox.js file at the top to resolve this.
    -Open all your other blocks and modules that use window.onload= in KATE or wordpad and write down all the onload events. Watch CAPS!
    -NOTE: window.onload=WorldClock will become WorldClock();
    -Place a // in front of all those window.onload events, save, and reupload. This stops them from running.
        -Example: // window.onload=WorldClock
    -Open shoutbox.js
    -At the top youll see:
           function allonloads() {
           populate();




           }
    -Place all your events in it like this:
           function allonloads() {
           populate();
           WorldClock();
           Something();
           SomethingElse();


           }
    -This starts all your blocks with javascript running again without conflict.
    -Save and upload shoutbox.js
    -Note: The shout box will have to be on the left side of your site in order for the others to work (unless all your blocks using javascript are on the right side).
 
v-tec







PostPosted: Fri Sep 11, 2009 1:07 am Reply with quote

thank s folks now all block conflicts solved RavensScripts
 
spasticdonkey







PostPosted: Fri Sep 11, 2009 6:20 am Reply with quote

sweet! glad you stuck with it and got it sorted out Smile
 
Display posts from previous:       
Post new topic   Reply to topic    Ravens PHP Scripts And Web Hosting Forum Index -> Converting/Creating Blocks

View next topic
View previous topic
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 can attach files in this forum
You can download files in this forum


Powered by phpBB © 2001-2007 phpBB Group
All times are GMT - 6 Hours
 
Forums ©