-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.php
186 lines (144 loc) · 6.38 KB
/
index.php
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
<?php
/*******************************************************************\
# @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ #
# @ ArBB V 1.0.0 Beta 1 @ #
# @ All Copyrights are saved Arabian bulletin board team @ #
# @ Copyright © 2009 ArBB Team @ #
# @ ArBB Is Free Bulletin Board and not for sale @ #
# @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ #
\*******************************************************************/
#
# index File started
#
/*
File name -> index.php
File Version -> 1.0.0 Beta 1
File Programmer -> Thaer
File type -> file
*/
$templatelist='index_subforum,index_mainforum,index_whats_going_on,index_forum_status_icons';
$phrasearray=array('index');
require('global.php');
$plugins->cache('index_start,index_complete,index_mainforum_start,index_mainforum_complete,index_subforum,index_event,index_loggedinuser');
($evalp = $plugins->load('index_start'))?eval($evalp):'';
if($localgroup['canviewforum']==0)
{
error_permission();
}
$month = mydate('n');
$year = mydate('Y');
$day = mydate('d');
$local['whereurl']='index.php?';
$local['wheretitle']=$options['sitetitle'];
update_online();
$addon='';
$birthdays='';
if($month == 3 && date('L', mktime(0, 0, 0, $month, 1, $year)) != 1)
{
$addon=" or birthday like '29-2-%'";
}
$show['stats'] = $options['showstats'];
$show['birthdays'] = $options['showbirthdays'];
$query=$DB->query("select f.*,i.title as icontitle,i.iconpath,p.iconid from "._PREFIX_."forum f
LEFT JOIN "._PREFIX_."post p on(p.postid=f.lastpostid)
LEFT JOIN "._PREFIX_."icon i on(i.iconid=p.iconid)
where f.active='1' order by f.displayorder ASC");
while($fetchf=$DB->fetch_array($query))
{
$forums[$fetchf[mainid]][$fetchf[displayorder]][$fetchf[forumid]]=$fetchf;
}
while(list($forumidinfo,$foruminf) = each ($forums[-1]))
{
foreach($foruminf as $forumidinfo => $foruminfo)
{
$mainforum=$bbcode->clearhtml($foruminfo);
($evalp = $plugins->load('index_mainforum_start'))?eval($evalp):'';
if(is_array($forums[$forumidinfo]))
{
foreach($forums[$forumidinfo] as $r => $t)
{
foreach($t as $subforumid => $subforuminfo)
{
$forum = $bbcode->clearhtml($subforuminfo);
$forum['lastthread']=$bbcode->clearhtml($forum['lastthread']);
$forum['statusimg'] = forumstatusimg($forum);
if($forum['iconid']>0)
{
$show['posticon']=1;
}
$forum['lastposttime']=mydate($forum['lastpost'],'last');
($evalp = $plugins->load('index_subforum'))?eval($evalp):'';
$subforumsbit.=$TP->GetTemp('index_subforum');
}
}
}
($evalp = $plugins->load('index_mainforum_complete'))?eval($evalp):'';
$TP->WebTemp('index_mainforum');
$subforumsbit='';
}
}
$stats=$DB->query_now('select * from '._PREFIX_.'stats');
$timer=60*15;
$activenow=time()-$timer;
$online_users=$DB->query("select o.username,o.userid,u.usergroupid,ug.opentag,ug.closetag
from "._PREFIX_."online o
LEFT JOIN "._PREFIX_."users u on (u.userid=o.userid)
LEFT JOIN "._PREFIX_."usergroup ug on (ug.usergroupid=u.usergroupid)
where dateline > $activenow");
$stats['activeusers']=$DB->num_rows($online_users);
$stats['activemembers']=0;
$stats['activeguests']=0;
$comma='';
$stats['active_usernames']='';
while($online=$DB->fetch_array($online_users))
{
($evalp = $plugins->load('index_loggedinuser'))?eval($evalp):'';
if($online['userid']>0)
{
// $online['username']=$bbcode->clearhtml($online['username']);
$stats['active_usernames'].=$comma."<a href=\"member.php?action=profile&userid=$online[userid]\">".$online['opentag'].$online['username'].$online['closetag']."</a>";
$comma=', ';
$stats['activemembers']++;
}
else
{
$stats['activeguests']++;
}
}
$stats['maxusersondate']=mydate($stats[maxusersondate],'last');
if(($stats['activeusers']==$stats['maxuserson'])||($stats['activeusers']>$stats['maxuserson']))
{
$DB->query("update "._PREFIX_."stats set maxuserson='".$stats['activeusers']."',maxusersondate='".time()."'");
}
eval("\$lang[currently_index_active_users]=\"".$lang['currently_index_active_users']."\";");
eval("\$lang[most_active_users]=\"".$lang['most_active_users']."\";");
eval("\$lang[forum_stats]=\"".$lang['forum_stats']."\";");
if($show['birthdays'] > 0)
{
$bd = $DB->query("select u.userid,u.birthday,u.username,u.usergroupid,ug.opentag,ug.closetag from "._PREFIX_."users u LEFT JOIN "._PREFIX_."usergroup ug on (ug.usergroupid=u.usergroupid) where u.birthday like '%$day-$month-%' $addon");
$show['birthdays']=0;
while($birthday = $DB->fetch_array($bd))
{
$show['birthdays']=1;
foreach($birthday as $key => $val)
{
if($key != 'opentag' && $key != 'closetag')
{
$birthday[$key]=$bbcode->clearhtml($val);
}
}
$m=explode("-",$birthday['birthday']);
$old=$year-$m[2];
$username="<a href=\"member.php?action=profile&userid=$birthday[userid]\">".$birthday['opentag'].$birthday['username'].$birthday['closetag']."</a>";
$comma=($birthdays)?' , ':'';
($evalp = $plugins->load('index_event'))?eval($evalp):'';
$birthdays.=$comma."$username ($old $lang[years_old])";
}
}
$stats['nusername']=$bbcode->clearhtml($stats['nusername']);
$TP->webtemp('index_whats_going_on');
$TP->webtemp('index_forum_status_icons');
($evalp = $plugins->load('index_complete'))?eval($evalp):'';
$titleetc='';
print_page();
?>