Siema, jako że jest na każdym forum sporo problemów z tym

daje gotowe rozwiązanie .
Tam gdzie chcemy żeby wyświetlały się niusy dajemy:
Kod:
<?php
define('IN_PHPBB', true);
$phpbb_root_path = './forum/';
$page_path = './../';
include($phpbb_root_path . 'extension.inc');
include($phpbb_root_path . 'common.'.$phpEx);
?>
oraz
Kod:
<?php include"news.php" ?>
Tutaj:
Kod:
$phpbb_root_path = './forum/';
Wybieramy ścieżke do forum.
Teraz tworzymy
news.php i dajemy do niego to:
Kod:
<?php
// Wybieramy ilosc newsów..
$conf['how_many_news'] = '9';
$page = $_GET['page'];
if ( $page != '' && file_exists($page.'.php') ) { include($page.'.php'); } else {
$sql = 'SELECT
t.topic_id,
t.topic_time,
t.topic_title,
pt.post_text,
u.username,
u.user_id,
u.user_rank,
u.user_posts,
t.topic_replies,
pt.bbcode_uid,
t.forum_id,
t.topic_poster,
t.topic_first_post_id,
t.topic_status,
pt.post_id,
p.post_id,
p.enable_smilies
FROM
' . TOPICS_TABLE . ' AS t,
' . USERS_TABLE . ' AS u,
' . POSTS_TEXT_TABLE . ' AS pt,
' . POSTS_TABLE . ' AS p
WHERE
t.forum_id IN (2) AND
t.topic_time <= ' . time() . ' 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 AND
t.topic_status <> 2
ORDER BY
t.topic_time DESC LIMIT 0, ' . $conf['how_many_news'] . '';
$result = $db->sql_query($sql);
while( $row = $db->sql_fetchrow($result) )
{
$text = $row['post_text'];
$link = append_sid('viewtopic.' . $phpEx . '?t=' . $row['topic_id']);
if (strlen($text) > 80)
{
$text = substr($text, 0, 40).'... <a href="./forum/'.$link.'" class="wiecej">wiecej<br></a>';
}
$text = str_replace('
', '<br />', $text);
echo ''.create_date($board_config['default_dateformat'], $row['topic_time'], $board_config['board_timezone']).'</b>';
echo ' - <span class="ur_t">'.$text;}
$db->sql_freeresult($result);
}
Tutaj:
Kod:
$conf['how_many_news'] = '9';
Ile ma być wyświetlanych niusów.
Tutaj:
Kod:
if (strlen($text) > 80)
{
$text = substr($text, 0, 40).'... <a href="./forum/'.$link.'" class="wiecej">wiecej<br></a>';
}
/\ Ile znaków ma być wyświetlanych
Kod:
t.forum_id IN (2) AND
Wybieramy id forum
bbcode
http://s000.wyslijto.pl/?file_id=30349976011532973771
Teraz pytajcie
www.ddonline.pl <-- Projekt darmowej , polskiej gry Mmorpg . ![Smile :]](http://www.phpbbhelp.pl/forum/images/smilies/icon_smile5.gif)