<?php
########################################################################
# PHP-Nuke Block: Advanced Center Forum Block v.3.0 #
# Made for PHP-Nuke 6.* and the phpbb2 Nuke port only #
# Original block made by coldblooded http://www.nukemods.com #
# Modifieds by thainuke of ThaiNuke.net #
########################################################################
# 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 you modify this, let me know for fun. =) #
########################################################################
if (stristr($_SERVER['SCRIPT_NAME'], "block-Advanced_Center_Forum.php")) {
Header("Location: index.html");
die();
}
$HideViewReadOnly = 0;
$Last_New_Topics = 10;
global $prefix, $db, $user_prefix, $sitename,$ThemeSel,$bgcolor1, $bgcolor2, $bgcolor3, $bgcolor4,$textcolor1, $textcolor2;
$folder_path = "themes/$ThemeSel/forums/";
/* 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;
if(!is_dir($folder_path))
{
$folder_path = "modules/Forums/templates/subsilver/";
}
$show = "
<tr><td height=\"28\" colspan=\"6\" align=\"center\" class=\"catbottom\" background=\"".$folder_path."images/cellpic1.gif\">"._Advancedcenterforumakharinersialirantraininglll."$Amount_Of_Topics|"._Advancedcenterforumakharinersialirantraininghh."$Amount_Of_Posts|"._Advancedcenterforumakharinersialirantrainingpp."$Amount_Of_Topic_Views|"._Advancedcenterforumakharinersialirantrainingoo."$Amount_Of_Topic_Replies|<a href=\"members.html\">"._AdvancedcenterforumListmembersirantraining."</a>$Amount_Of_Members</td></tr><tr><td align=\"center\" colspan=\"6\">[ <a href=\"forums.html\">"._Advancedcenterforumforumirantraining."</a> ][ <a href=\"modules.php?op=modload&name=Forums&file=search\">"._Advancedcenterforumforumsearchirantraining."</a> ]
</td></tr></table></td></tr></table></td></tr></table>";
$Count_Topics = 0;
$Topic_Buffer = "";
$result = $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");
$viewlasttop ="
<tr><th height=\"28\" colspan=\"2\" align=\"center\" nowrap background=\"".$folder_path."images/cellpic3.gif\" class=\"row2\"><font color=\"$textcolor1\">"._Advancedcenterforummozoatirantraining."</font></th>
<th align=\"center\" nowrap background=\"".$folder_path."images/cellpic3.gif\" class=\"row2\"><font color=\"$textcolor1\">"._Advancedcenterforumpasokhhairantraining."</font></th>
<th align=\"center\" nowrap background=\"".$folder_path."images/cellpic3.gif\"class=\"row2\"><font color=\"$textcolor1\">"._Advancedcenterforumnevisandehirantraining."</font></th>
<th align=\"center\" nowrap background=\"".$folder_path."images/cellpic3.gif\" class=\"row2\"><font color=\"$textcolor1\">"._Advancedcenterforumbzadidirantraining."</font></th>
<th align=\"center\" nowrap background=\"".$folder_path."images/cellpic3.gif\" class=\"row2\"><font color=\"$textcolor1\">"._Advancedcenterforumakharinersialirantraining."</font></th></tr>
";
while( list( $topic_id, $forum_id, $topic_last_post_id, $topic_title, $topic_poster, $topic_views, $topic_replies, $topic_moved_id ) = $db->sql_fetchrow($result) )
{
$skip_display = 0;
if( $HideViewReadOnly == 1 )
{
$result2 = $db->sql_query( "SELECT auth_view, auth_read FROM ".$prefix."_bbforums where forum_id = '$forum_id'");
list( $auth_view, $auth_read ) = $db->sql_fetchrow( $result2 );
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 username, user_id FROM ".$prefix."_users where user_id='$topic_poster'");
list($username, $user_id)=$db->sql_fetchrow($result2);
$avtor=$username;
$sifra=$user_id;
$result3 = $db->sql_query("SELECT 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($poster_id, $post_time)=$db->sql_fetchrow($result3);
$result4 = $db->sql_query("SELECT username, user_id FROM ".$prefix."_users where user_id='$poster_id'");
list($username, $user_id)=$db->sql_fetchrow($result4);
$viewlastdetail .="
<tr><td height=\"34\" nowrap bgcolor=\"$bgcolor1\" class=\"row1\"><img src=\"".$folder_path."images/folder_new_hot.gif\" border=\"0\" /></td><td width=\"100%\" bgcolor=\"$bgcolor1\" class=\"row1\"><a href=\"modules.php?name=Forums&file=viewtopic&t=$topic_id#$topic_last_post_id\">$topic_title</a></td>
<td align=\"center\" bgcolor=\"$bgcolor1\" class=\"row2\">$topic_replies</td>
<td align=\"center\" bgcolor=\"$bgcolor1\" class=\"row3\"><a href=\"forum-userprofile-.html$sifra\">$avtor</a></td>
<td align=\"center\" bgcolor=\"$bgcolor1\" class=\"row2\">$topic_views</td>
<td align=\"center\" nowrap bgcolor=\"$bgcolor1\" class=\"row3\">
<a href=\"forum-userprofile-.html$user_id\">$username</a><a href=\"modules.php?name=Forums&file=viewtopic&p=$topic_last_post_id#$topic_last_post_id\"><img src=\"".$folder_path."images/icon_minipost_new.gif\" border=\"0\" alt=\" $post_time\"></a></td></tr>";
}
if( $Last_New_Topics == $Count_Topics ) { break 1; }
}
$head = "
<table width=\"100%\" border=\"0\" cellspacing=\"0\" cellpadding=\"2\"><tr><td bgcolor=\"$bgcolor1\"><table width=\"100%\" border=\"0\" cellspacing=\"0\" cellpadding=\"1\" bgcolor=\"$bgcolor1\"><tr><td><table width=\"100%\" border=\"0\" cellpadding=\"2\" cellspacing=\"1\"><tr><td height=\"28\" colspan=\"6\" align=\"center\" class=\"row3\">"._Advancedcenterforumakharinersialirantrainingooakharinersalha."</td></tr>
";
$viewcatend = "</td></tr><tr><td>
</td></tr>";
$content = "$head";
$content .= "$viewcattop";
$content .= "$viewcat";
$content .= "$viewcatend";
$content .= "$viewlasttop";
$content .= "$viewlastdetail";
$content .= "$show";
?> |