[php]
$dzial = 'nr_dzialu';
$sql="SELECT p.post_id, pt.post_id, pt.post_text, pt.bbcode_uid, t.topic_id, t.topic_title, t.topic_first_post_id, t.forum_id, t.topic_replies, u.user_id, u.username, u.user_posts, u.user_rank
FROM ".TOPICS_TABLE." t, ".USERS_TABLE." u, ".POSTS_TABLE." p, ".POSTS_TEXT_TABLE." pt
WHERE t.forum_id = $dzial
AND t.topic_poster = u.user_id
AND t.topic_first_post_id = pt.post_id
AND t.topic_first_post_id = p.post_id
ORDER BY pt.post_id DESC";
$query=mysql_query($sql);
while(
$result=mysql_fetch_assoc($query))
{
$text = $result['post_text'];
$text = bbcode_strip($text, $result['bbcode_uid']);
$link = append_sid('viewtopic.' . $phpEx . '?t=' . $result['topic_id']);
if (strlen($text) > 1000){
$text = substr($text, 0, 1000).'... <a href="'.$link.'" class="wiecej">Wiecej</a>';}
$text = str_replace('
', '<br>', $text);
$author = color_username($result['user_id'],$result['username'], $result['user_rank'], $result['user_posts']);
echo '<tr><td background="./portal/images/news_gora.gif" width="350" height="10" colspan="3"></td></tr>
<tr valign="top"><td background="./portal/images/news_lewo.gif" width="13"></td><td background="./portal/images/tlo_news.gif" width="323"><a href="'.$link.'" class="tytul_newsa">'.$result['topic_title'].'</a><hr width="90%" align"center"><span class="news">'.$text.'</span><div align="right"><br /><span class="autor">'.$author.' :: </span><a href="'.$link.'" class="autor">Komentarzy: <span class="autor_red">'.$result['topic_replies'].'</span></a></div></td><td background="./portal/images/news_prawo.gif" width="14"></td></tr>
<tr><td background="./portal/images/news_dol.gif" width="350" height="11" colspan="3"></td></tr><tr><td height="25"></td></tr>';
}
[/php]
tak ja u siebie zrobilem w portalu - ty sobie juz sam spersonalizuj
kod jest przystosowany pod CR
a jak chcesz z calego forum to skasuj
WHERE t.forum_id = $dzial
Mam nadzieje ze dobrze zrozumialem o co ci chodzilo
aa zapomnialem - musisz jeszcze funkcje dorobic - ale to podbierz ezportalu
Autor postu otrzymał pochwałę
Pomocy nt. forum lub/i php udzielam tylko na forum.