Agilyera
Код: global $dbi;
$namedb = "phpbb";
$prefixdb = "phpbb";
$pathforum = "http://...";
$count = 1;
$content = "<A name= \"scrollingCode\"></A>";
$content .="<center>Последние сообщения</center>";
$result1 = sql_query("SELECT post_id FROM ".$namedb.".".$prefixdb."_posts_text ORDER BY post_id DESC LIMIT 5", $dbi);
$content .= "<br>";
while(list($post_id) = sql_fetch_row($result1, $dbi)) {
$result2 = sql_query("SELECT topic_id, poster_id, FROM_UNIXTIME(post_time,'%d/%m/%Y в %T') as post_time FROM ".$namedb.".".$prefixdb."_posts WHERE post_id='$post_id'", $dbi);
list($topic_id, $poster_id, $post_time)=sql_fetch_row($result2, $dbi);
$result3 = sql_query("SELECT username, user_id FROM ".$namedb.".".$prefixdb."_users where user_id='$poster_id'", $dbi);
list($username, $user_id)=sql_fetch_row($result3, $dbi);
$result4 = sql_query("SELECT topic_title FROM ".$namedb.".".$prefixdb."_topics WHERE topic_id='$topic_id'", $dbi);
list($topic_title)=sql_fetch_row($result4, $dbi);
$content .="<STYLE=\"text-decoration: none\"><font color=\"#666666\"><b>Тема: $count<br></b>";
$content .= "<img src=\"".$pathforum."/templates/DustyGreen/images/icon_mini_message.gif\" border=\"0\"alt=\"\"><a href=\"".$pathforum."/viewtopic.php?t=$topic_id\"STYLE=\"text-decoration: none\"><b> $topic_title </b></a><br><font color=\"#666666\"><i>Автор <A HREF=\"".$pathforum."/profile.php?mode=viewprofile&u=$user_id\"STYLE=\"text-decoration: none\"> $username </a><br> $post_time</i></font><br><br>";
$count = $count + 1;
}
$content .= "</MARQUEE><br><center>[ <a href=\"".$pathforum."\index.php\">Перейти на форум</a> ]</center>";
Код: global $dbi;
$namedb = "phpbb";
$prefixdb = "phpbb";
$pathforum = "http://...";
$count = 1;
$content = "<A name= \"scrollingCode\"></A>";
$content .="<center>Последние сообщения</center>";
$result1 = sql_query("SELECT post_id FROM ".$namedb.".".$prefixdb."_posts_text ORDER BY post_id DESC LIMIT 5", $dbi);
$content .= "<br>";
while(list($post_id) = sql_fetch_row($result1, $dbi)) {
$result2 = sql_query("SELECT topic_id, poster_id, FROM_UNIXTIME(post_time,'%d/%m/%Y в %T') as post_time FROM ".$namedb.".".$prefixdb."_posts WHERE post_id='$post_id'", $dbi);
list($topic_id, $poster_id, $post_time)=sql_fetch_row($result2, $dbi);
$result3 = sql_query("SELECT username, user_id FROM ".$namedb.".".$prefixdb."_users where user_id='$poster_id'", $dbi);
list($username, $user_id)=sql_fetch_row($result3, $dbi);
$result4 = sql_query("SELECT topic_title FROM ".$namedb.".".$prefixdb."_topics WHERE topic_id='$topic_id'", $dbi);
list($topic_title)=sql_fetch_row($result4, $dbi);
$content .="<STYLE=\"text-decoration: none\"><font color=\"#666666\"><b>Тема: $count<br></b>";
$content .= "<img src=\"".$pathforum."/templates/DustyGreen/images/icon_mini_message.gif\" border=\"0\"alt=\"\"><a href=\"".$pathforum."/viewtopic.php?t=$topic_id\"STYLE=\"text-decoration: none\"><b> $topic_title </b></a><br><font color=\"#666666\"><i>Автор <A HREF=\"".$pathforum."/profile.php?mode=viewprofile&u=$user_id\"STYLE=\"text-decoration: none\"> $username </a><br> $post_time</i></font><br><br>";
$count = $count + 1;
}
$content .= "</MARQUEE><br><center>[ <a href=\"".$pathforum."\index.php\">Перейти на форум</a> ]</center>";