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-2008 Cool Dude 2k - http://idb.berlios.de/
12 Copyright 2004-2008 Game Maker 2k - http://intdb.sourceforge.net/
14 $FileInfo: members.php - Last Update: 09/26/2008 SVN 170 - Author: cooldude2k $
16 $File3Name = basename($_SERVER['SCRIPT_NAME']);
17 if ($File3Name=="members.php"||$File3Name=="/members.php") {
20 if($_GET['act']=="list") {
22 $orderlist = "order by `ID` asc";
23 if(!isset($_GET['orderby'])) { $_GET['orderby'] = null; }
24 if(!isset($_GET['sorttype'])) { $_GET['sorttype'] = null; }
25 if(!isset($_GET['ordertype'])) { $_GET['ordertype'] = null; }
26 if(!isset($_GET['orderby'])) { $_GET['orderby'] = null; }
27 if(!isset($_GET['sortby'])) { $_GET['sortby'] = null; }
28 if(!isset($_GET['gid'])) { $_GET['gid'] = null; }
29 if(!isset($_GET['groupid'])) { $_GET['groupid'] = null; }
30 if($_GET['orderby']==null) {
31 if($_GET['sortby']!=null) {
32 $_GET['orderby'] = $_GET['sortby']; } }
33 if($_GET['orderby']==null) { $_GET['orderby'] = "joined"; }
34 if($_GET['orderby']!=null) {
35 if($_GET['orderby']=="id") { $orderlist = "order by `ID`"; }
36 if($_GET['orderby']=="name") { $orderlist = "order by `Name`"; }
37 if($_GET['orderby']=="joined") { $orderlist = "order by `Joined`"; }
38 if($_GET['orderby']=="active") { $orderlist = "order by `LastActive`"; }
39 if($_GET['orderby']=="posts") { $orderlist = "order by `PostCount`"; }
40 if($_GET['orderby']=="offset") { $orderlist = "order by `TimeZone`"; } }
41 if($_GET['ordertype']==null) {
42 if($_GET['sorttype']!=null) {
43 $_GET['ordertype'] = $_GET['sorttype']; } }
44 if($_GET['ordertype']==null) { $_GET['ordertype'] = "asc"; }
45 if($_GET['ordertype']!=null) {
46 if($_GET['ordertype']=="ascending") { $orderlist .= " asc"; }
47 if($_GET['ordertype']=="descending") { $orderlist .= " desc"; }
48 if($_GET['ordertype']=="asc") { $orderlist .= " asc"; }
49 if($_GET['ordertype']=="desc") { $orderlist .= " desc"; } }
50 if(!is_numeric($_GET['gid'])) { $_GET['gid'] = null; }
51 if($_GET['gid']!=null&&$_GET['groupid']==null) { $_GET['groupid'] = $_GET['gid']; }
52 if(!is_numeric($_GET['groupid'])) { $_GET['groupid'] = null; }
53 $ggquery = query("SELECT * FROM `".$Settings['sqltable']."groups` WHERE `Name`='%s' LIMIT 1", array($Settings['GuestGroup']));
54 $ggresult=mysql_query($ggquery);
55 $GGroup=mysql_result($ggresult,0,"id");
56 @mysql_free_result($ggresult);
57 //Get SQL LIMIT Number
58 $nums = $_GET['page'] * $Settings['max_memlist'];
59 $PageLimit = $nums - $Settings['max_memlist'];
60 if($PageLimit<0) { $PageLimit = 0; }
62 if($_GET['groupid']==null) {
63 $query = query("SELECT SQL_CALC_FOUND_ROWS * FROM `".$Settings['sqltable']."members` WHERE `GroupID`<>%i ".$orderlist." LIMIT %i,%i", array($GGroup,$PageLimit,$Settings['max_memlist'])); }
64 if($_GET['groupid']!=null) {
65 $query = query("SELECT SQL_CALC_FOUND_ROWS * FROM `".$Settings['sqltable']."members` WHERE `GroupID`=%i AND `GroupID`<>%i ".$orderlist." LIMIT %i,%i", array($_GET['groupid'],$GGroup,$PageLimit,$Settings['max_memlist'])); }
66 $rnquery = query("SELECT FOUND_ROWS();", array(null));
67 $result=mysql_query($query);
68 $rnresult=mysql_query($rnquery);
69 $NumberMembers = mysql_result($rnresult,0);
70 @mysql_free_result($rnresult);
71 if($NumberMembers==null) {
73 $num = $NumberMembers;
74 //Start MemberList Page Code
75 if(!isset($Settings['max_memlist'])) { $Settings['max_memlist'] = 10; }
76 if($_GET['page']==null) { $_GET['page'] = 1; }
77 if($_GET['page']<=0) { $_GET['page'] = 1; }
78 $nums = $_GET['page'] * $Settings['max_memlist'];
79 if($nums>$num) { $nums = $num; }
80 $numz = $nums - $Settings['max_memlist'];
81 if($numz<=0) { $numz = 0; }
83 if($nums<$num) { $nextpage = $_GET['page'] + 1; }
84 if($nums>=$num) { $nextpage = $_GET['page']; }
85 if($numz>=$Settings['max_memlist']) { $backpage = $_GET['page'] - 1; }
86 if($_GET['page']<=1) { $backpage = 1; }
87 $pnum = $num; $l = 1; $Pages = null;
89 if($pnum>=$Settings['max_memlist']) {
90 $pnum = $pnum - $Settings['max_memlist'];
91 $Pages[$l] = $l; ++$l; }
92 if($pnum<$Settings['max_memlist']&&$pnum>0) {
93 $pnum = $pnum - $pnum;
94 $Pages[$l] = $l; ++$l; } }
95 $nums = $_GET['page'] * $Settings['max_memlist'];
96 //End MemberList Page Code
97 $num=mysql_num_rows($result);
98 //List Page Number Code Start
99 $pagenum=count($Pages);
100 if($_GET['page']>$pagenum) {
101 $_GET['page'] = $pagenum; }
102 $pagei=0; $pstring = "<div class=\"PageList\">Pages: ";
103 if($_GET['page']<4) { $Pagez[0] = null; }
104 if($_GET['page']>=4) { $Pagez[0] = "First"; }
105 if($_GET['page']>=3) {
106 $Pagez[1] = $_GET['page'] - 2; }
107 if($_GET['page']<3) {
109 if($_GET['page']>=2) {
110 $Pagez[2] = $_GET['page'] - 1; }
111 if($_GET['page']<2) {
113 $Pagez[3] = $_GET['page'];
114 if($_GET['page']<$pagenum) {
115 $Pagez[4] = $_GET['page'] + 1; }
116 if($_GET['page']>=$pagenum) {
118 $pagenext = $_GET['page'] + 1;
119 if($pagenext<$pagenum) {
120 $Pagez[5] = $_GET['page'] + 2; }
121 if($pagenext>=$pagenum) {
123 if($_GET['page']<$pagenum) { $Pagez[6] = "Last"; }
124 if($_GET['page']>=$pagenum) { $Pagez[6] = null; }
125 $pagenumi=count($Pagez);
126 if($NumberMembers==0) {
128 $pstring = $pstring."<a href=\"".url_maker($exfile['member'],$Settings['file_ext'],"act=list&orderby=".$_GET['orderby']."&ordertype=".$_GET['ordertype']."&page=1",$Settings['qstr'],$Settings['qsep'],$prexqstr['member'],$exqstr['member'])."\">1</a> "; }
129 while ($pagei < $pagenumi) {
130 if($Pagez[$pagei]!=null&&
131 $Pagez[$pagei]!="First"&&
132 $Pagez[$pagei]!="Last") {
133 $pstring = $pstring."<a href=\"".url_maker($exfile['member'],$Settings['file_ext'],"act=list&orderby=".$_GET['orderby']."&ordertype=".$_GET['ordertype']."&page=".$Pagez[$pagei],$Settings['qstr'],$Settings['qsep'],$prexqstr['member'],$exqstr['member'])."\">".$Pagez[$pagei]."</a> "; }
134 if($Pagez[$pagei]=="First") {
135 $pstring = $pstring."<a href=\"".url_maker($exfile['member'],$Settings['file_ext'],"act=list&orderby=".$_GET['orderby']."&ordertype=".$_GET['ordertype']."&page=1",$Settings['qstr'],$Settings['qsep'],$prexqstr['member'],$exqstr['member'])."\">< First</a> ... "; }
136 if($Pagez[$pagei]=="Last") {
137 $pstring = $pstring."... <a href=\"".url_maker($exfile['member'],$Settings['file_ext'],"act=list&orderby=".$_GET['orderby']."&ordertype=".$_GET['ordertype']."&page=".$pagenum,$Settings['qstr'],$Settings['qsep'],$prexqstr['member'],$exqstr['member'])."\">Last ></a> "; }
138 ++$pagei; } $pstring = $pstring."</div>";
140 //List Page Number Code end
142 <div class="Table1Border">
143 <table class="Table1">
144 <tr class="TableRow1">
145 <td class="TableRow1" colspan="7"><span style="float: left;">
146 <?php echo $ThemeSet['TitleIcon'] ?><a href="<?php echo url_maker($exfile['member'],$Settings['file_ext'],"act=list&orderby=".$_GET['orderby']."&ordertype=".$_GET['ordertype']."&page=".$_GET['page'],$Settings['qstr'],$Settings['qsep'],$prexqstr['member'],$exqstr['member']); ?>">Member List</a>
147 </span><span style="float: right;"> </span></td>
149 <tr id="Member" class="TableRow2">
150 <th class="TableRow2" style="width: 5%;">ID</th>
151 <th class="TableRow2" style="width: 28%;">Name</th>
152 <th class="TableRow2" style="width: 10%;">Group</th>
153 <th class="TableRow2" style="width: 10%;">Posts</th>
154 <th class="TableRow2" style="width: 20%;">Joined</th>
155 <th class="TableRow2" style="width: 20%;">Last Active</th>
156 <th class="TableRow2" style="width: 7%;">Website</th>
160 $MemList['ID']=mysql_result($result,$i,"id");
161 $MemList['Name']=mysql_result($result,$i,"Name");
162 $MemList['Email']=mysql_result($result,$i,"Email");
163 $MemList['GroupID']=mysql_result($result,$i,"GroupID");
164 $MemList['WarnLevel']=mysql_result($result,$i,"WarnLevel");
165 $MemList['Interests']=mysql_result($result,$i,"Interests");
166 $MemList['Title']=mysql_result($result,$i,"Title");
167 $MemList['Joined']=mysql_result($result,$i,"Joined");
168 $MemList['Joined']=GMTimeChange("F j Y, g:i a",$MemList['Joined'],$_SESSION['UserTimeZone'],0,$_SESSION['UserDST']);
169 $MemList['LastActive']=mysql_result($result,$i,"LastActive");
170 $MemList['LastActive']=GMTimeChange("F j Y, g:i a",$MemList['LastActive'],$_SESSION['UserTimeZone'],0,$_SESSION['UserDST']);
171 $MemList['Website']=mysql_result($result,$i,"Website");
172 $MemList['Gender']=mysql_result($result,$i,"Gender");
173 $MemList['PostCount']=mysql_result($result,$i,"PostCount");
174 $MemList['TimeZone']=mysql_result($result,$i,"TimeZone");
175 $MemList['DST']=mysql_result($result,$i,"DST");
176 $MemList['IP']=mysql_result($result,$i,"IP");
177 $gquery = query("SELECT * FROM `".$Settings['sqltable']."groups` WHERE `id`=%i LIMIT 1", array($MemList['GroupID']));
178 $gresult=mysql_query($gquery);
179 $MemList['Group']=mysql_result($gresult,0,"Name");
180 @mysql_free_result($gresult);
181 $membertitle = " ".$ThemeSet['TitleDivider']." Member List";
182 if($MemList['Group']!=$Settings['GuestGroup']) {
184 <tr class="TableRow3" id="Member<?php echo $MemList['ID']; ?>">
185 <td class="TableRow3" style="text-align: center;"><?php echo $MemList['ID']; ?></td>
186 <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>
187 <td class="TableRow3" style="text-align: center;"><a href="<?php echo url_maker($exfile['member'],$Settings['file_ext'],"act=list&gid=".$MemList['GroupID']."&page=".$_GET['page'],$Settings['qstr'],$Settings['qsep'],$prexqstr['member'],$exqstr['member']); ?>"><?php echo $MemList['Group']; ?></a></td>
188 <td class="TableRow3" style="text-align: center;"><?php echo $MemList['PostCount']; ?></td>
189 <td class="TableRow3" style="text-align: center;"><?php echo $MemList['Joined']; ?></td>
190 <td class="TableRow3" style="text-align: center;"><?php echo $MemList['LastActive']; ?></td>
191 <td class="TableRow3" style="text-align: center;"><a href="<?php echo $MemList['Website']; ?>" onclick="window.open(this.href);return false;">Website</a></td>
194 ++$i; } @mysql_free_result($result);
196 <tr id="MemEnd" class="TableRow4">
197 <td class="TableRow4" colspan="7"> </td>
201 if($_GET['act']=="view") {
202 $query = query("SELECT * FROM `".$Settings['sqltable']."members` WHERE `id`=%i LIMIT 1", array($_GET['id']));
203 $result=mysql_query($query);
204 $num=mysql_num_rows($result);
206 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));
207 ob_clean(); @header("Content-Type: text/plain; charset=".$Settings['charset']);
208 gzip_page($Settings['use_gzip'],$GZipEncode['Type']); @mysql_close(); die(); }
209 $ViewMem['ID']=mysql_result($result,$i,"id");
210 $ViewMem['Name']=mysql_result($result,$i,"Name");
211 $ViewMem['Signature']=mysql_result($result,$i,"Signature");
212 $ViewMem['Avatar']=mysql_result($result,$i,"Avatar");
213 $ViewMem['AvatarSize']=mysql_result($result,$i,"AvatarSize");
214 $ViewMem['Email']=mysql_result($result,$i,"Email");
215 $ViewMem['GroupID']=mysql_result($result,$i,"GroupID");
216 $ViewMem['WarnLevel']=mysql_result($result,$i,"WarnLevel");
217 $ViewMem['Interests']=mysql_result($result,$i,"Interests");
218 $ViewMem['Title']=mysql_result($result,$i,"Title");
219 $ViewMem['Joined']=mysql_result($result,$i,"Joined");
220 $ViewMem['Joined']=GMTimeChange("M j Y, g:i a",$ViewMem['Joined'],$_SESSION['UserTimeZone'],0,$_SESSION['UserDST']);
221 $ViewMem['LastActive']=mysql_result($result,$i,"LastActive");
222 $ViewMem['LastActive']=GMTimeChange("M j Y, g:i a",$ViewMem['LastActive'],$_SESSION['UserTimeZone'],0,$_SESSION['UserDST']);
223 $ViewMem['Website']=mysql_result($result,$i,"Website");
224 $ViewMem['Gender']=mysql_result($result,$i,"Gender");
225 $ViewMem['PostCount']=mysql_result($result,$i,"PostCount");
226 $ViewMem['TimeZone']=mysql_result($result,$i,"TimeZone");
227 $ViewMem['DST']=mysql_result($result,$i,"DST");
228 $ViewMem['IP']=mysql_result($result,$i,"IP");
229 $gquery = query("SELECT * FROM `".$Settings['sqltable']."groups` WHERE `id`=%i LIMIT 1", array($ViewMem['GroupID']));
230 $gresult=mysql_query($gquery);
231 $ViewMem['Group']=mysql_result($gresult,0,"Name");
232 @mysql_free_result($gresult);
233 $membertitle = " ".$ThemeSet['TitleDivider']." ".$ViewMem['Name'];
234 if ($ViewMem['Avatar']=="http://"||$ViewMem['Avatar']==null||
235 strtolower($ViewMem['Avatar'])=="noavatar") {
236 $ViewMem['Avatar']=$ThemeSet['NoAvatar'];
237 $ViewMem['AvatarSize']=$ThemeSet['NoAvatarSize']; }
238 $AvatarSize1=explode("x", $ViewMem['AvatarSize']);
239 $AvatarSize1W=$AvatarSize1[0]; $AvatarSize1H=$AvatarSize1[1];
240 $ViewMem['Signature'] = text2icons($ViewMem['Signature'],$Settings['sqltable']);
241 if($_GET['view']==null) { $_GET['view'] = "profile"; }
242 if($_GET['view']!="profile"&&$_GET['view']!="avatar"&&
243 $_GET['view']!="website"&&$_GET['view']!="homepage") { $_GET['view'] = "profile"; }
244 if($_GET['view']=="avatar") {
245 @session_write_close();
246 @header("Location: ".$ViewMem['Avatar']); }
247 if($_GET['view']=="website"||$_GET['view']=="homepage") {
248 if ($ViewMem['Website']!="http://"&&$ViewMem['Website']!=null) {
249 @session_write_close();
250 @header("Location: ".$ViewMem['Website']); }
251 if ($ViewMem['Website']=="http://"||$ViewMem['Website']==null||
252 strtolower($ViewMem['Avatar'])=="noavatar") {
253 @session_write_close();
254 @header("Location: ".$BoardURL."index.php?act=view"); } }
256 <div class="Table1Border">
257 <table class="Table1">
258 <tr class="TableRow1">
259 <td class="TableRow1" colspan="2"><span style="float: left;">
260 <?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>
261 </span><span style="float: right;"> </span></td>
263 <tr id="Member" class="TableRow2">
264 <th class="TableRow2" style="width: 50%;">Avatar</th>
265 <th class="TableRow2" style="width: 50%;">User Info</th>
267 <tr class="TableRow3" id="MemberProfile">
268 <td class="TableRow3">
269 <?php /* Avatar Table Thanks For SeanJ's Help at http://seanj.jcink.com/ */ ?>
270 <table class="AvatarTable" style="width: 100%; height: 100px; text-align: center;">
271 <tr class="AvatarRow" style="width: 100px; height: 100px;">
272 <td class="AvatarRow" style="width: 100%; height: 100%; text-align: center; vertical-align: middle;">
273 <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;" />
277 <div style="text-align: center;">
278 Name: <?php echo $ViewMem['Name']; ?><br />
279 Title: <?php echo $ViewMem['Title']; ?></div>
281 <td class="TableRow3">
282 User Name: <?php echo $ViewMem['Name']; ?><br />
283 User Title: <?php echo $ViewMem['Title']; ?><br />
284 User Group: <?php echo $ViewMem['Group']; ?><br />
285 User Joined: <?php echo $ViewMem['Joined']; ?><br />
286 Last Active: <?php echo $ViewMem['LastActive']; ?><br />
287 User Time: <?php echo GMTimeGet("M j Y, g:i a",$ViewMem['TimeZone'],0,$ViewMem['DST']); ?><br />
288 User Website: <a href="<?php echo $ViewMem['Website']; ?>" onclick="window.open(this.href);return false;">Website</a><br />
289 Post Count: <?php echo $ViewMem['PostCount']; ?><br />
290 Interests: <?php echo $ViewMem['Interests']; ?><br />
293 <tr class="TableRow4">
294 <td class="TableRow4" colspan="2"> </td>
297 <?php } @mysql_free_result($result);
298 if($_GET['act']=="logout") {
300 if($cookieDomain==null) {
301 @setcookie("MemberName", null, GMTimeStamp() - 3600, $cbasedir);
302 @setcookie("UserID", null, GMTimeStamp() - 3600, $cbasedir);
303 @setcookie("SessPass", null, GMTimeStamp() - 3600, $cbasedir);
304 @setcookie(session_name(), "", GMTimeStamp() - 3600, $cbasedir); }
305 if($cookieDomain!=null) {
306 if($cookieSecure===true) {
307 @setcookie("MemberName", null, GMTimeStamp() - 3600, $cbasedir, $cookieDomain, 1);
308 @setcookie("UserID", null, GMTimeStamp() - 3600, $cbasedir, $cookieDomain, 1);
309 @setcookie("SessPass", null, GMTimeStamp() - 3600, $cbasedir, $cookieDomain, 1);
310 @setcookie(session_name(), "", GMTimeStamp() - 3600, $cbasedir, $cookieDomain, 1); }
311 if($cookieSecure===false) {
312 @setcookie("MemberName", null, GMTimeStamp() - 3600, $cbasedir, $cookieDomain);
313 @setcookie("UserID", null, GMTimeStamp() - 3600, $cbasedir, $cookieDomain);
314 @setcookie("SessPass", null, GMTimeStamp() - 3600, $cbasedir, $cookieDomain);
315 @setcookie(session_name(), "", GMTimeStamp() - 3600, $cbasedir, $cookieDomain); } }
316 unset($_COOKIE[session_name()]);
320 @redirect("location",$basedir.url_maker($exfile['member'],$Settings['file_ext'],"act=login",$Settings['qstr'],$Settings['qsep'],$prexqstr['member'],$exqstr['member'],false));
321 ob_clean(); @header("Content-Type: text/plain; charset=".$Settings['charset']);
322 gzip_page($Settings['use_gzip'],$GZipEncode['Type']); @mysql_close(); die(); }
323 if($_GET['act']=="login") {
324 if($_SESSION['UserID']!=0&&$_SESSION['UserID']!=null) {
325 redirect("location",$basedir.url_maker($exfile['member'],$Settings['file_ext'],"act=logout",$Settings['qstr'],$Settings['qsep'],$prexqstr['member'],$exqstr['member'],false));
326 ob_clean(); @header("Content-Type: text/plain; charset=".$Settings['charset']);
327 gzip_page($Settings['use_gzip'],$GZipEncode['Type']); @mysql_close(); die(); }
328 if($_SESSION['UserID']==0||$_SESSION['UserID']==null) {
329 $membertitle = " ".$ThemeSet['TitleDivider']." Login";
331 <div class="Table1Border">
332 <table class="Table1">
333 <tr class="TableRow1">
334 <td class="TableRow1"><span style="float: left;">
335 <?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>
336 </span><span style="float: right;"> </span></td>
338 <tr class="TableRow2">
339 <th class="TableRow2" style="width: 100%; text-align: left;"> Inert your login info: </th>
341 <tr class="TableRow3">
342 <td class="TableRow3">
343 <form style="display: inline;" method="post" action="<?php echo url_maker($exfile['member'],$Settings['file_ext'],"act=login_now",$Settings['qstr'],$Settings['qsep'],$prexqstr['member'],$exqstr['member']); ?>">
344 <table style="text-align: left;">
345 <tr style="text-align: left;">
346 <td style="width: 30%;"><label class="TextBoxLabel" for="username">Enter UserName: </label></td>
347 <td style="width: 70%;"><input maxlength="24" class="TextBox" id="username" type="text" name="username" /></td>
348 </tr><tr style="text-align: left;">
349 <td style="width: 30%;"><label class="TextBoxLabel" for="userpass">Enter Password: </label></td>
350 <td style="width: 70%;"><input maxlength="30" class="TextBox" id="userpass" type="password" name="userpass" /></td>
351 </tr><tr style="text-align: left;">
352 <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>
353 <td style="width: 70%;"><select id="storecookie" name="storecookie" class="TextBox">
354 <option value="true">Yes</option>
355 <option value="false">No</option>
358 <table style="text-align: left;">
359 <tr style="text-align: left;">
360 <td style="width: 100%;">
361 <input type="hidden" name="act" value="loginmember" style="display: none;" />
362 <input class="Button" type="submit" value="Log in" />
367 <tr class="TableRow4">
368 <td class="TableRow4"> </td>
371 <?php } } if($_POST['act']=="loginmember"&&$_GET['act']=="login_now") {
372 if($_SESSION['UserID']!=0&&$_SESSION['UserID']!=null) {
373 redirect("location",$basedir.url_maker($exfile['member'],$Settings['file_ext'],"act=logout",$Settings['qstr'],$Settings['qsep'],$prexqstr['member'],$exqstr['member'],false));
374 ob_clean(); @header("Content-Type: text/plain; charset=".$Settings['charset']);
375 gzip_page($Settings['use_gzip'],$GZipEncode['Type']); @mysql_close(); die(); }
376 if($_SESSION['UserID']==0||$_SESSION['UserID']==null) {
377 $membertitle = " ".$ThemeSet['TitleDivider']." Login";
378 $REFERERurl = parse_url($_SERVER['HTTP_REFERER']);
379 $URL['REFERER'] = $REFERERurl['host'];
380 $URL['HOST'] = $_SERVER["SERVER_NAME"];
383 <div class="Table1Border">
384 <table class="Table1">
385 <tr class="TableRow1">
386 <td class="TableRow1">
387 <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>
388 <span style="float: right;"> </span></td>
390 <tr class="TableRow2">
391 <th class="TableRow2" style="width: 100%; text-align: left;"> Login Message: </th>
393 <tr class="TableRow3">
394 <td class="TableRow3">
395 <table style="width: 100%; height: 25%; text-align: center;">
397 if (pre_strlen($_POST['userpass'])>="30") { $Error="Yes"; ?>
399 <td><span class="TableMessage">
400 <br />Your password is too big.<br />
403 <?php } if (pre_strlen($_POST['username'])>="24") { $Error="Yes"; ?>
405 <td><span class="TableMessage">
406 <br />Your user name is too big.<br />
409 <?php } if ($Settings['TestReferer']===true) {
410 if ($URL['HOST']!=$URL['REFERER']) { $Error="Yes"; ?>
412 <td><span class="TableMessage">
413 <br />Sorry the referering url dose not match our host name.<br />
416 <?php } } $BanError = null;
418 @redirect("refresh",$basedir.url_maker($exfile['member'],$Settings['file_ext'],"act=login",$Settings['qstr'],$Settings['qsep'],$prexqstr['member'],$exqstr['member'],false),"4"); }
420 $YourName = stripcslashes(htmlspecialchars($_POST['username'], ENT_QUOTES, $Settings['charset']));
421 //$YourName = preg_replace("/&#(x[a-f0-9]+|[0-9]+);/i", "&#$1;", $YourName);
422 $YourName = @remove_spaces($YourName);
424 $querylog = query("SELECT * FROM `".$Settings['sqltable']."members` WHERE `Name`='%s' LIMIT 1", array($YourName));
425 $resultlog=mysql_query($querylog);
426 $numlog=mysql_num_rows($resultlog);
429 $YourPassTry=mysql_result($resultlog,$i,"Password");
430 $HashType=mysql_result($resultlog,$i,"HashType");
431 $JoinedPass=mysql_result($resultlog,$i,"Joined");
432 $HashSalt=mysql_result($resultlog,$i,"Salt");
434 if($HashType=="ODFH") { $YourPassword = sha1(md5($_POST['userpass'])); }
435 if($HashType=="DF4H") { $YourPassword = b64e_hmac($_POST['userpass'],$JoinedPass,$HashSalt,"sha1"); }
436 if($HashType=="iDBH"||$UpdateHash!==true) { $YourPassword = b64e_hmac($_POST['userpass'],$JoinedPass,$HashSalt,"sha1"); }
437 if($YourPassword!=$YourPassTry) { $passright = false; }
438 if($YourPassword==$YourPassTry) { $passright = true;
439 $YourIDM=mysql_result($resultlog,$i,"id");
440 $YourNameM=mysql_result($resultlog,$i,"Name");
441 $YourPassM=mysql_result($resultlog,$i,"Password");
442 $PostCount=mysql_result($resultlog,$i,"PostCount");
443 $YourGroupM=mysql_result($resultlog,$i,"GroupID");
444 $YourBanTime=mysql_result($resultlog,$i,"BanTime");
445 $CGMTime = GMTimeStamp();
446 if($YourBanTime!=0&&$YourBanTime!=null) {
447 if($YourBanTime>=$CGMTime) { $BanError = "yes"; } }
448 $gquery = query("SELECT * FROM `".$Settings['sqltable']."groups` WHERE `id`=%i LIMIT 1", array($YourGroupM));
449 $gresult=mysql_query($gquery);
450 $YourGroupM=mysql_result($gresult,0,"Name");
451 @mysql_free_result($gresult);
452 $YourTimeZoneM=mysql_result($resultlog,$i,"TimeZone");
453 $YourDSTM=mysql_result($resultlog,$i,"DST");
454 $JoinedDate=mysql_result($resultlog,$i,"Joined");
455 $UseTheme=mysql_result($resultlog,$i,"UseTheme");
456 $NewHashSalt = salt_hmac();
457 $NewPassword = b64e_hmac($_POST['userpass'],$JoinedPass,$NewHashSalt,"sha1");
458 $NewDay=GMTimeStamp();
459 $NewIP=$_SERVER['REMOTE_ADDR'];
460 if($BanError!="yes") {
461 $queryup = query("UPDATE `".$Settings['sqltable']."members` SET `Password`='%s',`HashType`='iDBH',`LastActive`=%i,`IP`='%s',`Salt`='%s' WHERE `id`=%i", array($NewPassword,$NewDay,$NewIP,$NewHashSalt,$YourIDM));
462 mysql_query($queryup);
463 @mysql_free_result($resultlog); @mysql_free_result($queryup);
464 //session_regenerate_id();
465 $_SESSION['Theme']=$UseTheme;
466 $_SESSION['MemberName']=$YourNameM;
467 $_SESSION['UserID']=$YourIDM;
468 $_SESSION['UserTimeZone']=$YourTimeZoneM;
469 $_SESSION['UserGroup']=$YourGroupM;
470 $_SESSION['UserDST']=$YourDSTM;
471 $_SESSION['UserPass']=$NewPassword;
472 $_SESSION['DBName']=$Settings['sqldb'];
473 if($_POST['storecookie']===true) {
474 if($cookieDomain==null) {
475 @setcookie("MemberName", $YourNameM, time() + (7 * 86400), $cbasedir);
476 @setcookie("UserID", $YourIDM, time() + (7 * 86400), $cbasedir);
477 @setcookie("SessPass", $NewPassword, time() + (7 * 86400), $cbasedir); }
478 if($cookieDomain!=null) {
479 if($cookieSecure===true) {
480 @setcookie("MemberName", $YourNameM, time() + (7 * 86400), $cbasedir, $cookieDomain, 1);
481 @setcookie("UserID", $YourIDM, time() + (7 * 86400), $cbasedir, $cookieDomain, 1);
482 @setcookie("SessPass", $NewPassword, time() + (7 * 86400), $cbasedir, $cookieDomain, 1); }
483 if($cookieSecure===false) {
484 @setcookie("MemberName", $YourNameM, time() + (7 * 86400), $cbasedir, $cookieDomain);
485 @setcookie("UserID", $YourIDM, time() + (7 * 86400), $cbasedir, $cookieDomain);
486 @setcookie("SessPass", $NewPassword, time() + (7 * 86400), $cbasedir, $cookieDomain); } } } }
488 //echo "Password was not right or user not found!! <_< ";
490 <?php if($passright===true&&$BanError!="yes") {
491 @redirect("refresh",$basedir.url_maker($exfile['index'],$Settings['file_ext'],"act=view",$Settings['qstr'],$Settings['qsep'],$prexqstr['index'],$exqstr['index'],false),"3"); ?>
493 <td><span class="TableMessage">
494 <br />Welcome to the Board <?php echo $_SESSION['MemberName']; ?>. ^_^<br />
495 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 />
498 <?php } if($passright===false||$BanError=="yes") { ?>
500 <td><span class="TableMessage">
501 <br />Password was not right or user not found or user is banned!! <_<<br />
502 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 />
508 <tr class="TableRow4">
509 <td class="TableRow4"> </td>
512 <?php } } if($_GET['act']=="signup") {
513 $membertitle = " ".$ThemeSet['TitleDivider']." Signing up";
514 if($_SESSION['UserID']!=0&&$_SESSION['UserID']!=null) {
515 redirect("location",$basedir.url_maker($exfile['member'],$Settings['file_ext'],"act=logout",$Settings['qstr'],$Settings['qsep'],$prexqstr['member'],$exqstr['member'],false));
516 ob_clean(); @header("Content-Type: text/plain; charset=".$Settings['charset']);
517 gzip_page($Settings['use_gzip'],$GZipEncode['Type']); @mysql_close(); die(); }
518 if($_SESSION['UserID']==0||$_SESSION['UserID']==null) {
520 <div class="Table1Border">
521 <table class="Table1">
522 <tr class="TableRow1">
523 <td class="TableRow1"><span style="float: left;">
524 <?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>
525 </span><span style="float: right;"> </span></td>
527 <tr class="TableRow2">
528 <th class="TableRow2" style="width: 100%; text-align: left;"> Inert your user info: </th>
530 <tr class="TableRow3">
531 <td class="TableRow3">
532 <form style="display: inline;" method="post" action="<?php echo url_maker($exfile['member'],$Settings['file_ext'],"act=makemember",$Settings['qstr'],$Settings['qsep'],$prexqstr['member'],$exqstr['member']); ?>">
533 <table style="text-align: left;">
534 <tr style="text-align: left;">
535 <td style="width: 30%;"><label class="TextBoxLabel" for="Name">Insert a UserName:</label></td>
536 <td style="width: 70%;"><input maxlength="24" type="text" class="TextBox" name="Name" size="20" id="Name" /></td>
538 <td style="width: 30%;"><label class="TextBoxLabel" for="Password">Insert a Password:</label></td>
539 <td style="width: 70%;"><input maxlength="30" type="password" class="TextBox" name="Password" size="20" id="Password" /></td>
541 <td style="width: 30%;"><label class="TextBoxLabel" for="RePassword">ReInsert a Password:</label></td>
542 <td style="width: 70%;"><input maxlength="30" type="password" class="TextBox" name="RePassword" size="20" id="RePassword" /></td>
544 <td style="width: 30%;"><label class="TextBoxLabel" for="Email">Insert Your Email:</label></td>
545 <td style="width: 70%;"><input type="text" class="TextBox" name="Email" size="20" id="Email" /></td>
547 <td style="width: 30%;"><label class="TextBoxLabel" for="YourOffSet">Your TimeZone:</label></td>
548 <td style="width: 70%;"><select id="YourOffSet" name="YourOffSet" class="TextBox"><?php
549 $tsa_mem = explode(":",$Settings['DefaultTimeZone']);
550 $TimeZoneArray = array("offset" => $Settings['DefaultTimeZone'], "hour" => $tsa_mem[0], "minute" => $tsa_mem[1]);
551 $plusi = 1; $minusi = 12;
552 $plusnum = 13; $minusnum = 0;
553 while ($minusi > $minusnum) {
554 if($TimeZoneArray['hour']==-$minusi) {
555 echo "<option selected=\"selected\" value=\"-".$minusi."\">GMT - ".$minusi.":00 hours</option>\n"; }
556 if($TimeZoneArray['hour']!=-$minusi) {
557 echo "<option value=\"-".$minusi."\">GMT - ".$minusi.":00 hours</option>\n"; }
559 if($TimeZoneArray['hour']==0) { ?>
560 <option selected="selected" value="0">GMT +/- 0:00 hours</option>
561 <?php } if($TimeZoneArray['hour']!=0) { ?>
562 <option value="0">GMT +/- 0:00 hours</option>
564 while ($plusi < $plusnum) {
565 if($TimeZoneArray['hour']==$plusi) {
566 echo "<option selected=\"selected\" value=\"".$plusi."\">GMT + ".$plusi.":00 hours</option>\n"; }
567 if($TimeZoneArray['hour']!=$plusi) {
568 echo "<option value=\"".$plusi."\">GMT + ".$plusi.":00 hours</option>\n"; }
572 <td style="width: 50%;"><label class="TextBoxLabel" for="MinOffSet">Minute OffSet:</label></td>
573 <td style="width: 50%;"><select id="MinOffSet" name="MinOffSet" class="TextBox"><?php
574 $mini = 0; $minnum = 60;
575 while ($mini < $minnum) {
576 if(pre_strlen($mini)==2) { $showmin = $mini; }
577 if(pre_strlen($mini)==1) { $showmin = "0".$mini; }
578 if($mini==$TimeZoneArray['minute']) {
579 echo "\n<option selected=\"selected\" value=\"".$showmin."\">0:".$showmin." minutes</option>\n"; }
580 if($mini!=$TimeZoneArray['minute']) {
581 echo "<option value=\"".$showmin."\">0:".$showmin." minutes</option>\n"; }
585 <td style="width: 30%;"><label class="TextBoxLabel" for="DST">Is <span title="Daylight Savings Time">DST</span> / <span title="Summer Time">ST</span> on or off:</label></td>
586 <td style="width: 70%;"><select id="DST" name="DST" class="TextBox"><?php echo "\n" ?>
587 <?php if($Settings['DefaultDST']=="off"||$Settings['DefaultDST']!="on") { ?>
588 <option selected="selected" value="off">off</option><?php echo "\n" ?><option value="on">on</option>
589 <?php } if($Settings['DefaultDST']=="on") { ?>
590 <option selected="selected" value="on">on</option><?php echo "\n" ?><option value="off">off</option>
591 <?php } echo "\n" ?></select></td>
593 <td style="width: 30%;"><label class="TextBoxLabel" for="YourGender">Your Gender:</label></td>
594 <td style="width: 70%;"><select id="YourGender" name="YourGender" class="TextBox">
595 <option value="Male">Male</option>
596 <option value="Female">Female</option>
597 <option value="Unknow">Unknow</option>
600 <td style="width: 30%;"><label class="TextBoxLabel" for="Website">Insert your Website:</label></td>
601 <td style="width: 70%;"><input type="text" class="TextBox" name="Website" size="20" value="http://" id="Website" /></td>
603 <td style="width: 30%;"><label class="TextBoxLabel" for="Avatar">Insert a URL for Avatar:</label></td>
604 <td style="width: 70%;"><input type="text" class="TextBox" name="Avatar" size="20" value="http://" id="Avatar" /></td>
606 <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>
607 <td style="width: 70%;"><select id="storecookie" name="storecookie" class="TextBox">
608 <option value="true">Yes</option>
609 <option value="false">No</option>
613 <table style="text-align: left;">
614 <tr style="text-align: left;">
615 <td style="width: 100%;">
616 <label class="TextBoxLabel" for="TOSBox">TOS - Please read fully and check 'I agree' box ONLY if you agree to terms</label><br />
617 <textarea rows="10" cols="58" id="TOSBox" name="TOSBox" class="TextBox" readonly="readonly" accesskey="T"><?php
618 echo file_get_contents("TOS"); ?></textarea><br />
619 <input type="checkbox" class="TextBox" name="TOS" value="Agree" id="TOS" /><label class="TextBoxLabel" for="TOS">I Agree</label>
620 <?php if($Settings['use_captcha']!="on") { ?><br />
621 <?php } if($Settings['use_captcha']=="on") { ?>
623 <tr style="text-align: left;">
624 <td style="width: 100%;">
625 <label class="TextBoxLabel" for="signcode"><img src="index.php?act=MkCaptcha" alt="CAPTCHA Code" title="CAPTCHA Code" /></label><br />
626 <input maxlength="25" type="text" class="TextBox" name="signcode" size="20" id="signcode" value="Enter SignCode" /><br /><?php } ?>
627 <input type="hidden" style="display: none;" name="act" value="makemembers" />
628 <input type="submit" class="Button" value="Sign UP" />
634 <tr class="TableRow4">
635 <td class="TableRow4"> </td>
638 <?php } } if($_GET['act']=="makemember") {
639 if($_POST['act']=="makemembers") {
640 if($_SESSION['UserID']!=0&&$_SESSION['UserID']!=null) {
641 redirect("location",$basedir.url_maker($exfile['member'],$Settings['file_ext'],"act=logout",$Settings['qstr'],$Settings['qsep'],$prexqstr['member'],$exqstr['member'],false));
642 ob_clean(); @header("Content-Type: text/plain; charset=".$Settings['charset']);
643 gzip_page($Settings['use_gzip'],$GZipEncode['Type']); @mysql_close(); die(); }
644 if($_SESSION['UserID']==0||$_SESSION['UserID']==null) {
645 $membertitle = " ".$ThemeSet['TitleDivider']." Signing up";
646 $REFERERurl = parse_url($_SERVER['HTTP_REFERER']);
647 $URL['REFERER'] = $REFERERurl['host'];
648 $URL['HOST'] = $_SERVER["SERVER_NAME"];
650 if(!isset($_POST['username'])) { $_POST['username'] = null; }
651 if(!isset($_POST['TOS'])) { $_POST['TOS'] = null; }
652 if($Settings['use_captcha']=="on") {
653 require($SettDir['inc']."captcha.php"); }
655 <div class="Table1Border">
656 <table class="Table1">
657 <tr class="TableRow1">
658 <td class="TableRow1"><span style="float: right;"> </span>
659 <a href="<?php echo url_maker($exfile['messenger'],$Settings['file_ext'],"act=signup",$Settings['qstr'],$Settings['qsep'],$prexqstr['messenger'],$exqstr['messenger']); ?>">Register</a></td>
661 <tr class="TableRow2">
662 <th class="TableRow2" style="width: 100%; text-align: left;"> Signup Message: </th>
664 <tr class="TableRow3">
665 <td class="TableRow3">
666 <table style="width: 100%; height: 25%; text-align: center;">
667 <?php if (pre_strlen($_POST['Password'])>="30") { $Error="Yes"; ?>
669 <td><span class="TableMessage">
670 <br />Your password is too big.<br />
673 <?php } if (pre_strlen($_POST['username'])>="24") { $Error="Yes"; ?>
675 <td><span class="TableMessage">
676 <br />Your user name is too big.<br />
679 <?php } if ($_POST['Password']!=$_POST['RePassword']) { $Error="Yes"; ?>
681 <td><span class="TableMessage">
682 <br />Your passwords did not match.<br />
685 <?php } if($Settings['use_captcha']=="on") {
686 if (PhpCaptcha::Validate($_POST['signcode'])) {
687 //echo 'Valid code entered';
688 } else { $Error="Yes"; ?>
690 <td><span class="TableMessage">
691 <br />Invalid code entered<br />
694 <?php } } if ($Settings['TestReferer']===true) {
695 if ($URL['HOST']!=$URL['REFERER']) { $Error="Yes"; ?>
697 <td><span class="TableMessage">
698 <br />Sorry the referering url dose not match our host name.<br />
702 $Name = stripcslashes(htmlspecialchars($_POST['Name'], ENT_QUOTES, $Settings['charset']));
703 //$Name = preg_replace("/&#(x[a-f0-9]+|[0-9]+);/i", "&#$1;", $Name);
704 $Name = @remove_spaces($Name);
705 $lonewolfqy=query("SELECT * FROM `".$Settings['sqltable']."restrictedwords` WHERE `RestrictedUserName`='yes'", array(null));
706 $lonewolfrt=mysql_query($lonewolfqy);
707 $lonewolfnm=mysql_num_rows($lonewolfrt);
708 $lonewolfs=0; $RMatches = null;
709 while ($lonewolfs < $lonewolfnm) {
710 $RWord=mysql_result($lonewolfrt,$lonewolfs,"Word");
711 $RCaseInsensitive=mysql_result($lonewolfrt,$lonewolfs,"CaseInsensitive");
712 if($RCaseInsensitive=="on") { $RCaseInsensitive = "yes"; }
713 if($RCaseInsensitive=="off") { $RCaseInsensitive = "no"; }
714 if($RCaseInsensitive!="yes"||$RCaseInsensitive!="no") { $RCaseInsensitive = "no"; }
715 $RWholeWord=mysql_result($lonewolfrt,$lonewolfs,"WholeWord");
716 if($RWholeWord=="on") { $RWholeWord = "yes"; }
717 if($RWholeWord=="off") { $RWholeWord = "no"; }
718 if($RWholeWord!="yes"||$RWholeWord!="no") { $RWholeWord = "no"; }
719 $RWord = preg_quote($RWord, "/");
720 if($RCaseInsensitive!="yes"&&$RWholeWord=="yes") {
721 $RMatches = preg_match("/\b(".$RWord.")\b/", $Name);
722 if($RMatches==true) { break 1; } }
723 if($RCaseInsensitive=="yes"&&$RWholeWord=="yes") {
724 $RMatches = preg_match("/\b(".$RWord.")\b/i", $Name);
725 if($RMatches==true) { break 1; } }
726 if($RCaseInsensitive!="yes"&&$RWholeWord!="yes") {
727 $RMatches = preg_match("/".$RWord."/", $Name);
728 if($RMatches==true) { break 1; } }
729 if($RCaseInsensitive=="yes"&&$RWholeWord!="yes") {
730 $RMatches = preg_match("/".$RWord."/i", $Name);
731 if($RMatches==true) { break 1; } }
732 ++$lonewolfs; } @mysql_free_result($lonewolfrt);
733 $sql_email_check = mysql_query(query("SELECT `Email` FROM `".$Settings['sqltable']."members` WHERE `Email`='%s'", array($_POST['Email'])));
734 $sql_username_check = mysql_query(query("SELECT `Name` FROM `".$Settings['sqltable']."members` WHERE `Name`='%s'", array($Name)));
735 $email_check = mysql_num_rows($sql_email_check);
736 $username_check = mysql_num_rows($sql_username_check);
737 @mysql_free_result($sql_email_check); @mysql_free_result($sql_username_check);
738 if ($_POST['TOS']!="Agree") { $Error="Yes"; ?>
740 <td><span class="TableMessage">
741 <br />You need to agree to the tos.<br />
744 <?php } if ($_POST['Name']==null) { $Error="Yes"; ?>
746 <td><span class="TableMessage">
747 <br />You need to enter a name.<br />
750 <?php } if ($_POST['Name']=="ShowMe") { $Error="Yes"; ?>
752 <td><span class="TableMessage">
753 <br />You need to enter a name.<br />
756 <?php } if ($_POST['Password']==null) { $Error="Yes"; ?>
758 <td><span class="TableMessage">
759 <br />You need to enter a password.<br />
762 <?php } if ($_POST['Email']==null) { $Error="Yes"; ?>
764 <td><span class="TableMessage">
765 <br />You need to enter a email.<br />
768 <?php } if($email_check > 0) { $Error="Yes"; ?>
770 <td><span class="TableMessage">
771 <br />Email address is already used.<br />
774 <?php } if($username_check > 0) { $Error="Yes"; ?>
776 <td><span class="TableMessage">
777 <br />User Name is already used.<br />
780 <?php } if($RMatches==true) { $Error="Yes"; ?>
782 <td><span class="TableMessage">
783 <br />This User Name is restricted to use.<br />
786 <?php } if ($Error=="Yes") {
787 @redirect("refresh",$basedir.url_maker($exfile['member'],$Settings['file_ext'],"act=signup",$Settings['qstr'],$Settings['qsep'],$prexqstr['member'],$exqstr['member'],FALSE),"4"); ?>
789 <td><span class="TableMessage">
790 <br />Click <a href="<?php echo url_maker($exfile['member'],$Settings['file_ext'],"act=signup",$Settings['qstr'],$Settings['qsep'],$exqstr['member'],$prexqstr['member']); ?>">here</a> to try again.<br />
793 <?php } if ($Error!="Yes") {
794 $_POST['UserIP'] = $_SERVER['REMOTE_ADDR'];
795 $_POST['Group'] = $Settings['MemberGroup'];
796 $_POST['Joined'] = GMTimeStamp(); $_POST['LastActive'] = GMTimeStamp();
797 $_POST['Signature'] = ""; $_POST['Interests'] = "";
798 $_POST['Title'] = ""; $_POST['PostCount'] = "0";
799 if($Settings['AdminValidate']===true||$Settings['AdminValidate']!==false)
800 { $ValidateStats="no"; $yourgroup=$Settings['ValidateGroup']; }
801 if($Settings['AdminValidate']===false)
802 { $ValidateStats="yes"; $yourgroup=$Settings['MemberGroup']; }
803 $HashSalt = salt_hmac();
804 $NewPassword = b64e_hmac($_POST['Password'],$_POST['Joined'],$HashSalt,"sha1");
805 $_GET['YourPost'] = $_POST['Signature'];
806 //require( './'.$SettDir['misc'].'HTMLTags.php');
807 $_GET['YourPost'] = htmlspecialchars($_GET['YourPost'], ENT_QUOTES, $Settings['charset']);
808 //$_GET['YourPost'] = preg_replace("/&#(x[a-f0-9]+|[0-9]+);/i", "&#$1;", $_GET['YourPost']);
809 $NewSignature = $_GET['YourPost'];
810 $_GET['YourPost'] = preg_replace("/\t+/"," ",$_GET['YourPost']);
811 $_GET['YourPost'] = preg_replace("/\s\s+/"," ",$_GET['YourPost']);
812 $_GET['YourPost'] = remove_bad_entities($_GET['YourPost']);
813 $Avatar = stripcslashes(htmlspecialchars($_POST['Avatar'], ENT_QUOTES, $Settings['charset']));
814 //$Avatar = preg_replace("/&#(x[a-f0-9]+|[0-9]+);/i", "&#$1;", $Avatar);
815 $Avatar = @remove_spaces($Avatar);
816 $Website = stripcslashes(htmlspecialchars($_POST['Website'], ENT_QUOTES, $Settings['charset']));
817 //$Website = preg_replace("/&#(x[a-f0-9]+|[0-9]+);/i", "&#$1;", $Website);
818 $Website = @remove_spaces($Website);
819 $gquerys = query("SELECT * FROM `".$Settings['sqltable']."groups` WHERE `Name`='%s' LIMIT 1", array($yourgroup));
820 $gresults=mysql_query($gquerys);
821 $yourgroup=mysql_result($gresults,0,"id");
822 @mysql_free_result($gresults);
823 $yourid = getnextid($Settings['sqltable'],"members");
824 $_POST['Interests'] = @remove_spaces($_POST['Interests']);
825 $_POST['Title'] = @remove_spaces($_POST['Title']);
826 $_POST['Email'] = @remove_spaces($_POST['Email']);
827 if(!is_numeric($_POST['YourOffSet'])) { $_POST['YourOffSet'] = "0"; }
828 if($_POST['YourOffSet']>12) { $_POST['YourOffSet'] = "12"; }
829 if($_POST['YourOffSet']<-12) { $_POST['YourOffSet'] = "-12"; }
830 if(!is_numeric($_POST['MinOffSet'])) { $_POST['MinOffSet'] = "00"; }
831 if($_POST['MinOffSet']>59) { $_POST['MinOffSet'] = "59"; }
832 if($_POST['MinOffSet']<0) { $_POST['MinOffSet'] = "00"; }
833 $_POST['YourOffSet'] = $_POST['YourOffSet'].":".$_POST['MinOffSet'];
834 $query = query("INSERT INTO `".$Settings['sqltable']."members` VALUES (".$yourid.",'%s','%s','%s','%s','%s','%s',%i,'%s','%s',%i,%i,'0','0','0','0','%s','%s','%s','%s','%s','%s',%i,'%s','%s','%s','%s','%s')", array($Name,$NewPassword,"iDBH",$_POST['Email'],$yourgroup,$ValidateStats,"0",$_POST['Interests'],$_POST['Title'],$_POST['Joined'],$_POST['LastActive'],$NewSignature,'Your Notes',$Avatar,"100x100",$Website,$_POST['YourGender'],$_POST['PostCount'],$_POST['YourOffSet'],$_POST['DST'],$Settings['DefaultTheme'],$_POST['UserIP'],$HashSalt));
836 $querylogr = query("SELECT * FROM `".$Settings['sqltable']."members` WHERE `Name`='%s' AND `Password`='%s' LIMIT 1", array($Name,$NewPassword));
837 $resultlogr=mysql_query($querylogr);
838 $numlogr=mysql_num_rows($resultlogr);
841 $YourIDMr=mysql_result($resultlogr,$ir,"id");
842 $YourNameMr=mysql_result($resultlogr,$ir,"Name");
843 $YourGroupMr=mysql_result($resultlogr,$ir,"GroupID");
844 $gquery = query("SELECT * FROM `".$Settings['sqltable']."groups` WHERE `id`=%i LIMIT 1", array($YourGroupMr));
845 $gresult=mysql_query($gquery);
846 $YourGroupMr=mysql_result($gresult,0,"Name");
847 @mysql_free_result($gresult);
848 $YourTimeZoneMr=mysql_result($resultlogr,$ir,"TimeZone");
849 $YourDSTMr=mysql_result($resultlogr,$ir,"DST"); }
850 @mysql_free_result($resultlogr);
851 @session_regenerate_id(true);
852 $_SESSION['Loggedin']=true;
853 $_SESSION['MemberName']=$YourNameMr;
854 $_SESSION['UserID']=$YourIDMr;
855 $_SESSION['UserTimeZone']=$YourTimeZoneMr;
856 $_SESSION['UserDST']=$YourDSTMr;
857 $_SESSION['UserGroup']=$YourGroupMr;
858 $_SESSION['UserPass']=$NewPassword;
859 $_SESSION['DBName']=$Settings['sqldb'];
860 if($_POST['storecookie']===true) {
861 if($cookieDomain==null) {
862 @setcookie("MemberName", $YourNameM, time() + (7 * 86400), $cbasedir);
863 @setcookie("UserID", $YourIDM, time() + (7 * 86400), $cbasedir);
864 @setcookie("SessPass", $NewPassword, time() + (7 * 86400), $cbasedir); }
865 if($cookieDomain!=null) {
866 if($cookieSecure===true) {
867 @setcookie("MemberName", $YourNameM, time() + (7 * 86400), $cbasedir, $cookieDomain, 1);
868 @setcookie("UserID", $YourIDM, time() + (7 * 86400), $cbasedir, $cookieDomain, 1);
869 @setcookie("SessPass", $NewPassword, time() + (7 * 86400), $cbasedir, $cookieDomain, 1); }
870 if($cookieSecure===false) {
871 @setcookie("MemberName", $YourNameM, time() + (7 * 86400), $cbasedir, $cookieDomain);
872 @setcookie("UserID", $YourIDM, time() + (7 * 86400), $cbasedir, $cookieDomain);
873 @setcookie("SessPass", $NewPassword, time() + (7 * 86400), $cbasedir, $cookieDomain); } } }
875 $SendPMtoID=$_SESSION['UserID'];
877 $PMTitle = "Welcome ".$Name.".";
878 $YourMessage = "Hello ".$Name.". Welcome to ".$Settings['board_name'].". I hope you enjoy your stay here. ^_^ ";
879 $_POST['YourDate'] = $_POST['Joined'];
880 $query = query("INSERT INTO `".$Settings['sqltable']."messenger` VALUES (null,%i,%i,'%s','%s','%s','%s',0)", array($YourPMID,$SendPMtoID,'',$PMTitle,$YourMessage,$_POST['YourDate']));
881 //mysql_query($query);
882 @redirect("refresh",$basedir.url_maker($exfile['index'],$Settings['file_ext'],"act=view",$Settings['qstr'],$Settings['qsep'],$prexqstr['index'],$exqstr['index'],FALSE),"3");
886 <td><span class="TableMessage">
887 <br />Welcome to the Board <?php echo $_SESSION['MemberName']; ?>. ^_^<br />
888 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.<?php echo "\n";
889 if($Settings['AdminValidate']===true||$Settings['AdminValidate']!==false) {
890 echo "<br />The admin has to validate your account befoure you can post.\n";
891 echo "<br />The admin has been notified of your registration.\n"; } ?>
898 <tr class="TableRow4">
899 <td class="TableRow4"> </td>