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-2010 iDB Support - http://idb.berlios.de/
12 Copyright 2004-2010 Game Maker 2k - http://gamemaker2k.org/
14 $FileInfo: events.php - Last Update: 10/09/2010 SVN 586 - 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']);
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']); ?>">Board index
</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,$i,"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 $EventText = preg_replace("/\<br\>/", "<br />", nl2br($EventText));
41 $EventStart=sql_result($result,$is,"TimeStamp");
42 $EventEnd=sql_result($result,$is,"TimeStampEnd");
43 $EventStart = GMTimeChange("M. j Y",$EventStart,null);
44 $EventEnd = GMTimeChange("M. j Y",$EventEnd,null);
46 $_SESSION['ViewingPage'] = url_maker(null,"no+ext","act=view&id=".$_GET['id'],"&","=",$prexqstr['event'],$exqstr['event']);
47 if($Settings['file_ext']!="no+ext"&&$Settings['file_ext']!="no ext") {
48 $_SESSION['ViewingFile'] = $exfile['event'].$Settings['file_ext']; }
49 if($Settings['file_ext']=="no+ext"||
$Settings['file_ext']=="no ext") {
50 $_SESSION['ViewingFile'] = $exfile['event']; }
51 $_SESSION['PreViewingTitle'] = "Viewing Event:";
52 $_SESSION['ViewingTitle'] = $EventName;
53 $requery = sql_pre_query("SELECT * FROM \"".$Settings['sqltable']."members\" WHERE \"id\"=%i LIMIT 1", array($EventUser));
54 $reresult=sql_query($requery,$SQLStat);
55 $renum=sql_num_rows($reresult);
56 if($renum<1) { $EventUser = -1;
57 $requery = sql_pre_query("SELECT * FROM \"".$Settings['sqltable']."members\" WHERE \"id\"=%i LIMIT 1", array($EventUser));
58 $reresult=sql_query($requery,$SQLStat);
59 $renum=sql_num_rows($reresult); }
62 $User1Name=sql_result($reresult,$rei,"Name");
63 $User1IP=sql_result($reresult,$rei,"IP");
64 if($User1IP==$EventIP) { $ipshow = "one"; }
65 $User1Email=sql_result($reresult,$rei,"Email");
66 $User1Title=sql_result($reresult,$rei,"Title");
67 $User1Joined=sql_result($reresult,$rei,"Joined");
68 $User1Joined=GMTimeChange("M j Y",$User1Joined,$_SESSION['UserTimeZone'],0,$_SESSION['UserDST']);
69 $User1GroupID=sql_result($reresult,$rei,"GroupID");
70 $gquery = sql_pre_query("SELECT * FROM \"".$Settings['sqltable']."groups\" WHERE \"id\"=%i LIMIT 1", array($User1GroupID));
71 $gresult=sql_query($gquery,$SQLStat);
72 $User1Hidden=sql_result($reresult,$rei,"HiddenMember");
73 $User1Group=sql_result($gresult,0,"Name");
74 $GroupNamePrefix=sql_result($gresult,0,"NamePrefix");
75 $GroupNameSuffix=sql_result($gresult,0,"NameSuffix");
76 sql_free_result($gresult);
77 if($User1Title=="") { $User1Title = $User1Group; }
78 $User1Signature=sql_result($reresult,$rei,"Signature");
79 $User1Signature = preg_replace("/\<br\>/", "<br />", nl2br($User1Signature));
80 $User1Avatar=sql_result($reresult,$rei,"Avatar");
81 $User1AvatarSize=sql_result($reresult,$rei,"AvatarSize");
82 if ($User1Avatar=="http://"||
$User1Avatar==null||
83 strtolower($User1Avatar)=="noavatar") {
84 $User1Avatar=$ThemeSet['NoAvatar'];
85 $User1AvatarSize=$ThemeSet['NoAvatarSize']; }
86 $AvatarSize1=explode("x", $User1AvatarSize);
87 $AvatarSize1W=$AvatarSize1[0]; $AvatarSize1H=$AvatarSize1[1];
88 $User1Website=sql_result($reresult,$rei,"Website");
89 $User1Website = urlcheck($User1Website);
90 $BoardWWWChCk = parse_url($Settings['idburl']);
91 $User1WWWChCk = parse_url($User1Website);
92 $opennew = " onclick=\"window.open(this.href);return false;\"";
93 if($BoardWWWChCk['host']==$User1WWWChCk['host']) {
95 $User1PostCount=sql_result($reresult,$rei,"PostCount");
96 $User1IP=sql_result($reresult,$rei,"IP");
97 sql_free_result($reresult);
98 ++
$is; } sql_free_result($result);
99 if($User1Name=="Guest") { $User1Name=$EventGuest;
100 if($User1Name==null) { $User1Name="Guest"; } }
101 if(isset($GroupNamePrefix)&&$GroupNamePrefix!=null) {
102 $User1Name = $GroupNamePrefix.$User1Name; }
103 if(isset($GroupNameSuffix)&&$GroupNameSuffix!=null) {
104 $User1Name = $User1Name.$GroupNameSuffix; }
105 $EventText = url2link($EventText);
106 $EventText = text2icons($EventText,$Settings['sqltable'],$SQLStat);
107 $User1Signature = text2icons($User1Signature,$Settings['sqltable'],$SQLStat);
109 <div
class="TableInfo1Border">
110 <?php
if($ThemeSet['TableStyle']=="div") { ?
>
111 <div
class="TableInfoRow1">
112 <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
>
114 <table
class="TableInfo1">
115 <?php
if($ThemeSet['TableStyle']=="table") { ?
>
116 <tr
class="TableInfoRow1">
117 <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
>
120 <tr
class="TableInfoRow2">
121 <td
class="TableInfoColumn2" style
="vertical-align: middle; width: 160px;">
123 if($User1ID>0&&$User1Hidden=="no") {
125 echo url_maker($exfile['member'],$Settings['file_ext'],"act=view&id=".$User1ID,$Settings['qstr'],$Settings['qsep'],$prexqstr['member'],$exqstr['member']);
126 echo "\">".$User1Name."</a>"; }
127 if($User1ID<=0||
$User1Hidden=="yes") {
128 echo "<span>".$User1Name."</span>"; }
130 <td
class="TableInfoColumn2" style
="vertical-align: middle;">
131 <div style
="float: left; text-align: left;">
132 <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; ?
>
134 <div style
="text-align: right;"> 
;</div
>
137 <tr
class="TableInfoRow3">
138 <td
class="TableInfoColumn3" style
="vertical-align: top; width: 180px;">
139 <?php
// Avatar Table Thanks For SeanJ's Help at http://seanj.jcink.com/
141 <table
class="AvatarTable" style
="width: 100px; height: 100px; text-align: center;">
142 <tr
class="AvatarRow" style
="width: 100%; height: 100%;">
143 <td
class="AvatarRow" style
="width: 100%; height: 100%; text-align: center; vertical-align: middle;">
144 <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;" />
148 <?php
echo $User1Title; ?
><br
/>
149 Group
: <?php
echo $User1Group; ?
><br
/>
151 if($User1ID>0&&$User1Hidden=="no") { echo $User1ID; }
152 if($User1ID<=0||
$User1Hidden=="yes") { echo 0; }
154 Posts
: <?php
echo $User1PostCount; ?
><br
/>
155 Joined
: <?php
echo $User1Joined; ?
><br
/>
156 <?php
if($GroupInfo['HasAdminCP']=="yes") { ?
>
157 User IP
: <a onclick
="window.open(this.href);return false;" href
="<?php echo sprintf($IPCheckURL,$User1IP); ?>">
158 <?php
echo $User1IP; ?
></a
><br
/>
159 <?php
if($ipshow=="two") { ?
>
160 Event IP
: <a onclick
="window.open(this.href);return false;" href
="<?php echo sprintf($IPCheckURL,$EventIP); ?>">
161 <?php
echo $EventIP; ?
></a
><br
/>
164 <td
class="TableInfoColumn3" style
="vertical-align: middle;">
165 <div
class="eventpost"><?php
echo $EventText; ?
></div
>
166 <?php
if(isset($User1Signature)&&$User1Signature!="") { ?
> <br
/>--------------------
167 <div
class="signature"><?php
echo $User1Signature; ?
></div
><?php
} ?
>
170 <tr
class="TableInfoRow4">
171 <td
class="TableInfoColumn4" colspan
="2">
172 <span style
="text-align: left;"> 
;<a href
="<?php
173 if($User1ID>0&&$User1Hidden=="no
"&&isset($ThemeSet['Profile'])&&$ThemeSet['Profile']!=null) {
174 echo url_maker($exfile['member'],$Settings['file_ext'],"act
=view
&id
=".$User1ID,$Settings['qstr'],$Settings['qsep'],$prexqstr['member'],$exqstr['member']); }
175 if(($User1ID<=0||$User1Hidden=="yes
")&&isset($ThemeSet['Profile'])&&$ThemeSet['Profile']!=null) {
176 echo url_maker($exfile['index'],$Settings['file_ext'],"act
=view
",$Settings['qstr'],$Settings['qsep'],$prexqstr['index'],$exqstr['index']); }
177 ?>"><?php
echo $ThemeSet['Profile']; ?
></a
>
178 <?php
if(isset($ThemeSet['WWW'])&&$ThemeSet['WWW']!=null) {
179 echo $ThemeSet['LineDividerTopic']; ?
><a href
="<?php echo $User1Website; ?>"<?php
echo $opennew; ?
>><?php
echo $ThemeSet['WWW']; ?
></a
><?php
} echo $ThemeSet['LineDividerTopic']; ?
><a href
="<?php
180 if($User1ID>0&&$User1Hidden=="no
"&&isset($ThemeSet['PM'])&&$ThemeSet['PM']!=null) {
181 echo url_maker($exfile['messenger'],$Settings['file_ext'],"act
=create
&id
=".$User1ID,$Settings['qstr'],$Settings['qsep'],$prexqstr['messenger'],$exqstr['messenger']); }
182 if(($User1ID<=0||$User1Hidden=="yes
")&&isset($ThemeSet['PM'])&&$ThemeSet['PM']!=null) {
183 echo url_maker($exfile['index'],$Settings['file_ext'],"act
=view
",$Settings['qstr'],$Settings['qsep'],$prexqstr['index'],$exqstr['index']); }
184 ?>"><?php
echo $ThemeSet['PM']; ?
></a
></span
>
188 <?php
} if($_GET['act']=="create") {
189 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));
190 ob_clean(); header("Content-Type: text/plain; charset=".$Settings['charset']);
191 gzip_page($Settings['use_gzip'],$GZipEncode['Type']); session_write_close(); die(); }
192 $UFID = rand_uuid("rand");
193 $_SESSION['UserFormID'] = $UFID;
195 <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']); ?>">Board index
</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
>
196 <div
class="DivNavLinks"> 
;</div
>
197 <div
class="Table1Border">
198 <?php
if($ThemeSet['TableStyle']=="div") { ?
>
199 <div
class="TableRow1">
200 <span style
="text-align: left;">
201 <?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
>
203 <table
class="Table1" id
="MakeEvent">
204 <?php
if($ThemeSet['TableStyle']=="table") { ?
>
205 <tr
class="TableRow1" id
="EventStart">
206 <td
class="TableColumn1" colspan
="2"><span style
="text-align: left;">
207 <?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
>
210 <tr id
="MakeEventRow" class="TableRow2">
211 <td
class="TableColumn2" colspan
="2" style
="width: 100%;">Making a Event
</td
>
213 <tr
class="TableRow3" id
="MkEvent">
214 <td
class="TableColumn3" style
="width: 15%; vertical-align: middle; text-align: center;">
215 <div style
="width: 100%; height: 160px; overflow: auto;">
216 <table style
="width: 100%; text-align: center;"><?php
217 $renee_query=sql_pre_query("SELECT * FROM \"".$Settings['sqltable']."smileys\" WHERE \"Display\"='yes'", array(null));
218 $renee_result=sql_query($renee_query,$SQLStat);
219 $renee_num=sql_num_rows($renee_result);
220 $renee_s=0; $SmileRow=0; $SmileCRow=0;
221 while ($renee_s < $renee_num) { ++
$SmileRow;
222 $FileName=sql_result($renee_result,$renee_s,"FileName");
223 $SmileName=sql_result($renee_result,$renee_s,"SmileName");
224 $SmileText=sql_result($renee_result,$renee_s,"SmileText");
225 $SmileDirectory=sql_result($renee_result,$renee_s,"Directory");
226 $ShowSmile=sql_result($renee_result,$renee_s,"Display");
227 $ReplaceType=sql_result($renee_result,$renee_s,"ReplaceCI");
228 if($SmileRow==1) { ?
><tr
>
229 <?php
} if($SmileRow<5) { ++
$SmileCRow; ?
>
230 <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
>
231 <?php
} if($SmileRow==5) { ++
$SmileCRow; ?
>
232 <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
>
233 <?php
$SmileCRow=0; $SmileRow=0; }
235 if($SmileCRow<5&&$SmileCRow!=0) {
236 $SmileCRowL = 5 - $SmileCRow;
237 echo "<td colspan=\"".$SmileCRowL."\"> </td></tr>"; }
239 sql_free_result($renee_result);
241 <td
class="TableColumn3" style
="width: 85%;">
242 <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']); ?>">
243 <table style
="text-align: left;">
244 <tr style
="text-align: left;">
245 <td style
="width: 50%;"><label
class="TextBoxLabel" for="EventName">Insert Event Name
:</label
></td
>
246 <td style
="width: 50%;"><input maxlength
="30" type
="text" name
="EventName" class="TextBox" id
="EventName" size
="20" /></td
>
247 </tr
><?php
if($_SESSION['UserGroup']==$Settings['GuestGroup']) { ?
><tr style
="text-align: left;">
248 <td style
="width: 50%;"><label
class="TextBoxLabel" for="GuestName">Insert Guest Name
:</label
></td
>
249 <?php
if(!isset($_SESSION['GuestName'])) { ?
>
250 <td style
="width: 50%;"><input maxlength
="25" type
="text" name
="GuestName" class="TextBox" id
="GuestName" size
="20" /></td
>
251 <?php
} if(isset($_SESSION['GuestName'])) { ?
>
252 <td style
="width: 50%;"><input maxlength
="25" type
="text" name
="GuestName" class="TextBox" id
="GuestName" size
="20" value
="<?php echo $_SESSION['GuestName']; ?>" /></td
>
253 <?php
} ?
></tr
><?php
} ?
><tr style
="text-align: left;">
254 <td style
="width: 50%;"><label
class="TextBoxLabel" for="EventStart">Insert Event Start
:</label
></td
>
255 <td style
="width: 50%;"><input maxlength
="10" type
="text" name
="EventStart" class="TextBox" id
="EventStart" size
="20" value
="MM/DD/YYYY" /></td
>
256 </tr
><tr style
="text-align: left;">
257 <td style
="width: 50%;"><label
class="TextBoxLabel" for="EventEnd">Insert Event End
:</label
></td
>
258 <td style
="width: 50%;"><input maxlength
="10" type
="text" name
="EventEnd" class="TextBox" id
="EventEnd" size
="20" value
="MM/DD/YYYY" /></td
>
261 <table style
="text-align: left;">
262 <tr style
="text-align: left;">
263 <td style
="width: 100%;">
264 <label
class="TextBoxLabel" for="EventText">Insert Event Text
:</label
><br
/>
265 <textarea rows
="10" name
="EventText" id
="EventText" cols
="40" class="TextBox"></textarea
><br
/>
266 <?php
if($_SESSION['UserGroup']==$Settings['GuestGroup']&&$Settings['captcha_guest']=="on") { ?
>
267 <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
/>
268 <input maxlength
="25" type
="text" class="TextBox" name
="signcode" size
="20" id
="signcode" value
="Enter SignCode" /><br
/>
270 <input type
="hidden" name
="act" value
="makeevents" style
="display: none;" />
271 <input type
="hidden" style
="display: none;" name
="fid" value
="<?php echo $UFID; ?>" />
272 <?php
if($_SESSION['UserGroup']!=$Settings['GuestGroup']) { ?
>
273 <input type
="hidden" name
="GuestName" value
="null" style
="display: none;" />
275 <input type
="submit" class="Button" value
="Make Event" name
="make_event" />
276 <input type
="reset" value
="Reset Form" class="Button" name
="Reset_Form" />
279 <tr id
="MkEventEnd" class="TableRow4">
280 <td
class="TableColumn4" colspan
="2"> 
;</td
>
283 <?php
} if($_GET['act']=="makeevent"&&$_POST['act']=="makeevents") {
284 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));
285 ob_clean(); header("Content-Type: text/plain; charset=".$Settings['charset']);
286 gzip_page($Settings['use_gzip'],$GZipEncode['Type']); session_write_close(); die(); }
287 $MyUserID = $_SESSION['UserID']; if($MyUserID=="0"||
$MyUserID==null) { $MyUserID = -1; }
288 $_SESSION['ViewingPage'] = url_maker(null,"no+ext","act=view","&","=",$prexqstr['index'],$exqstr['index']);
289 if($Settings['file_ext']!="no+ext"&&$Settings['file_ext']!="no ext") {
290 $_SESSION['ViewingFile'] = $exfile['index'].$Settings['file_ext']; }
291 if($Settings['file_ext']=="no+ext"||
$Settings['file_ext']=="no ext") {
292 $_SESSION['ViewingFile'] = $exfile['index']; }
293 $_SESSION['PreViewingTitle'] = "Making";
294 $_SESSION['ViewingTitle'] = "Event";
295 $REFERERurl = parse_url($_SERVER['HTTP_REFERER']);
296 $URL['REFERER'] = $REFERERurl['host'];
297 $URL['HOST'] = $_SERVER["SERVER_NAME"];
299 if(!isset($_POST['EventName'])) { $_POST['EventName'] = null; }
300 if(!isset($_POST['EventStart'])) { $_POST['EventStart'] = null; }
301 if(!isset($_POST['EventEnd'])) { $_POST['EventEnd'] = null; }
302 if(!isset($_POST['EventText'])) { $_POST['EventText'] = null; }
303 if(!isset($_POST['GuestName'])) { $_POST['GuestName'] = null; }
304 $TimeIn = explode("/",$_POST['EventStart']);
305 $TimeOut = explode("/",$_POST['EventEnd']);
306 if($_SESSION['UserGroup']==$Settings['GuestGroup']&&
307 $Settings['captcha_guest']=="on") {
308 require($SettDir['inc']."captcha.php"); }
310 <div
class="Table1Border">
311 <?php
if($ThemeSet['TableStyle']=="div") { ?
>
312 <div
class="TableRow1">
313 <span style
="text-align: left;">
314 <?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
>
316 <table
class="Table1">
317 <?php
if($ThemeSet['TableStyle']=="table") { ?
>
318 <tr
class="TableRow1">
319 <td
class="TableColumn1"><span style
="text-align: left;">
320 <?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
>
323 <tr
class="TableRow2">
324 <th
class="TableColumn2" style
="width: 100%; text-align: left;"> 
;Make Event Message
: </th
>
326 <tr
class="TableRow3">
327 <td
class="TableColumn3">
328 <table style
="width: 100%; height: 25%; text-align: center;">
329 <?php
if (pre_strlen($_POST['EventName'])>="30") { $Error="Yes"; ?
>
331 <td
><span
class="TableMessage">
332 <br
/>Your Event Name is too big
.<br
/>
335 <?php
} if($_POST['fid']!=$_SESSION['UserFormID']) { $Error="Yes"; ?
>
337 <td
><span
class="TableMessage">
338 <br
/>Sorry the referering url dose not match our host name
.<br
/>
341 <?php
} if($_SESSION['UserGroup']==$Settings['GuestGroup']&&
342 $Settings['captcha_guest']=="on") {
343 if (PhpCaptcha
::Validate($_POST['signcode'])) {
344 //echo 'Valid code entered';
345 } else { $Error="Yes"; ?
>
347 <td
><span
class="TableMessage">
348 <br
/>Invalid code entered
<br
/>
351 <?php
} } if (pre_strlen($TimeIn[0])<"2") { $Error="Yes"; ?
>
353 <td
><span
class="TableMessage">
354 <br
/>Event Start Month is too small
.<br
/>
357 <?php
} if (pre_strlen($TimeIn[0])>"2") { $Error="Yes"; ?
>
359 <td
><span
class="TableMessage">
360 <br
/>Event Start Month is too big
.<br
/>
363 <?php
} if (pre_strlen($TimeIn[1])<"2") { $Error="Yes"; ?
>
365 <td
><span
class="TableMessage">
366 <br
/>Event Start Day is too small
.<br
/>
369 <?php
} if (pre_strlen($TimeIn[1])>"2") { $Error="Yes"; ?
>
371 <td
><span
class="TableMessage">
372 <br
/>Event Start Day is too big
.<br
/>
375 <?php
} if (pre_strlen($TimeIn[2])<"4") { $Error="Yes"; ?
>
377 <td
><span
class="TableMessage">
378 <br
/>Event Start Year is too small
.<br
/>
381 <?php
} if (pre_strlen($TimeIn[2])>"4") { $Error="Yes"; ?
>
383 <td
><span
class="TableMessage">
384 <br
/>Event Start Year is too big
.<br
/>
387 <?php
} if (pre_strlen($TimeOut[0])<"2") { $Error="Yes"; ?
>
389 <td
><span
class="TableMessage">
390 <br
/>Event End Month is too small
.<br
/>
393 <?php
} if (pre_strlen($TimeOut[0])>"2") { $Error="Yes"; ?
>
395 <td
><span
class="TableMessage">
396 <br
/>Event End Month is too big
.<br
/>
399 <?php
} if (pre_strlen($TimeOut[1])<"2") { $Error="Yes"; ?
>
401 <td
><span
class="TableMessage">
402 <br
/>Event End Day is too small
.<br
/>
405 <?php
} if (pre_strlen($TimeOut[1])>"2") { $Error="Yes"; ?
>
407 <td
><span
class="TableMessage">
408 <br
/>Event End Day is too big
.<br
/>
411 <?php
} if (pre_strlen($TimeOut[2])<"4") { $Error="Yes"; ?
>
413 <td
><span
class="TableMessage">
414 <br
/>Event End Year is too small
.<br
/>
417 <?php
} if (pre_strlen($TimeOut[2])>"4") { $Error="Yes"; ?
>
419 <td
><span
class="TableMessage">
420 <br
/>Event End Year is too big
.<br
/>
423 <?php
} if (checkdate($TimeIn[0],$TimeIn[1],$TimeIn[2])===false) { $Error="Yes"; ?
>
425 <td
><span
class="TableMessage">
426 <br
/>Sorry the event start date is not valid
.<br
/>
429 <?php
} if (checkdate($TimeOut[0],$TimeOut[1],$TimeOut[2])===false) { $Error="Yes"; ?
>
431 <td
><span
class="TableMessage">
432 <br
/>Sorry the event end date is not valid
.<br
/>
435 <?php
} if($_SESSION['UserGroup']==$Settings['GuestGroup']&&
436 pre_strlen($_POST['GuestName'])>="25") { $Error="Yes"; ?
>
438 <td
><span
class="TableMessage">
439 <br
/>You Guest Name is too big
.<br
/>
442 <?php
} if ($Settings['TestReferer']===true) {
443 if ($URL['HOST']!=$URL['REFERER']) { $Error="Yes"; ?
>
445 <td
><span
class="TableMessage">
446 <br
/>Sorry the referering url dose not match our host name
.<br
/>
450 $_POST['EventName'] = stripcslashes(htmlspecialchars($_POST['EventName'], ENT_QUOTES
, $Settings['charset']));
451 //$_POST['EventName'] = preg_replace("/&#(x[a-f0-9]+|[0-9]+);/i", "&#$1;", $_POST['EventName']);
452 $_POST['EventName'] = remove_spaces($_POST['EventName']);
453 $_POST['GuestName'] = stripcslashes(htmlspecialchars($_POST['GuestName'], ENT_QUOTES
, $Settings['charset']));
454 //$_POST['GuestName'] = preg_replace("/&#(x[a-f0-9]+|[0-9]+);/i", "&#$1;", $_POST['GuestName']);
455 $_POST['GuestName'] = remove_spaces($_POST['GuestName']);
456 $_POST['EventText'] = stripcslashes(htmlspecialchars($_POST['EventText'], ENT_QUOTES
, $Settings['charset']));
457 //$_POST['EventText'] = preg_replace("/&#(x[a-f0-9]+|[0-9]+);/i", "&#$1;", $_POST['EventText']);
458 $_POST['EventText'] = remove_bad_entities($_POST['EventText']);
459 //$_POST['EventText'] = remove_spaces($_POST['EventText']);
460 if($_SESSION['UserGroup']==$Settings['GuestGroup']) {
461 if(isset($_POST['GuestName'])&&$_POST['GuestName']!=null) {
462 if($cookieDomain==null) {
463 setcookie("GuestName", $_POST['GuestName'], time() +
(7 * 86400), $cbasedir); }
464 if($cookieDomain!=null) {
465 if($cookieSecure===true) {
466 setcookie("GuestName", $_POST['GuestName'], time() +
(7 * 86400), $cbasedir, $cookieDomain, 1); }
467 if($cookieSecure===false) {
468 setcookie("GuestName", $_POST['GuestName'], time() +
(7 * 86400), $cbasedir, $cookieDomain); } }
469 $_SESSION['GuestName']=$_POST['GuestName']; } }
470 /* <_< iWordFilter >_>
471 by Kazuki Przyborowski - Cool Dude 2k */
472 $katarzynaqy=sql_pre_query("SELECT * FROM \"".$Settings['sqltable']."wordfilter\"", array(null));
473 $katarzynart=sql_query($katarzynaqy,$SQLStat);
474 $katarzynanm=sql_num_rows($katarzynart);
476 while ($katarzynas < $katarzynanm) {
477 $Filter=sql_result($katarzynart,$katarzynas,"FilterWord");
478 $Replace=sql_result($katarzynart,$katarzynas,"Replacement");
479 $CaseInsensitive=sql_result($katarzynart,$katarzynas,"CaseInsensitive");
480 if($CaseInsensitive=="on") { $CaseInsensitive = "yes"; }
481 if($CaseInsensitive=="off") { $CaseInsensitive = "no"; }
482 if($CaseInsensitive!="yes"||
$CaseInsensitive!="no") { $CaseInsensitive = "no"; }
483 $WholeWord=sql_result($katarzynart,$katarzynas,"WholeWord");
484 if($WholeWord=="on") { $WholeWord = "yes"; }
485 if($WholeWord=="off") { $WholeWord = "no"; }
486 if($WholeWord!="yes"&&$WholeWord!="no") { $WholeWord = "no"; }
487 $Filter = preg_quote($Filter, "/");
488 if($CaseInsensitive!="yes"&&$WholeWord=="yes") {
489 $_POST['EventText'] = preg_replace("/\b(".$Filter.")\b/", $Replace, $_POST['EventText']); }
490 if($CaseInsensitive=="yes"&&$WholeWord=="yes") {
491 $_POST['EventText'] = preg_replace("/\b(".$Filter.")\b/i", $Replace, $_POST['EventText']); }
492 if($CaseInsensitive!="yes"&&$WholeWord!="yes") {
493 $_POST['EventText'] = preg_replace("/".$Filter."/", $Replace, $_POST['EventText']); }
494 if($CaseInsensitive=="yes"&&$WholeWord!="yes") {
495 $_POST['EventText'] = preg_replace("/".$Filter."/i", $Replace, $_POST['EventText']); }
496 ++
$katarzynas; } sql_free_result($katarzynart);
497 $lonewolfqy=sql_pre_query("SELECT * FROM \"".$Settings['sqltable']."restrictedwords\" WHERE \"RestrictedEventName\"='yes' or \"RestrictedUserName\"='yes'", array(null));
498 $lonewolfrt=sql_query($lonewolfqy,$SQLStat);
499 $lonewolfnm=sql_num_rows($lonewolfrt);
500 $lonewolfs=0; $RMatches = null; $RGMatches = null;
501 while ($lonewolfs < $lonewolfnm) {
502 $RWord=sql_result($lonewolfrt,$lonewolfs,"Word");
503 $RCaseInsensitive=sql_result($lonewolfrt,$lonewolfs,"CaseInsensitive");
504 if($RCaseInsensitive=="on") { $RCaseInsensitive = "yes"; }
505 if($RCaseInsensitive=="off") { $RCaseInsensitive = "no"; }
506 if($RCaseInsensitive!="yes"||
$RCaseInsensitive!="no") { $RCaseInsensitive = "no"; }
507 $RWholeWord=sql_result($lonewolfrt,$lonewolfs,"WholeWord");
508 if($RWholeWord=="on") { $RWholeWord = "yes"; }
509 if($RWholeWord=="off") { $RWholeWord = "no"; }
510 if($RWholeWord!="yes"||
$RWholeWord!="no") { $RWholeWord = "no"; }
511 $RestrictedEventName=sql_result($lonewolfrt,$lonewolfs,"RestrictedEventName");
512 if($RestrictedEventName=="on") { $RestrictedEventName = "yes"; }
513 if($RestrictedEventName=="off") { $RestrictedEventName = "no"; }
514 if($RestrictedEventName!="yes"||
$RestrictedEventName!="no") { $RestrictedEventName = "no"; }
515 $RestrictedUserName=sql_result($lonewolfrt,$lonewolfs,"RestrictedUserName");
516 if($RestrictedUserName=="on") { $RestrictedUserName = "yes"; }
517 if($RestrictedUserName=="off") { $RestrictedUserName = "no"; }
518 if($RestrictedUserName!="yes"||
$RestrictedUserName!="no") { $RestrictedUserName = "no"; }
519 $RWord = preg_quote($RWord, "/");
520 if($RCaseInsensitive!="yes"&&$RWholeWord=="yes") {
521 if($RestrictedEventName=="yes") {
522 $RMatches = preg_match("/\b(".$RWord.")\b/", $_POST['EventName']);
523 if($RMatches==true) { break 1; } }
524 if($RestrictedUserName=="yes") {
525 $RGMatches = preg_match("/\b(".$RWord.")\b/", $_POST['GuestName']);
526 if($RGMatches==true) { break 1; } } }
527 if($RCaseInsensitive=="yes"&&$RWholeWord=="yes") {
528 if($RestrictedEventName=="yes") {
529 $RMatches = preg_match("/\b(".$RWord.")\b/i", $_POST['EventName']);
530 if($RMatches==true) { break 1; } }
531 if($RestrictedUserName=="yes") {
532 $RGMatches = preg_match("/\b(".$RWord.")\b/i", $_POST['GuestName']);
533 if($RGMatches==true) { break 1; } } }
534 if($RCaseInsensitive!="yes"&&$RWholeWord!="yes") {
535 if($RestrictedEventName=="yes") {
536 $RMatches = preg_match("/".$RWord."/", $_POST['EventName']);
537 if($RMatches==true) { break 1; } }
538 if($RestrictedUserName=="yes") {
539 $RGMatches = preg_match("/".$RWord."/", $_POST['GuestName']);
540 if($RGMatches==true) { break 1; } } }
541 if($RCaseInsensitive=="yes"&&$RWholeWord!="yes") {
542 if($RestrictedEventName=="yes") {
543 $RMatches = preg_match("/".$RWord."/i", $_POST['EventName']);
544 if($RMatches==true) { break 1; } }
545 if($RestrictedUserName=="yes") {
546 $RGMatches = preg_match("/".$RWord."/i", $_POST['GuestName']);
547 if($RGMatches==true) { break 1; } } }
548 ++
$lonewolfs; } sql_free_result($lonewolfrt);
549 if ($_POST['EventName']==null) { $Error="Yes"; ?
>
551 <td
><span
class="TableMessage">
552 <br
/>You need to enter a Event Name
.<br
/>
555 <?php
} if ($_POST['EventText']==null) { $Error="Yes"; ?
>
557 <td
><span
class="TableMessage">
558 <br
/>You need to enter a Event Text
.<br
/>
561 <?php
} if ($_POST['EventStart']==null) { $Error="Yes"; ?
>
563 <td
><span
class="TableMessage">
564 <br
/>You need to enter date
for event to start in MM
/DD
/YYYY format
.<br
/>
567 <?php
} if ($_POST['EventEnd']==null) { $Error="Yes"; ?
>
569 <td
><span
class="TableMessage">
570 <br
/>You need to enter date
for event to end in MM
/DD
/YYYY format
.<br
/>
573 <?php
} if (count($TimeIn)!="3") { $Error="Yes"; ?
>
575 <td
><span
class="TableMessage">
576 <br
/>You need to enter valid date
for event to start in MM
/DD
/YYYY format
.<br
/>
579 <?php
} if (count($TimeOut)!="3") { $Error="Yes"; ?
>
581 <td
><span
class="TableMessage">
582 <br
/>You need to enter valid date
for event to end in MM
/DD
/YYYY format
.<br
/>
585 <?php
} if (!is_numeric($TimeIn[0])||
!is_numeric($TimeIn[1])||
!is_numeric($TimeIn[2])) { $Error="Yes"; ?
>
587 <td
><span
class="TableMessage">
588 <br
/>You need to enter valid date
for event to start in MM
/DD
/YYYY format
.<br
/>
591 <?php
} if (!is_numeric($TimeOut[0])||
!is_numeric($TimeOut[1])||
!is_numeric($TimeOut[2])) { $Error="Yes"; ?
>
593 <td
><span
class="TableMessage">
594 <br
/>You need to enter valid date
for event to end in MM
/DD
/YYYY format
.<br
/>
597 <?php
} if (!isset($TimeIn[0])||
!isset($TimeIn[1])||
!isset($TimeIn[2])) { $Error="Yes"; ?
>
599 <td
><span
class="TableMessage">
600 <br
/>You need to enter valid date
for event to start in MM
/DD
/YYYY format
.<br
/>
603 <?php
} if (!isset($TimeOut[0])||
!isset($TimeOut[1])||
!isset($TimeOut[2])) { $Error="Yes"; ?
>
605 <td
><span
class="TableMessage">
606 <br
/>You need to enter valid date
for event to end in MM
/DD
/YYYY format
.<br
/>
609 <?php
} if($_SESSION['UserGroup']==$Settings['GuestGroup']&&
610 $_POST['GuestName']==null) { $Error="Yes"; ?
>
612 <td
><span
class="TableMessage">
613 <br
/>You need to enter a Guest Name
.<br
/>
616 <?php
} if($_SESSION['UserGroup']==$Settings['GuestGroup']&&
617 $RGMatches==true) { $Error="Yes"; ?
>
619 <td
><span
class="TableMessage">
620 <br
/>This Guest Name is restricted to
use.<br
/>
623 <?php
} if($GroupInfo['CanAddEvents']=="no") { $Error="Yes"; ?
>
625 <td
><span
class="TableMessage">
626 <br
/>You
do not have permission to make a event here
.<br
/>
629 <?php
} if($RMatches==true) { $Error="Yes"; ?
>
631 <td
><span
class="TableMessage">
632 <br
/>This User Name is restricted to
use.<br
/>
635 <?php
} if ($Error=="Yes") {
636 redirect("refresh",$rbasedir.url_maker($exfile['index'],$Settings['file_ext'],"act=view",$Settings['qstr'],$Settings['qsep'],$prexqstr['index'],$exqstr['index'],false),"4"); ?
>
638 <td
><span
class="TableMessage">
639 <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
/> 
;
642 <?php
} if ($Error!="Yes") {
643 $TimeSIn = mktime(0,0,0,$TimeIn[0],$TimeIn[1],$TimeIn[2]);
644 $TimeSOut = mktime(23,59,59,$TimeOut[0],$TimeOut[1],$TimeOut[2]);
645 $EventMonth=GMTimeChange("m",$TimeSIn,0,0,"off");
646 $EventMonthEnd=GMTimeChange("m",$TimeSOut,0,0,"off");
647 $EventDay=GMTimeChange("d",$TimeSIn,0,0,"off");
648 $EventDayEnd=GMTimeChange("d",$TimeSOut,0,0,"off");
649 $EventYear=GMTimeChange("Y",$TimeSIn,0,0,"off");
650 $EventYearEnd=GMTimeChange("Y",$TimeSOut,0,0,"off");
652 $User1IP=$_SERVER['REMOTE_ADDR'];
653 if($_SESSION['UserGroup']==$Settings['GuestGroup']) { $User1Name = $_POST['GuestName']; }
654 if($_SESSION['UserGroup']!=$Settings['GuestGroup']) { $User1Name = $_SESSION['MemberName']; }
655 $query = sql_pre_query("INSERT INTO ".$Settings['sqltable']."events (\"UserID\", \"GuestName\", \"EventName\", \"EventText\", \"TimeStamp\", \"TimeStampEnd\", \"EventMonth\", \"EventMonthEnd\", \"EventDay\", \"EventDayEnd\", \"EventYear\", \"EventYearEnd\", \"IP\") VALUES\n".
656 "(%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));
657 sql_query($query,$SQLStat);
658 $eventid = sql_get_next_id($Settings['sqltable'],"events",$SQLStat);
659 redirect("refresh",$rbasedir.url_maker($exfile['event'],$Settings['file_ext'],"act=event&id=".$eventid,$Settings['qstr'],$Settings['qsep'],$prexqstr['event'],$exqstr['event'],FALSE),"3");
661 <td
><span
class="TableMessage"><br
/>
662 Event
<?php
echo $_POST['EventName']; ?
> was started
.<br
/>
663 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
/> 
;
669 <tr
class="TableRow4">
670 <td
class="TableColumn4"> 
;</td
>
674 <div
class="DivEvents"> 
;</div
>