Файл: phpbb.php
Строк: 51
<?php
function showPHPBB($db)
{
global $db_name_forum;
$sql = "SELECT t.topic_id, t.topic_title, t.topic_last_post_id, t.forum_id, t.topic_replies, p.post_id, p.poster_id, p.post_time, u.user_id, u.username
        FROM $db_name_forum.forum_topics AS t, $db_name_forum.forum_posts AS p, $db_name_forum.forum_users AS u
        WHERE t.topic_status <> 2
            AND p.post_id = t.topic_last_post_id
            AND p.poster_id = u.user_id
            AND t.forum_id != 20
            AND t.forum_id != 16
            AND t.forum_id != 15
            AND t.forum_id != 21
            AND t.forum_id != 28
            AND t.forum_id != 30
        ORDER BY p.post_id DESC
        LIMIT 10";
$result=$db->query($sql);
$text="";
$text.="<table width='200' bgcolor='#000000' cellpadding='1' cellspacing='1'><tr bgcolor='#e2e0e0'><td>n";
       //cycle on all record
    while($row = $result->fetchRow())
    {
        $out = $row[1]." (".$row[4].")";
        //$url = 'http://forum.darktime.ru/viewtopic.php?t='.$row[0];
        $url = 'http://forum.darktime.ru/topic_'.$row[0].'.html';
            $text.= "<a href='$url'><small>".$out."</small></a><br>";
    }
$text.= "</td></tr></table>n";
return $text;
}
function showNews($db)
{
global $db_name_forum;
    $sql = "SELECT t.topic_id, t.topic_title, t.topic_last_post_id, t.forum_id, t.topic_replies, p.post_id, p.poster_id, p.post_time, u.user_id, u.username,t.topic_time
        FROM $db_name_forum.forum_topics AS t, $db_name_forum.forum_posts AS p, $db_name_forum.forum_users AS u
        WHERE t.topic_status <> 2
            AND p.post_id = t.topic_last_post_id
            AND p.poster_id = u.user_id
            AND t.forum_id = 21 
            AND t.topic_id > 210
        ORDER BY t.topic_id DESC
        LIMIT 10";
//$result = mysql_query($sql,$new_link);
$result = $db->query($sql);
$text="";
$text.="<TABLE cellSpacing=1 cellPadding=0 width='98%' align=center bgColor=#336597 border=0>";
$text.= "<tr><td align=center><class=boxes-title height=18 align='center'><STRONG><FONT face="Verdana, Arial, Helvetica, sans-serif" color=#ffffff size=2>  </FONT><FONT color=#ffffff><STRONG>оПЧПУФЙ РТПЕЛФБ !</STRONG></FONT></STRONG></td></tr>";
$text.= "<tr><td align=center bgColor=#d0d9e1>";
       //cycle on all record
    
    while($row = $result->fetchRow())
    //while ($row = mysql_fetch_row ($result))
    {
        $out = $row[1];
        $url = 'forum/viewtopic.php?t='.$row[0];
            $text.= "<a href="$url"><font color=black>".date("d.m.Y",$row[10]).' '.$out."</font></a><br><br>";
            
            //get text message
            $sql="SELECT t.post_text from $db_name_forum.forum_posts_text as t, 
                $db_name_forum.forum_posts as p  where p.topic_id=$row[0] AND t.post_id=p.post_id LIMIT 1";
            
            $res = $db->query($sql);
            if (DB::isError($res)) {
                die($res->toString());
            }
            
            $row_1 = $res->fetchRow();
            
            $text.= "<div align=left>".$row_1[0]."</div><br>";
            
            //discution
            $text.= "<div align=right><a href="$url">пВУХДЙФШ</a><br></div>";
    }
$text.="</td></tr>";
$text.= "</table>n";
//mysql_close($new_link);
return nl2br($text);
}
?>