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: events.php - Last Update: 08/02/2019 SVN 905 - Author: cooldude2k $
16 $File3Name = basename($_SERVER['SCRIPT_NAME']);
17 if ($File3Name=="events.php"||
$File3Name=="/events.php") {
20 if(!is_numeric($_GET['id'])) { $_GET['id'] = null; }
21 if($_GET['act']=="view"||
$_GET['act']==null) {
22 $query = sql_pre_query("SELECT * FROM \"".$Settings['sqltable']."events\" WHERE \"id\"=%i LIMIT 1", array($_GET['id']));
23 $result=sql_query($query,$SQLStat);
24 $num=sql_num_rows($result);
26 if($num==0) { redirect("location",$rbasedir.url_maker($exfile['index'],$Settings['file_ext'],"act=view",$Settings['qstr'],$Settings['qsep'],$prexqstr['index'],$exqstr['index'],false)); sql_free_result($result);
27 ob_clean(); header("Content-Type: text/plain; charset=".$Settings['charset']); $urlstatus = 302;
28 gzip_page($Settings['use_gzip'],$GZipEncode['Type']); session_write_close(); die(); }
30 <div
class="NavLinks"><?php
echo $ThemeSet['NavLinkIcon']; ?
><a href
="<?php echo url_maker($exfile['index'],$Settings['file_ext'],"act
=view
",$Settings['qstr'],$Settings['qsep'],$prexqstr['index'],$exqstr['index']); ?>"><?php
echo $Settings['board_name']; ?
></a
><?php
echo $ThemeSet['NavLinkDivider']; ?
><a href
="<?php echo url_maker($exfile['event'],$Settings['file_ext'],"act
=view
&id
=".$_GET['id'],$Settings['qstr'],$Settings['qsep'],$prexqstr['event'],$exqstr['event']); ?>">Viewing Event
</a
></div
>
31 <div
class="DivNavLinks"> 
;</div
>
34 $EventID=sql_result($result,$is,"id");
35 $EventIP=sql_result($result,$is,"IP");
36 $EventUser=sql_result($result,$is,"UserID");
37 $EventGuest=sql_result($result,$is,"GuestName");
38 $EventName=sql_result($result,$is,"EventName");
39 $EventText=sql_result($result,$is,"EventText");
40 $EventStart=sql_result($result,$is,"TimeStamp");
41 $EventEnd=sql_result($result,$is,"TimeStampEnd");
42 $eventstartcurtime = new DateTime();
43 $eventstartcurtime->setTimestamp($EventStart);
44 $eventstartcurtime->setTimezone($usertz);
45 $EventStart = $eventstartcurtime->format($_SESSION['iDBDateFormat']);
46 $eventendcurtime = new DateTime();
47 $eventendcurtime->setTimestamp($EventEnd);
48 $eventendcurtime->setTimezone($usertz);
49 $EventEnd = $eventendcurtime->format($_SESSION['iDBDateFormat']);
51 if(isset($_SESSION['OldViewingPage'])) { $_SESSION['AncientViewingPage'] = $_SESSION['OldViewingPage']; } else { $_SESSION['AncientViewingPage'] = url_maker(null,"no+ext","act=view","&","=",$prexqstr['index'],$exqstr['index']); }
52 if(isset($_SESSION['OldViewingFile'])) { $_SESSION['AncientViewingFile'] = $_SESSION['OldViewingFile']; } else {
53 if($Settings['file_ext']!="no+ext"&&$Settings['file_ext']!="no ext") {
54 $_SESSION['AncientViewingFile'] = $exfile['index'].$Settings['file_ext']; }
55 if($Settings['file_ext']=="no+ext"||
$Settings['file_ext']=="no ext") {
56 $_SESSION['AncientViewingFile'] = $exfile['index']; } }
57 if(isset($_SESSION['OldPreViewingTitle'])) { $_SESSION['AncientPreViewingTitle'] = $_SESSION['OldPreViewingTitle']; } else { $_SESSION['AncientPreViewingTitle'] = "Viewing"; }
58 if(isset($_SESSION['OldViewingTitle'])) { $_SESSION['AncientViewingTitle'] = $_SESSION['OldViewingTitle']; } else { $_SESSION['AncientViewingTitle'] = "Board index"; }
59 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;"; }
60 if(isset($_SESSION['ViewingPage'])) { $_SESSION['OldViewingPage'] = $_SESSION['ViewingPage']; } else { $_SESSION['OldViewingPage'] = url_maker(null,"no+ext","act=view","&","=",$prexqstr['index'],$exqstr['index']); }
61 if(isset($_SESSION['ViewingFile'])) { $_SESSION['OldViewingFile'] = $_SESSION['ViewingFile']; } else {
62 if($Settings['file_ext']!="no+ext"&&$Settings['file_ext']!="no ext") {
63 $_SESSION['OldViewingFile'] = $exfile['index'].$Settings['file_ext']; }
64 if($Settings['file_ext']=="no+ext"||
$Settings['file_ext']=="no ext") {
65 $_SESSION['OldViewingFile'] = $exfile['index']; } }
66 if(isset($_SESSION['PreViewingTitle'])) { $_SESSION['OldPreViewingTitle'] = $_SESSION['PreViewingTitle']; } else { $_SESSION['OldPreViewingTitle'] = "Viewing"; }
67 if(isset($_SESSION['ViewingTitle'])) { $_SESSION['OldViewingTitle'] = $_SESSION['ViewingTitle']; } else { $_SESSION['OldViewingTitle'] = "Board index"; }
68 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;"; }
69 $_SESSION['ViewingPage'] = url_maker(null,"no+ext","act=view&id=".$_GET['id'],"&","=",$prexqstr['event'],$exqstr['event']);
70 if($Settings['file_ext']!="no+ext"&&$Settings['file_ext']!="no ext") {
71 $_SESSION['ViewingFile'] = $exfile['event'].$Settings['file_ext']; }
72 if($Settings['file_ext']=="no+ext"||
$Settings['file_ext']=="no ext") {
73 $_SESSION['ViewingFile'] = $exfile['event']; }
74 $_SESSION['PreViewingTitle'] = "Viewing Event:";
75 $_SESSION['ViewingTitle'] = $EventName;
76 $_SESSION['ExtraData'] = "currentact:".$_GET['act']."; currentcategoryid:0; currentforumid:0; currenttopicid:0; currentmessageid:0; currenteventid:".$EventID.";";
77 $requery = sql_pre_query("SELECT * FROM \"".$Settings['sqltable']."members\" WHERE \"id\"=%i LIMIT 1", array($EventUser));
78 $reresult=sql_query($requery,$SQLStat);
79 $renum=sql_num_rows($reresult);
80 if($renum<1) { $EventUser = -1;
81 $requery = sql_pre_query("SELECT * FROM \"".$Settings['sqltable']."members\" WHERE \"id\"=%i LIMIT 1", array($EventUser));
82 $reresult=sql_query($requery,$SQLStat);
83 $renum=sql_num_rows($reresult); }
84 $memrequery = sql_pre_query("SELECT * FROM \"".$Settings['sqltable']."mempermissions\" WHERE \"id\"=%i LIMIT 1", array($EventUser));
85 $memreresult=sql_query($memrequery,$SQLStat);
86 $memrenum=sql_num_rows($memreresult);
89 $User1Name=sql_result($reresult,$rei,"Name");
90 $User1IP=sql_result($reresult,$rei,"IP");
91 if($User1IP==$EventIP) { $ipshow = "one"; }
92 $User1Email=sql_result($reresult,$rei,"Email");
93 $User1Title=sql_result($reresult,$rei,"Title");
94 $PreUserCanExecPHP=sql_result($memreresult,$rei,"CanExecPHP");
95 if($PreUserCanExecPHP!="yes"&&$PreUserCanExecPHP!="no"&&$PreUserCanExecPHP!="group") {
96 $PreUserCanExecPHP = "no"; }
97 $PreUserCanDoHTML=sql_result($memreresult,$rei,"CanDoHTML");
98 if($PreUserCanDoHTML!="yes"&&$PreUserCanDoHTML!="no"&&$PreUserCanDoHTML!="group") {
99 $PreUserCanDoHTML = "no"; }
100 $PreUserCanUseBBTags=sql_result($memreresult,$rei,"CanUseBBTags");
101 if($PreUserCanUseBBTags!="yes"&&$PreUserCanUseBBTags!="no"&&$PreUserCanUseBBTags!="group") {
102 $PreUserCanUseBBTags = "no"; }
103 sql_free_result($memreresult);
104 $User1Joined=sql_result($reresult,$rei,"Joined");
105 $tmpusrcurtime = new DateTime();
106 $tmpusrcurtime->setTimestamp($User1Joined);
107 $tmpusrcurtime->setTimezone($usertz);
108 $User1Joined=$tmpusrcurtime->format($_SESSION['iDBDateFormat']);
109 $User1GroupID=sql_result($reresult,$rei,"GroupID");
110 $gquery = sql_pre_query("SELECT * FROM \"".$Settings['sqltable']."groups\" WHERE \"id\"=%i LIMIT 1", array($User1GroupID));
111 $gresult=sql_query($gquery,$SQLStat);
112 $User1Hidden=sql_result($reresult,$rei,"HiddenMember");
113 $User1Group=sql_result($gresult,0,"Name");
114 $User1CanExecPHP = $PreUserCanExecPHP;
115 if($PreUserCanExecPHP=="group") {
116 $User1CanExecPHP=sql_result($gresult,0,"CanExecPHP"); }
117 if($User1CanExecPHP!="yes"&&$User1CanExecPHP!="no") {
118 $User1CanExecPHP = "no"; }
119 $User1CanDoHTML = $PreUserCanDoHTML;
120 if($PreUserCanDoHTML=="group") {
121 $User1CanDoHTML=sql_result($gresult,0,"CanDoHTML"); }
122 if($User1CanDoHTML!="yes"&&$User1CanDoHTML!="no") {
123 $User1CanDoHTML = "no"; }
124 $User1CanUseBBTags = $PreUserCanUseBBTags;
125 if($User1CanUseBBTags=="group") {
126 $User1CanUseBBTags=sql_result($gresult,0,"CanUseBBTags"); }
127 if($User1CanUseBBTags!="yes"&&$User1CanUseBBTags!="no") {
128 $User1CanUseBBTags = "no"; }
129 $GroupNamePrefix=sql_result($gresult,0,"NamePrefix");
130 $GroupNameSuffix=sql_result($gresult,0,"NameSuffix");
131 sql_free_result($gresult);
132 if($User1Title=="") { $User1Title = $User1Group; }
133 $User1Signature=sql_result($reresult,$rei,"Signature");
134 $User1Signature = preg_replace("/\<br\>/", "<br />", nl2br($User1Signature));
135 $User1Avatar=sql_result($reresult,$rei,"Avatar");
136 $User1AvatarSize=sql_result($reresult,$rei,"AvatarSize");
137 if ($User1Avatar=="http://"||
$User1Avatar==null||
138 strtolower($User1Avatar)=="noavatar") {
139 $User1Avatar=$ThemeSet['NoAvatar'];
140 $User1AvatarSize=$ThemeSet['NoAvatarSize']; }
141 $AvatarSize1=explode("x", $User1AvatarSize);
142 $AvatarSize1W=$AvatarSize1[0]; $AvatarSize1H=$AvatarSize1[1];
143 $User1Website=sql_result($reresult,$rei,"Website");
144 if($User1Website=="http://") {
145 $User1Website = $Settings['idburl']; }
146 $User1Website = urlcheck($User1Website);
147 $BoardWWWChCk = parse_url($Settings['idburl']);
148 $User1WWWChCk = parse_url($User1Website);
149 $opennew = " onclick=\"window.open(this.href);return false;\"";
150 if($BoardWWWChCk['host']==$User1WWWChCk['host']) {
152 $User1PostCount=sql_result($reresult,$rei,"PostCount");
153 $User1IP=sql_result($reresult,$rei,"IP");
154 sql_free_result($reresult);
155 ++
$is; } sql_free_result($result);
156 if($User1Name=="Guest") { $User1Name=$EventGuest;
157 if($User1Name==null) { $User1Name="Guest"; } }
158 if(isset($GroupNamePrefix)&&$GroupNamePrefix!=null) {
159 $User1Name = $GroupNamePrefix.$User1Name; }
160 if(isset($GroupNameSuffix)&&$GroupNameSuffix!=null) {
161 $User1Name = $User1Name.$GroupNameSuffix; }
162 if($User1CanUseBBTags=="yes") { $EventText = bbcode_parser($EventText); }
163 if($User1CanExecPHP=="no") {
164 $EventText = preg_replace("/\[ExecPHP\](.*?)\[\/ExecPHP\]/is","<span style=\"color: red; font-weight: bold;\">ERROR:</span> cannot execute php code.",$EventText); }
165 if($User1CanExecPHP=="yes") { $EventText = php_execute($EventText); }
166 if($User1CanDoHTML=="no") {
167 $EventText = preg_replace("/\[DoHTML\](.*?)\[\/DoHTML\]/is","<span style=\"color: red; font-weight: bold;\">ERROR:</span> cannot execute html.",$EventText); }
168 if($User1CanDoHTML=="yes") { $EventText = do_html_bbcode($EventText); }
169 $EventText = text2icons($EventText,$Settings['sqltable'],$SQLStat);
170 $EventText = preg_replace("/\<br\>/", "<br />", nl2br($EventText));
171 $EventText = url2link($EventText);
172 if($User1CanUseBBTags=="yes") { $User1Signature = bbcode_parser($User1Signature); }
173 if($User1CanExecPHP=="no") {
174 $User1Signature = preg_replace("/\[ExecPHP\](.*?)\[\/ExecPHP\]/is","<span style=\"color: red; font-weight: bold;\">ERROR:</span> cannot execute php code.",$User1Signature); }
175 if($User1CanExecPHP=="yes") { $User1Signature = php_execute($User1Signature); }
176 if($User1CanDoHTML=="no") {
177 $User1Signature = preg_replace("/\[DoHTML\](.*?)\[\/DoHTML\]/is","<span style=\"color: red; font-weight: bold;\">ERROR:</span> cannot execute html.",$User1Signature); }
178 if($User1CanDoHTML=="yes") { $User1Signature = do_html_bbcode($User1Signature); }
179 $User1Signature = text2icons($User1Signature,$Settings['sqltable'],$SQLStat);
180 $User1Signature = preg_replace("/\<br\>/", "<br />", nl2br($User1Signature));
181 $User1Signature = url2link($User1Signature);
183 <div
class="TableInfo1Border">
184 <?php
if($ThemeSet['TableStyle']=="div") { ?
>
185 <div
class="TableInfoRow1">
186 <span style
="font-weight: bold; text-align: left;"><?php
echo $ThemeSet['TitleIcon']; ?
><a href
="<?php echo url_maker($exfile['event'],$Settings['file_ext'],"act
=view
&id
=".$_GET['id'],$Settings['qstr'],$Settings['qsep'],$prexqstr['event'],$exqstr['event']); ?>"><?php
echo $EventName; ?
></a
></span
></div
>
188 <table
class="TableInfo1">
189 <?php
if($ThemeSet['TableStyle']=="table") { ?
>
190 <tr
class="TableInfoRow1">
191 <td
class="TableInfoColumn1" colspan
="2"><span style
="font-weight: bold; text-align: left;"><?php
echo $ThemeSet['TitleIcon']; ?
><a href
="<?php echo url_maker($exfile['event'],$Settings['file_ext'],"act
=view
&id
=".$_GET['id'],$Settings['qstr'],$Settings['qsep'],$prexqstr['event'],$exqstr['event']); ?>"><?php
echo $EventName; ?
></a
></span
>
194 <tr
class="TableInfoRow2">
195 <td
class="TableInfoColumn2" style
="vertical-align: middle; width: 160px;">
197 if($User1ID>0&&$User1Hidden=="no") {
199 echo url_maker($exfile['member'],$Settings['file_ext'],"act=view&id=".$User1ID,$Settings['qstr'],$Settings['qsep'],$prexqstr['member'],$exqstr['member']);
200 echo "\">".$User1Name."</a>"; }
201 if($User1ID<=0||
$User1Hidden=="yes") {
202 echo "<span>".$User1Name."</span>"; }
204 <td
class="TableInfoColumn2" style
="vertical-align: middle;">
205 <div style
="float: left; text-align: left;">
206 <span style
="font-weight: bold;">Event Start
: </span
><?php
echo $EventStart; ?
><?php
echo $ThemeSet['LineDividerTopic']; ?
><span style
="font-weight: bold;">Event End
: </span
><?php
echo $EventEnd; ?
>
208 <div style
="text-align: right;"> 
;</div
>
211 <tr
class="TableInfoRow3">
212 <td
class="TableInfoColumn3" style
="vertical-align: top; width: 180px;">
213 <?php
// Avatar Table Thanks For SeanJ's Help at http://seanj.jcink.com/
215 <table
class="AvatarTable" style
="width: 100px; height: 100px; text-align: center;">
216 <tr
class="AvatarRow" style
="width: 100%; height: 100%;">
217 <td
class="AvatarRow" style
="width: 100%; height: 100%; text-align: center; vertical-align: middle;">
218 <img src
="<?php echo $User1Avatar; ?>" alt
="<?php echo $User1Name; ?>'s Avatar" title
="<?php echo $User1Name; ?>'s Avatar" style
="border: 0px; width: <?php echo $AvatarSize1W; ?>px; height: <?php echo $AvatarSize1H; ?>px;" />
222 <?php
echo $User1Title; ?
><br
/>
223 Group
: <?php
echo $User1Group; ?
><br
/>
225 if($User1ID>0&&$User1Hidden=="no") { echo $User1ID; }
226 if($User1ID<=0||
$User1Hidden=="yes") { echo 0; }
228 Posts
: <?php
echo $User1PostCount; ?
><br
/>
229 Joined
: <?php
echo $User1Joined; ?
><br
/>
230 <?php
if($GroupInfo['CanViewIPAddress']=="yes") { ?
>
231 User IP
: <a onclick
="window.open(this.href);return false;" href
="<?php echo sprintf($IPCheckURL,$User1IP); ?>">
232 <?php
echo $User1IP; ?
></a
><br
/>
233 <?php
if($ipshow=="two") { ?
>
234 Event IP
: <a onclick
="window.open(this.href);return false;" href
="<?php echo sprintf($IPCheckURL,$EventIP); ?>">
235 <?php
echo $EventIP; ?
></a
><br
/>
238 <td
class="TableInfoColumn3" style
="vertical-align: middle;">
239 <div
class="eventpost"><?php
echo $EventText; ?
></div
>
240 <?php
if(isset($User1Signature)&&$User1Signature!="") { ?
> <br
/>--------------------
241 <div
class="signature"><?php
echo $User1Signature; ?
></div
><?php
} ?
>
244 <tr
class="TableInfoRow4">
245 <td
class="TableInfoColumn4" colspan
="2">
246 <span style
="text-align: left;"> 
;<a href
="<?php
247 if($User1ID>0&&$User1Hidden=="no
"&&isset($ThemeSet['Profile'])&&$ThemeSet['Profile']!=null) {
248 echo url_maker($exfile['member'],$Settings['file_ext'],"act
=view
&id
=".$User1ID,$Settings['qstr'],$Settings['qsep'],$prexqstr['member'],$exqstr['member']); }
249 if(($User1ID<=0||$User1Hidden=="yes
")&&isset($ThemeSet['Profile'])&&$ThemeSet['Profile']!=null) {
250 echo url_maker($exfile['index'],$Settings['file_ext'],"act
=view
",$Settings['qstr'],$Settings['qsep'],$prexqstr['index'],$exqstr['index']); }
251 ?>"><?php
echo $ThemeSet['Profile']; ?
></a
>
252 <?php
if(isset($ThemeSet['WWW'])&&$ThemeSet['WWW']!=null) {
253 echo $ThemeSet['LineDividerTopic']; ?
><a href
="<?php echo $User1Website; ?>"<?php
echo $opennew; ?
>><?php
echo $ThemeSet['WWW']; ?
></a
><?php
} echo $ThemeSet['LineDividerTopic']; ?
><a href
="<?php
254 if($User1ID>0&&$User1Hidden=="no
"&&isset($ThemeSet['PM'])&&$ThemeSet['PM']!=null) {
255 echo url_maker($exfile['messenger'],$Settings['file_ext'],"act
=create
&id
=".$User1ID,$Settings['qstr'],$Settings['qsep'],$prexqstr['messenger'],$exqstr['messenger']); }
256 if(($User1ID<=0||$User1Hidden=="yes
")&&isset($ThemeSet['PM'])&&$ThemeSet['PM']!=null) {
257 echo url_maker($exfile['index'],$Settings['file_ext'],"act
=view
",$Settings['qstr'],$Settings['qsep'],$prexqstr['index'],$exqstr['index']); }
258 ?>"><?php
echo $ThemeSet['PM']; ?
></a
></span
>
262 <?php
} if($_GET['act']=="create") {
263 if($GroupInfo['CanAddEvents']=="no") { redirect("location",$rbasedir.url_maker($exfile['index'],$Settings['file_ext'],"act=view",$Settings['qstr'],$Settings['qsep'],$prexqstr['index'],$exqstr['index'],false));
264 ob_clean(); header("Content-Type: text/plain; charset=".$Settings['charset']); $urlstatus = 302;
265 gzip_page($Settings['use_gzip'],$GZipEncode['Type']); session_write_close(); die(); }
266 $UFID = rand_uuid("rand");
267 $_SESSION['UserFormID'] = $UFID;
269 <div
class="NavLinks"><?php
echo $ThemeSet['NavLinkIcon']; ?
><a href
="<?php echo url_maker($exfile['index'],$Settings['file_ext'],"act
=view
",$Settings['qstr'],$Settings['qsep'],$prexqstr['index'],$exqstr['index']); ?>"><?php
echo $Settings['board_name']; ?
></a
><?php
echo $ThemeSet['NavLinkDivider']; ?
><a href
="<?php echo url_maker($exfile['event'],$Settings['file_ext'],"act
=create
",$Settings['qstr'],$Settings['qsep'],$prexqstr['event'],$exqstr['event']); ?>">Making a Event
</a
></div
>
270 <div
class="DivNavLinks"> 
;</div
>
271 <div
class="Table1Border">
272 <?php
if($ThemeSet['TableStyle']=="div") { ?
>
273 <div
class="TableRow1">
274 <span style
="text-align: left;">
275 <?php
echo $ThemeSet['TitleIcon']; ?
><a href
="<?php echo url_maker($exfile['calendar'],$Settings['file_ext'],"act
=view
",$Settings['qstr'],$Settings['qsep'],$prexqstr['calendar'],$exqstr['calendar']); ?>">Making a Event
</a
></span
></div
>
277 <table
class="Table1" id
="MakeEvent">
278 <?php
if($ThemeSet['TableStyle']=="table") { ?
>
279 <tr
class="TableRow1" id
="EventStart">
280 <td
class="TableColumn1" colspan
="2"><span style
="text-align: left;">
281 <?php
echo $ThemeSet['TitleIcon']; ?
><a href
="<?php echo url_maker($exfile['calendar'],$Settings['file_ext'],"act
=view
",$Settings['qstr'],$Settings['qsep'],$prexqstr['calendar'],$exqstr['calendar']); ?>">Making a Event
</a
></span
>
284 <tr id
="MakeEventRow" class="TableRow2">
285 <td
class="TableColumn2" colspan
="2" style
="width: 100%;">Making a Event
</td
>
287 <tr
class="TableRow3" id
="MkEvent">
288 <td
class="TableColumn3" style
="width: 15%; vertical-align: middle; text-align: center;">
289 <div style
="width: 100%; height: 160px; overflow: auto;">
290 <table style
="width: 100%; text-align: center;"><?php
291 $melanie_query=sql_pre_query("SELECT * FROM \"".$Settings['sqltable']."smileys\" WHERE \"Display\"='yes'", array(null));
292 $melanie_result=sql_query($melanie_query,$SQLStat);
293 $melanie_num=sql_num_rows($melanie_result);
294 $melanie_p=0; $SmileRow=0; $SmileCRow=0;
295 while ($melanie_p < $melanie_num) { ++
$SmileRow;
296 $FileName=sql_result($melanie_result,$melanie_p,"FileName");
297 $SmileName=sql_result($melanie_result,$melanie_p,"SmileName");
298 $SmileText=sql_result($melanie_result,$melanie_p,"SmileText");
299 $SmileDirectory=sql_result($melanie_result,$melanie_p,"Directory");
300 $ShowSmile=sql_result($melanie_result,$melanie_p,"Display");
301 $ReplaceType=sql_result($melanie_result,$melanie_p,"ReplaceCI");
302 if($SmileRow==1) { ?
><tr
>
303 <?php
} if($SmileRow<5) { ++
$SmileCRow; ?
>
304 <td
><img src
="<?php echo $SmileDirectory."".$FileName; ?>" style
="vertical-align: middle; border: 0px; cursor: pointer;" title
="<?php echo $SmileName; ?>" alt
="<?php echo $SmileName; ?>" onclick
="addsmiley('EventText',' <?php echo htmlspecialchars($SmileText, ENT_QUOTES, $Settings['charset']); ?> ')" /></td
>
305 <?php
} if($SmileRow==5) { ++
$SmileCRow; ?
>
306 <td
><img src
="<?php echo $SmileDirectory."".$FileName; ?>" style
="vertical-align: middle; border: 0px; cursor: pointer;" title
="<?php echo $SmileName; ?>" alt
="<?php echo $SmileName; ?>" onclick
="addsmiley('EventText',' <?php echo htmlspecialchars($SmileText, ENT_QUOTES, $Settings['charset']); ?> ')" /></td
></tr
>
307 <?php
$SmileCRow=0; $SmileRow=0; }
309 if($SmileCRow<5&&$SmileCRow!=0) {
310 $SmileCRowL = 5 - $SmileCRow;
311 echo "<td colspan=\"".$SmileCRowL."\"> </td></tr>"; }
313 sql_free_result($melanie_result);
315 <td
class="TableColumn3" style
="width: 85%;">
316 <form style
="display: inline;" method
="post" id
="MkEventForm" action
="<?php echo url_maker($exfile['event'],$Settings['file_ext'],"act
=makeevent
",$Settings['qstr'],$Settings['qsep'],$prexqstr['event'],$exqstr['event']); ?>">
317 <table style
="text-align: left;">
318 <tr style
="text-align: left;">
319 <td style
="width: 50%;"><label
class="TextBoxLabel" for="EventName">Insert Event Name
:</label
></td
>
320 <td style
="width: 50%;"><input maxlength
="30" type
="text" name
="EventName" class="TextBox" id
="EventName" size
="20" /></td
>
321 </tr
><?php
if($_SESSION['UserGroup']==$Settings['GuestGroup']) { ?
><tr style
="text-align: left;">
322 <td style
="width: 50%;"><label
class="TextBoxLabel" for="GuestName">Insert Guest Name
:</label
></td
>
323 <?php
if(!isset($_SESSION['GuestName'])) { ?
>
324 <td style
="width: 50%;"><input maxlength
="25" type
="text" name
="GuestName" class="TextBox" id
="GuestName" size
="20" /></td
>
325 <?php
} if(isset($_SESSION['GuestName'])) { ?
>
326 <td style
="width: 50%;"><input maxlength
="25" type
="text" name
="GuestName" class="TextBox" id
="GuestName" size
="20" value
="<?php echo $_SESSION['GuestName']; ?>" /></td
>
327 <?php
} ?
></tr
><?php
} ?
><tr style
="text-align: left;">
328 <td style
="width: 50%;"><label
class="TextBoxLabel" for="EventStart">Insert Event Start
:</label
></td
>
329 <td style
="width: 50%;"><input maxlength
="10" type
="date" name
="EventStart" class="TextBox" id
="EventStart" size
="20" value
="MM/DD/YYYY" /></td
>
330 </tr
><tr style
="text-align: left;">
331 <td style
="width: 50%;"><label
class="TextBoxLabel" for="EventEnd">Insert Event End
:</label
></td
>
332 <td style
="width: 50%;"><input maxlength
="10" type
="date" name
="EventEnd" class="TextBox" id
="EventEnd" size
="20" value
="MM/DD/YYYY" /></td
>
335 <table style
="text-align: left;">
336 <tr style
="text-align: left;">
337 <td style
="width: 100%;">
338 <label
class="TextBoxLabel" for="EventText">Insert Event Text
:</label
><br
/>
339 <textarea rows
="10" name
="EventText" id
="EventText" cols
="40" class="TextBox"></textarea
><br
/>
340 <?php
if($_SESSION['UserGroup']==$Settings['GuestGroup']&&$Settings['captcha_guest']=="on") { ?
>
341 <label
class="TextBoxLabel" for="signcode"><img src
="<?php echo url_maker($exfile['index'],$Settings['file_ext'],"act
=MkCaptcha
",$Settings['qstr'],$Settings['qsep'],$prexqstr['index'],$exqstr['index']); ?>" alt
="CAPTCHA Code" title
="CAPTCHA Code" /></label
><br
/>
342 <input maxlength
="25" type
="text" class="TextBox" name
="signcode" size
="20" id
="signcode" value
="Enter SignCode" /><br
/>
344 <input type
="hidden" name
="act" value
="makeevents" style
="display: none;" />
345 <input type
="hidden" style
="display: none;" name
="fid" value
="<?php echo $UFID; ?>" />
346 <input type
="hidden" style
="display: none;" name
="ubid" value
="<?php echo $Settings['BoardUUID']; ?>" />
347 <?php
if($_SESSION['UserGroup']!=$Settings['GuestGroup']) { ?
>
348 <input type
="hidden" name
="GuestName" value
="null" style
="display: none;" />
350 <input type
="submit" class="Button" value
="Make Event" name
="make_event" />
351 <input type
="reset" value
="Reset Form" class="Button" name
="Reset_Form" />
354 <tr id
="MkEventEnd" class="TableRow4">
355 <td
class="TableColumn4" colspan
="2"> 
;</td
>
358 <?php
} if($_GET['act']=="makeevent"&&$_POST['act']=="makeevents") {
359 if(preg_match("/([0-9]{4})\-([0-9]{2})\-([0-9]{2})/", $_POST['EventStart'])) { $_POST['EventStart'] = preg_replace("/([0-9]{4})\-([0-9]{2})\-([0-9]{2})/", "$2/$3/$1", $_POST['EventStart']); }
360 if(preg_match("/([0-9]{4})\-([0-9]{2})\-([0-9]{2})/", $_POST['EventEnd'])) { $_POST['EventEnd'] = preg_replace("/([0-9]{4})\-([0-9]{2})\-([0-9]{2})/", "$2/$3/$1", $_POST['EventEnd']); }
361 if($GroupInfo['CanAddEvents']=="no") { redirect("location",$rbasedir.url_maker($exfile['index'],$Settings['file_ext'],"act=view",$Settings['qstr'],$Settings['qsep'],$prexqstr['index'],$exqstr['index'],false));
362 ob_clean(); header("Content-Type: text/plain; charset=".$Settings['charset']); $urlstatus = 302;
363 gzip_page($Settings['use_gzip'],$GZipEncode['Type']); session_write_close(); die(); }
364 $MyUserID = $_SESSION['UserID']; if($MyUserID=="0"||
$MyUserID==null) { $MyUserID = -1; }
365 if(isset($_SESSION['OldViewingPage'])) { $_SESSION['AncientViewingPage'] = $_SESSION['OldViewingPage']; } else { $_SESSION['AncientViewingPage'] = url_maker(null,"no+ext","act=view","&","=",$prexqstr['index'],$exqstr['index']); }
366 if(isset($_SESSION['OldViewingFile'])) { $_SESSION['AncientViewingFile'] = $_SESSION['OldViewingFile']; } else {
367 if($Settings['file_ext']!="no+ext"&&$Settings['file_ext']!="no ext") {
368 $_SESSION['AncientViewingFile'] = $exfile['index'].$Settings['file_ext']; }
369 if($Settings['file_ext']=="no+ext"||
$Settings['file_ext']=="no ext") {
370 $_SESSION['AncientViewingFile'] = $exfile['index']; } }
371 if(isset($_SESSION['OldPreViewingTitle'])) { $_SESSION['AncientPreViewingTitle'] = $_SESSION['OldPreViewingTitle']; } else { $_SESSION['AncientPreViewingTitle'] = "Viewing"; }
372 if(isset($_SESSION['OldViewingTitle'])) { $_SESSION['AncientViewingTitle'] = $_SESSION['OldViewingTitle']; } else { $_SESSION['AncientViewingTitle'] = "Board index"; }
373 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;"; }
374 if(isset($_SESSION['ViewingPage'])) { $_SESSION['OldViewingPage'] = $_SESSION['ViewingPage']; } else { $_SESSION['OldViewingPage'] = url_maker(null,"no+ext","act=view","&","=",$prexqstr['index'],$exqstr['index']); }
375 if(isset($_SESSION['ViewingFile'])) { $_SESSION['OldViewingFile'] = $_SESSION['ViewingFile']; } else {
376 if($Settings['file_ext']!="no+ext"&&$Settings['file_ext']!="no ext") {
377 $_SESSION['OldViewingFile'] = $exfile['index'].$Settings['file_ext']; }
378 if($Settings['file_ext']=="no+ext"||
$Settings['file_ext']=="no ext") {
379 $_SESSION['OldViewingFile'] = $exfile['index']; } }
380 if(isset($_SESSION['PreViewingTitle'])) { $_SESSION['OldPreViewingTitle'] = $_SESSION['PreViewingTitle']; } else { $_SESSION['OldPreViewingTitle'] = "Viewing"; }
381 if(isset($_SESSION['ViewingTitle'])) { $_SESSION['OldViewingTitle'] = $_SESSION['ViewingTitle']; } else { $_SESSION['OldViewingTitle'] = "Board index"; }
382 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;"; }
383 $_SESSION['ViewingPage'] = url_maker(null,"no+ext","act=view","&","=",$prexqstr['index'],$exqstr['index']);
384 if($Settings['file_ext']!="no+ext"&&$Settings['file_ext']!="no ext") {
385 $_SESSION['ViewingFile'] = $exfile['index'].$Settings['file_ext']; }
386 if($Settings['file_ext']=="no+ext"||
$Settings['file_ext']=="no ext") {
387 $_SESSION['ViewingFile'] = $exfile['index']; }
388 $_SESSION['PreViewingTitle'] = "Making";
389 $_SESSION['ViewingTitle'] = "Event";
390 $_SESSION['ExtraData'] = "currentact:".$_GET['act']."; currentcategoryid:0; currentforumid:0; currenttopicid:0; currentmessageid:0; currenteventid:0; currentmemberid:0;";
391 $REFERERurl = parse_url($_SERVER['HTTP_REFERER']);
392 $URL['REFERER'] = $REFERERurl['host'];
393 $URL['HOST'] = $_SERVER["SERVER_NAME"];
395 if(!isset($_POST['EventName'])) { $_POST['EventName'] = null; }
396 if(!isset($_POST['EventStart'])) { $_POST['EventStart'] = null; }
397 if(!isset($_POST['EventEnd'])) { $_POST['EventEnd'] = null; }
398 if(!isset($_POST['EventText'])) { $_POST['EventText'] = null; }
399 if(!isset($_POST['GuestName'])) { $_POST['GuestName'] = null; }
400 $TimeIn = explode("/",$_POST['EventStart']);
401 $TimeOut = explode("/",$_POST['EventEnd']);
402 if($_SESSION['UserGroup']==$Settings['GuestGroup']&&
403 $Settings['captcha_guest']=="on") {
404 require($SettDir['inc']."captcha.php"); }
406 <div
class="Table1Border">
407 <?php
if($ThemeSet['TableStyle']=="div") { ?
>
408 <div
class="TableRow1">
409 <span style
="text-align: left;">
410 <?php
echo $ThemeSet['TitleIcon']; ?
><a href
="<?php echo url_maker($exfile['calendar'],$Settings['file_ext'],"act
=view
",$Settings['qstr'],$Settings['qsep'],$prexqstr['calendar'],$exqstr['calendar']); ?>">Making a Event
</a
></span
></div
>
412 <table
class="Table1">
413 <?php
if($ThemeSet['TableStyle']=="table") { ?
>
414 <tr
class="TableRow1">
415 <td
class="TableColumn1"><span style
="text-align: left;">
416 <?php
echo $ThemeSet['TitleIcon']; ?
><a href
="<?php echo url_maker($exfile['calendar'],$Settings['file_ext'],"act
=view
",$Settings['qstr'],$Settings['qsep'],$prexqstr['calendar'],$exqstr['calendar']); ?>">Making a Event
</a
></span
>
419 <tr
class="TableRow2">
420 <th
class="TableColumn2" style
="width: 100%; text-align: left;"> 
;Make Event Message
: </th
>
422 <tr
class="TableRow3">
423 <td
class="TableColumn3">
424 <table style
="width: 100%; height: 25%; text-align: center;">
425 <?php
if (pre_strlen($_POST['EventName'])>="30") { $Error="Yes"; ?
>
427 <td
><span
class="TableMessage">
428 <br
/>Your Event Name is too big
.<br
/>
431 <?php
} if($_POST['fid']!=$_SESSION['UserFormID']) { $Error="Yes"; ?
>
433 <td
><span
class="TableMessage">
434 <br
/>Sorry the referering url dose not match our host name
.<br
/>
437 <?php
} if($_POST['ubid']!=$Settings['BoardUUID']) { $Error="Yes"; ?
>
439 <td
><span
class="TableMessage">
440 <br
/>Sorry the referering url dose not match our host name
.<br
/>
443 <?php
} if($_SESSION['UserGroup']==$Settings['GuestGroup']&&
444 $Settings['captcha_guest']=="on") {
445 if (PhpCaptcha
::Validate($_POST['signcode'])) {
446 //echo 'Valid code entered';
447 } else { $Error="Yes"; ?
>
449 <td
><span
class="TableMessage">
450 <br
/>Invalid code entered
<br
/>
453 <?php
} } if (pre_strlen($TimeIn[0])<"2") { $Error="Yes"; ?
>
455 <td
><span
class="TableMessage">
456 <br
/>Event Start Month is too small
.<br
/>
459 <?php
} if (pre_strlen($TimeIn[0])>"2") { $Error="Yes"; ?
>
461 <td
><span
class="TableMessage">
462 <br
/>Event Start Month is too big
.<br
/>
465 <?php
} if (pre_strlen($TimeIn[1])<"2") { $Error="Yes"; ?
>
467 <td
><span
class="TableMessage">
468 <br
/>Event Start Day is too small
.<br
/>
471 <?php
} if (pre_strlen($TimeIn[1])>"2") { $Error="Yes"; ?
>
473 <td
><span
class="TableMessage">
474 <br
/>Event Start Day is too big
.<br
/>
477 <?php
} if (pre_strlen($TimeIn[2])<"4") { $Error="Yes"; ?
>
479 <td
><span
class="TableMessage">
480 <br
/>Event Start Year is too small
.<br
/>
483 <?php
} if (pre_strlen($TimeIn[2])>"4") { $Error="Yes"; ?
>
485 <td
><span
class="TableMessage">
486 <br
/>Event Start Year is too big
.<br
/>
489 <?php
} if (pre_strlen($TimeOut[0])<"2") { $Error="Yes"; ?
>
491 <td
><span
class="TableMessage">
492 <br
/>Event End Month is too small
.<br
/>
495 <?php
} if (pre_strlen($TimeOut[0])>"2") { $Error="Yes"; ?
>
497 <td
><span
class="TableMessage">
498 <br
/>Event End Month is too big
.<br
/>
501 <?php
} if (pre_strlen($TimeOut[1])<"2") { $Error="Yes"; ?
>
503 <td
><span
class="TableMessage">
504 <br
/>Event End Day is too small
.<br
/>
507 <?php
} if (pre_strlen($TimeOut[1])>"2") { $Error="Yes"; ?
>
509 <td
><span
class="TableMessage">
510 <br
/>Event End Day is too big
.<br
/>
513 <?php
} if (pre_strlen($TimeOut[2])<"4") { $Error="Yes"; ?
>
515 <td
><span
class="TableMessage">
516 <br
/>Event End Year is too small
.<br
/>
519 <?php
} if (pre_strlen($TimeOut[2])>"4") { $Error="Yes"; ?
>
521 <td
><span
class="TableMessage">
522 <br
/>Event End Year is too big
.<br
/>
525 <?php
} if (checkdate($TimeIn[0],$TimeIn[1],$TimeIn[2])===false) { $Error="Yes"; ?
>
527 <td
><span
class="TableMessage">
528 <br
/>Sorry the event start date is not valid
.<br
/>
531 <?php
} if (checkdate($TimeOut[0],$TimeOut[1],$TimeOut[2])===false) { $Error="Yes"; ?
>
533 <td
><span
class="TableMessage">
534 <br
/>Sorry the event end date is not valid
.<br
/>
537 <?php
} if($_SESSION['UserGroup']==$Settings['GuestGroup']&&
538 pre_strlen($_POST['GuestName'])>="25") { $Error="Yes"; ?
>
540 <td
><span
class="TableMessage">
541 <br
/>You Guest Name is too big
.<br
/>
544 <?php
} if ($Settings['TestReferer']===true) {
545 if ($URL['HOST']!=$URL['REFERER']) { $Error="Yes"; ?
>
547 <td
><span
class="TableMessage">
548 <br
/>Sorry the referering url dose not match our host name
.<br
/>
552 $_POST['EventName'] = stripcslashes(htmlspecialchars($_POST['EventName'], ENT_QUOTES
, $Settings['charset']));
553 //$_POST['EventName'] = preg_replace("/&#(x[a-f0-9]+|[0-9]+);/i", "&#$1;", $_POST['EventName']);
554 $_POST['EventName'] = remove_spaces($_POST['EventName']);
555 $_POST['GuestName'] = stripcslashes(htmlspecialchars($_POST['GuestName'], ENT_QUOTES
, $Settings['charset']));
556 //$_POST['GuestName'] = preg_replace("/&#(x[a-f0-9]+|[0-9]+);/i", "&#$1;", $_POST['GuestName']);
557 $_POST['GuestName'] = remove_spaces($_POST['GuestName']);
558 $_POST['EventText'] = stripcslashes(htmlspecialchars($_POST['EventText'], ENT_QUOTES
, $Settings['charset']));
559 //$_POST['EventText'] = preg_replace("/&#(x[a-f0-9]+|[0-9]+);/i", "&#$1;", $_POST['EventText']);
560 $_POST['EventText'] = remove_bad_entities($_POST['EventText']);
561 //$_POST['EventText'] = remove_spaces($_POST['EventText']);
562 if($_SESSION['UserGroup']==$Settings['GuestGroup']) {
563 if(isset($_POST['GuestName'])&&$_POST['GuestName']!=null) {
564 if($cookieDomain==null) {
565 setcookie("GuestName", $_POST['GuestName'], time() +
(7 * 86400), $cbasedir); }
566 if($cookieDomain!=null) {
567 if($cookieSecure===true) {
568 setcookie("GuestName", $_POST['GuestName'], time() +
(7 * 86400), $cbasedir, $cookieDomain, 1); }
569 if($cookieSecure===false) {
570 setcookie("GuestName", $_POST['GuestName'], time() +
(7 * 86400), $cbasedir, $cookieDomain); } }
571 $_SESSION['GuestName']=$_POST['GuestName']; } }
572 /* <_< iWordFilter >_>
573 by Kazuki Przyborowski - Cool Dude 2k */
574 $melanieqy=sql_pre_query("SELECT * FROM \"".$Settings['sqltable']."wordfilter\"", array(null));
575 $melaniert=sql_query($melanieqy,$SQLStat);
576 $melanienm=sql_num_rows($melaniert);
578 while ($melanies < $melanienm) {
579 $Filter=sql_result($melaniert,$melanies,"FilterWord");
580 $Replace=sql_result($melaniert,$melanies,"Replacement");
581 $CaseInsensitive=sql_result($melaniert,$melanies,"CaseInsensitive");
582 if($CaseInsensitive=="on") { $CaseInsensitive = "yes"; }
583 if($CaseInsensitive=="off") { $CaseInsensitive = "no"; }
584 if($CaseInsensitive!="yes"||
$CaseInsensitive!="no") { $CaseInsensitive = "no"; }
585 $WholeWord=sql_result($melaniert,$melanies,"WholeWord");
586 if($WholeWord=="on") { $WholeWord = "yes"; }
587 if($WholeWord=="off") { $WholeWord = "no"; }
588 if($WholeWord!="yes"&&$WholeWord!="no") { $WholeWord = "no"; }
589 $Filter = preg_quote($Filter, "/");
590 if($CaseInsensitive!="yes"&&$WholeWord=="yes") {
591 $_POST['EventText'] = preg_replace("/\b(".$Filter.")\b/", $Replace, $_POST['EventText']); }
592 if($CaseInsensitive=="yes"&&$WholeWord=="yes") {
593 $_POST['EventText'] = preg_replace("/\b(".$Filter.")\b/i", $Replace, $_POST['EventText']); }
594 if($CaseInsensitive!="yes"&&$WholeWord!="yes") {
595 $_POST['EventText'] = preg_replace("/".$Filter."/", $Replace, $_POST['EventText']); }
596 if($CaseInsensitive=="yes"&&$WholeWord!="yes") {
597 $_POST['EventText'] = preg_replace("/".$Filter."/i", $Replace, $_POST['EventText']); }
598 ++
$melanies; } sql_free_result($melaniert);
599 $lonewolfqy=sql_pre_query("SELECT * FROM \"".$Settings['sqltable']."restrictedwords\" WHERE \"RestrictedEventName\"='yes' or \"RestrictedUserName\"='yes'", array(null));
600 $lonewolfrt=sql_query($lonewolfqy,$SQLStat);
601 $lonewolfnm=sql_num_rows($lonewolfrt);
602 $lonewolfs=0; $RMatches = null; $RGMatches = null;
603 while ($lonewolfs < $lonewolfnm) {
604 $RWord=sql_result($lonewolfrt,$lonewolfs,"Word");
605 $RCaseInsensitive=sql_result($lonewolfrt,$lonewolfs,"CaseInsensitive");
606 if($RCaseInsensitive=="on") { $RCaseInsensitive = "yes"; }
607 if($RCaseInsensitive=="off") { $RCaseInsensitive = "no"; }
608 if($RCaseInsensitive!="yes"||
$RCaseInsensitive!="no") { $RCaseInsensitive = "no"; }
609 $RWholeWord=sql_result($lonewolfrt,$lonewolfs,"WholeWord");
610 if($RWholeWord=="on") { $RWholeWord = "yes"; }
611 if($RWholeWord=="off") { $RWholeWord = "no"; }
612 if($RWholeWord!="yes"||
$RWholeWord!="no") { $RWholeWord = "no"; }
613 $RestrictedEventName=sql_result($lonewolfrt,$lonewolfs,"RestrictedEventName");
614 if($RestrictedEventName=="on") { $RestrictedEventName = "yes"; }
615 if($RestrictedEventName=="off") { $RestrictedEventName = "no"; }
616 if($RestrictedEventName!="yes"||
$RestrictedEventName!="no") { $RestrictedEventName = "no"; }
617 $RestrictedUserName=sql_result($lonewolfrt,$lonewolfs,"RestrictedUserName");
618 if($RestrictedUserName=="on") { $RestrictedUserName = "yes"; }
619 if($RestrictedUserName=="off") { $RestrictedUserName = "no"; }
620 if($RestrictedUserName!="yes"||
$RestrictedUserName!="no") { $RestrictedUserName = "no"; }
621 $RWord = preg_quote($RWord, "/");
622 if($RCaseInsensitive!="yes"&&$RWholeWord=="yes") {
623 if($RestrictedEventName=="yes") {
624 $RMatches = preg_match("/\b(".$RWord.")\b/", $_POST['EventName']);
625 if($RMatches==true) { break 1; } }
626 if($RestrictedUserName=="yes") {
627 $RGMatches = preg_match("/\b(".$RWord.")\b/", $_POST['GuestName']);
628 if($RGMatches==true) { break 1; } } }
629 if($RCaseInsensitive=="yes"&&$RWholeWord=="yes") {
630 if($RestrictedEventName=="yes") {
631 $RMatches = preg_match("/\b(".$RWord.")\b/i", $_POST['EventName']);
632 if($RMatches==true) { break 1; } }
633 if($RestrictedUserName=="yes") {
634 $RGMatches = preg_match("/\b(".$RWord.")\b/i", $_POST['GuestName']);
635 if($RGMatches==true) { break 1; } } }
636 if($RCaseInsensitive!="yes"&&$RWholeWord!="yes") {
637 if($RestrictedEventName=="yes") {
638 $RMatches = preg_match("/".$RWord."/", $_POST['EventName']);
639 if($RMatches==true) { break 1; } }
640 if($RestrictedUserName=="yes") {
641 $RGMatches = preg_match("/".$RWord."/", $_POST['GuestName']);
642 if($RGMatches==true) { break 1; } } }
643 if($RCaseInsensitive=="yes"&&$RWholeWord!="yes") {
644 if($RestrictedEventName=="yes") {
645 $RMatches = preg_match("/".$RWord."/i", $_POST['EventName']);
646 if($RMatches==true) { break 1; } }
647 if($RestrictedUserName=="yes") {
648 $RGMatches = preg_match("/".$RWord."/i", $_POST['GuestName']);
649 if($RGMatches==true) { break 1; } } }
650 ++
$lonewolfs; } sql_free_result($lonewolfrt);
651 if ($_POST['EventName']==null) { $Error="Yes"; ?
>
653 <td
><span
class="TableMessage">
654 <br
/>You need to enter a Event Name
.<br
/>
657 <?php
} if ($_POST['EventText']==null) { $Error="Yes"; ?
>
659 <td
><span
class="TableMessage">
660 <br
/>You need to enter a Event Text
.<br
/>
663 <?php
} if ($_POST['EventStart']==null) { $Error="Yes"; ?
>
665 <td
><span
class="TableMessage">
666 <br
/>You need to enter date
for event to start in MM
/DD
/YYYY format
.<br
/>
669 <?php
} if ($_POST['EventEnd']==null) { $Error="Yes"; ?
>
671 <td
><span
class="TableMessage">
672 <br
/>You need to enter date
for event to end in MM
/DD
/YYYY format
.<br
/>
675 <?php
} if (count($TimeIn)!="3") { $Error="Yes"; ?
>
677 <td
><span
class="TableMessage">
678 <br
/>You need to enter valid date
for event to start in MM
/DD
/YYYY format
.<br
/>
681 <?php
} if (count($TimeOut)!="3") { $Error="Yes"; ?
>
683 <td
><span
class="TableMessage">
684 <br
/>You need to enter valid date
for event to end in MM
/DD
/YYYY format
.<br
/>
687 <?php
} if (!is_numeric($TimeIn[0])||
!is_numeric($TimeIn[1])||
!is_numeric($TimeIn[2])) { $Error="Yes"; ?
>
689 <td
><span
class="TableMessage">
690 <br
/>You need to enter valid date
for event to start in MM
/DD
/YYYY format
.<br
/>
693 <?php
} if (!is_numeric($TimeOut[0])||
!is_numeric($TimeOut[1])||
!is_numeric($TimeOut[2])) { $Error="Yes"; ?
>
695 <td
><span
class="TableMessage">
696 <br
/>You need to enter valid date
for event to end in MM
/DD
/YYYY format
.<br
/>
699 <?php
} if (!isset($TimeIn[0])||
!isset($TimeIn[1])||
!isset($TimeIn[2])) { $Error="Yes"; ?
>
701 <td
><span
class="TableMessage">
702 <br
/>You need to enter valid date
for event to start in MM
/DD
/YYYY format
.<br
/>
705 <?php
} if (!isset($TimeOut[0])||
!isset($TimeOut[1])||
!isset($TimeOut[2])) { $Error="Yes"; ?
>
707 <td
><span
class="TableMessage">
708 <br
/>You need to enter valid date
for event to end in MM
/DD
/YYYY format
.<br
/>
711 <?php
} if($_SESSION['UserGroup']==$Settings['GuestGroup']&&
712 $_POST['GuestName']==null) { $Error="Yes"; ?
>
714 <td
><span
class="TableMessage">
715 <br
/>You need to enter a Guest Name
.<br
/>
718 <?php
} if($_SESSION['UserGroup']==$Settings['GuestGroup']&&
719 $RGMatches==true) { $Error="Yes"; ?
>
721 <td
><span
class="TableMessage">
722 <br
/>This Guest Name is restricted to
use.<br
/>
725 <?php
} if($GroupInfo['CanAddEvents']=="no") { $Error="Yes"; ?
>
727 <td
><span
class="TableMessage">
728 <br
/>You
do not have permission to make a event here
.<br
/>
731 <?php
} if($RMatches==true) { $Error="Yes"; ?
>
733 <td
><span
class="TableMessage">
734 <br
/>This User Name is restricted to
use.<br
/>
737 <?php
} if ($Error=="Yes") {
738 redirect("refresh",$rbasedir.url_maker($exfile['index'],$Settings['file_ext'],"act=view",$Settings['qstr'],$Settings['qsep'],$prexqstr['index'],$exqstr['index'],false),"4"); ?
>
740 <td
><span
class="TableMessage">
741 <br
/>Click
<a href
="<?php echo url_maker($exfile['index'],$Settings['file_ext'],"act
=view
",$Settings['qstr'],$Settings['qsep'],$prexqstr['index'],$exqstr['index']); ?>">here
</a
> to
goto index page
.<br
/> 
;
744 <?php
} if ($Error!="Yes") {
745 $TimeSIn = mktime(0,0,0,$TimeIn[0],$TimeIn[1],$TimeIn[2]);
746 $TimeSOut = mktime(23,59,59,$TimeOut[0],$TimeOut[1],$TimeOut[2]);
747 $eventstartcurtime = new DateTime();
748 $eventstartcurtime->setTimestamp($TimeSIn);
749 $eventstartcurtime->setTimezone($utctz);
750 $eventendcurtime = new DateTime();
751 $eventendcurtime->setTimestamp($TimeSOut);
752 $eventendcurtime->setTimezone($utctz);
753 $EventMonth=$eventstartcurtime->format("m");
754 $EventMonthEnd=$eventendcurtime->format("m");
755 $EventDay=$eventstartcurtime->format("d");
756 $EventDayEnd=$eventendcurtime->format("d");
757 $EventYear=$eventstartcurtime->format("Y");
758 $EventYearEnd=$eventendcurtime->format("Y");
760 $User1IP=$_SERVER['REMOTE_ADDR'];
761 if($_SESSION['UserGroup']==$Settings['GuestGroup']) { $User1Name = $_POST['GuestName']; }
762 if($_SESSION['UserGroup']!=$Settings['GuestGroup']) { $User1Name = $_SESSION['MemberName']; }
763 $query = sql_pre_query("INSERT INTO ".$Settings['sqltable']."events (\"UserID\", \"GuestName\", \"EventName\", \"EventText\", \"TimeStamp\", \"TimeStampEnd\", \"EventMonth\", \"EventMonthEnd\", \"EventDay\", \"EventDayEnd\", \"EventYear\", \"EventYearEnd\", \"IP\") VALUES\n".
764 "(%i, '%s', '%s', '%s', %i, %i, %i, %i, %i, %i, %i, %i, '%s')", array($User1ID,$User1Name,$_POST['EventName'],$_POST['EventText'],$TimeSIn,$TimeSOut,$EventMonth,$EventMonthEnd,$EventDay,$EventDayEnd,$EventYear,$EventYearEnd,$User1IP));
765 sql_query($query,$SQLStat);
766 $eventid = sql_get_next_id($Settings['sqltable'],"events",$SQLStat);
767 redirect("refresh",$rbasedir.url_maker($exfile['event'],$Settings['file_ext'],"act=event&id=".$eventid,$Settings['qstr'],$Settings['qsep'],$prexqstr['event'],$exqstr['event'],FALSE),"3");
769 <td
><span
class="TableMessage"><br
/>
770 Event
<?php
echo $_POST['EventName']; ?
> was started
.<br
/>
771 Click
<a href
="<?php echo url_maker($exfile['event'],$Settings['file_ext'],"act
=event
&id
=".$eventid,$Settings['qstr'],$Settings['qsep'],$prexqstr['event'],$exqstr['event']); ?>">here
</a
> to
continue to event
.<br
/> 
;
777 <tr
class="TableRow4">
778 <td
class="TableColumn4"> 
;</td
>
782 <div
class="DivEvents"> 
;</div
>