Hallo,
wie hier Beschrieben, lasse ich jetzt meine Beiträge auf meiner Hauptseite anzeigen. Ich würde jetzt gerne noch die Anzahl der Beiträge in Klammern hinter die Themen haben. Geht das?
Beiträge vom Forum auf Hauptseite mit Anzahl von Antworten
Forumsregeln
phpBB 2.0 hat das Ende seiner Lebenszeit überschritten
phpBB 2.0 wird nicht mehr aktiv unterstützt. Insbesondere werden - auch bei Sicherheitslücken - keine Patches mehr bereitgestellt. Der Einsatz von phpBB 2.0 erfolgt daher auf eigene Gefahr. Wir empfehlen einen Umstieg auf phpBB 3.1, welches aktiv weiterentwickelt wird und für welches regelmäßig Updates zur Verfügung gestellt werden.
phpBB 2.0 hat das Ende seiner Lebenszeit überschritten
phpBB 2.0 wird nicht mehr aktiv unterstützt. Insbesondere werden - auch bei Sicherheitslücken - keine Patches mehr bereitgestellt. Der Einsatz von phpBB 2.0 erfolgt daher auf eigene Gefahr. Wir empfehlen einen Umstieg auf phpBB 3.1, welches aktiv weiterentwickelt wird und für welches regelmäßig Updates zur Verfügung gestellt werden.
rdf.php
[suchen]
[Ersetzen durch]
esperitox
[suchen]
Code: Alles auswählen
// SQL statement to fetch active topics of public forums
$sql = "SELECT DISTINCT t.topic_title, t.topic_last_post_id, p.post_time, f.forum_name
FROM " . TOPICS_TABLE . " AS t, " . POSTS_TABLE . " AS p, " . FORUMS_TABLE . " AS f
WHERE
t.forum_id = f.forum_id
AND f.auth_view = " . AUTH_ALL . "
AND p.topic_id = t.topic_id
AND p.post_id = t.topic_last_post_id
$sql_where
ORDER BY p.post_time DESC LIMIT $count";
$topics_query = $db->sql_query($sql);
if ( !$topics_query )
{
die("Failed obtaining list of active topics");
}
else
{
$topics = $db->sql_fetchrowset($topics_query);
}
if ( count($topics) == 0 )
{
die("No topics found");
}
else
{
// $topics contains all interesting data
for ($i = 0; $i < count($topics); $i++)
{
$title = $topics[$i]['topic_title'];
$url = $viewtopic_url . "?" . POST_POST_URL . "=" . $topics[$i]['topic_last_post_id'] . "#" . $topics[$i]['topic_last_post_id'];
$rdf .= "
<item>
<title>" . $title . "</title>
<link>" . $url . "</link>
</item>
";
}
}
Code: Alles auswählen
// SQL statement to fetch active topics of public forums
$sql = "SELECT DISTINCT t.topic_title, t.topic_last_post_id, t.topic_replies, p.post_time, f.forum_name
FROM " . TOPICS_TABLE . " AS t, " . POSTS_TABLE . " AS p, " . FORUMS_TABLE . " AS f
WHERE
t.forum_id = f.forum_id
AND f.auth_view = " . AUTH_ALL . "
AND p.topic_id = t.topic_id
AND p.post_id = t.topic_last_post_id
$sql_where
ORDER BY p.post_time DESC LIMIT $count";
$topics_query = $db->sql_query($sql);
if ( !$topics_query )
{
die("Failed obtaining list of active topics");
}
else
{
$topics = $db->sql_fetchrowset($topics_query);
}
if ( count($topics) == 0 )
{
die("No topics found");
}
else
{
// $topics contains all interesting data
for ($i = 0; $i < count($topics); $i++)
{
$title = $topics[$i]['topic_title'];
$replies = $topics[$i]['topic_replies'];
$url = $viewtopic_url . "?" . POST_POST_URL . "=" . $topics[$i]['topic_last_post_id'] . "#" . $topics[$i]['topic_last_post_id'];
$rdf .= "
<item>
<title>" . $title . "</title> (" . $replies . ")
<link>" . $url . "</link>
</item>
";
}
}
rdf.php
[Suchen]
[Ersetzen durch]

esperitox
[Suchen]
Code: Alles auswählen
$title = $topics[$i]['topic_title'];
Bei dem Rot markierten kannst du einstellen wie lang der topic title sein darf bevor ... angezeigt wird$topic_title_size = 20;
$title = strlen($topics[$i]['topic_title']) > $topic_title_size ? substr($topics[$i]['topic_title'], 0, ($topic_title_size)) . "..." : $topics[$i]['topic_title'];

esperitox