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:
43:
44:
45:
46:
47:
48:
49:
50:
51:
52:
53:
54:
55:
56:
57:
58:
59:
60:
61:
62:
63:
64:
65:
66:
67:
68:
69:
70:
71:
72:
73:
74:
75:
76:
77:
78:
79:
80:
81:
82:
83:
84:
85:
86:
87:
88:
89:
90:
91:
92:
93:
94:
95:
96:
97:
98:
99:
100:
101:
102:
103:
104:
105:
106:
107:
108:
109:
110:
111:
112:
113:
114:
115:
116:
117:
118:
119:
120:
121:
122:
123:
124:
125:
126:
127:
128:
129:
130:
131:
132:
133:
134:
135:
136:
137:
138:
139:
140:
141:
142:
143:
144:
145:
146:
147:
148:
149:
150:
151:
152:
153:
154:
155:
156:
157:
158:
159:
160:
161:
162:
163:
164:
165:
166:
167:
168:
169:
170:
171:
172:
173:
174:
175:
176:
177:
178:
179:
180:
181:
182:
183:
184:
185:
186:
187:
188:
189:
190:
191:
192:
193:
194:
195:
196:
197:
198:
199:
200:
201:
202:
203:
204:
205:
|
<?php
// ************************************************************************************//
// * WoltLab Burning Board 2
// ************************************************************************************//
// * Copyright (c) 2001-2004 WoltLab GmbH
// * Web http://www.woltlab.de/
// * License http://www.woltlab.de/products/burning_board/license_en.php
// * http://www.woltlab.de/products/burning_board/license.php
// ************************************************************************************//
// * WoltLab Burning Board 2 is NOT free software.
// * You may not redistribute this package or any of it's files.
// ************************************************************************************//
// * $Date: 2004-10-26 14:41:23 +0200 (Tue, 26 Oct 2004) $
// * $Author: Burntime $
// * $Rev: 1459 $
// ************************************************************************************//
$filename = 'homesite.php';
require('./global.php');
if ($ywhome_shownews == 1 || $ywhome_shownews_fb == 1) {
require('./acp/lib/class_parse.php');
}
$lang->load('HOME,START');
/* ############## user disable home ############## */
if ($wbbuserdata['disablehome'] == 1){
header("Location: index.php$SID_ARG_1ST");
exit();
}
/* ############## load Languages ############## */
$lang->items['LANG_HOME_BOX_WELCOME'] = $lang->get("LANG_HOME_BOX_WELCOME", array('$master_board_name' => $master_board_name));
$lang->items['LANG_HOME_BOX_WELCOME_TEXT'] = $lang->get("LANG_HOME_BOX_WELCOME_TEXT", array('$master_board_name' => $master_board_name));
$lang->items['LANG_HOME_BOX_WELCOME_GREETZTEAM'] = $lang->get("LANG_HOME_BOX_WELCOME_GREETZTEAM", array('$master_board_name' => $master_board_name));
/* ############## installdate ############## */
$install_date = formatdate($wbbuserdata['dateformat'], $installdate);
/* ############## usercount / postcount / threadcount ############## */
$ywuspoth = $db->query_first("SELECT * FROM bb".$n."_stats");
if ($ywuspoth['usercount'] >= 1000) $ywuspoth['usercount'] = number_format($ywuspoth['usercount'], 0, "", $lang->get("LANG_GLOBAL_THOUSANDS_SEP"));
if ($ywuspoth['threadcount'] >= 1000) $ywuspoth['threadcount'] = number_format($ywuspoth['threadcount'], 0, "", $lang->get("LANG_GLOBAL_THOUSANDS_SEP"));
if ($ywuspoth['postcount'] >= 1000) $ywuspoth['postcount'] = number_format($ywuspoth['postcount'], 0, "", $lang->get("LANG_GLOBAL_THOUSANDS_SEP"));
/* ############## useronline ############## */
$ywuseron = $db->query_first("SELECT COUNT(userid) AS user_on FROM bb".$n."_sessions WHERE lastactivity>='".(time()-60*$useronlinetimeout)."' AND userid>=1");
if ($ywuseron['user_on'] >= 1000) $ywuseron['user_on'] = number_format($useron['ywuser_on'], 0, "", $lang->get("LANG_GLOBAL_THOUSANDS_SEP"));
/* ############## guestonline ############## */
$ywgueston = $db->query_first("SELECT COUNT(userid) AS guest_on FROM bb".$n."_sessions WHERE lastactivity>='".(time()-60*$useronlinetimeout)."' AND userid=0");
if($ywgueston['guest_on'] >= 1000) $ywgueston['guest_on'] = number_format($ywgueston['guest_on'], 0, "", $lang->get("LANG_GLOBAL_THOUSANDS_SEP"));
/* ############## offline ############## */
if ($offline == 1 && $ywhome_showoff == 1) {
$offlinemessage = nl2br(htmlconverter($offlinemessage));
}
/* ############## lastvisit ############## */
if ($wbbuserdata['userid']) {
$lastvisitdate = formatdate($wbbuserdata['dateformat'], $wbbuserdata['lastvisit']);
$lastvisittime = formatdate($wbbuserdata['timeformat'], $wbbuserdata['lastvisit']);
}
/* ############## news from post ############## */
if ($ywhome_shownews == 1) {
$newspost = $db->query_first("SELECT p.*, pc.cache, t.threadid, t.boardid, t.topic, t.closed, t.important, t.replycount, t.views FROM bb".$n."_posts p LEFT JOIN bb".$n."_threads t ON (p.threadid = t.threadid) LEFT JOIN bb".$n."_postcache pc ON (p.postid=pc.postid) WHERE p.postid=$ywhome_newsid");
$parse = &new parse($docensor, 75, $wbbuserdata['showimages'], $hilight, $usecode);
if ($newspost['posttopic'] == '') $newtopic = $newspost['topic'];
else $newtopic = $newspost['posttopic'];
if ($newspost['cache']) $newspostmessage = $parse->parseCache($newspost['cache']);
else $newspostmessage = $parse->doparse($newspost['message'], $newspost['allowsmilies'], $newspost['allowhtml'], $newspost['allowbbcode'], $newspost['allowimages']);
if ($ywhome_shownews_postcut == 1) {
$search = strpos($newspostmessage,"*");
$newspostmessage = substr($newspostmessage,0,$search);
$newspostmessage .= $LANG_HOME_BOX_NEWS_POST_POSTCUT = $lang->get("LANG_HOME_BOX_NEWS_POST_POSTCUT");
}
$newsdate = formatdate($wbbuserdata['dateformat'], $newspost[posttime],1);
$newstime = formatdate($wbbuserdata['timeformat'], $newspost[posttime]);
if ($newspost['views'] >= 1000) $newspost['views'] = number_format($newspost['views'], 0, "", $lang->get("LANG_GLOBAL_THOUSANDS_SEP"));
if ($newspost['replycount'] >= 1000) $newspost['replycount'] = number_format($newspost['replycount'], 0, "", $lang->get("LANG_GLOBAL_THOUSANDS_SEP"));
$lang->items['LANG_HOME_BOX_NEWS_POST'] = $lang->get("LANG_HOME_BOX_NEWS_POST", array('$newspostuserid' => $newspost['userid'], '$newspostusername' => $newspost['username'], '$SID_ARG_2ND' => $SID_ARG_2ND, '$newsdate' => $newsdate, '$newstime' => $newstime));
}
/* ############## lastthreads ############## */
if ($ywhome_showlt == 1) {
/* ############## funktion for permisson to boards ############## */
function getSearchableBoardsYWH() {
global $db, $n, $wbbuserdata, $ywhcache;
if (!isset($ywhcache) || !is_array($ywhcache)) $ywhcache = array();
$result = $db->query("SELECT boardid, boardorder, parentid, parentlist FROM bb".$n."_boards ORDER BY parentid ASC, boardorder ASC");
while ($row = $db->fetch_array($result)) {
$ywhcache[$row['parentid']][$row['boardorder']][$row['boardid']] = $row;
}
$ywhpermissions = getPermissions();
$boardids = '';
foreach($ywhcache as $key => $val) {
foreach($val as $key2 => $val2) {
foreach($val2 as $row) if(!isset($ywhpermissions[$row['boardid']]['can_use_search']) || $ywhpermissions[$row['boardid']]['can_use_search'] !=0 ) $boardids .= ",".$row['boardid'];
}
}
return $boardids;
}
/* ############## config own threads for lastthreads ############## */
if ($wbbuserdata['userid']) {
$ywhome_ownuserid = "DISTINCT p.userid,";
$ywhome_ownjoin = "LEFT JOIN bb".$n."_posts p ON (t.threadid = p.threadid AND p.userid = '$wbbuserdata[userid]')";
} else {
$ywhome_ownuserid = '';
$ywhome_ownjoin = '';
}
if ($wbbuserdata['userid']) {
$ywhome_vselect = ", bv.lastvisit AS boardlastvisit, tv.lastvisit AS threadlastvisit";
$ywhome_vjoin = " LEFT JOIN bb".$n."_boardvisit bv ON (bv.boardid=b.boardid AND bv.userid='".$wbbuserdata['userid']."') LEFT JOIN bb".$n."_threadvisit tv ON (tv.threadid=t.threadid AND tv.userid='".$wbbuserdata['userid']."')";
} else {
$ywhome_vselect = '';
$ywhome_vjoin = '';
}
/* ############## select and output for lastthreads ############## */
$lastthread = $db->query ("SELECT $ywhome_ownuserid t.*, b.boardid, b.title, b.hotthread_reply, b.hotthread_view, b.postsperpage, i.* $ywhome_vselect FROM bb".$n."_threads t LEFT JOIN bb".$n."_icons i USING (iconid) LEFT JOIN bb".$n."_boards b ON (b.boardid=t.boardid) $ywhome_ownjoin $ywhome_vjoin WHERE b.boardid AND t.boardid IN (0".getSearchableBoardsYWH().") AND t.visible=1 AND t.closed<>3 AND b.boardid NOT IN (0$ywhome_showlt_boardidno) ORDER BY t.lastposttime DESC LIMIT 0,$ywhome_lt");
while ($lastthreads = $db->fetch_array ($lastthread)) {
$prefix = '';
if ($lastthreads['boardlastvisit'] > $lastthreads['threadlastvisit']) $lastthreads['threadlastvisit'] = $lastthreads['boardlastvisit'];
if ($wbbuserdata['lastvisit'] > $lastthreads['threadlastvisit']) $lastthreads['threadlastvisit'] = $wbbuserdata['lastvisit'];
if ($lastthreads['hotthread_reply'] == 0) $lastthreads['hotthread_reply'] = $default_hotthread_reply;
if ($lastthreads['hotthread_view'] == 0) $lastthreads['hotthread_view'] = $default_hotthread_view;
if ($lastthreads['lastposttime'] > $lastthreads['threadlastvisit']) $firstnew = 1;
else $firstnew = 0;
if ($lastthreads['important'] == 2) $foldericon = "announce";
else $foldericon = ((isset($lastthreads['userid']) && $lastthreads['userid']) ? ("dot") : ("")).(($lastthreads['lastposttime'] > $lastthreads['threadlastvisit']) ? ("new") : ("")).(($lastthreads['replycount'] >= $lastthreads['hotthread_reply'] || $lastthreads['views'] >= $lastthreads['hotthread_view']) ? ("hot") : ("")).(($lastthreads['closed'] != 0) ? ("lock") : (""))."folder";
if ($lastthreads['pollid'] != 0) $threadicon = makeimgtag($style['imagefolder']."/poll.gif");
elseif ($lastthreads['iconid']) $threadicon = makeimgtag($lastthreads['iconpath'],getlangvar($lastthreads['icontitle'], $lang), 0);
else $threadicon = " ";
$lastthreads['title'] = getlangvar($lastthreads['title'], $lang);
$topic = $lastthreads['topic'];
$topic = htmlconverter($topic);
if(strlen($topic) > 43) $topic = substr($topic, 0, 38)." ...";
$lastthreads['lastposter'] = htmlconverter($lastthreads['lastposter']);
$lasttime = formatdate($wbbuserdata['timeformat'],$lastthreads['lastposttime']);
$lastdate = formatdate($wbbuserdata['dateformat'],$lastthreads['lastposttime'],1);
if ($lastthreads['replycount'] >= 1000) $lastthreads['replycount'] = number_format($lastthreads['replycount'], 0, "", $lang->get("LANG_GLOBAL_THOUSANDS_SEP"));
if ($lastthreads['views'] >= 1000) $lastthreads['views'] = number_format($lastthreads['views'], 0, "", $lang->get("LANG_GLOBAL_THOUSANDS_SEP"));
if ($lastthreads['attachments'] >= 1000) $lastthreads['attachments'] = number_format($lastthreads['attachments'], 0, "", $lang->get("LANG_GLOBAL_THOUSANDS_SEP"));
eval ("\$homelastthreadsbit .= \"".$tpl->get("homelastthreadsbit")."\";");
}
}
/* ############## news from board ############## */
if ($ywhome_shownews_fb == 1) {
$newsboards = $db->query (" SELECT t.*, p.postid, p.threadid, p.message, p.allowsmilies, p.allowhtml, p.allowbbcode, p.allowimages, pc.cache FROM bb".$n."_threads t LEFT JOIN bb".$n."_posts p USING (threadid) LEFT JOIN bb".$n."_postcache pc ON (p.postid=pc.postid) WHERE t.boardid = '$ywhome_shownews_fb_boardid' AND t.closed <> '3' AND t.starttime = p.posttime AND t.threadid NOT IN (0$ywhome_shownews_fb_threadidno) AND p.postid NOT IN (0$ywhome_shownews_fb_postidno) ORDER BY t.starttime DESC LIMIT 0,$ywhome_shownews_fb_limit");
while ($newsboard = $db->fetch_array ($newsboards)) {
$parse = &new parse($docensor,75,$wbbuserdata['showimages'],$hilight,$usecode);
if ($newsboard['cache']) $newsboardmessage = $parse->parseCache($newsboard['cache']);
else $newsboardmessage = $parse->doparse($newsboard['message'], $newsboard['allowsmilies'], $newsboard['allowhtml'], $newsboard['allowbbcode'], $newsboard['allowimages']);
if ($ywhome_shownews_fb_postcut == 1) {
$search = strpos($newsboardmessage,"*");
$newsboardmessage = substr($newsboardmessage,0,$search);
$newsboardmessage .= $LANG_HOME_BOX_NEWS_BOARD_POSTCUT = $lang->get("LANG_HOME_BOX_NEWS_BOARD_POSTCUT");
}
$newsboarddate = formatdate($wbbuserdata['dateformat'],$newsboard[starttime],1);
$newsboardtime = formatdate($wbbuserdata['timeformat'],$newsboard[starttime]);
if($newsboard['views'] >= 1000) $newsboard['views'] = number_format($newsboard['views'], 0, "", $lang->get("LANG_GLOBAL_THOUSANDS_SEP"));
if($newsboard['replycount'] >= 1000) $newsboard['replycount'] = number_format($newsboard['replycount'], 0, "", $lang->get("LANG_GLOBAL_THOUSANDS_SEP"));
if(strlen($newsboard[topic]) > 36) $newsboard[topic] = substr($newsboard[topic], 0, 35)." ...";
$LANG_HOME_BOX_NEWS_BOARD_AUTHOR = $lang->get("LANG_HOME_BOX_NEWS_BOARD_AUTHOR", array('$newsboarduserid' => $newsboard['starterid'], '$newsboardusername' => $newsboard['starter'], '$SID_ARG_2ND' => $SID_ARG_2ND, '$newsboarddate' => $newsboarddate, '$newsboardtime' => $newsboardtime));
$LANG_HOME_BOX_NEWS_BOARD_AUTHOR2 = $lang->get("LANG_HOME_BOX_NEWS_BOARD_AUTHOR2", array('$newsboarduserid' => $newsboard['starterid'], '$newsboardusername' => $newsboard['starter'], '$SID_ARG_2ND' => $SID_ARG_2ND, '$newsboarddate' => $newsboarddate, '$newsboardtime' => $newsboardtime));
eval ("\$homenewsboardbit .= \"".$tpl->get("homenewsboardbit")."\";");
}
}
/* ############## output ############## */
eval("\$tpl->output(\"".$tpl->get("home")."\");");
?> |