Also, wenn ich dich richtig verstanden hab, dann meinst du sowas hier:
Das ließt alle Themen aus dem Forum mti der id 14 aus und stellt sie dar:
Code: Alles auswählen
$sql = 'SELECT topic_id, forum_id, topic_time, topic_attachment, poll_title, topic_poster, topic_title, topic_first_poster_name, topic_first_poster_colour, topic_title, topic_first_post_id
FROM phpbb_topics
WHERE forum_id = "14"
ORDER BY topic_time DESC';
$result = $db->sql_query($sql);
$news = "";
$bbcode = new bbcode();
while ($row = $db->sql_fetchrow($result))
{
$sql_text = "SELECT post_id, post_text, bbcode_bitfield, bbcode_uid, post_attachment
FROM phpbb_posts
WHERE post_id = '".$row['topic_first_post_id']."'";
$result_text = $db->sql_query($sql_text);
$row_text = $db->sql_fetchrow($result_text);
$attach_list = $attachments = $update_count = array();
// Does post have an attachment? If so, add it to the list
if ($row_text['post_attachment'] && $config['allow_attachments'])
{
$attach_list[] = $row_text['post_id'];
$sql2 = 'SELECT *
FROM ' . ATTACHMENTS_TABLE . '
WHERE ' . $db->sql_in_set('post_msg_id', $attach_list) . '
AND in_message = 0
ORDER BY filetime DESC, post_msg_id ASC';
$result2 = $db->sql_query($sql2);
while ($row2 = $db->sql_fetchrow($result2))
{
$attachments[$row2['post_msg_id']][] = $row2;
}
$db->sql_freeresult($result2);
}
$message = censor_text($row_text['post_text']);
// Second parse bbcode here
if ($row_text['bbcode_bitfield'])
{
$bbcode->bbcode_second_pass($message, $row_text['bbcode_uid'], $row_text['bbcode_bitfield']);
}
$message = bbcode_nl2br($message);
$message = smiley_text($message);
if ($row_text['post_attachment'])
{
parse_attachments(14, $message, $attachments[$row_text['post_id']], $update_count);
}
$news .= "<h2><a href=\"".append_sid($phpbb_root_path."viewtopic.php" ,"f=14&t=".$row['topic_id'])."\">".censor_text($row['topic_title'])."</a></h2><p style=\"font-size: .9em;\">Geschrieben von ".get_username_string('full', $row['topic_poster'], x_get_username($row['topic_poster']), x_get_user_colour($row['topic_poster']), false, $page_root_path.'steckbrief.php?')." am ".date("d.m.Y", $row['topic_time'])." um ".date("H:i", $row['topic_time'])." Uhr</p><div class=\"news\" style=\"font-size: 1.2em;\">".$message."</div>";
$news .= "<br />\n<span style=\"font-size: .9em;\">";
if($row['topic_attachment']) {
$news .= "<br />Dieser Newsbeitrag hat <a href=\"".append_sid($phpbb_root_path."viewtopic.php", "f=".$row['forum_id']."&t=".$row['topic_id'])."\">Anhänge</a>.";
}
if($row['poll_title'] != "") {
$news .= "<br />Dieser Newsbeitrag beinhaltet eine <a href=\"".append_sid($phpbb_root_path."viewtopic.php", "f=".$row['forum_id']."&t=".$row['topic_id'])."\">Umfrage</a>.";
}
$news .= "<hr />";
}
$db->sql_freeresult($result);
$news .= "<h2><a href=\"".append_sid($phpbb_root_path."viewforum.php", "f=14")."\">Alte Newsbeiträge >>>></a></h2>";
$template->assign_vars(array(
'X_TITLE' => "News",
'X_CONTENT' => $news,
));
Folgende Dinge müssen geändert werden:
- Die Foren ID, also überall da wo bei mir 14 steht
- Das Datenbank präfix.
Jetz schfreibst du in die zugehörige html datei einfach folgendes rein:
Code: Alles auswählen
<!-- INCLUDE overall_header.html -->
<h3>{X_TITLE}</h3>
{X_CONTENT}
<!-- INCLUDE overall_footer.html -->
Ich hoffe ich konnte euch helfen.
Gruß Hasu0bs