A wi?c znalaz?em sobie skrypt, który wysi?ga newsy z forum na portal. Chcia?em tego u?y? zamiast zwyk?ych newsów w php fusion.
Oto skrypt:
<?
define('IN_PHPBB', true);
$phpbb_root_path = './forums/';
include($phpbb_root_path . 'extension.inc');
include($phpbb_root_path . 'common.'.$phpEx);
include($phpbb_root_path . 'includes/bbcode.'.$phpEx);
$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 (58) 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 <> 8
ORDER BY
t.topic_time DESC';
if ($number_of_posts != 0)
{
$sql .= 'LIMIT
0,10';
}
if(!($result = $db->sql_query($sql)))
{
message_die(GENERAL_ERROR, 'Could not query announcements information', '', __LINE__, __FILE__, $sql);
}
while($row = $db->sql_fetchrow($result)){
$tresc = nl2br(stripslashes($row['post_text']));
echo '<div class="title"><SPAN CLASS="cattitle"><b>Tytu?:</b> <a href="http://forums.d2land.org/'.append_sid('viewtopic.' . $phpEx . '?t=' . $row['topic_id']).'"class="public" >'.$row['topic_title'].'</a></span></div>';
echo '<div class="public">dodany '.create_date($board_config['default_dateformat'], $row['topic_time'], $board_config['board_timezone']).' przez <a href="' . append_sid('http://forums.d2land.org/profile.'.$phpEx.'?mode=viewprofile&u='.$row['user_id'].'') . '">'.$row['username'].'</a>';
echo '<br />'.$tresc;
echo '<br /><a href="http://forums.d2land.org/'.append_sid('viewtopic.' . $phpEx . '?t=' . $row['topic_id']).'" class="public">Komentarze: [ '.$row['topic_replies'].' ]</a>';
echo ' | <a href="'.append_sid('http://forums.d2land.org/posting.' . $phpEx . '?mode=reply&t=' . $row['topic_id']).'" class="public">Dodaj komentarz</a></div><br />';}
$db->sql_freeresult($result);
?>
Sam w sobie jako odr?bny plik dzia?a, ale gdy wklejam go do news.php to wszystko si? sypie... Przestaje wy?wietal? si? prawe menu no i stopka... Jakie? sugestie? |