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:
|
/* ############## STATS ############## */
if($showstats==1) {
$members=$db->query_first("SELECT COUNT(*) AS members, MAX(userid) AS userid FROM bb".$n."_users WHERE activation = 1");
$newestmember=$db->query_first("SELECT userid, username FROM bb".$n."_users WHERE userid = '$members[userid]'");
$posts=$db->query_first("SELECT COUNT(*) AS posts FROM bb".$n."_posts");
$threads=$db->query_first("SELECT COUNT(*) AS threads FROM bb".$n."_threads");
$installdays = (time() - $installdate) / 86400;
if ($installdays < 1) $postperday = $posts['posts'];
else $postperday = sprintf("%.2f",($posts['posts'] / $installdays));
####Anfang Erweiterte Statistik####
$gespuserfrage = $db->query("SELECT blocked FROM bb".$n."_users WHERE blocked='1'");
$gespuser2=mysql_num_rows($gespuserfrage);
if($gespuser2==1) {
$gespuser="1 gesperrter";
}
else {
$gespuser="".$gespuser2." gesperte";
}
$nafrage = $db->query("SELECT activation FROM bb".$n."_users WHERE activation='0'");
$na2=mysql_num_rows($nafrage);
if($na2==1) {
$na="1 nicht freigeschalteter";
}
else {
$na="".$na2." nicht freigeschaltete";
}
$gmfrage = $db->query("SELECT gender FROM bb".$n."_users WHERE gender='1'");
$gm=mysql_num_rows($gmfrage);
$gkafrage = $db->query("SELECT gender FROM bb".$n."_users WHERE gender='0'");
$gka=mysql_num_rows($gkafrage);
$gwfrage = $db->query("SELECT gender FROM bb".$n."_users WHERE gender='2'");
$gw=mysql_num_rows($gwfrage);
$posts2 = $db->query_first("SELECT COUNT(postid) AS posts FROM bb".$n."_posts");
$members2 = $db->query_first("SELECT COUNT(userid) AS members FROM bb".$n."_users ");
$anzahlposts = ($posts2['posts']);
$anzahluser = ($members2['members']);
$bu=sprintf("%.3f",$anzahlposts / $anzahluser);
####Ende Erweiterte Statistik####
eval ("\$index_stats = \"".$tpl->get("index_stats")."\";");
}
/* ############## USERONLINE ############## */
if($showuseronline==1) {
$guestcount=0;
$membercount=0;
$useronlinebit = '';
$result = $db->query("SELECT bb".$n."_sessions.userid, username, groupid, invisible FROM bb".$n."_sessions LEFT JOIN bb".$n."_users USING (userid) WHERE bb".$n."_sessions.lastactivity >= '".(time()-60*$useronlinetimeout)."' ORDER BY username ASC");
while($row = $db->fetch_array($result)) {
if($row['userid']==0) {
$guestcount++;
continue;
}
$membercount++;
if(!$row['invisible']) {
if(isset($useronlinebit) && $useronlinebit != '') $useronlinebit .= ', ';
eval ("\$useronlinebit .= \"".$tpl->get("index_useronline")."\";");
}
}
$totaluseronline = $membercount+$guestcount;
if($totaluseronline>$rekord) {
$rekord=$totaluseronline;
$rekordtime=time();
$db->unbuffered_query("UPDATE bb".$n."_options SET value='$rekord' WHERE varname='rekord'",1);
$db->unbuffered_query("UPDATE bb".$n."_options SET value='$rekordtime' WHERE varname='rekordtime'",1);
require ("./acp/lib/class_options.php");
$option=new options("acp/lib");
$option->write();
}
$rekorddate = formatdate($dateformat,$rekordtime);
$rekordtime = formatdate($timeformat,$rekordtime);
eval ("\$index_useronline = \"".$tpl->get("index_showuseronline")."\";");
}
if(!$wbbuserdata['userid']) {
eval ("\$welcome = \"".$tpl->get("index_welcome")."\";");
eval ("\$quicklogin = \"".$tpl->get("index_quicklogin")."\";");
}
else {
$currenttime=formatdate($timeformat,time());
$toffset=ifelse($default_timezoneoffset>=0,"+").$default_timezoneoffset;
$lastvisitdate = formatdate($dateformat,$wbbuserdata['lastvisit']);
$lastvisittime = formatdate($timeformat,$wbbuserdata['lastvisit']);
eval ("\$welcome = \"".$tpl->get("index_hello")."\";");
if($wbbuserdata['canusepms']==1 && $showpmonindex==1) {
$counttotal=0; $countunread=0; $countnew=0;
$result = $db->query("SELECT view, sendtime FROM bb".$n."_privatemessage WHERE deletepm <> 1 AND recipientid = '$wbbuserdata[userid]'");
while($row=$db->fetch_array($result)) {
$counttotal++;
if($row['view']==0) {
$countunread++;
if($row['sendtime']>$wbbuserdata['lastvisit']) $countnew++;
}
}
if($countnew>0) eval ("\$new_notnew = \"".$tpl->get("index_newpm")."\";");
else eval ("\$new_notnew = \"".$tpl->get("index_nonewpm")."\";");
eval ("\$index_pms = \"".$tpl->get("index_pms")."\";");
}
}
#### ANFANG NEWSBAR HACK ####
$nb = $db->query_first("SELECT barai,bartextrichtung,barforum,barnumber FROM bb".$n."_newsbar");
if($nb['barai']=="1") {
$richtung2=($nb['bartextrichtung']);
if($richtung2=="LR") {
$richtung='direction="right"';
}
else {
$richtung='direction="left"';
}
$forum=$nb['barforum'];
$anzahl=$nb['barnumber'];
$bartext=" .:: ";
$tr = $db->query("SELECT topic,threadid FROM bb".$n."_threads WHERE boardid LIKE '".$forum."' ORDER BY starttime DESC LIMIT ".$anzahl."");
while($abfrage = $db->fetch_array($tr)) {
$bartext.=' <a href="thread.php?threadid='.($abfrage["threadid"]).'">'.($abfrage["topic"]).'</a> :';
}
$bartext.=":. ";
$newsbar='
<table cellspacing=1 border=0 width="98%" bgcolor="#000000">
<tr bgcolor="#0B6295" id="tabletitle">
<td><font face="Tahoma,Helvetica" size="2" color="#ffffff"><b>News:</b></font></td></tr>
<tr bgcolor="#f5f5f5" id="tablea">
<td align="left"><font face="Tahoma,Helvetica" size="2"><b><marquee '.$richtung.' scrollamount="3" width="95%" height="15">'.$bartext.'</marquee></font></p></td></td>
</td></tr></table>
<table cellpadding=4 cellspacing=1 border=0 width="98%" bgcolor="#000000">';
}
else {
$newsbar="";
}
#### ENDE NEWSBAR HACK####
eval("\$tpl->output(\"".$tpl->get("index")."\");");
?> |