Seite 1 von 1
[3.2] Beiträge auf Homepage
Verfasst: 04.09.2018 18:38
von Sammler22
Hallo kennt jemand die Extension, das man neue Beiträge auf der Homepage darstellen kann, genau wie hier?
https://www.portal.my-tastenworld.ch/
Suche das dringlich für 3.2! Danke.
Re: [3.2] Beiträge auf Homepage
Verfasst: 04.09.2018 19:05
von Mahony
Hallo Sammler22
Das ist keine Extension auf der Seite. Es handelt sich dabei um eine HTML-Seite wo in einem Iframe die letzten Beiträge, mittels eines PHP-Scriptes, aus bestimmten Foren ausgelesen werden.
Hier mal das PHP-Script
Code: Alles auswählen
<?php
// How Many Topics you want to display?
$topicnumber = 12;
// Change this to your phpBB path
$urlPath = "https://www.mein-forum.de";
// Database Configuration (Where your phpBB config.php file is located)
include 'config.php';
header('Content-Type: text/html;charset=utf-8');
$table_topics = $table_prefix. "topics";
$table_forums = $table_prefix. "forums";
$table_posts = $table_prefix. "posts";
$table_users = $table_prefix. "users";
$link = mysqli_connect("$dbhost", "$dbuser", "$dbpasswd", "$dbname") or die("Could not connect");
//mysql_select_db("$dbname") or die("Could not select database");
$query = "SELECT t.topic_id, t.topic_title, t.topic_last_post_id, t.forum_id, p.post_id, p.poster_id, p.post_time, u.user_id, u.username
FROM $table_topics t, $table_forums f, $table_posts p, $table_users u
WHERE t.topic_id = p.topic_id AND
f.forum_id = t.forum_id AND
t.forum_id != 4 AND
t.topic_status <> 2 AND
p.post_id = t.topic_last_post_id AND
p.poster_id = u.user_id
ORDER BY p.post_id DESC LIMIT $topicnumber";
$result = mysqli_query($link, $query) or die("Query failed");
print "<table cellpadding='3' cellSpacing='2' width='695'>";
while ($row = mysqli_fetch_array($result, MYSQLI_ASSOC)) {
echo utf8_encode("<tr valign='top'><td><font face=\"Maven+Pro, Arial, Helvetica, sans-serif\" size=\"1\"><font color=\"#283857\"><style=\"text-decoration:none\"><b><a href=\"$urlPath/viewtopic.php?f=$row[forum_id]&t=$row[topic_id]&p=$row[post_id]#p$row[post_id]\" TARGET=\"_blank\">" .
$row["topic_title"] .
"</a></td></font></b><td><font face=\"Maven+Pro, Arial, Helvetica, sans-serif\" size=\"1\"><font color=\"#283857\"> User: <a href=\"$urlPath/memberlist.php?mode=viewprofile&u=$row[user_id]\" TARGET=\"_blank\">" .
$row["username"] .
"</td><td><font face=\"Maven+Pro, Arial, Helvetica, sans-serif\" size=\"1\"><font color=\"#283857\">" .
date('d.m.Y, H:i', $row["post_time"]) .
"</td></tr></font>");
}
print "</table>";
mysqli_free_result($result);
mysqli_close($link);
?>
https://www.mein-forum.de
und
t.forum_id != 4
musst du natürlich entsprechend anpassen.
Grüße: Mahony
Re: [3.2] Beiträge auf Homepage
Verfasst: 06.11.2021 17:18
von derd
Hallo, super vielen Dank genau danach habe ich gesucht. Funktioniert super.