// Daten für Verbindung zur Datenbank
$dbhost = "-";
$dbuser = "-";
$dbpassword = "-";
$dbdatabase = "-";
// Präfix
$prefix = "mybb_";
// URL zum Forum
$url = "http://www.123.de/forum";
$viewable_forums = ""; // Sichtbare Foren mit Kommatas trennen! Also z.b "10,15";
$viewable_forums = str_replace(","," OR ",$viewable_forums);
// Anzahl der Themen
$limit = "5";
// Überlange Themen kürzen (0 = Nein, x = Anzahl der auszugebenden Zeichen)
$length = "0";
// Globales
define("KILL_GLOBALS", 1);
define("NO_ONLINE", 1);
define("IN_MYBB", 1);
require("./global.php");
### Konfiguration ###
//Nicht sichtbare Foren ausschließen
$unviewable = get_unviewable_forums();
if($unviewable)
{
$unviewwhere = "AND fid NOT IN (".$unviewable.")";
}
// Head ausgeben
echo "<table width=\"90%\" align=\"center\" border=\"1\" padding=\"0px\" cellpadding=\"3\" cellspacing=\"0\" style=\"font-family: Arial; font-size: 10; border-collapse: inherit; border-top-style: none; border-right-style: none; border-left-style: none; white-space: normal; border-top-width: medium; border-right-width: medium; border-left-width: medium; white-space: normal; border-bottom: 0px solid silver; \" border-collapse: inherit><tr><td colpan=\"4\" colspan=\"4\"><strong>Letzte Themen</strong></td></tr><tr><td>Forum</td><td>Benutzer</td><td>Datum</td><td>Thema</td></tr>";
// Themen aus Datenbank holen
$query = $db->query ("SELECT subject,username,uid,tid,fid,dateline FROM ".TABLE_PREFIX."threads WHERE visible='1' $unviewwhere ORDER BY tid DESC LIMIT 0,".$limit."");
while($threads = $db->fetch_array($query))
{
// Forum ermitteln
$query2 = $db->query ("SELECT name FROM ".TABLE_PREFIX."forums WHERE fid = '".$threads['fid']."'");
$forums = $db->fetch_array($query2);
// Betreff kürzen?
if ($length != 0)
{
if (strlen($threads['subject']) > $length)
{
$threads['subject'] = substr($threads['subject'],0,$length) . "...";
}
}
// Daten ausgeben
echo "<tr><font size=\"2\"><td><a href=\"".$mybb->settings['bburl']."/forumdisplay.php?fid=".$threads['fid']."\">".htmlentities($forums['name'])."</a></td>
<td><a href=\"".$mybb->settings['bburl']."/member.php?action=profile&uid=".$threads['uid']."\">".htmlentities($threads['username'])."</a></td>
<td>".htmlentities(my_date($mybb->settings['dateformat'], $threads['dateline'])).", ".htmlentities(my_date($mybb->settings['timeformat'], $threads['dateline']))."</td>
<td><a href=\"".$mybb->settings['bburl']."/showthread.php?tid=".$threads['tid']."\">".htmlentities($threads['subject'])."</a></td></tr>";
}
// Footer ausgeben
echo "</table>";
?>