Small update
[iDB.git] / inc / groupsetup.php
blobce1c83e2c52d759a83a656ccdb6eca77cb551a7f
1 <?php
2 /*
3 This program is free software; you can redistribute it and/or modify
4 it under the terms of the Revised BSD License.
6 This program is distributed in the hope that it will be useful,
7 but WITHOUT ANY WARRANTY; without even the implied warranty of
8 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
9 Revised BSD License for more details.
11 Copyright 2004-2019 iDB Support - https://idb.osdn.jp/support/category.php?act=view&id=1
12 Copyright 2004-2019 Game Maker 2k - https://idb.osdn.jp/support/category.php?act=view&id=2
14 $FileInfo: groupsetup.php - Last Update: 08/02/2019 SVN 905 - Author: cooldude2k $
16 $File3Name = basename($_SERVER['SCRIPT_NAME']);
17 if ($File3Name=="groupsetup.php"||$File3Name=="/groupsetup.php") {
18 require('index.php');
19 exit(); }
20 //Set members temp location
21 if(isset($_SESSION['OldViewingPage'])) { $_SESSION['AncientViewingPage'] = $_SESSION['OldViewingPage']; } else { $_SESSION['AncientViewingPage'] = url_maker(null,"no+ext","act=view","&","=",$prexqstr['index'],$exqstr['index']); }
22 if(isset($_SESSION['OldViewingFile'])) { $_SESSION['AncientViewingFile'] = $_SESSION['OldViewingFile']; } else {
23 if($Settings['file_ext']!="no+ext"&&$Settings['file_ext']!="no ext") {
24 $_SESSION['AncientViewingFile'] = $exfile['index'].$Settings['file_ext']; }
25 if($Settings['file_ext']=="no+ext"||$Settings['file_ext']=="no ext") {
26 $_SESSION['AncientViewingFile'] = $exfile['index']; } }
27 if(isset($_SESSION['OldPreViewingTitle'])) { $_SESSION['AncientPreViewingTitle'] = $_SESSION['OldPreViewingTitle']; } else { $_SESSION['AncientPreViewingTitle'] = "Viewing"; }
28 if(isset($_SESSION['OldViewingTitle'])) { $_SESSION['AncientViewingTitle'] = $_SESSION['OldViewingTitle']; } else { $_SESSION['AncientViewingTitle'] = "Board index"; }
29 if(isset($_SESSION['OldExtraData'])) { $_SESSION['AncientExtraData'] = $_SESSION['OldExtraData']; } else { $_SESSION['AncientExtraData'] = "currentact:view; currentcategoryid:0; currentforumid:0; currenttopicid:0; currentmessageid:0; currenteventid:0; currentmemberid:0;"; }
30 if(isset($_SESSION['ViewingPage'])) { $_SESSION['OldViewingPage'] = $_SESSION['ViewingPage']; } else { $_SESSION['OldViewingPage'] = url_maker(null,"no+ext","act=view","&","=",$prexqstr['index'],$exqstr['index']); }
31 if(isset($_SESSION['ViewingFile'])) { $_SESSION['OldViewingFile'] = $_SESSION['ViewingFile']; } else {
32 if($Settings['file_ext']!="no+ext"&&$Settings['file_ext']!="no ext") {
33 $_SESSION['OldViewingFile'] = $exfile['index'].$Settings['file_ext']; }
34 if($Settings['file_ext']=="no+ext"||$Settings['file_ext']=="no ext") {
35 $_SESSION['OldViewingFile'] = $exfile['index']; } }
36 if(isset($_SESSION['PreViewingTitle'])) { $_SESSION['OldPreViewingTitle'] = $_SESSION['PreViewingTitle']; } else { $_SESSION['OldPreViewingTitle'] = "Viewing"; }
37 if(isset($_SESSION['ViewingTitle'])) { $_SESSION['OldViewingTitle'] = $_SESSION['ViewingTitle']; } else { $_SESSION['OldViewingTitle'] = "Board index"; }
38 if(isset($_SESSION['ExtraData'])) { $_SESSION['OldExtraData'] = $_SESSION['ExtraData']; } else { $_SESSION['OldExtraData'] = "currentact:view; currentcategoryid:0; currentforumid:0; currenttopicid:0; currentmessageid:0; currenteventid:0; currentmemberid:0;"; }
39 $_SESSION['ViewingPage'] = url_maker(null,"no+ext","act=view","&","=",$prexqstr['index'],$exqstr['index']);
40 if($Settings['file_ext']!="no+ext"&&$Settings['file_ext']!="no ext") {
41 $_SESSION['ViewingFile'] = $exfile['index'].$Settings['file_ext']; }
42 if($Settings['file_ext']=="no+ext"||$Settings['file_ext']=="no ext") {
43 $_SESSION['ViewingFile'] = $exfile['index']; }
44 $_SESSION['PreViewingTitle'] = "Viewing";
45 $_SESSION['ViewingTitle'] = "Board index";
46 $_SESSION['ExtraData'] = "currentact:view; currentcategoryid:0; currentforumid:0; currenttopicid:0; currentmessageid:0; currenteventid:0; currentmemberid:0;";
47 /*$ggidquery = sql_pre_query("SELECT * FROM \"".$Settings['sqltable']."groups\" WHERE \"Name\"='%s' LIMIT 1", array($Settings['GuestGroup']));
48 $ggidresult=sql_query($ggidquery,$SQLStat);
49 $Settings['GuestGroupID']=sql_result($ggidresult,0,"id");*/
50 // Check to make sure MemberInfo is right
51 $MyPostCountChk = null; $MyKarmaCount = null;
52 if(!isset($_SESSION['UserID'])) { $_SESSION['UserID'] = 0; }
53 if($_SESSION['UserID']!=0&&$_SESSION['UserID']!=null) { $BanError = null;
54 $kgbquerychkusr = sql_pre_query("SELECT * FROM \"".$Settings['sqltable']."members\" WHERE \"Name\"='%s' AND \"UserPassword\"='%s' AND \"id\"=%i LIMIT 1", array($_SESSION['MemberName'],$_SESSION['UserPass'],$_SESSION['UserID']));
55 $resultchkusr=sql_query($kgbquerychkusr,$SQLStat);
56 $numchkusr=sql_num_rows($resultchkusr);
57 if($numchkusr==1) {
58 $ChkUsrID=sql_result($resultchkusr,0,"id");
59 $ChkUsrName=sql_result($resultchkusr,0,"Name");
60 $ChkUsrGroup=sql_result($resultchkusr,0,"GroupID");
61 $ChkUsrGroupID=$ChkUsrGroup;
62 $ChkUsrLevel=sql_result($resultchkusr,0,"LevelID");
63 $ChkUsrLevelID=$ChkUsrLevel;
64 $ChkUsrPass=sql_result($resultchkusr,0,"UserPassword");
65 $ChkUsrTimeZone=sql_result($resultchkusr,0,"TimeZone");
66 $ChkUsrDateFormat=sql_result($resultchkusr,0,"DateFormat");
67 $ChkUsrTimeFormat=sql_result($resultchkusr,0,"TimeFormat");
68 $ChkUsrTheme=sql_result($resultchkusr,0,"UseTheme");
69 $ChkUsrLastPostTime=sql_result($resultchkusr,0,"LastPostTime");
70 $MyPostCountChk=sql_result($resultchkusr,0,"PostCount");
71 $MyKarmaCount=sql_result($resultchkusr,0,"Karma");
72 $MyKarmaUpdate=sql_result($resultchkusr,0,"KarmaUpdate");
73 $MyRepliesPerPage=sql_result($resultchkusr,0,"RepliesPerPage");
74 $Settings['max_posts'] = $MyRepliesPerPage;
75 $MyTopicsPerPage=sql_result($resultchkusr,0,"TopicsPerPage");
76 $Settings['max_topics'] = $MyTopicsPerPage;
77 $MyMessagesPerPage=sql_result($resultchkusr,0,"MessagesPerPage");
78 $Settings['max_memlist'] = $MyMessagesPerPage;
79 $Settings['max_pmlist'] = $MyMessagesPerPage;
80 $svrquery = sql_pre_query("SELECT * FROM \"".$Settings['sqltable']."groups\" WHERE \"id\"=%i LIMIT 1", array($ChkUsrGroup));
81 $svrgresultkgb=sql_query($svrquery,$SQLStat);
82 $ChkUsrGroup=sql_result($svrgresultkgb,0,"Name");
83 $ChkUsrBanTime=sql_result($resultchkusr,0,"BanTime");
84 $ChkUsrGMTime = $utccurtime->getTimestamp();
85 if($ChkUsrBanTime!=0&&$ChkUsrBanTime!=null) {
86 if($ChkUsrBanTime>=$ChkUsrGMTime) { $BanError = "yes"; }
87 if($ChkUsrBanTime<0) { $BanError = "yes"; } }
88 if($BanError!="yes") {
89 $_SESSION['Theme']=$ChkUsrTheme;
90 $_SESSION['MemberName']=$ChkUsrName;
91 $_SESSION['UserID']=$ChkUsrID;
92 $_SESSION['UserIP']=$_SERVER['REMOTE_ADDR'];
93 $_SESSION['UserTimeZone']=$ChkUsrTimeZone;
94 $usertz = new DateTimeZone($_SESSION['UserTimeZone']);
95 $usercurtime->setTimestamp($defcurtime->getTimestamp());
96 $usercurtime->setTimezone($usertz);
97 $_SESSION['iDBDateFormat']=$ChkUsrDateFormat;
98 $_SESSION['iDBTimeFormat']=$ChkUsrTimeFormat;
99 $_SESSION['UserGroup']=$ChkUsrGroup;
100 $_SESSION['UserGroupID']=$ChkUsrGroupID;
101 $_SESSION['UserPass']=$ChkUsrPass;
102 $_SESSION['LastPostTime'] = $ChkUsrLastPostTime; } }
103 if($numchkusr<=0||$numchkusr>1||$BanError=="yes") { session_unset();
104 if($cookieDomain==null) {
105 setcookie("MemberName", null, $utccurtime->getTimestamp() - 3600, $cbasedir);
106 setcookie("UserID", null, $utccurtime->getTimestamp() - 3600, $cbasedir);
107 setcookie("SessPass", null, $utccurtime->getTimestamp() - 3600, $cbasedir);
108 setcookie(session_name(), "", $utccurtime->getTimestamp() - 3600, $cbasedir); }
109 if($cookieDomain!=null) {
110 if($cookieSecure===true) {
111 setcookie("MemberName", null, $utccurtime->getTimestamp() - 3600, $cbasedir, $cookieDomain, 1);
112 setcookie("UserID", null, $utccurtime->getTimestamp() - 3600, $cbasedir, $cookieDomain, 1);
113 setcookie("SessPass", null, $utccurtime->getTimestamp() - 3600, $cbasedir, $cookieDomain, 1);
114 setcookie(session_name(), "", $utccurtime->getTimestamp() - 3600, $cbasedir, $cookieDomain, 1); }
115 if($cookieSecure===false) {
116 setcookie("MemberName", null, $utccurtime->getTimestamp() - 3600, $cbasedir, $cookieDomain);
117 setcookie("UserID", null, $utccurtime->getTimestamp() - 3600, $cbasedir, $cookieDomain);
118 setcookie("SessPass", null, $utccurtime->getTimestamp() - 3600, $cbasedir, $cookieDomain);
119 setcookie(session_name(), "", $utccurtime->getTimestamp() - 3600, $cbasedir, $cookieDomain); } }
120 unset($_COOKIE[session_name()]);
121 $_SESSION = array(); session_unset(); session_destroy();
122 redirect("location",$rbasedir.url_maker($exfile['member'],$Settings['file_ext'],"act=login",$Settings['qstr'],$Settings['qsep'],$prexqstr['member'],$exqstr['member'],false)); sql_free_result($resultchkusr); sql_free_result($svrgresultkgb);
123 ob_clean(); header("Content-Type: text/plain; charset=".$Settings['charset']); $urlstatus = 302;
124 gzip_page($Settings['use_gzip'],$GZipEncode['Type']); session_write_close(); die(); }
125 sql_free_result($resultchkusr); sql_free_result($svrgresultkgb); }
126 if($_SESSION['UserID']==0||$_SESSION['UserID']==null) {
127 $_SESSION['UserIP']=$_SERVER['REMOTE_ADDR'];
128 $_SESSION['MemberName'] = null;
129 $_SESSION['UserGroup'] = $Settings['GuestGroup'];
130 $gidquery = sql_pre_query("SELECT * FROM \"".$Settings['sqltable']."groups\" WHERE \"Name\"='%s' LIMIT 1", array($Settings['GuestGroup']));
131 $gidresult=sql_query($gidquery,$SQLStat);
132 $_SESSION['UserGroupID']=sql_result($gidresult,0,"id");
133 sql_free_result($gidresult); }
134 if($_SESSION['MemberName']==null) { $_SESSION['UserID'] = "0";
135 $_SESSION['UserIP']=$_SERVER['REMOTE_ADDR'];
136 $_SESSION['UserGroup'] = $Settings['GuestGroup'];
137 $gidquery = sql_pre_query("SELECT * FROM \"".$Settings['sqltable']."groups\" WHERE \"Name\"='%s' LIMIT 1", array($Settings['GuestGroup']));
138 $gidresult=sql_query($gidquery,$SQLStat);
139 $_SESSION['UserGroupID']=sql_result($gidresult,0,"id");
140 sql_free_result($gidresult); }
141 if($_SESSION['UserID']==0||$_SESSION['UserID']==null) {
142 $levnum = 0; }
143 if($_SESSION['UserID']!=0&&$_SESSION['UserID']!=null) {
144 $levquery = sql_pre_query("SELECT * FROM \"".$Settings['sqltable']."levels\" WHERE \"id\"=%i LIMIT 1", array($ChkUsrLevelID));
145 $levresult=sql_query($levquery,$SQLStat);
146 $levnum=sql_num_rows($levresult);
147 if($levnum<=0) { $GruError = true; sql_free_result($levresult);
148 header("Content-Type: text/plain; charset=".$Settings['charset']); $urlstatus = 503;
149 ob_clean(); echo "Sorry could not find level data in database.\nContact the board admin about error.";
150 gzip_page($Settings['use_gzip'],$GZipEncode['Type']); session_write_close(); die(); } }
151 if($levnum>=1) {
152 $LevelInfo['ID']=sql_result($levresult,0,"id");
153 if(!is_numeric($LevelInfo['ID'])) { $GruError = true; }
154 $LevelInfo['Name']=sql_result($levresult,0,"Name");
155 $LevelInfo['PromoteTo']=sql_result($levresult,0,"PromoteTo");
156 $LevelInfo['PromotePosts']=sql_result($levresult,0,"PromotePosts");
157 if(!is_numeric($LevelInfo['PromotePosts'])) {
158 $LevelInfo['PromotePosts'] = 0; $LevelInfo['PromoteTo'] = 0; }
159 $LevelInfo['PromoteKarma']=sql_result($levresult,0,"PromoteKarma");
160 if(!is_numeric($LevelInfo['PromoteKarma'])) {
161 $LevelInfo['PromoteKarma'] = 0; $LevelInfo['PromoteTo'] = 0; } }
162 // Member Group Setup
163 if(!isset($_SESSION['UserGroup'])) { $_SESSION['UserGroup'] = null; }
164 if($_SESSION['UserGroup']==null) {
165 $_SESSION['UserGroup']=$Settings['GuestGroup']; } $GruError = null;
166 $gruquery = sql_pre_query("SELECT * FROM \"".$Settings['sqltable']."groups\" WHERE \"Name\"='%s' LIMIT 1", array($_SESSION['UserGroup']));
167 $gruresult=sql_query($gruquery,$SQLStat);
168 $grunum=sql_num_rows($gruresult);
169 if($grunum<=0) { $GruError = true; sql_free_result($gruresult);
170 header("Content-Type: text/plain; charset=".$Settings['charset']); $urlstatus = 503;
171 ob_clean(); echo "Sorry could not find group data in database.\nContact the board admin about error.";
172 gzip_page($Settings['use_gzip'],$GZipEncode['Type']); session_write_close(); die(); }
173 if($_SESSION['UserID']!=0) {
174 $memprequery = sql_pre_query("SELECT * FROM \"".$Settings['sqltable']."mempermissions\" WHERE \"id\"=%i LIMIT 1", array($_SESSION['UserID'])); }
175 if($_SESSION['UserID']==0) {
176 $memprequery = sql_pre_query("SELECT * FROM \"".$Settings['sqltable']."mempermissions\" WHERE \"id\"=%i LIMIT 1", array(-1)); }
177 $mempreresult=sql_query($memprequery,$SQLStat);
178 $memprenum=sql_num_rows($mempreresult);
179 if($grunum>=1) {
180 $GroupInfo['ID']=sql_result($gruresult,0,"id");
181 if(!is_numeric($GroupInfo['ID'])) { $GruError = true; }
182 $GroupInfo['Name']=sql_result($gruresult,0,"Name");
183 $GroupInfo['PermissionID']=sql_result($mempreresult,0,"PermissionID");
184 if(!is_numeric($GroupInfo['PermissionID'])||$GroupInfo['PermissionID']=="0") {
185 $GroupInfo['PermissionID']=sql_result($gruresult,0,"PermissionID");
186 if(!is_numeric($GroupInfo['PermissionID'])) { $GruError = true; } }
187 $GroupInfo['NamePrefix']=sql_result($gruresult,0,"NamePrefix");
188 $GroupInfo['NameSuffix']=sql_result($gruresult,0,"NameSuffix");
189 $GroupInfo['CanViewBoard']=sql_result($mempreresult,0,"CanViewBoard");
190 if($GroupInfo['CanViewBoard']!="yes"&&$GroupInfo['CanViewBoard']!="no"&&$GroupInfo['CanViewBoard']!="group") {
191 $GruError = true; }
192 if($GroupInfo['CanViewBoard']=="group") {
193 $GroupInfo['CanViewBoard']=sql_result($gruresult,0,"CanViewBoard");
194 if($GroupInfo['CanViewBoard']!="yes"&&$GroupInfo['CanViewBoard']!="no") {
195 $GruError = true; } }
196 $GroupInfo['CanViewOffLine']=sql_result($mempreresult,0,"CanViewOffLine");
197 if($GroupInfo['CanViewOffLine']!="yes"&&$GroupInfo['CanViewOffLine']!="no"&&$GroupInfo['CanViewOffLine']!="group") {
198 $GruError = true; }
199 if($GroupInfo['CanViewOffLine']=="group") {
200 $GroupInfo['CanViewOffLine']=sql_result($gruresult,0,"CanViewOffLine");
201 if($GroupInfo['CanViewOffLine']!="yes"&&$GroupInfo['CanViewOffLine']!="no") {
202 $GruError = true; } }
203 $GroupInfo['FloodControl']=sql_result($mempreresult,0,"FloodControl");
204 if(!is_numeric($GroupInfo['FloodControl'])) { $GroupInfo['FloodControl'] = 30; }
205 if($GroupInfo['FloodControl']==-1) {
206 $GroupInfo['FloodControl']=sql_result($gruresult,0,"FloodControl");
207 if(!is_numeric($GroupInfo['FloodControl'])) { $GroupInfo['FloodControl'] = 30; } }
208 $GroupInfo['SearchFlood']=sql_result($mempreresult,0,"SearchFlood");
209 if(!is_numeric($GroupInfo['SearchFlood'])) { $GroupInfo['SearchFlood'] = 30; }
210 if($GroupInfo['SearchFlood']==-1) {
211 $GroupInfo['SearchFlood']=sql_result($gruresult,0,"SearchFlood");
212 if(!is_numeric($GroupInfo['SearchFlood'])) { $GroupInfo['SearchFlood'] = 30; } }
213 $GroupInfo['CanEditProfile']=sql_result($mempreresult,0,"CanEditProfile");
214 if($GroupInfo['CanEditProfile']!="yes"&&$GroupInfo['CanEditProfile']!="no"&&$GroupInfo['CanEditProfile']!="group") {
215 $GruError = true; }
216 if($GroupInfo['CanEditProfile']=="group") {
217 $GroupInfo['CanEditProfile']=sql_result($gruresult,0,"CanEditProfile");
218 if($GroupInfo['CanEditProfile']!="yes"&&$GroupInfo['CanEditProfile']!="no") {
219 $GruError = true; } }
220 $GroupInfo['CanAddEvents']=sql_result($mempreresult,0,"CanAddEvents");
221 if($GroupInfo['CanAddEvents']!="yes"&&$GroupInfo['CanAddEvents']!="no"&&$GroupInfo['CanAddEvents']!="group") {
222 $GruError = true; }
223 if($GroupInfo['CanAddEvents']=="group") {
224 $GroupInfo['CanAddEvents']=sql_result($gruresult,0,"CanAddEvents");
225 if($GroupInfo['CanAddEvents']!="yes"&&$GroupInfo['CanAddEvents']!="no") {
226 $GruError = true; } }
227 $GroupInfo['CanPM']=sql_result($mempreresult,0,"CanPM");
228 if($GroupInfo['CanPM']!="yes"&&$GroupInfo['CanPM']!="no"&&$GroupInfo['CanPM']!="group") {
229 $GruError = true; }
230 if($GroupInfo['CanPM']=="group") {
231 $GroupInfo['CanPM']=sql_result($gruresult,0,"CanPM");
232 if($GroupInfo['CanPM']!="yes"&&$GroupInfo['CanPM']!="no") {
233 $GruError = true; } }
234 $GroupInfo['CanSearch']=sql_result($mempreresult,0,"CanSearch");
235 if($GroupInfo['CanSearch']!="yes"&&$GroupInfo['CanSearch']!="no"&&$GroupInfo['CanSearch']!="group") {
236 $GruError = true; }
237 if($GroupInfo['CanSearch']=="group") {
238 $GroupInfo['CanSearch']=sql_result($gruresult,0,"CanSearch");
239 if($GroupInfo['CanSearch']!="yes"&&$GroupInfo['CanSearch']!="no") {
240 $GruError = true; } }
241 $GroupInfo['CanExecPHP']=sql_result($mempreresult,0,"CanExecPHP");
242 if($GroupInfo['CanExecPHP']!="yes"&&$GroupInfo['CanExecPHP']!="no"&&$GroupInfo['CanExecPHP']!="group") {
243 $GroupInfo['CanExecPHP'] = "no"; }
244 if($GroupInfo['CanExecPHP']=="group") {
245 $GroupInfo['CanExecPHP']=sql_result($gruresult,0,"CanExecPHP");
246 if($GroupInfo['CanExecPHP']!="yes"&&$GroupInfo['CanExecPHP']!="no") {
247 $GroupInfo['CanExecPHP'] = "no"; } }
248 $GroupInfo['CanDoHTML']=sql_result($mempreresult,0,"CanDoHTML");
249 if($GroupInfo['CanDoHTML']!="yes"&&$GroupInfo['CanDoHTML']!="no"&&$GroupInfo['CanDoHTML']!="group") {
250 $GroupInfo['CanDoHTML'] = "no"; }
251 if($GroupInfo['CanDoHTML']=="group") {
252 $GroupInfo['CanDoHTML']=sql_result($gruresult,0,"CanDoHTML");
253 if($GroupInfo['CanDoHTML']!="yes"&&$GroupInfo['CanDoHTML']!="no") {
254 $GroupInfo['CanDoHTML'] = "no"; } }
255 $GroupInfo['CanUseBBTags']=sql_result($mempreresult,0,"CanUseBBTags");
256 if($GroupInfo['CanUseBBTags']!="yes"&&$GroupInfo['CanUseBBTags']!="no"&&$GroupInfo['CanUseBBTags']!="group") {
257 $GroupInfo['CanUseBBTags'] = "no"; }
258 if($GroupInfo['CanUseBBTags']=="group") {
259 $GroupInfo['CanUseBBTags']=sql_result($gruresult,0,"CanUseBBTags");
260 if($GroupInfo['CanUseBBTags']!="yes"&&$GroupInfo['CanUseBBTags']!="no") {
261 $GroupInfo['CanUseBBTags'] = "no"; } }
262 $GroupInfo['PromoteTo']=sql_result($gruresult,0,"PromoteTo");
263 $GroupInfo['PromotePosts']=sql_result($gruresult,0,"PromotePosts");
264 if(!is_numeric($GroupInfo['PromotePosts'])) {
265 $GroupInfo['PromotePosts'] = 0; $GroupInfo['PromoteTo'] = 0; }
266 $GroupInfo['PromoteKarma']=sql_result($gruresult,0,"PromoteKarma");
267 if(!is_numeric($GroupInfo['PromoteKarma'])) {
268 $GroupInfo['PromoteKarma'] = 0; $GroupInfo['PromoteTo'] = 0; }
269 if(!isset($Settings['KarmaBoostDays'])) {
270 $Settings['KarmaBoostDays'] = null; }
271 $Settings['OldKarmaBoostDays'] = $Settings['KarmaBoostDays'];
272 if(!isset($Settings['KBoostPercent'])) {
273 $Settings['KBoostPercent'] = "6|10"; }
274 //Update karma and group upgrade on post count or karma count.
275 if($_SESSION['UserID']!=0) { $BoostTotal = null;
276 $KarmaExp = explode("&",$Settings['KarmaBoostDays']);
277 $KarmaNow = $usercurtime->format("md");
278 $kupdate = false;
279 if(in_array($KarmaNow,$KarmaExp)) {
280 $KarmaNum = count($KarmaExp);
281 $Karmai = 0;
282 while ($Karmai < $KarmaNum) {
283 if($KarmaExp[$Karmai]==$KarmaNow) {
284 $Settings['KarmaBoostDays'] = $KarmaExp[$Karmai];
285 $kupdate = true; break 1; }
286 ++$Karmai; } }
287 if($kupdate===false) {
288 $Settings['KarmaBoostDays'] = $KarmaExp[0]; }
289 $NewKarmaUpdate = $usercurtime->format("Ymd");
290 $ThisYearUpdate = $usercurtime->format("Y");
291 if($MyKarmaUpdate<$NewKarmaUpdate&&$MyPostCountChk>0) {
292 $KarmaBoostDay = $Settings['KarmaBoostDays'];
293 $KBoostPercent = explode("|",$Settings['KBoostPercent']);
294 if(count($KBoostPercent)<1) {
295 $KBoostPercent[0] = rand(1,4); }
296 if(!is_numeric($KBoostPercent[0])) {
297 $KBoostPercent[0] = 6; }
298 if(count($KBoostPercent)==1) {
299 $KBoostPercent[1] = $KBoostPercent[0] + rand(3,6); }
300 if(!is_numeric($KBoostPercent[1])) {
301 $KBoostPercent[0] = 10; }
302 $KBoostPercent = rand($KBoostPercent[0],$KBoostPercent[1]);
303 if($ThisYearUpdate.$KarmaBoostDay==$NewKarmaUpdate&&
304 is_numeric($KarmaBoostDay)) {
305 $KBoostPercent = $KBoostPercent / 100;
306 $BoostTotal = $MyKarmaCount * $KBoostPercent;
307 $BoostTotal = round($BoostTotal,0); }
308 if($BoostTotal!=null) {
309 $MyKarmaCount = $MyKarmaCount + $BoostTotal; }
310 if($BoostTotal==null) {
311 $MyKarmaCount = $MyKarmaCount + 1; }
312 $querykarmaup = sql_pre_query("UPDATE \"".$Settings['sqltable']."members\" SET \"Karma\"=%i,\"KarmaUpdate\"=%i WHERE \"id\"=%i", array($MyKarmaCount,$NewKarmaUpdate,$_SESSION['UserID']));
313 sql_query($querykarmaup,$SQLStat); }
314 $Settings['KarmaBoostDays'] = $Settings['OldKarmaBoostDays'];
315 if($LevelInfo['PromoteTo']!=0&&$MyPostCountChk>=$LevelInfo['PromotePosts']) {
316 $sql_level_check = sql_query(sql_pre_query("SELECT * FROM \"".$Settings['sqltable']."levels\" WHERE \"id\"=%i LIMIT 1", array($LevelInfo['PromoteTo'])),$SQLStat);
317 $level_check = sql_num_rows($sql_level_check);
318 sql_free_result($sql_level_check);
319 if($level_check > 0) {
320 $queryupgrade = sql_pre_query("UPDATE \"".$Settings['sqltable']."members\" SET \"LevelID\"=%i WHERE \"id\"=%i", array($LevelInfo['PromoteTo'],$_SESSION['UserID']));
321 sql_query($queryupgrade,$SQLStat); } }
322 if($LevelInfo['PromotePosts']==0&&$LevelInfo['PromoteTo']!=0&&$MyKarmaCount>=$LevelInfo['PromoteKarma']) {
323 $sql_level_check = sql_query(sql_pre_query("SELECT * FROM \"".$Settings['sqltable']."levels\" WHERE \"id\"=%i LIMIT 1", array($LevelInfo['PromoteTo'])),$SQLStat);
324 $level_check = sql_num_rows($sql_level_check);
325 sql_free_result($sql_level_check);
326 if($level_check > 0) {
327 $queryupgrade = sql_pre_query("UPDATE \"".$Settings['sqltable']."members\" SET \"LevelID\"=%i WHERE \"id\"=%i", array($LevelInfo['PromoteTo'],$_SESSION['UserID']));
328 sql_query($queryupgrade,$SQLStat); } }
329 if($GroupInfo['PromoteTo']!=0&&$MyPostCountChk>=$GroupInfo['PromotePosts']) {
330 $sql_group_check = sql_query(sql_pre_query("SELECT * FROM \"".$Settings['sqltable']."groups\" WHERE \"id\"=%i LIMIT 1", array($GroupInfo['PromoteTo'])),$SQLStat);
331 $group_check = sql_num_rows($sql_group_check);
332 sql_free_result($sql_group_check);
333 if($group_check > 0) {
334 $queryupgrade = sql_pre_query("UPDATE \"".$Settings['sqltable']."members\" SET \"GroupID\"=%i WHERE \"id\"=%i", array($GroupInfo['PromoteTo'],$_SESSION['UserID']));
335 sql_query($queryupgrade,$SQLStat); } }
336 if($GroupInfo['PromotePosts']==0&&$GroupInfo['PromoteTo']!=0&&$MyKarmaCount>=$GroupInfo['PromoteKarma']) {
337 $sql_group_check = sql_query(sql_pre_query("SELECT * FROM \"".$Settings['sqltable']."groups\" WHERE \"id\"=%i LIMIT 1", array($GroupInfo['PromoteTo'])),$SQLStat);
338 $group_check = sql_num_rows($sql_group_check);
339 sql_free_result($sql_group_check);
340 if($group_check > 0) {
341 $queryupgrade = sql_pre_query("UPDATE \"".$Settings['sqltable']."members\" SET \"GroupID\"=%i WHERE \"id\"=%i", array($GroupInfo['PromoteTo'],$_SESSION['UserID']));
342 sql_query($queryupgrade,$SQLStat); } } }
343 $GroupInfo['HasModCP']=sql_result($mempreresult,0,"HasModCP");
344 if($GroupInfo['HasModCP']!="yes"&&$GroupInfo['HasModCP']!="no"&&$GroupInfo['HasModCP']!="group") {
345 $GroupInfo['HasModCP'] = "no"; }
346 if($GroupInfo['HasModCP']=="group") {
347 $GroupInfo['HasModCP']=sql_result($gruresult,0,"HasModCP");
348 if($GroupInfo['HasModCP']!="yes"&&$GroupInfo['HasModCP']!="no") {
349 $GroupInfo['HasModCP'] = "no"; } }
350 $GroupInfo['HasAdminCP']=sql_result($mempreresult,0,"HasAdminCP");
351 if($GroupInfo['HasAdminCP']!="yes"&&$GroupInfo['HasAdminCP']!="no"&&$GroupInfo['HasAdminCP']!="group") {
352 $GroupInfo['HasAdminCP'] = "no"; }
353 if($GroupInfo['HasAdminCP']=="group") {
354 $GroupInfo['HasAdminCP']=sql_result($gruresult,0,"HasAdminCP");
355 if($GroupInfo['HasAdminCP']!="yes"&&$GroupInfo['HasAdminCP']!="no") {
356 $GroupInfo['HasAdminCP'] = "no"; } }
357 $GroupInfo['CanViewIPAddress']=sql_result($mempreresult,0,"CanViewIPAddress");
358 if($GroupInfo['CanViewIPAddress']!="yes"&&$GroupInfo['CanViewIPAddress']!="no"&&$GroupInfo['CanViewIPAddress']!="group") {
359 $GroupInfo['CanViewIPAddress'] = "no"; }
360 if($GroupInfo['CanViewIPAddress']=="group") {
361 $GroupInfo['CanViewIPAddress']=sql_result($gruresult,0,"CanViewIPAddress");
362 if($GroupInfo['CanViewIPAddress']!="yes"&&$GroupInfo['CanViewIPAddress']!="no") {
363 $GroupInfo['CanViewIPAddress'] = "no"; } }
364 $GroupInfo['CanViewUserAgent']=sql_result($mempreresult,0,"CanViewUserAgent");
365 if($GroupInfo['CanViewUserAgent']!="yes"&&$GroupInfo['CanViewUserAgent']!="no"&&$GroupInfo['CanViewUserAgent']!="group") {
366 $GroupInfo['CanViewUserAgent'] = "no"; }
367 if($GroupInfo['CanViewUserAgent']=="group") {
368 $GroupInfo['CanViewUserAgent']=sql_result($gruresult,0,"CanViewUserAgent");
369 if($GroupInfo['CanViewUserAgent']!="yes"&&$GroupInfo['CanViewUserAgent']!="no") {
370 $GroupInfo['CanViewUserAgent'] = "no"; } }
371 $GroupInfo['ViewDBInfo']=sql_result($mempreresult,0,"ViewDBInfo");
372 if($GroupInfo['ViewDBInfo']!="yes"&&$GroupInfo['ViewDBInfo']!="no"&&$GroupInfo['ViewDBInfo']!="group") {
373 $GroupInfo['ViewDBInfo'] = "no"; }
374 if($GroupInfo['ViewDBInfo']=="group") {
375 $GroupInfo['ViewDBInfo']=sql_result($gruresult,0,"ViewDBInfo");
376 if($GroupInfo['ViewDBInfo']!="yes"&&$GroupInfo['ViewDBInfo']!="no") {
377 $GroupInfo['ViewDBInfo'] = "no"; } }
378 if($GruError==true) {
379 header("Content-Type: text/plain; charset=".$Settings['charset']);
380 sql_free_result($gruresult); sql_free_result($levresult); sql_free_result($mempreresult); $urlstatus = 503;
381 ob_clean(); echo "Sorry could not load all group data in database.\nContact the board admin about error.";
382 gzip_page($Settings['use_gzip'],$GZipEncode['Type']); session_write_close(); die(); } }
383 sql_free_result($gruresult);
384 if($_SESSION['UserID']!=0&&$_SESSION['UserID']!=null) {
385 sql_free_result($levresult); }
386 if($GroupInfo['CanViewBoard']=="no") {
387 header("Content-Type: text/plain; charset=".$Settings['charset']);
388 ob_clean(); echo "Sorry you can not view the board."; $urlstatus = 503;
389 gzip_page($Settings['use_gzip'],$GZipEncode['Type']); session_write_close(); die(); }
390 // Member Group Permissions Setup
391 $perquery = sql_pre_query("SELECT * FROM \"".$Settings['sqltable']."permissions\" WHERE \"PermissionID\"=%i ORDER BY \"ForumID\" ASC", array($GroupInfo['PermissionID']));
392 $peresult=sql_query($perquery,$SQLStat);
393 $pernum=sql_num_rows($peresult);
394 $peri=0; $PerError = null;
395 if($pernum<0) { $PerError = true; sql_free_result($peresult);
396 header("Content-Type: text/plain; charset=".$Settings['charset']); $urlstatus = 503;
397 ob_clean(); echo "Sorry could not find permission data in database.\nContact the board admin about error.";
398 gzip_page($Settings['use_gzip'],$GZipEncode['Type']); session_write_close(); die(); }
399 $ForumIgnoreList1 = null; $ForumIgnoreList2 = null;
400 $ForumIgnoreList3 = null; $ForumIgnoreList4 = null;
401 $ForumIgnoreList5 = null; $ForumIgnoreList6 = null;
402 $ModForumIgnoreList1 = null; $ModForumIgnoreList2 = null;
403 $ModForumIgnoreList3 = null; $ModForumIgnoreList4 = null;
404 if($pernum>=1) { while ($peri < $pernum) {
405 $PerForumID=sql_result($peresult,$peri,"ForumID");
406 if(!is_numeric($PerForumID)) { $PerError = true; }
407 $PermissionInfo['ID'][$PerForumID]=sql_result($peresult,$peri,"id");
408 if(!is_numeric($PermissionInfo['ID'][$PerForumID])) { $PerError = true; }
409 $PermissionInfo['PermissionID'][$PerForumID]=sql_result($peresult,$peri,"PermissionID");
410 if(!is_numeric($PermissionInfo['PermissionID'][$PerForumID])) { $PerError = true; }
411 $PermissionInfo['Name'][$PerForumID]=sql_result($peresult,$peri,"Name");
412 $PermissionInfo['ForumID'][$PerForumID]=sql_result($peresult,$peri,"ForumID");
413 if(!is_numeric($PermissionInfo['ForumID'][$PerForumID])) { $PerError = true; }
414 $PermissionInfo['CanViewForum'][$PerForumID]=sql_result($peresult,$peri,"CanViewForum");
415 if($PermissionInfo['CanViewForum'][$PerForumID]!="yes"&&$PermissionInfo['CanViewForum'][$PerForumID]!="no") {
416 $PerError = true; }
417 if($PermissionInfo['CanViewForum'][$PerForumID]=="no") {
418 if(strlen($ForumIgnoreList1)>1) { $ForumIgnoreList1 .= " AND \"id\"<>".$PerForumID; }
419 if(strlen($ForumIgnoreList1)<1) { $ForumIgnoreList1 = " \"id\"<>".$PerForumID; }
420 if(strlen($ForumIgnoreList2)>1) { $ForumIgnoreList2 .= " AND \"id\"<>".$PerForumID; }
421 if(strlen($ForumIgnoreList2)<1) { $ForumIgnoreList2 = " AND \"id\"<>".$PerForumID; }
422 if(strlen($ForumIgnoreList3)>1) { $ForumIgnoreList3 .= " AND \"ForumID\"<>".$PerForumID; }
423 if(strlen($ForumIgnoreList3)<1) { $ForumIgnoreList3 = " WHERE \"ForumID\"<>".$PerForumID; }
424 if(strlen($ForumIgnoreList4)>1) { $ForumIgnoreList4 .= " AND \"ForumID\"<>".$PerForumID; }
425 if(strlen($ForumIgnoreList4)<1) { $ForumIgnoreList4 = " AND \"ForumID\"<>".$PerForumID; }
426 if(strlen($ForumIgnoreList5)>1) { $ForumIgnoreList5 .= " AND \"OldForumID\"<>".$PerForumID; }
427 if(strlen($ForumIgnoreList5)<1) { $ForumIgnoreList5 = " WHERE \"OldForumID\"<>".$PerForumID; }
428 if(strlen($ForumIgnoreList6)>1) { $ForumIgnoreList6 .= " AND \"OldForumID\"<>".$PerForumID; }
429 if(strlen($ForumIgnoreList6)<1) { $ForumIgnoreList6 = " AND \"OldForumID\"<>".$PerForumID; } }
430 $PermissionInfo['CanMakePolls'][$PerForumID]=sql_result($peresult,$peri,"CanMakePolls");
431 if($PermissionInfo['CanMakePolls'][$PerForumID]!="yes"&&$PermissionInfo['CanMakePolls'][$PerForumID]!="no") {
432 $PerError = true; }
433 $PermissionInfo['CanMakeTopics'][$PerForumID]=sql_result($peresult,$peri,"CanMakeTopics");
434 if($PermissionInfo['CanMakeTopics'][$PerForumID]!="yes"&&$PermissionInfo['CanMakeTopics'][$PerForumID]!="no") {
435 $PerError = true; }
436 $PermissionInfo['CanMakeReplys'][$PerForumID]=sql_result($peresult,$peri,"CanMakeReplys");
437 if($PermissionInfo['CanMakeReplys'][$PerForumID]!="yes"&&$PermissionInfo['CanMakeReplys'][$PerForumID]!="no") {
438 $PerError = true; }
439 $PermissionInfo['CanMakeReplysClose'][$PerForumID]=sql_result($peresult,$peri,"CanMakeReplysCT");
440 if($PermissionInfo['CanMakeReplysClose'][$PerForumID]!="yes"&&$PermissionInfo['CanMakeReplysClose'][$PerForumID]!="no") {
441 $PerError = true; }
442 $PermissionInfo['CanEditTopics'][$PerForumID]=sql_result($peresult,$peri,"CanEditTopics");
443 if($PermissionInfo['CanEditTopics'][$PerForumID]!="yes"&&$PermissionInfo['CanEditTopics'][$PerForumID]!="no") {
444 $PermissionInfo['CanEditTopics'][$PerForumID] = "no"; }
445 $PermissionInfo['CanEditTopicsClose'][$PerForumID]=sql_result($peresult,$peri,"CanEditTopicsCT");
446 if($PermissionInfo['CanEditTopicsClose'][$PerForumID]!="yes"&&$PermissionInfo['CanEditTopicsClose'][$PerForumID]!="no") {
447 $PermissionInfo['CanEditTopicsClose'][$PerForumID] = "no"; }
448 $PermissionInfo['CanEditReplys'][$PerForumID]=sql_result($peresult,$peri,"CanEditReplys");
449 if($PermissionInfo['CanEditReplys'][$PerForumID]!="yes"&&$PermissionInfo['CanEditReplys'][$PerForumID]!="no") {
450 $PermissionInfo['CanEditReplys'][$PerForumID] = "no"; }
451 $PermissionInfo['CanEditReplysClose'][$PerForumID]=sql_result($peresult,$peri,"CanEditReplysCT");
452 if($PermissionInfo['CanEditReplysClose'][$PerForumID]!="yes"&&$PermissionInfo['CanEditReplysClose'][$PerForumID]!="no") {
453 $PermissionInfo['CanEditReplysClose'][$PerForumID] = "no"; }
454 $PermissionInfo['CanDeleteTopics'][$PerForumID]=sql_result($peresult,$peri,"CanDeleteTopics");
455 if($PermissionInfo['CanDeleteTopics'][$PerForumID]!="yes"&&$PermissionInfo['CanDeleteTopics'][$PerForumID]!="no") {
456 $PermissionInfo['CanDeleteTopics'][$PerForumID] = "no"; }
457 $PermissionInfo['CanDeleteTopicsClose'][$PerForumID]=sql_result($peresult,$peri,"CanDeleteTopicsCT");
458 if($PermissionInfo['CanDeleteTopicsClose'][$PerForumID]!="yes"&&$PermissionInfo['CanDeleteTopicsClose'][$PerForumID]!="no") {
459 $PermissionInfo['CanDeleteTopicsClose'][$PerForumID] = "no"; }
460 $PermissionInfo['CanDeleteReplys'][$PerForumID]=sql_result($peresult,$peri,"CanDeleteReplys");
461 if($PermissionInfo['CanDeleteReplys'][$PerForumID]!="yes"&&$PermissionInfo['CanDeleteReplys'][$PerForumID]!="no") {
462 $PermissionInfo['CanDeleteReplys'][$PerForumID] = "no"; }
463 $PermissionInfo['CanDeleteReplysClose'][$PerForumID]=sql_result($peresult,$peri,"CanDeleteReplysCT");
464 if($PermissionInfo['CanDeleteReplysClose'][$PerForumID]!="yes"&&$PermissionInfo['CanDeleteReplysClose'][$PerForumID]!="no") {
465 $PermissionInfo['CanDeleteReplysClose'][$PerForumID] = "no"; }
466 $PermissionInfo['CanCloseTopics'][$PerForumID]=sql_result($peresult,$peri,"CanCloseTopics");
467 if($PermissionInfo['CanCloseTopics'][$PerForumID]!="yes"&&$PermissionInfo['CanCloseTopics'][$PerForumID]!="no") {
468 $PermissionInfo['CanCloseTopics'][$PerForumID] = "no"; }
469 $PermissionInfo['CanPinTopics'][$PerForumID]=sql_result($peresult,$peri,"CanPinTopics");
470 if($PermissionInfo['CanPinTopics'][$PerForumID]!="yes"&&$PermissionInfo['CanPinTopics'][$PerForumID]!="no") {
471 $PermissionInfo['CanPinTopics'][$PerForumID] = "no"; }
472 $PermissionInfo['CanDoHTML'][$PerForumID]=sql_result($peresult,$peri,"CanDoHTML");
473 if($PermissionInfo['CanDoHTML'][$PerForumID]!="yes"&&$PermissionInfo['CanDoHTML'][$PerForumID]!="no") {
474 $PermissionInfo['CanDoHTML'][$PerForumID] = "no"; }
475 $PermissionInfo['CanUseBBTags'][$PerForumID]=sql_result($peresult,$peri,"CanUseBBTags");
476 if($PermissionInfo['CanUseBBTags'][$PerForumID]!="yes"&&$PermissionInfo['CanUseBBTags'][$PerForumID]!="no") {
477 $PermissionInfo['CanUseBBTags'][$PerForumID] = "no"; }
478 $PermissionInfo['CanModForum'][$PerForumID]=sql_result($peresult,$peri,"CanModForum");
479 if($PermissionInfo['CanModForum'][$PerForumID]!="yes"&&$PermissionInfo['CanModForum'][$PerForumID]!="no") {
480 $PermissionInfo['CanModForum'][$PerForumID] = "no"; }
481 if($PermissionInfo['CanModForum'][$PerForumID]=="no") {
482 if(strlen($ModForumIgnoreList1)>1) { $ModForumIgnoreList1 .= " AND \"id\"<>".$PerForumID; }
483 if(strlen($ModForumIgnoreList1)<1) { $ModForumIgnoreList1 = " \"id\"<>".$PerForumID; }
484 if(strlen($ModForumIgnoreList2)>1) { $ModForumIgnoreList2 .= " AND \"id\"<>".$PerForumID; }
485 if(strlen($ModForumIgnoreList2)<1) { $ModForumIgnoreList2 = " AND \"id\"<>".$PerForumID; }
486 if(strlen($ModForumIgnoreList3)>1) { $ModForumIgnoreList3 .= " AND \"ForumID\"<>".$PerForumID; }
487 if(strlen($ModForumIgnoreList3)<1) { $ModForumIgnoreList3 = " WHERE \"ForumID\"<>".$PerForumID; }
488 if(strlen($ModForumIgnoreList4)>1) { $ModForumIgnoreList4 .= " AND \"ForumID\"<>".$PerForumID; }
489 if(strlen($ModForumIgnoreList4)<1) { $ModForumIgnoreList4 = " AND \"ForumID\"<>".$PerForumID; } }
490 if($PerError===true) { $peri = $pernum; }
491 ++$peri; } if($PerError===true) {
492 header("Content-Type: text/plain; charset=".$Settings['charset']); sql_free_result($peresult); $urlstatus = 503;
493 ob_clean(); echo "Sorry could not load all permission data in database.\nContact the board admin about error.";
494 gzip_page($Settings['use_gzip'],$GZipEncode['Type']); session_write_close(); die(); } }
495 sql_free_result($peresult);
496 $per2query = sql_pre_query("SELECT * FROM \"".$Settings['sqltable']."catpermissions\" WHERE \"PermissionID\"=%i ORDER BY \"CategoryID\" ASC", array($GroupInfo['PermissionID']));
497 $per2esult=sql_query($per2query,$SQLStat);
498 $per2num=sql_num_rows($per2esult);
499 $per2i=0; $Per2Error = null;
500 if($per2num<=0) { $Per2Error = true; sql_free_result($per2esult);
501 header("Content-Type: text/plain; charset=".$Settings['charset']); $urlstatus = 503;
502 ob_clean(); echo "Sorry could not find permission data in database.\nContact the board admin about error.";
503 gzip_page($Settings['use_gzip'],$GZipEncode['Type']); session_write_close(); die(); }
504 $CatIgnoreList1 = null; $CatIgnoreList2 = null;
505 $CatIgnoreList3 = null; $CatIgnoreList4 = null;
506 $CatIgnoreList5 = null; $CatIgnoreList6 = null;
507 if($per2num>=1) { while ($per2i < $per2num) {
508 $PerCatID=sql_result($per2esult,$per2i,"CategoryID");
509 if(!is_numeric($PerCatID)) { $Per2Error = true; }
510 $CatPermissionInfo['ID'][$PerCatID]=sql_result($per2esult,$per2i,"id");
511 if(!is_numeric($CatPermissionInfo['ID'][$PerCatID])) { $Per2Error = true; }
512 $CatPermissionInfo['PermissionID'][$PerCatID]=sql_result($per2esult,$per2i,"PermissionID");
513 if(!is_numeric($CatPermissionInfo['PermissionID'][$PerCatID])) { $Per2Error = true; }
514 $CatPermissionInfo['Name'][$PerCatID]=sql_result($per2esult,$per2i,"Name");
515 $CatPermissionInfo['CategoryID'][$PerCatID]=sql_result($per2esult,$per2i,"CategoryID");
516 if(!is_numeric($CatPermissionInfo['CategoryID'][$PerCatID])) { $Per2Error = true; }
517 $CatPermissionInfo['CanViewCategory'][$PerCatID]=sql_result($per2esult,$per2i,"CanViewCategory");
518 if($CatPermissionInfo['CanViewCategory'][$PerCatID]!="yes"&&$CatPermissionInfo['CanViewCategory'][$PerCatID]!="no") { $Per2Error = true; }
519 if($CatPermissionInfo['CanViewCategory'][$PerCatID]=="no") {
520 if(strlen($CatIgnoreList1)>1) { $CatIgnoreList1 .= " AND \"id\"<>".$PerCatID; }
521 if(strlen($CatIgnoreList1)<1) { $CatIgnoreList1 = " \"id\"<>".$PerCatID; }
522 if(strlen($CatIgnoreList2)>1) { $CatIgnoreList2 .= " AND \"id\"<>".$PerCatID; }
523 if(strlen($CatIgnoreList2)<1) { $CatIgnoreList2 = " AND \"id\"<>".$PerCatID; }
524 if(strlen($CatIgnoreList3)>1) { $CatIgnoreList3 .= " AND \"CategoryID\"<>".$PerCatID; }
525 if(strlen($CatIgnoreList3)<1) { $CatIgnoreList3 = " WHERE \"CategoryID\"<>".$PerCatID; }
526 if(strlen($CatIgnoreList4)>1) { $CatIgnoreList4 .= " AND \"CategoryID\"<>".$PerCatID; }
527 if(strlen($CatIgnoreList4)<1) { $CatIgnoreList4 = " AND \"CategoryID\"<>".$PerCatID; }
528 if(strlen($CatIgnoreList5)>1) { $CatIgnoreList5 .= " AND \"OldCategoryID\"<>".$PerCatID; }
529 if(strlen($CatIgnoreList5)<1) { $CatIgnoreList5 = " WHERE \"OldCategoryID\"<>".$PerCatID; }
530 if(strlen($CatIgnoreList6)>1) { $CatIgnoreList6 .= " AND \"OldCategoryID\"<>".$PerCatID; }
531 if(strlen($CatIgnoreList6)<1) { $CatIgnoreList6 = " AND \"OldCategoryID\"<>".$PerCatID; } }
532 if($Per2Error===true) { $per2i = $per2num; }
533 ++$per2i; } if($Per2Error===true) {
534 header("Content-Type: text/plain; charset=".$Settings['charset']); sql_free_result($per2esult); $urlstatus = 503;
535 ob_clean(); echo "Sorry could not load all permission data in database.\nContact the board admin about error.";
536 gzip_page($Settings['use_gzip'],$GZipEncode['Type']); session_write_close(); die(); } }
537 sql_free_result($per2esult);