1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
29:
30:
31:
32:
33:
34:
35:
36:
37:
38:
39:
40:
41:
42:
|
<?php
require_once(WCF_DIR.'lib/page/AbstractPage.class.php');
# USER-SETUP ***********************************************
# Max. Anzahl der anzuzeigenden News
$maxNews = 5;
# Max. Zeichenlaenge des Topic
$maxLength = 35;
# **********************************************************
$TopNewsData = array();
$sql = "SELECT wnew.threadID, wnew.boardID, lastPostTime, wnew.topic"
."\n FROM wbb".WBB_N."_thread wnew"
."\n WHERE wnew.boardID in (71,70,129)"
."\n ORDER BY lastPostTime DESC"
."\n LIMIT 0, ".$maxNews;
$result = WBBCore::getDB()->sendQuery($sql);
while($row = WBBCore::getDB()->fetchArray($result)) {
$row['topic'] = StringUtil::substring(StringUtil::encodeHTML($row['topic']), 0, $maxLength);
$row['threadid'] = intval($row['threadID']);
$row['lastPostTime']= date("H:i:s" , $row['lastPostTime']);
$TopNewsData[] = $row;
}
$c = 1;
foreach($TopNewsData as $k => $u) {
echo '<div class="container-'.$c.' smallFont" style="float:none; margin-right:6px;">';
echo '<img alt="" src="icon/postS.png" /> ';
echo '<a title="';
echo "$u[topic]";
echo '" href="index.php?page=Thread&threadID=';
echo "$u[threadid]";
echo '">';
echo "$u[topic]";
echo ' - ';
echo "$u[lastPostTime]";
echo '</a>';
echo '<br />';
echo '</div>';
$c = $c === 1 ? 2 : 1;
}
unset($TopNewsData, $maxNews, $maxLength, $result, $row);
?> |