ho modificato lo script in questo modo:
Codice:
<?php
/* Database */
$dbhost = "localhost";
$dbuname = "";
$dbpass = "";
$db_name = "";
/* Tables */
$prefix = "phpbb_";
$user_prefix = "phpbb_";
$db = mysql_connect($dbhost, $dbuname, $dbpass, $dbname);
$sitename = "";
$bgcolor1 = "#FF00FF";
$bgcolor2 = "#FF0000";
/**********************************/
/* */
/* 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 = 1;
// Show only 5 last new topics
$Last_New_Topics = 5;
// Icon that is displayed in Center Block in front of Topic
$IconPath = "phpBB2/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 */
$query = "SELECT * FROM ".$prefix."topics";
$result = mysql_query($query,$db);
$Amount_Of_Topics = mysql_num_rows($result);
/* Total Amount of Posts */
$query = "SELECT * FROM ".$prefix."posts";
$result = mysql_query($query,$db);
$Amount_Of_Posts = mysql_num_rows($result);
/* Total Amount of Topic Views */
$Amount_Of_Topic_Views = 0;
$query = "SELECT topic_views FROM ".$prefix."topics";
$result = mysql_query($query,$db);
$row = mysql_fetch_row($result);
while(list($topic_views) = $row);
{
$Amount_Of_Topic_Views = $Amount_Of_Topic_Views + $topic_views;
}
/* Total Amount of Topic Replies */
$Amount_Of_Topic_Replies = 0;
$query = "SELECT topic_replies FROM ".$prefix."topics";
$result = mysql_query($query,$db);
$row = mysql_fetch_row($result);
while(list($topic_replies) = $row)
{
$Amount_Of_Topic_Replies = $Amount_Of_Topic_Replies + $topic_replies;
}
/* Total Amount of Members */
$query = "SELECT * FROM ".$prefix."users";
$result = mysql_query($query,$db);
$Amount_Of_Members = mysql_num_rows($result) - 1;
/* Last X New Topics */
$Count_Topics = 0;
$Topic_Buffer = "";
$query = "SELECT topic_id, forum_id, topic_last_post_id, topic_title, topic_poster, topic_views, topic_replies, topic_moved_id FROM ".$prefix."topics ORDER BY topic_last_post_id DESC";
$result1 = mysql_query($query,$db);
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, $db ) )
{
$skip_display = 0;
if( $HideViewReadOnly == 1 )
{
$query = "SELECT auth_view, auth_read FROM ".$prefix."forums where forum_id = '$forum_id'";
$result5 = mysql_query($query,$db);
$row = mysql_fetch_row($result5);
list( $auth_view, $auth_read ) = $row;
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;
$query = "SELECT topic_id, poster_id, FROM_UNIXTIME( post_time,'%b %d, %Y at %T') as post_time FROM ".$prefix."posts where post_id = '$topic_last_post_id'";
$result2 = mysql_query($query,$db);
$row = mysql_fetch_row($result2);
list( $topic_id, $poster_id, $post_time ) = $row;
$query = "SELECT username, user_id FROM ".$prefix."users where user_id='$poster_id'";
$result3 = mysql_query($query,$db);
$row = mysql_fetch_row($result3);
list( $uname, $uid ) = $row ;
$LastPoster = "<A HREF=\"modules.php?name=Forums&file=profile&mode=viewprofile&u=$uid\"STYLE=\"text-decoration: none\"> $uname </a>";
$query = "SELECT username, user_id FROM ".$prefix."users where user_id='$topic_poster'";
$result4 = mysql_query($query,$db);
$row = mysql_fetch_row($result4);
list( $uname, $uid ) = $row ;
$OrigPoster = "<A HREF=\"phpBB2/profile.php?mode=viewprofile&u=$uid\"STYLE=\"text-decoration: none\"> $uname </a>";
$TopicImage = "<img src=\"$IconPath\" border=\"0\" alt=\"\">";
$TopicTitleShow = "<a href=\"phpBB2/viewtopic.php?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 </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=\"$bgcolor1\">";
$content .= "<tr><td height=\"21\" align=\"center\" colspan=\"6\" bgcolor=\"$bgcolor2\"><b>$sitename</b></td></tr>";
$content .= "<tr><td> </td><td align=\"center\">Nuovi messaggi</td><td align=\"center\">Autori</td><td align=\"center\">Visti</td><td align=\"center\">Risposte</td><td align=\"center\">Ultimi posts</td></tr>";
$content .= "$Topic_Buffer";
$content .= "<tr><td align=\"center\" colspan=\"6\">Messaggi:<b>$Amount_Of_Topics</b> <b>|</b> Posts:<b>$Amount_Of_Posts</b> <b>|</b> Visti:<b>$Amount_Of_Topic_Views</b> <b>|</b> Risposte:<b>$Amount_Of_Topic_Replies</b> <b>|</b> <a href=\"phpBB2/memberlist.php\">Utenti:</a> <b>$Amount_Of_Members</b></center></td></tr>";
$content .= "<tr><td align=\"center\" colspan=\"6\">[ <a href=\"phpBB2/index.php\">Vai al forum</a> ] [ <a href=\"phpBB2/search.php\">Cerca</a> ]</center></td></tr>";
$content .= "</table>";
echo "$content";
?>
Non ricevo errori nè warnings, le query, se eseguite direttamente nel database funzionano... ma nonostante questo vedo la tabella ma non viene scritto nessun post... qualcuno sa aiutarmi?