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-2007 Cool Dude 2k - http://intdb.sourceforge.net/
12 Copyright 2004-2007 Game Maker 2k - http://upload.idb.s1.jcink.com/
14 $FileInfo: members.php - Last Update: 05/09/2007 SVN 1 - Author: cooldude2k $
16 $File1Name = dirname($_SERVER['SCRIPT_NAME'])."/";
17 $File2Name = $_SERVER['SCRIPT_NAME'];
18 $File3Name=str_replace($File1Name, null, $File2Name);
19 if ($File3Name=="members.php"||$File3Name=="/members.php") {
23 <div class="Table1Border">
24 <table class="Table1">
26 if($_GET['act']=="list") {
28 <tr class="TableRow1">
29 <td class="TableRow1" colspan="7"><span style="float: left;">
30 <?php echo $ThemeSet['TitleIcon'] ?><a href="<?php echo url_maker($exfile['member'],$Settings['file_ext'],"act=list",$Settings['qstr'],$Settings['qsep'],$prexqstr['member'],$exqstr['member']); ?>">Member List</a>
31 </span><span style="float: right;"> </span></td>
33 <tr id="Member" class="TableRow2">
34 <th class="TableRow2" style="width: 5%;">ID</th>
35 <th class="TableRow2" style="width: 28%;">Name</th>
36 <th class="TableRow2" style="width: 10%;">Group</th>
37 <th class="TableRow2" style="width: 10%;">Posts</th>
38 <th class="TableRow2" style="width: 20%;">Joined</th>
39 <th class="TableRow2" style="width: 20%;">Last Active</th>
40 <th class="TableRow2" style="width: 7%;">Website</th>
44 $orderlist = "order by `ID` asc";
45 if($_GET['orderby']==null) {
46 if($_GET['sortby']!=null) {
47 $_GET['orderby'] = $_GET['sortby']; } }
48 if($_GET['orderby']==null) { $_GET['orderby'] = "joined"; }
49 if($_GET['orderby']!=null) {
50 if($_GET['orderby']=="id") { $orderlist = "order by `ID`"; }
51 if($_GET['orderby']=="name") { $orderlist = "order by `Name`"; }
52 if($_GET['orderby']=="joined") { $orderlist = "order by `Joined`"; }
53 if($_GET['orderby']=="active") { $orderlist = "order by `LastActive`"; }
54 if($_GET['orderby']=="posts") { $orderlist = "order by `PostCount`"; }
55 if($_GET['orderby']=="offset") { $orderlist = "order by `TimeZone`"; } }
56 if($_GET['ordertype']==null) {
57 if($_GET['sorttype']!=null) {
58 $_GET['ordertype'] = $_GET['sorttype']; } }
59 if($_GET['ordertype']==null) { $_GET['ordertype'] = "asc"; }
60 if($_GET['ordertype']!=null) {
61 if($_GET['ordertype']=="ascending") { $orderlist .= " asc"; }
62 if($_GET['ordertype']=="descending") { $orderlist .= " desc"; }
63 if($_GET['ordertype']=="asc") { $orderlist .= " asc"; }
64 if($_GET['ordertype']=="desc") { $orderlist .= " desc"; } }
65 if(!is_numeric($_GET['gid'])) { $_GET['gid'] = null; }
66 if($_GET['gid']!=null&&$_GET['groupid']==null) { $_GET['groupid'] = $_GET['gid']; }
67 if(!is_numeric($_GET['groupid'])) { $_GET['groupid'] = null; }
68 if($_GET['groupid']==null) {
69 $query = query("select * from ".$Settings['sqltable']."members ".$orderlist, array(null)); }
70 if($_GET['groupid']!=null) {
71 $query = query("select * from ".$Settings['sqltable']."members where GroupID=%i ".$orderlist, array($_GET['groupid'])); }
72 $result=mysql_query($query);
73 $num=mysql_num_rows($result);
76 $MemList['ID']=mysql_result($result,$i,"id");
77 $MemList['Name']=mysql_result($result,$i,"Name");
78 $MemList['Email']=mysql_result($result,$i,"Email");
79 $MemList['GroupID']=mysql_result($result,$i,"GroupID");
80 $MemList['WarnLevel']=mysql_result($result,$i,"WarnLevel");
81 $MemList['Interests']=mysql_result($result,$i,"Interests");
82 $MemList['Title']=mysql_result($result,$i,"Title");
83 $MemList['Joined']=mysql_result($result,$i,"Joined");
84 $MemList['Joined']=GMTimeChange("F j Y, g:i a",$MemList['Joined'],$_SESSION['UserTimeZone'],0,$_SESSION['UserDST']);
85 $MemList['LastActive']=mysql_result($result,$i,"LastActive");
86 $MemList['LastActive']=GMTimeChange("F j Y, g:i a",$MemList['LastActive'],$_SESSION['UserTimeZone'],0,$_SESSION['UserDST']);
87 $MemList['Website']=mysql_result($result,$i,"Website");
88 $MemList['Gender']=mysql_result($result,$i,"Gender");
89 $MemList['PostCount']=mysql_result($result,$i,"PostCount");
90 $MemList['TimeZone']=mysql_result($result,$i,"TimeZone");
91 $MemList['DST']=mysql_result($result,$i,"DST");
92 $MemList['IP']=mysql_result($result,$i,"IP");
93 $gquery = query("select * from ".$Settings['sqltable']."groups where ID=%i", array($MemList['GroupID']));
94 $gresult=mysql_query($gquery);
95 $MemList['Group']=mysql_result($gresult,0,"Name");
96 @mysql_free_result($gresult);
97 $membertitle = " ".$ThemeSet['TitleDivider']." Member List";
98 if($MemList['Group']!=$Settings['GuestGroup']) {
100 <tr class="TableRow3" id="Member<?php echo $MemList['ID']; ?>">
101 <td class="TableRow3" style="text-align: center;"><?php echo $MemList['ID']; ?></td>
102 <td class="TableRow3"> <a href="<?php echo url_maker($exfile['member'],$Settings['file_ext'],"act=view&id=".$MemList['ID'],$Settings['qstr'],$Settings['qsep'],$prexqstr['member'],$exqstr['member']); ?>"><?php echo $MemList['Name']; ?></a></td>
103 <td class="TableRow3" style="text-align: center;"><a href="<?php echo url_maker($exfile['member'],$Settings['file_ext'],"act=list&gid=".$MemList['GroupID'],$Settings['qstr'],$Settings['qsep'],$prexqstr['member'],$exqstr['member']); ?>"><?php echo $MemList['Group']; ?></a></td>
104 <td class="TableRow3" style="text-align: center;"><?php echo $MemList['PostCount']; ?></td>
105 <td class="TableRow3" style="text-align: center;"><?php echo $MemList['Joined']; ?></td>
106 <td class="TableRow3" style="text-align: center;"><?php echo $MemList['LastActive']; ?></td>
107 <td class="TableRow3" style="text-align: center;"><a href="<?php echo $MemList['Website']; ?>" onclick="window.open(this.href);return false;">Website</a></td>
110 ++$i; } @mysql_free_result($result);
112 <tr id="CatEnd" class="TableRow4">
113 <td class="TableRow4" colspan="7"> </td>
116 if($_GET['act']=="view") { ?>
117 <tr class="TableRow1">
118 <td class="TableRow1" colspan="2"><span style="float: left;">
119 <?php echo $ThemeSet['TitleIcon'] ?><a href="<?php echo url_maker($exfile['member'],$Settings['file_ext'],"act=view&id=".$_GET['id'],$Settings['qstr'],$Settings['qsep'],$prexqstr['member'],$exqstr['member']); ?>">Viewing Profile</a>
120 </span><span style="float: right;"> </span></td>
122 <tr id="Member" class="TableRow2">
123 <th class="TableRow2" style="width: 50%;">Avatar</th>
124 <th class="TableRow2" style="width: 50%;">User Info</th>
127 $query = query("select * from ".$Settings['sqltable']."members where ID=%i", array($_GET['id']));
128 $result=mysql_query($query);
129 $num=mysql_num_rows($result);
131 if($num==0||$_GET['id']=="-1") { redirect("location",$basedir.url_maker($exfile['index'],$Settings['file_ext'],"act=view",$Settings['qstr'],$Settings['qsep'],$prexqstr['index'],$exqstr['index'],false)); }
132 $ViewMem['ID']=mysql_result($result,$i,"id");
133 $ViewMem['Name']=mysql_result($result,$i,"Name");
134 $ViewMem['Signature']=mysql_result($result,$rei,"Signature");
135 $ViewMem['Avatar']=mysql_result($result,$rei,"Avatar");
136 $ViewMem['AvatarSize']=mysql_result($result,$rei,"AvatarSize");
137 $ViewMem['Email']=mysql_result($result,$i,"Email");
138 $ViewMem['GroupID']=mysql_result($result,$i,"GroupID");
139 $ViewMem['WarnLevel']=mysql_result($result,$i,"WarnLevel");
140 $ViewMem['Interests']=mysql_result($result,$i,"Interests");
141 $ViewMem['Title']=mysql_result($result,$i,"Title");
142 $ViewMem['Joined']=mysql_result($result,$i,"Joined");
143 $ViewMem['Joined']=GMTimeChange("M j Y, g:i a",$ViewMem['Joined'],$_SESSION['UserTimeZone'],0,$_SESSION['UserDST']);
144 $ViewMem['LastActive']=mysql_result($result,$i,"LastActive");
145 $ViewMem['LastActive']=GMTimeChange("M j Y, g:i a",$ViewMem['LastActive'],$_SESSION['UserTimeZone'],0,$_SESSION['UserDST']);
146 $ViewMem['Website']=mysql_result($result,$i,"Website");
147 $ViewMem['Gender']=mysql_result($result,$i,"Gender");
148 $ViewMem['PostCount']=mysql_result($result,$i,"PostCount");
149 $ViewMem['TimeZone']=mysql_result($result,$i,"TimeZone");
150 $ViewMem['DST']=mysql_result($result,$i,"DST");
151 unset($dstake); $dstake = null;
152 if($ViewMem['DST']=="on") {
153 if($dstake!="done") {
154 if($ViewMem['TimeZone']>=0) { $dstake = "done";
155 $ViewMem['TimeZone'] = $ViewMem['TimeZone']-1; } }
156 if($dstake!="done") {
157 if($ViewMem['TimeZone']<0) { $dstake = "done";
158 $ViewMem['TimeZone'] = $ViewMem['TimeZone']+1; } } }
159 $ViewMem['IP']=mysql_result($result,$i,"IP");
160 $gquery = query("select * from ".$Settings['sqltable']."groups where ID=%i", array($ViewMem['GroupID']));
161 $gresult=mysql_query($gquery);
162 $ViewMem['Group']=mysql_result($gresult,0,"Name");
163 @mysql_free_result($gresult);
164 $membertitle = " ".$ThemeSet['TitleDivider']." Viewing Profile ".$ViewMem['Name'];
165 if ($ViewMem['Avatar']=="http://"||$ViewMem['Avatar']==null) {
166 $ViewMem['Avatar']=$ThemeSet['NoAvatar'];
167 $ViewMem['AvatarSize']=$ThemeSet['NoAvatarSize']; }
168 $AvatarSize1=explode("x", $ViewMem['AvatarSize']);
169 $AvatarSize1W=$AvatarSize1[0]; $AvatarSize1H=$AvatarSize1[1];
170 $ViewMem['Signature'] = text2icons($ViewMem['Signature'],$Settings['sqltable']);
171 if($_GET['view']==null) { $_GET['view'] = "profile"; }
172 if($_GET['view']!="profile"&&$_GET['view']!="avatar"&&
173 $_GET['view']!="website"&&$_GET['view']!="homepage") { $_GET['view'] = "profile"; }
174 if($_GET['view']=="avatar") {
175 @session_write_close();
176 @header("Location: ".$ViewMem['Avatar']); }
177 if($_GET['view']=="website"||$_GET['view']=="homepage") {
178 if ($ViewMem['Website']!="http://"&&$ViewMem['Website']!=null) {
179 @session_write_close();
180 @header("Location: ".$ViewMem['Website']); }
181 if ($ViewMem['Website']=="http://"||$ViewMem['Website']==null) {
182 @session_write_close();
183 @header("Location: ".$BoardURL."index.php?act=view"); } }
185 <tr class="TableRow3" id="MemberProfile">
186 <td class="TableRow3">
187 <?php /* Avatar Table Thanks For SeanJ's Help at http://seanj.jcink.com/ */ ?>
188 <table class="AvatarTable" style="width: 100%; height: 100px; text-align: center;">
189 <tr class="AvatarRow" style="width: 100px; height: 100px;">
190 <td class="AvatarRow" style="width: 100%; height: 100%; text-align: center; vertical-align: middle;">
191 <img src="<?php echo $ViewMem['Avatar']; ?>" alt="<?php echo $ViewMem['Name']; ?>'s Avatar" title="<?php echo $ViewMem['Name']; ?>'s Avatar" style="border: 0px; width: <?php echo $AvatarSize1W; ?>px; height: <?php echo $AvatarSize1H; ?>px;" />
195 <div style="text-align: center;">
196 Name: <?php echo $ViewMem['Name']; ?><br />
197 Title: <?php echo $ViewMem['Title']; ?></div>
199 <td class="TableRow3">
200 User Name: <?php echo $ViewMem['Name']; ?><br />
201 User Title: <?php echo $ViewMem['Title']; ?><br />
202 User Group: <?php echo $ViewMem['Group']; ?><br />
203 User Joined: <?php echo $ViewMem['Joined']; ?><br />
204 Last Active: <?php echo $ViewMem['LastActive']; ?><br />
205 User Time: <?php echo GMTimeGet("M j Y, g:i a",$ViewMem['TimeZone']); ?><br />
206 User Website: <a href="<?php echo $ViewMem['Website']; ?>" onclick="window.open(this.href);return false;">Website</a><br />
207 Post Count: <?php echo $ViewMem['PostCount']; ?><br />
208 Interests: <?php echo $ViewMem['Interests']; ?><br />
211 <tr class="TableRow4">
212 <td class="TableRow4" colspan="2"> </td>
214 <?php } @mysql_free_result($result);
215 if($_GET['act']=="logout") {
217 @setcookie("MemberName", null, GMTimeStamp() - 3600, $basedir);
218 @setcookie("UserID", null, GMTimeStamp() - 3600, $basedir);
219 @setcookie("SessPass", null, GMTimeStamp() - 3600, $basedir);
220 @setcookie(session_name(), "", GMTimeStamp() - 3600, $basedir);
221 unset($_COOKIE[session_name()]);
225 @redirect("location",$basedir.url_maker($exfile['member'],$Settings['file_ext'],"act=login",$Settings['qstr'],$Settings['qsep'],$prexqstr['member'],$exqstr['member'],false));
228 if($_GET['act']=="login")
230 $membertitle = " ".$ThemeSet['TitleDivider']." Login";
232 <tr class="TableRow1">
233 <td class="TableRow1"><span style="float: left;">
234 <?php echo $ThemeSet['TitleIcon'] ?><a href="<?php echo url_maker($exfile['member'],$Settings['file_ext'],"act=login",$Settings['qstr'],$Settings['qsep'],$prexqstr['member'],$exqstr['member']); ?>">Log in</a>
235 </span><span style="float: right;"> </span></td>
237 <tr class="TableRow2">
238 <th class="TableRow2" style="width: 100%; text-align: left;"> Inert your login info: </th>
240 <tr class="TableRow3">
241 <td class="TableRow3">
242 <form method="post" action="<?php echo url_maker($exfile['member'],$Settings['file_ext'],"act=login_now",$Settings['qstr'],$Settings['qsep'],$prexqstr['member'],$exqstr['member']); ?>">
243 <table style="text-align: left;">
244 <tr style="text-align: left;">
245 <td style="width: 30%;"><label class="TextBoxLabel" for="username">Enter UserName: </label></td>
246 <td style="width: 70%;"><input class="TextBox" id="username" type="text" name="username" /></td>
248 <td style="width: 30%;"><label class="TextBoxLabel" for="userpass">Enter Password: </label></td>
249 <td style="width: 70%;"><input class="TextBox" id="userpass" type="password" name="userpass" maxlength="30" /></td>
251 <td style="width: 30%;"><label class="TextBoxLabel" title="Store userinfo as a cookie so you dont need to login again." for="storecookie">Store as cookie?</label></td>
252 <td style="width: 70%;"><select id="storecookie" name="storecookie" class="TextBox">
253 <option value="true">Yes</option>
254 <option value="false">No</option>
257 <table style="text-align: left;">
258 <tr style="text-align: left;">
259 <td style="width: 100%;">
260 <input type="hidden" name="act" value="loginmember" style="display: none;" />
261 <input class="Button" type="submit" value="Log in" />
266 <tr class="TableRow4">
267 <td class="TableRow4"> </td>
269 <?php } if($_POST['act']=="loginmember") {
270 $membertitle = " ".$ThemeSet['TitleDivider']." Login";
271 $REFERERurl = parse_url($_SERVER['HTTP_REFERER']);
272 $URL['REFERER'] = $REFERERurl['host'];
273 $URL['HOST'] = $_SERVER["SERVER_NAME"];
274 $REFERERurl = null; unset($REFERERurl);
276 <tr class="TableRow1">
277 <td class="TableRow1">
278 <span style="float: left;"> <a href="<?php echo url_maker($exfile['member'],$Settings['file_ext'],"act=login",$Settings['qstr'],$Settings['qsep'],$prexqstr['member'],$exqstr['member']); ?>">Log in</a></span>
279 <span style="float: right;"> </span></td>
281 <tr class="TableRow2">
282 <th class="TableRow2" style="width: 100%; text-align: left;"> Login Message: </th>
284 <tr class="TableRow3">
285 <td class="TableRow3">
286 <table style="width: 100%; height: 25%; text-align: center;">
288 if (strlen($_POST['userpass'])=="30") { $Error="Yes"; ?>
290 <td><span class="TableMessage">
291 <br />Your password is too big.<br />
294 <?php } if (strlen($_POST['username'])=="20") { $Error="Yes"; ?>
296 <td><span class="TableMessage">
297 <br />Your user name is too big.<br />
300 <?php } if ($Settings['TestReferer']==true) {
301 if ($URL['HOST']!=$URL['REFERER']) { $Error="Yes"; ?>
303 <td><span class="TableMessage">
304 <br />Sorry the referering url dose not match our host name.<br />
309 @redirect("refresh",$basedir.url_maker($exfile['member'],$Settings['file_ext'],"act=login",$Settings['qstr'],$Settings['qsep'],$prexqstr['member'],$exqstr['member'],false),"4"); }
311 $YourName = stripcslashes(htmlspecialchars($_POST['username'], ENT_QUOTES));
312 $YourName = preg_replace("/&#(x[a-f0-9]+|[0-9]+);/i", "&#$1;", $YourName);
313 $YourName = @remove_spaces($YourName);
315 $querylog = query("select * from ".$Settings['sqltable']."members where Name = '%s'", array($YourName));
316 $resultlog=mysql_query($querylog);
317 $numlog=mysql_num_rows($resultlog);
320 $YourPassTry=mysql_result($resultlog,$i,"Password");
321 $HashType=mysql_result($resultlog,$i,"HashType");
322 $JoinedPass=mysql_result($resultlog,$i,"Joined");
323 $HashSalt=mysql_result($resultlog,$i,"Salt");
325 if($HashType=="ODFH") {
326 $YourPassword = sha1(md5($_POST['userpass'])); }
327 if($HashType=="DF4H") {
328 $YourPassword = b64e_hmac($_POST['userpass'],$JoinedPass,$HashSalt,"sha1"); }
329 if($HashType=="iDBH"||$UpdateHash!=true) {
330 $YourPassword = b64e_hmac($_POST['userpass'],$JoinedPass,$HashSalt,"sha1"); }
331 if($YourPassword==$YourPassTry) {
333 } if($YourPassword==$YourPassTry) {
335 $YourIDM=mysql_result($resultlog,$i,"id");
336 $YourNameM=mysql_result($resultlog,$i,"Name");
337 $YourPassM=mysql_result($resultlog,$i,"Password");
338 $YourGroupM=mysql_result($resultlog,$i,"GroupID");
339 $gquery = query("select * from ".$Settings['sqltable']."groups where ID=%i", array($YourGroupM));
340 $gresult=mysql_query($gquery);
341 $YourGroupM=mysql_result($gresult,0,"Name");
342 @mysql_free_result($gresult);
343 $YourTimeZoneM=mysql_result($resultlog,$i,"TimeZone");
344 $YourDSTM=mysql_result($resultlog,$i,"DST");
345 $JoinedDate=mysql_result($resultlog,$i,"Joined");
346 $UseTheme=mysql_result($resultlog,$i,"UseTheme");
347 $NewHashSalt = salt_hmac();
348 $NewPassword = b64e_hmac($_POST['userpass'],$JoinedPass,$NewHashSalt,"sha1");
349 $NewDay=GMTimeStamp();
350 $NewIP=$_SERVER['REMOTE_ADDR'];
351 $queryup = query("update ".$Settings['sqltable']."members set Password='%s',HashType='iDBH',LastActive='%s',IP='%s',Salt='%s' WHERE id=%i", array($NewPassword,$NewDay,$NewIP,$NewHashSalt,$YourIDM));
352 mysql_query($queryup);
353 @mysql_free_result($resultlog); @mysql_free_result($queryup);
354 //session_regenerate_id();
355 $_SESSION['Theme']=$UseTheme;
356 $_SESSION['MemberName']=$YourNameM;
357 $_SESSION['UserID']=$YourIDM;
358 $_SESSION['UserTimeZone']=$YourTimeZoneM;
359 $_SESSION['UserGroup']=$YourGroupM;
360 $_SESSION['UserDST']=$YourDSTM;
361 if($_POST['storecookie']==true) {
362 setcookie("MemberName", $YourNameM, time() + (7 * 86400), $basedir);
363 setcookie("UserID", $YourIDM, time() + (7 * 86400), $basedir);
364 setcookie("SessPass", $NewPassword, time() + (7 * 86400), $basedir); }
366 //echo "Password was not right or user not found!! <_< ";
368 <?php if($passright==true) {
369 @redirect("refresh",$basedir.url_maker($exfile['index'],$Settings['file_ext'],"act=view",$Settings['qstr'],$Settings['qsep'],$prexqstr['index'],$exqstr['index'],false),"3"); ?>
371 <td><span class="TableMessage">
372 <br />Welcome to the Board <?php echo $_SESSION['MemberName']; ?>. ^_^<br />
373 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 continue to board.<br />
376 <?php } if($passright==false) { ?>
378 <td><span class="TableMessage">
379 <br />Password was not right or user not found!! <_<<br />
380 Click <a href="<?php echo url_maker($exfile['member'],$Settings['file_ext'],"act=login",$Settings['qstr'],$Settings['qsep'],$exqstr['member'],$prexqstr['member']); ?>">here</a> to try again.<br />
386 <tr class="TableRow4">
387 <td class="TableRow4"> </td>
390 if($_GET['act']=="signup")
392 $membertitle = " ".$ThemeSet['TitleDivider']." Signing up"; ?>
393 <tr class="TableRow1">
394 <td class="TableRow1"><span style="float: left;">
395 <?php echo $ThemeSet['TitleIcon'] ?><a href="<?php echo url_maker($exfile['member'],$Settings['file_ext'],"act=signup",$Settings['qstr'],$Settings['qsep'],$prexqstr['member'],$exqstr['member']); ?>">Register</a>
396 </span><span style="float: right;"> </span></td>
398 <tr class="TableRow2">
399 <th class="TableRow2" style="width: 100%; text-align: left;"> Inert your user info: </th>
401 <tr class="TableRow3">
402 <td class="TableRow3">
403 <form method="post" action="<?php echo url_maker($exfile['member'],$Settings['file_ext'],"act=makemember",$Settings['qstr'],$Settings['qsep'],$prexqstr['member'],$exqstr['member']); ?>">
404 <table style="text-align: left;">
405 <tr style="text-align: left;">
406 <td style="width: 30%;"><label class="TextBoxLabel" for="Name">Insert a UserName:</label></td>
407 <td style="width: 70%;"><input type="text" class="TextBox" name="Name" size="20" id="Name" /></td>
409 <td><label class="TextBoxLabel" for="Password">Insert a Password:</label></td>
410 <td><input type="password" class="TextBox" name="Password" size="20" id="Password" maxlength="30" /></td>
412 <td><label class="TextBoxLabel" for="RePassword">ReInsert a Password:</label></td>
413 <td><input type="password" class="TextBox" name="RePassword" size="20" id="RePassword" maxlength="30" /></td>
415 <td><label class="TextBoxLabel" for="Email">Insert Your Email:</label></td>
416 <td><input type="text" class="TextBox" name="Email" size="20" id="Email" /></td>
418 <td><label class="TextBoxLabel" for="YourOffSet">Your TimeZone:</label></td>
419 <td><select id="YourOffSet" name="YourOffSet" class="TextBox"><?php
420 $plusi = 1; $minusi = 12;
421 $plusnum = 13; $minusnum = 0;
422 while ($minusi > $minusnum) {
423 if($Settings['DefaultTimeZone']==-$minusi) {
424 echo "<option selected=\"selected\" value=\"-".$minusi."\">GMT - ".$minusi.":00 hours</option>\n"; }
425 if($Settings['DefaultTimeZone']!=-$minusi) {
426 echo "<option value=\"-".$minusi."\">GMT - ".$minusi.":00 hours</option>\n"; }
428 if($Settings['DefaultTimeZone']==0) { ?>
429 <option selected="selected" value="0">GMT +/- 0:00 hours</option>
430 <?php } if($Settings['DefaultTimeZone']!=0) { ?>
431 <option value="0">GMT +/- 0:00 hours</option>
433 while ($plusi < $plusnum) {
434 if($Settings['DefaultTimeZone']==$plusi) {
435 echo "<option selected=\"selected\" value=\"".$plusi."\">GMT + ".$plusi.":00 hours</option>\n"; }
436 if($Settings['DefaultTimeZone']!=$plusi) {
437 echo "<option value=\"".$plusi."\">GMT + ".$plusi.":00 hours</option>\n"; }
441 <td style="width: 40%;"><label class="TextBoxLabel" for="DST">Is <span title="Daylight Savings Time">DST</span> / <span title="Summer Time">ST</span> on or off:</label></td>
442 <td style="width: 60%;"><select id="DST" name="DST" class="TextBox"><?php echo "\n" ?>
443 <?php if($Settings['DefaultDST']=="off"||$Settings['DefaultDST']!="on") { ?>
444 <option selected="selected" value="off">off</option><?php echo "\n" ?><option value="on">on</option>
445 <?php } if($Settings['DefaultDST']=="on") { ?>
446 <option selected="selected" value="on">on</option><?php echo "\n" ?><option value="off">off</option>
447 <?php } echo "\n" ?></select></td>
449 <td><label class="TextBoxLabel" for="YourGender">Your Gender:</label></td>
450 <td><select id="YourGender" name="YourGender" class="TextBox">
451 <option value="Male">Male</option>
452 <option value="Female">Female</option>
453 <option value="Unknow">Unknow</option>
456 <td><label class="TextBoxLabel" for="Website">Insert your Website:</label></td>
457 <td><input type="text" class="TextBox" name="Website" size="20" value="http://" id="Website" /></td>
459 <td><label class="TextBoxLabel" for="Avatar">Insert a URL for Avatar:</label></td>
460 <td><input type="text" class="TextBox" name="Avatar" size="20" value="http://" id="Avatar" /></td>
462 <td style="width: 30%;"><label class="TextBoxLabel" title="Store userinfo as a cookie so you dont need to login again." for="storecookie">Store as cookie?</label></td>
463 <td style="width: 70%;"><select id="storecookie" name="storecookie" class="TextBox">
464 <option value="true">Yes</option>
465 <option value="false">No</option>
469 <table style="text-align: left;">
470 <tr style="text-align: left;">
471 <td style="width: 100%;">
472 <label class="TextBoxLabel" for="TOSBox">TOS - Please read fully and check 'I agree' box ONLY if you agree to terms</label><br />
473 <textarea rows="10" cols="58" id="TOSBox" name="TOSBox" class="TextBox" readonly="readonly" accesskey="T"><?php
474 echo file_get_contents("TOS"); ?></textarea><br />
475 <input type="checkbox" class="TextBox" name="TOS" value="Agree" id="TOS" /><label class="TextBoxLabel" for="TOS">I Agree</label><br/>
476 <input type="hidden" style="display: none;" name="act" value="makemembers" />
477 <input type="submit" class="Button" value="Sign UP" />
482 <tr class="TableRow4">
483 <td class="TableRow4"> </td>
485 <?php } if($_GET['act']=="makemember") {
486 if($_POST['act']=="makemembers") {
487 $membertitle = " ".$ThemeSet['TitleDivider']." Signing up";
488 $REFERERurl = parse_url($_SERVER['HTTP_REFERER']);
489 $URL['REFERER'] = $REFERERurl['host'];
490 $URL['HOST'] = $_SERVER["SERVER_NAME"];
491 $REFERERurl = null; unset($REFERERurl);
493 <tr class="TableRow1">
494 <td class="TableRow1"><span style="float: right;"> </span>
495 <a href="<?php echo url_maker($exfile['messenger'],$Settings['file_ext'],"act=signup",$Settings['qstr'],$Settings['qsep'],$prexqstr['messenger'],$exqstr['messenger']); ?>">Register</a></td>
497 <tr class="TableRow2">
498 <th class="TableRow2" style="width: 100%; text-align: left;"> Signup Message: </th>
500 <tr class="TableRow3">
501 <td class="TableRow3">
502 <table style="width: 100%; height: 25%; text-align: center;">
503 <?php if (strlen($_POST['Password'])=="30") { $Error="Yes"; ?>
505 <td><span class="TableMessage">
506 <br />Your password is too big.<br />
509 <?php } if (strlen($_POST['username'])=="20") { $Error="Yes"; ?>
511 <td><span class="TableMessage">
512 <br />Your user name is too big.<br />
515 <?php } if ($_POST['Password']!=$_POST['RePassword']) { $Error="Yes"; ?>
517 <td><span class="TableMessage">
518 <br />Your passwords did not match.<br />
521 <?php } if ($Settings['TestReferer']==true) {
522 if ($URL['HOST']!=$URL['REFERER']) { $Error="Yes"; ?>
524 <td><span class="TableMessage">
525 <br />Sorry the referering url dose not match our host name.<br />
529 $Name = stripcslashes(htmlspecialchars($_POST['Name'], ENT_QUOTES));
530 $Name = preg_replace("/&#(x[a-f0-9]+|[0-9]+);/i", "&#$1;", $Name);
531 $Name = @remove_spaces($Name);
532 $sql_email_check = mysql_query(query("select Email from ".$Settings['sqltable']."members where Email = '%s'", array($_POST['Email'])));
533 $sql_username_check = mysql_query(query("select Name from ".$Settings['sqltable']."members where Name = '%s'", array($Name)));
534 $email_check = mysql_num_rows($sql_email_check);
535 $username_check = mysql_num_rows($sql_username_check);
536 @mysql_free_result($sql_email_check); @mysql_free_result($sql_username_check);
537 if ($_POST['TOS']!="Agree") { $Error="Yes"; ?>
539 <td><span class="TableMessage">
540 <br />You need to agree to the tos.<br />
543 <?php } if ($_POST['Name']==null) { $Error="Yes"; ?>
545 <td><span class="TableMessage">
546 <br />You need to enter a name.<br />
549 <?php } if ($_POST['Name']=="ShowMe") { $Error="Yes"; ?>
551 <td><span class="TableMessage">
552 <br />You need to enter a name.<br />
555 <?php } if ($_POST['Password']==null) { $Error="Yes"; ?>
557 <td><span class="TableMessage">
558 <br />You need to enter a password.<br />
561 <?php } if ($_POST['Email']==null) { $Error="Yes"; ?>
563 <td><span class="TableMessage">
564 <br />You need to enter a email.<br />
567 <?php } if($email_check > 0) { $Error="Yes"; ?>
569 <td><span class="TableMessage">
570 <br />Email address is already used.<br />
573 <?php } if($username_check > 0) { $Error="Yes"; ?>
575 <td><span class="TableMessage">
576 <br />UserName is already used.<br />
579 <?php } if ($Error=="Yes") {
580 @redirect("refresh",$basedir.url_maker($exfile['member'],$Settings['file_ext'],"act=signup",$Settings['qstr'],$Settings['qsep'],$prexqstr['member'],$exqstr['member'],FALSE),"4"); }
582 $_POST['UserIP'] = $_SERVER['REMOTE_ADDR'];
583 $_POST['Group'] = $Settings['MemberGroup'];
584 $_POST['Joined'] = GMTimeStamp(); $_POST['LastActive'] = GMTimeStamp();
585 $_POST['Signature'] = ""; $_POST['Interests'] = "";
586 $_POST['Title'] = ""; $_POST['PostCount'] = "0";
587 if($Settings['AdminValidate']==true||$Settings['AdminValidate']!=false)
588 { $ValidateStats="no"; $yourgroup=$Settings['ValidateGroup']; }
589 if($Settings['AdminValidate']==false)
590 { $ValidateStats="yes"; $yourgroup=$Settings['MemberGroup']; }
591 $HashSalt = salt_hmac();
592 $NewPassword = b64e_hmac($_POST['Password'],$_POST['Joined'],$HashSalt,"sha1");
593 $_GET['YourPost'] = $_POST['Signature'];
594 //require( './'.$SettDir['misc'].'HTMLTags.php');
595 $_GET['YourPost'] = htmlspecialchars($_GET['YourPost'], ENT_QUOTES);
596 $_GET['YourPost'] = preg_replace("/&#(x[a-f0-9]+|[0-9]+);/i", "&#$1;", $_GET['YourPost']);
597 $NewSignature = $_GET['YourPost'];
598 $_GET['YourPost'] = preg_replace("/\t+/"," ",$_GET['YourPost']);
599 $_GET['YourPost'] = preg_replace("/\s\s+/"," ",$_GET['YourPost']);
600 $Avatar = stripcslashes(htmlspecialchars($_POST['Avatar'], ENT_QUOTES));
601 $Avatar = preg_replace("/&#(x[a-f0-9]+|[0-9]+);/i", "&#$1;", $Avatar);
602 $Avatar = @remove_spaces($Avatar);
603 $Website = stripcslashes(htmlspecialchars($_POST['Website'], ENT_QUOTES));
604 $Website = preg_replace("/&#(x[a-f0-9]+|[0-9]+);/i", "&#$1;", $Website);
605 $Website = @remove_spaces($Website);
606 $gquerys = query("select * from ".$Settings['sqltable']."groups where Name='%s'", array($Settings['MemberGroup']));
607 $gresults=mysql_query($gquerys);
608 $yourgroup=mysql_result($gresults,0,"id");
609 @mysql_free_result($gresults);
610 $yourid = getnextid($Settings['sqltable'],"members");
611 $_POST['Interests'] = @remove_spaces($_POST['Interests']);
612 $_POST['Title'] = @remove_spaces($_POST['Title']);
613 $_POST['Email'] = @remove_spaces($_POST['Email']);
614 $query = query("insert into ".$Settings['sqltable']."members values (".$yourid.",'%s','%s','%s','%s','%s','%s','%i','%s','%s','%s','%s','%s','%s','%s','%s','%s','%s','%s','%s','%s','%s','%s','%s','%s')", array($Name,$NewPassword,"iDBH",$_POST['Email'],$yourgroup,$ValidateStats,"0",$_POST['Interests'],$_POST['Title'],$_POST['Joined'],$_POST['LastActive'],"0",$NewSignature,'Your Notes',$Avatar,"100x100",$Website,$_POST['YourGender'],$_POST['PostCount'],$_POST['YourOffSet'],$_POST['DST'],$Settings['DefaultTheme'],$_POST['UserIP'],$HashSalt));
616 $querylogr = query("select * from ".$Settings['sqltable']."members where Name='%s' AND Password='%s'", array($Name,$NewPassword));
617 $resultlogr=mysql_query($querylogr);
618 $numlogr=mysql_num_rows($resultlogr);
621 $YourIDMr=mysql_result($resultlogr,$ir,"id");
622 $YourNameMr=mysql_result($resultlogr,$ir,"Name");
623 $YourGroupMr=mysql_result($resultlogr,$ir,"GroupID");
624 $gquery = query("select * from ".$Settings['sqltable']."groups where ID=%i", array($YourGroupMr));
625 $gresult=mysql_query($gquery);
626 $YourGroupMr=mysql_result($gresult,0,"Name");
627 @mysql_free_result($gresult);
628 $YourTimeZoneMr=mysql_result($resultlogr,$ir,"TimeZone");
629 $YourDSTMr=mysql_result($resultlogr,$ir,"DST"); }
630 @mysql_free_result($resultlogr);
631 @session_regenerate_id(true);
632 $_SESSION['Loggedin']=true;
633 $_SESSION['MemberName']=$YourNameMr;
634 $_SESSION['UserID']=$YourIDMr;
635 $_SESSION['UserTimeZone']=$YourTimeZoneMr;
636 $_SESSION['UserDST']=$YourDSTMr;
637 $_SESSION['UserGroup']=$YourGroupMr;
638 if($_POST['storecookie']==true) {
639 @setcookie("MemberName", $YourNameM, time() + (7 * 86400), $basedir);
640 @setcookie("UserID", $YourIDM, time() + (7 * 86400), $basedir);
641 @setcookie("SessPass", $YourPassM, time() + (7 * 86400), $basedir); }
642 //$SendPMtoID=$_SESSION['UserID'];
644 //$PMTitle = "Welcome ".$Name.".";
645 //$YourMessage = "Hello ".$Name.". Welcome to ".$Settings['board_name'].". I hope you have fun here. ^_^ ";
646 //$_POST['YourDate'] = $_POST['Joined'];
647 //$query = query("insert into ".$Settings['sqltable']."messenger values (null,%s,%s,'%s','%s','%s',%s,0)", array($YourPMID,$SendPMtoID,'',$PMTitle,$YourMessage,$_POST['YourDate']));
648 //mysql_query($query);
649 @redirect("refresh",$basedir.url_maker($exfile['index'],$Settings['file_ext'],"act=view",$Settings['qstr'],$Settings['qsep'],$prexqstr['index'],$exqstr['index'],FALSE),"3");
652 <td><span class="TableMessage">
653 <br />Welcome to the Board <?php echo $_SESSION['MemberName']; ?>. ^_^<br />
654 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 continue to board.<br />
660 <tr class="TableRow4">
661 <td class="TableRow4"> </td>