<?php
// Anzahl der Themen
$limit = "40";
// Überlange Themen kürzen (0 = Nein, x = Anzahl der auszugebenden Zeichen)
$length = "50";
define("NO_ONLINE", 1);
define("IN_MYBB", 1);
require("./global.php");
$lang->load("index");
$templatelist = "lastposts, lastposts_stats";
$whosonline = '';
### Konfiguration ###
//Nicht sichtbare Foren ausschließen
$unviewable = get_unviewable_forums();
if($unviewable) {
$unviewwhere = "AND t.fid NOT IN (".$unviewable.")";
}
// Themen aus Datenbank holen
$query = $db->query ("SELECT t.subject,t.username,t.uid,t.tid,f.fid,t.lastposter,t.lastpost,f.name,t.views,t.replies FROM ".TABLE_PREFIX."threads t LEFT JOIN ".TABLE_PREFIX."forums f ON f.fid=t.fid WHERE t.visible='1' $unviewwhere ORDER BY t.lastpost DESC LIMIT 0,".$limit."");
while($threads = $db->fetch_array($query)) {
// Betreff kürzen?
if ($length != 0) {
if (strlen($threads['subject']) > $length) {
$threads['subject'] = substr($threads['subject'],0,$length) . "...";
}
}
// Daten ausgeben
$output .= "<tr>
<td class=\"trow1\" style=\"text-align: left;\"><a href=\"".$mybb->settings['bburl']."/showthread.php?tid=".$threads['tid']."\" target=\"_self\">".htmlspecialchars($threads['subject'])."</a></td>
<td class=\"trow1\" style=\"text-align: left;\"><a href=\"".$mybb->settings['bburl']."/forumdisplay.php?fid=".$threads['fid']."\" target=\"_self\">".htmlspecialchars($threads['name'])."</a></td>
<td class=\"trow1\" style=\"text-align: center;\">{$threads['views']}</td>
<td class=\"trow1\" style=\"text-align: center;\">{$threads['username']}</td>
<td class=\"trow1\" style=\"text-align: center;\">{$threads['replies']}</td>
<td class=\"trow1\" style=\"text-align: left;\"><a href=\"".$mybb->settings['bburl']."/showthread.php?tid=".$threads['tid']."\" target=\"_self\"><img src=\"images/jump.gif\" alt=\"\" style=\"vertical-align: middle;\" /></a>
".htmlspecialchars(my_date($mybb->settings['dateformat'], $threads['lastpost'])).", ".htmlspecialchars(my_date($mybb->settings['timeformat'], $threads['lastpost']))."</td>
<td class=\"trow1\" style=\"text-align: center;\">{$threads['lastposter']}</td>
</tr>";
}
/* Ausgabe des Templates */
eval("\$lastposts_lists = \"".$templates->get("lastposts_lists")."\";");
//output_page($lastposts);
/************************************************************************************************************
* hier startet die Ausgabe der Statistik
************************************************************************************************************/
// Build the forum statistics to show on the index page.
if($mybb->settings['showindexstats'] != "no") {
// First, load the stats cache.
$stats = $cache->read("stats");
// Check who's the newest member.
if(!$stats['lastusername']) {
$newestmember = "no-one";
}
else {
$newestmember = build_profile_link($stats['lastusername'], $stats['lastuid']);
}
// Format the stats language.
$lang->stats_posts_threads = sprintf($lang->stats_posts_threads, my_number_format($stats['numposts']), my_number_format($stats['numthreads']));
$lang->stats_numusers = sprintf($lang->stats_numusers, my_number_format($stats['numusers']));
$lang->stats_newestuser = sprintf($lang->stats_newestuser, $newestmember);
// Find out what the highest users online count is.
$mostonline = $cache->read("mostonline");
if($onlinecount > $mostonline['numusers']) {
$time = time();
$mostonline['numusers'] = $onlinecount;
$mostonline['time'] = $time;
$cache->update("mostonline", $mostonline);
}
$recordcount = $mostonline['numusers'];
$recorddate = my_date($mybb->settings['dateformat'], $mostonline['time']);
$recordtime = my_date($mybb->settings['timeformat'], $mostonline['time']);
// Then format that language string.
$lang->stats_mostonline = sprintf($lang->stats_mostonline, my_number_format($recordcount), $recorddate, $recordtime);
}
eval("\$lastposts_stats = \"".$templates->get("lastposts_stats")."\";");
eval("\$lastposts = \"".$templates->get("lastposts")."\";");
output_page($lastposts);
?>