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:
|
function makeboardbit($boardid,$depth=1) {
global $db, $n, $tpl, $boardvisit, $threadvisit, $boardcache, $visitcache, $permissioncache, $modcache, $wbbuserdata, $session, $hidecats, $index_depth, $show_subboards, $showlastposttitle, $dateformat, $timeformat, $filename, $temp_boardid;
if(!isset($boardcache[$boardid])) return;
reset($boardcache[$boardid]);
$boardbit="";
while(list($key1,$val1)=each($boardcache[$boardid])) {
while(list($key2,$boards)=each($val1)) {
if($boards['invisible']==2 || ($boards['invisible']==1 && !$permissioncache[$boards['boardid']]['boardpermission'])) continue;
if($boards['description']) eval ("\$boards['description'] = \"".$tpl->get("index_boarddescription")."\";");
$subboardbit="";
$subboards="";
if($depth==$index_depth && $show_subboards==1) {
$subboardbit=getSubboards($boards['boardid']);
if($subboardbit) {
$subboardbit=substr($subboardbit, 0, -2);
eval ("\$subboards = \"".$tpl->get("index_subboard")."\";");
}
}
if($wbbuserdata['lastvisit'] > $boards['lastposttime'] || $boardvisit[$boards['boardid']] > $boards['lastposttime']) $onoff="off";
else {
$onoff="off";
$tempids = explode(",","$boards[boardid],$boards[childlist]");
for($j=0;$j<count($tempids);$j++) {
if($tempids[$j]==0) continue;
if(is_array($visitcache[$tempids[$j]]) && count($visitcache[$tempids[$j]])) {
reset($visitcache[$tempids[$j]]);
while(list($threadid,$lastposttime)=each($visitcache[$tempids[$j]])) {
if($threadvisit[$threadid]<$lastposttime && $boardvisit[$tempids[$j]]<$lastposttime) {
$onoff="on";
break 2;
} // end if
} // end while
} // end if
} // end for
} // end else
if($boards['isboard']) {
if($boards['closed']==1) $onoff.="closed";
elseif((!$permissioncache[$boards['boardid']]['startpermission'] && !$permissioncache[$boards['boardid']]['replypermission']) || (!$wbbuserdata['canstarttopic'] && !$wbbuserdata['canreplytopic'])) $onoff.="closed";
if($boards['threadcount']) {
$lastpostdate=formatdate($dateformat,$boards['lastposttime'],1);
$lastposttime=formatdate($timeformat,$boards['lastposttime']);
if($boards['lastposterid']) eval ("\$lastposter = \"".$tpl->get("index_lastposter")."\";");
else eval ("\$lastposter = \"".$tpl->get("index_lastposter_guest")."\";");
if($showlastposttitle==1) {
if(!$permissioncache[$boards['boardid']]['boardpermission'] || $boards['password']!="") eval ("\$lastposttitle = \"".$tpl->get("index_lastpost_title_hide")."\";");
else {
if(strlen($boards['topic'])>30) $topic=cutTopic($boards['topic']);
else $topic=$boards['topic'];
eval ("\$lastposttitle = \"".$tpl->get("index_lastpost_title_show")."\";");
}
if(isset($boards['iconid'])) $ViewPosticon=makeimgtag($boards['iconpath'],$boards['icontitle']);
else $ViewPosticon=makeimgtag("{imagefolder}/icons/icon14.gif");
if(isset($boards['threadprefix']) && $boards['threadprefix']!="") {
$threads['prefix']=$boards['threadprefix'];
eval ("\$prefix = \"".$tpl->get("board_thread_prefix")."\";");
}
else $prefix="";
eval ("\$lastpost = \"".$tpl->get("index_lastpost_title")."\";");
}
else eval ("\$lastpost = \"".$tpl->get("index_lastpost")."\";");
}
else eval ("\$lastpost = \"".$tpl->get("index_nolastpost")."\";");
$moderators="";
$moderatorbit="";
if(isset($modcache[$boards['boardid']])) {
while (list($mkey,$moderator)=each($modcache[$boards['boardid']])) {
if($moderatorbit) eval ("\$moderatorbit .= \", ".$tpl->get("index_moderatorbit")."\";");
else eval ("\$moderatorbit = \"".$tpl->get("index_moderatorbit")."\";");
}
}
else $moderatorbit=" ";
eval ("\$moderators = \"".$tpl->get("index_moderators")."\";");
eval ("\$boardbit .= \"".$tpl->get("index_boardbit$depth")."\";");
}
else {
if ((isset($hidecats[$boards['boardid']]) && $hidecats[$boards['boardid']]==0) || ($depth<$index_depth && (!isset($hidecats[$boards['boardid']]) || $hidecats[$boards['boardid']]!=1))){
eval ("\$show_hide = \"".$tpl->get("index_catbit_hide")."\";");
} else {
eval ("\$show_hide = \"".$tpl->get("index_catbit_show")."\";");
}
eval ("\$boardbit .= \"".$tpl->get("index_catbit$depth")."\";");
}
if ((isset($hidecats[$boards['boardid']]) && $hidecats[$boards['boardid']]==0) || ($depth<$index_depth && (!isset($hidecats[$boards['boardid']]) || $hidecats[$boards['boardid']]!=1))) $boardbit.=makeboardbit($boards['boardid'],$depth+1);
}
}
unset($boardcache[$boardid]);
return $boardbit;
} |