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: 03/27/2008 SVN 156 - 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 $NumberMembers = getnumrows($Settings['sqltable'],"members");
58 $sql_guest_check = mysql_query(query("SELECT * FROM `".$Settings['sqltable']."members` WHERE `id`=%i LIMIT 1", array("-1")));
59 $guest_check = mysql_num_rows($sql_guest_check); @mysql_free_result($sql_guest_check);
60 if($guest_check > 0) { $NumberMembers = $NumberMembers - 1; }
61 if($NumberMembers==null) {
63 $num = $NumberMembers;
64 //Start MemberList Page Code
65 if(!isset($Settings['max_memlist'])) { $Settings['max_memlist'] = 10; }
66 if($_GET['page']==null) { $_GET['page'] = 1; }
67 if($_GET['page']<=0) { $_GET['page'] = 1; }
68 $nums = $_GET['page'] * $Settings['max_memlist'];
69 if($nums>$num) { $nums = $num; }
70 $numz = $nums - $Settings['max_memlist'];
71 if($numz<=0) { $numz = 0; }
73 if($nums<$num) { $nextpage = $_GET['page'] + 1; }
74 if($nums>=$num) { $nextpage = $_GET['page']; }
75 if($numz>=$Settings['max_memlist']) { $backpage = $_GET['page'] - 1; }
76 if($_GET['page']<=1) { $backpage = 1; }
77 $pnum = $num; $l = 1; $Pages = null;
79 if($pnum>=$Settings['max_memlist']) {
80 $pnum = $pnum - $Settings['max_memlist'];
81 $Pages[$l] = $l; ++$l; }
82 if($pnum<$Settings['max_memlist']&&$pnum>0) {
83 $pnum = $pnum - $pnum;
84 $Pages[$l] = $l; ++$l; } }
85 $PageLimit = $nums - $Settings['max_memlist'];
86 if($PageLimit<0) { $PageLimit = 0; }
87 //End MemberList Page Code
89 if($_GET['groupid']==null) {
90 $query = query("SELECT * FROM `".$Settings['sqltable']."members` WHERE `GroupID`<>%i ".$orderlist." LIMIT %i,%i", array($GGroup,$PageLimit,$Settings['max_memlist'])); }
91 if($_GET['groupid']!=null) {
92 $query = query("SELECT * FROM `".$Settings['sqltable']."members` WHERE `GroupID`=%i AND `GroupID`<>%i ".$orderlist." LIMIT %i,%i", array($_GET['groupid'],$GGroup,$PageLimit,$Settings['max_memlist'])); }
93 $result=mysql_query($query);
94 $num=mysql_num_rows($result);
95 //List Page Number Code Start
96 $pagenum=count($Pages);
97 if($_GET['page']>$pagenum) {
98 $_GET['page'] = $pagenum; }
99 $pagei=0; $pstring = "<div class=\"PageList\">Pages: ";
100 if($_GET['page']<4) { $Pagez[0] = null; }
101 if($_GET['page']>=4) { $Pagez[0] = "First"; }
102 if($_GET['page']>=3) {
103 $Pagez[1] = $_GET['page'] - 2; }
104 if($_GET['page']<3) {
106 if($_GET['page']>=2) {
107 $Pagez[2] = $_GET['page'] - 1; }
108 if($_GET['page']<2) {
110 $Pagez[3] = $_GET['page'];
111 if($_GET['page']<$pagenum) {
112 $Pagez[4] = $_GET['page'] + 1; }
113 if($_GET['page']>=$pagenum) {
115 $pagenext = $_GET['page'] + 1;
116 if($pagenext<$pagenum) {
117 $Pagez[5] = $_GET['page'] + 2; }
118 if($pagenext>=$pagenum) {
120 if($_GET['page']<$pagenum) { $Pagez[6] = "Last"; }
121 if($_GET['page']>=$pagenum) { $Pagez[6] = null; }
122 $pagenumi=count($Pagez);
123 if($NumberTopics==0) {
125 $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> "; }
126 while ($pagei < $pagenumi) {
127 if($Pagez[$pagei]!=null&&
128 $Pagez[$pagei]!="First"&&
129 $Pagez[$pagei]!="Last") {
130 $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> "; }
131 if($Pagez[$pagei]=="First") {
132 $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> ... "; }
133 if($Pagez[$pagei]=="Last") {
134 $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> "; }
135 ++$pagei; } $pstring = $pstring."</div>";
137 //List Page Number Code end
139 <div class="Table1Border">
140 <table class="Table1">
141 <tr class="TableRow1">
142 <td class="TableRow1" colspan="7"><span style="float: left;">
143 <?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>
144 </span><span style="float: right;"> </span></td>
146 <tr id="Member" class="TableRow2">
147 <th class="TableRow2" style="width: 5%;">ID</th>
148 <th class="TableRow2" style="width: 28%;">Name</th>
149 <th class="TableRow2" style="width: 10%;">Group</th>
150 <th class="TableRow2" style="width: 10%;">Posts</th>
151 <th class="TableRow2" style="width: 20%;">Joined</th>
152 <th class="TableRow2" style="width: 20%;">Last Active</th>
153 <th class="TableRow2" style="width: 7%;">Website</th>
157 $MemList['ID']=mysql_result($result,$i,"id");
158 $MemList['Name']=mysql_result($result,$i,"Name");
159 $MemList['Email']=mysql_result($result,$i,"Email");
160 $MemList['GroupID']=mysql_result($result,$i,"GroupID");
161 $MemList['WarnLevel']=mysql_result($result,$i,"WarnLevel");
162 $MemList['Interests']=mysql_result($result,$i,"Interests");
163 $MemList['Title']=mysql_result($result,$i,"Title");
164 $MemList['Joined']=mysql_result($result,$i,"Joined");
165 $MemList['Joined']=GMTimeChange("F j Y, g:i a",$MemList['Joined'],$_SESSION['UserTimeZone'],0,$_SESSION['UserDST']);
166 $MemList['LastActive']=mysql_result($result,$i,"LastActive");
167 $MemList['LastActive']=GMTimeChange("F j Y, g:i a",$MemList['LastActive'],$_SESSION['UserTimeZone'],0,$_SESSION['UserDST']);
168 $MemList['Website']=mysql_result($result,$i,"Website");
169 $MemList['Gender']=mysql_result($result,$i,"Gender");
170 $MemList['PostCount']=mysql_result($result,$i,"PostCount");
171 $MemList['TimeZone']=mysql_result($result,$i,"TimeZone");
172 $MemList['DST']=mysql_result($result,$i,"DST");
173 $MemList['IP']=mysql_result($result,$i,"IP");
174 $gquery = query("SELECT * FROM `".$Settings['sqltable']."groups` WHERE `id`=%i LIMIT 1", array($MemList['GroupID']));
175 $gresult=mysql_query($gquery);
176 $MemList['Group']=mysql_result($gresult,0,"Name");
177 @mysql_free_result($gresult);
178 $membertitle = " ".$ThemeSet['TitleDivider']." Member List";
179 if($MemList['Group']!=$Settings['GuestGroup']) {
181 <tr class="TableRow3" id="Member<?php echo $MemList['ID']; ?>">
182 <td class="TableRow3" style="text-align: center;"><?php echo $MemList['ID']; ?></td>
183 <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>
184 <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>
185 <td class="TableRow3" style="text-align: center;"><?php echo $MemList['PostCount']; ?></td>
186 <td class="TableRow3" style="text-align: center;"><?php echo $MemList['Joined']; ?></td>
187 <td class="TableRow3" style="text-align: center;"><?php echo $MemList['LastActive']; ?></td>
188 <td class="TableRow3" style="text-align: center;"><a href="<?php echo $MemList['Website']; ?>" onclick="window.open(this.href);return false;">Website</a></td>
191 ++$i; } @mysql_free_result($result);
193 <tr id="MemEnd" class="TableRow4">
194 <td class="TableRow4" colspan="7"> </td>
198 if($_GET['act']=="view") {
199 $query = query("SELECT * FROM `".$Settings['sqltable']."members` WHERE `id`=%i LIMIT 1", array($_GET['id']));
200 $result=mysql_query($query);
201 $num=mysql_num_rows($result);
203 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));
204 ob_clean(); @header("Content-Type: text/plain; charset=".$Settings['charset']);
205 gzip_page($Settings['use_gzip'],$GZipEncode['Type']); @mysql_close(); die(); }
206 $ViewMem['ID']=mysql_result($result,$i,"id");
207 $ViewMem['Name']=mysql_result($result,$i,"Name");
208 $ViewMem['Signature']=mysql_result($result,$i,"Signature");
209 $ViewMem['Avatar']=mysql_result($result,$i,"Avatar");
210 $ViewMem['AvatarSize']=mysql_result($result,$i,"AvatarSize");
211 $ViewMem['Email']=mysql_result($result,$i,"Email");
212 $ViewMem['GroupID']=mysql_result($result,$i,"GroupID");
213 $ViewMem['WarnLevel']=mysql_result($result,$i,"WarnLevel");
214 $ViewMem['Interests']=mysql_result($result,$i,"Interests");
215 $ViewMem['Title']=mysql_result($result,$i,"Title");
216 $ViewMem['Joined']=mysql_result($result,$i,"Joined");
217 $ViewMem['Joined']=GMTimeChange("M j Y, g:i a",$ViewMem['Joined'],$_SESSION['UserTimeZone'],0,$_SESSION['UserDST']);
218 $ViewMem['LastActive']=mysql_result($result,$i,"LastActive");
219 $ViewMem['LastActive']=GMTimeChange("M j Y, g:i a",$ViewMem['LastActive'],$_SESSION['UserTimeZone'],0,$_SESSION['UserDST']);
220 $ViewMem['Website']=mysql_result($result,$i,"Website");
221 $ViewMem['Gender']=mysql_result($result,$i,"Gender");
222 $ViewMem['PostCount']=mysql_result($result,$i,"PostCount");
223 $ViewMem['TimeZone']=mysql_result($result,$i,"TimeZone");
224 $ViewMem['DST']=mysql_result($result,$i,"DST");
225 $ViewMem['IP']=mysql_result($result,$i,"IP");
226 $gquery = query("SELECT * FROM `".$Settings['sqltable']."groups` WHERE `id`=%i LIMIT 1", array($ViewMem['GroupID']));
227 $gresult=mysql_query($gquery);
228 $ViewMem['Group']=mysql_result($gresult,0,"Name");
229 @mysql_free_result($gresult);
230 $membertitle = " ".$ThemeSet['TitleDivider']." ".$ViewMem['Name'];
231 if ($ViewMem['Avatar']=="http://"||$ViewMem['Avatar']==null||
232 strtolower($ViewMem['Avatar'])=="noavatar") {
233 $ViewMem['Avatar']=$ThemeSet['NoAvatar'];
234 $ViewMem['AvatarSize']=$ThemeSet['NoAvatarSize']; }
235 $AvatarSize1=explode("x", $ViewMem['AvatarSize']);
236 $AvatarSize1W=$AvatarSize1[0]; $AvatarSize1H=$AvatarSize1[1];
237 $ViewMem['Signature'] = text2icons($ViewMem['Signature'],$Settings['sqltable']);
238 if($_GET['view']==null) { $_GET['view'] = "profile"; }
239 if($_GET['view']!="profile"&&$_GET['view']!="avatar"&&
240 $_GET['view']!="website"&&$_GET['view']!="homepage") { $_GET['view'] = "profile"; }
241 if($_GET['view']=="avatar") {
242 @session_write_close();
243 @header("Location: ".$ViewMem['Avatar']); }
244 if($_GET['view']=="website"||$_GET['view']=="homepage") {
245 if ($ViewMem['Website']!="http://"&&$ViewMem['Website']!=null) {
246 @session_write_close();
247 @header("Location: ".$ViewMem['Website']); }
248 if ($ViewMem['Website']=="http://"||$ViewMem['Website']==null||
249 strtolower($ViewMem['Avatar'])=="noavatar") {
250 @session_write_close();
251 @header("Location: ".$BoardURL."index.php?act=view"); } }
253 <div class="Table1Border">
254 <table class="Table1">
255 <tr class="TableRow1">
256 <td class="TableRow1" colspan="2"><span style="float: left;">
257 <?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>
258 </span><span style="float: right;"> </span></td>
260 <tr id="Member" class="TableRow2">
261 <th class="TableRow2" style="width: 50%;">Avatar</th>
262 <th class="TableRow2" style="width: 50%;">User Info</th>
264 <tr class="TableRow3" id="MemberProfile">
265 <td class="TableRow3">
266 <?php /* Avatar Table Thanks For SeanJ's Help at http://seanj.jcink.com/ */ ?>
267 <table class="AvatarTable" style="width: 100%; height: 100px; text-align: center;">
268 <tr class="AvatarRow" style="width: 100px; height: 100px;">
269 <td class="AvatarRow" style="width: 100%; height: 100%; text-align: center; vertical-align: middle;">
270 <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;" />
274 <div style="text-align: center;">
275 Name: <?php echo $ViewMem['Name']; ?><br />
276 Title: <?php echo $ViewMem['Title']; ?></div>
278 <td class="TableRow3">
279 User Name: <?php echo $ViewMem['Name']; ?><br />
280 User Title: <?php echo $ViewMem['Title']; ?><br />
281 User Group: <?php echo $ViewMem['Group']; ?><br />
282 User Joined: <?php echo $ViewMem['Joined']; ?><br />
283 Last Active: <?php echo $ViewMem['LastActive']; ?><br />
284 User Time: <?php echo GMTimeGet("M j Y, g:i a",$ViewMem['TimeZone'],0,$ViewMem['DST']); ?><br />
285 User Website: <a href="<?php echo $ViewMem['Website']; ?>" onclick="window.open(this.href);return false;">Website</a><br />
286 Post Count: <?php echo $ViewMem['PostCount']; ?><br />
287 Interests: <?php echo $ViewMem['Interests']; ?><br />
290 <tr class="TableRow4">
291 <td class="TableRow4" colspan="2"> </td>
294 <?php } @mysql_free_result($result);
295 if($_GET['act']=="logout") {
297 if($cookieDomain==null) {
298 @setcookie("MemberName", null, GMTimeStamp() - 3600, $cbasedir);
299 @setcookie("UserID", null, GMTimeStamp() - 3600, $cbasedir);
300 @setcookie("SessPass", null, GMTimeStamp() - 3600, $cbasedir);
301 @setcookie(session_name(), "", GMTimeStamp() - 3600, $cbasedir); }
302 if($cookieDomain!=null) {
303 if($cookieSecure==true) {
304 @setcookie("MemberName", null, GMTimeStamp() - 3600, $cbasedir, $cookieDomain, 1);
305 @setcookie("UserID", null, GMTimeStamp() - 3600, $cbasedir, $cookieDomain, 1);
306 @setcookie("SessPass", null, GMTimeStamp() - 3600, $cbasedir, $cookieDomain, 1);
307 @setcookie(session_name(), "", GMTimeStamp() - 3600, $cbasedir, $cookieDomain, 1); }
308 if($cookieSecure==false) {
309 @setcookie("MemberName", null, GMTimeStamp() - 3600, $cbasedir, $cookieDomain);
310 @setcookie("UserID", null, GMTimeStamp() - 3600, $cbasedir, $cookieDomain);
311 @setcookie("SessPass", null, GMTimeStamp() - 3600, $cbasedir, $cookieDomain);
312 @setcookie(session_name(), "", GMTimeStamp() - 3600, $cbasedir, $cookieDomain); } }
313 unset($_COOKIE[session_name()]);
317 @redirect("location",$basedir.url_maker($exfile['member'],$Settings['file_ext'],"act=login",$Settings['qstr'],$Settings['qsep'],$prexqstr['member'],$exqstr['member'],false));
318 ob_clean(); @header("Content-Type: text/plain; charset=".$Settings['charset']);
319 gzip_page($Settings['use_gzip'],$GZipEncode['Type']); @mysql_close(); die(); }
320 if($_GET['act']=="login") {
321 if($_SESSION['UserID']!=0&&$_SESSION['UserID']!=null) {
322 redirect("location",$basedir.url_maker($exfile['member'],$Settings['file_ext'],"act=logout",$Settings['qstr'],$Settings['qsep'],$prexqstr['member'],$exqstr['member'],false));
323 ob_clean(); @header("Content-Type: text/plain; charset=".$Settings['charset']);
324 gzip_page($Settings['use_gzip'],$GZipEncode['Type']); @mysql_close(); die(); }
325 if($_SESSION['UserID']==0||$_SESSION['UserID']==null) {
326 $membertitle = " ".$ThemeSet['TitleDivider']." Login";
328 <div class="Table1Border">
329 <table class="Table1">
330 <tr class="TableRow1">
331 <td class="TableRow1"><span style="float: left;">
332 <?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>
333 </span><span style="float: right;"> </span></td>
335 <tr class="TableRow2">
336 <th class="TableRow2" style="width: 100%; text-align: left;"> Inert your login info: </th>
338 <tr class="TableRow3">
339 <td class="TableRow3">
340 <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']); ?>">
341 <table style="text-align: left;">
342 <tr style="text-align: left;">
343 <td style="width: 30%;"><label class="TextBoxLabel" for="username">Enter UserName: </label></td>
344 <td style="width: 70%;"><input maxlength="24" class="TextBox" id="username" type="text" name="username" /></td>
346 <td style="width: 30%;"><label class="TextBoxLabel" for="userpass">Enter Password: </label></td>
347 <td style="width: 70%;"><input maxlength="30" class="TextBox" id="userpass" type="password" name="userpass" /></td>
349 <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>
350 <td style="width: 70%;"><select id="storecookie" name="storecookie" class="TextBox">
351 <option value="true">Yes</option>
352 <option value="false">No</option>
355 <table style="text-align: left;">
356 <tr style="text-align: left;">
357 <td style="width: 100%;">
358 <input type="hidden" name="act" value="loginmember" style="display: none;" />
359 <input class="Button" type="submit" value="Log in" />
364 <tr class="TableRow4">
365 <td class="TableRow4"> </td>
368 <?php } } if($_POST['act']=="loginmember"&&$_GET['act']=="login_now") {
369 if($_SESSION['UserID']!=0&&$_SESSION['UserID']!=null) {
370 redirect("location",$basedir.url_maker($exfile['member'],$Settings['file_ext'],"act=logout",$Settings['qstr'],$Settings['qsep'],$prexqstr['member'],$exqstr['member'],false));
371 ob_clean(); @header("Content-Type: text/plain; charset=".$Settings['charset']);
372 gzip_page($Settings['use_gzip'],$GZipEncode['Type']); @mysql_close(); die(); }
373 if($_SESSION['UserID']==0||$_SESSION['UserID']==null) {
374 $membertitle = " ".$ThemeSet['TitleDivider']." Login";
375 $REFERERurl = parse_url($_SERVER['HTTP_REFERER']);
376 $URL['REFERER'] = $REFERERurl['host'];
377 $URL['HOST'] = $_SERVER["SERVER_NAME"];
380 <div class="Table1Border">
381 <table class="Table1">
382 <tr class="TableRow1">
383 <td class="TableRow1">
384 <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>
385 <span style="float: right;"> </span></td>
387 <tr class="TableRow2">
388 <th class="TableRow2" style="width: 100%; text-align: left;"> Login Message: </th>
390 <tr class="TableRow3">
391 <td class="TableRow3">
392 <table style="width: 100%; height: 25%; text-align: center;">
394 if (pre_strlen($_POST['userpass'])>="30") { $Error="Yes"; ?>
396 <td><span class="TableMessage">
397 <br />Your password is too big.<br />
400 <?php } if (pre_strlen($_POST['username'])>="24") { $Error="Yes"; ?>
402 <td><span class="TableMessage">
403 <br />Your user name is too big.<br />
406 <?php } if ($Settings['TestReferer']==true) {
407 if ($URL['HOST']!=$URL['REFERER']) { $Error="Yes"; ?>
409 <td><span class="TableMessage">
410 <br />Sorry the referering url dose not match our host name.<br />
413 <?php } } $BanError = null;
415 @redirect("refresh",$basedir.url_maker($exfile['member'],$Settings['file_ext'],"act=login",$Settings['qstr'],$Settings['qsep'],$prexqstr['member'],$exqstr['member'],false),"4"); }
417 $YourName = stripcslashes(htmlspecialchars($_POST['username'], ENT_QUOTES, $Settings['charset']));
418 //$YourName = preg_replace("/&#(x[a-f0-9]+|[0-9]+);/i", "&#$1;", $YourName);
419 $YourName = @remove_spaces($YourName);
421 $querylog = query("SELECT * FROM `".$Settings['sqltable']."members` WHERE `Name`='%s' LIMIT 1", array($YourName));
422 $resultlog=mysql_query($querylog);
423 $numlog=mysql_num_rows($resultlog);
426 $YourPassTry=mysql_result($resultlog,$i,"Password");
427 $HashType=mysql_result($resultlog,$i,"HashType");
428 $JoinedPass=mysql_result($resultlog,$i,"Joined");
429 $HashSalt=mysql_result($resultlog,$i,"Salt");
431 if($HashType=="ODFH") { $YourPassword = sha1(md5($_POST['userpass'])); }
432 if($HashType=="DF4H") { $YourPassword = b64e_hmac($_POST['userpass'],$JoinedPass,$HashSalt,"sha1"); }
433 if($HashType=="iDBH"||$UpdateHash!=true) { $YourPassword = b64e_hmac($_POST['userpass'],$JoinedPass,$HashSalt,"sha1"); }
434 if($YourPassword==$YourPassTry) { $passright = false; }
435 if($YourPassword==$YourPassTry) { $passright = true;
436 $YourIDM=mysql_result($resultlog,$i,"id");
437 $YourNameM=mysql_result($resultlog,$i,"Name");
438 $YourPassM=mysql_result($resultlog,$i,"Password");
439 $PostCount=mysql_result($resultlog,$i,"PostCount");
440 $YourGroupM=mysql_result($resultlog,$i,"GroupID");
441 $YourBanTime=mysql_result($resultlog,$i,"BanTime");
442 $CGMTime = GMTimeStamp();
443 if($YourBanTime!=0&&$YourBanTime!=null) {
444 if($YourBanTime>=$CGMTime) { $BanError = "yes"; } }
445 $gquery = query("SELECT * FROM `".$Settings['sqltable']."groups` WHERE `id`=%i LIMIT 1", array($YourGroupM));
446 $gresult=mysql_query($gquery);
447 $YourGroupM=mysql_result($gresult,0,"Name");
448 @mysql_free_result($gresult);
449 $YourTimeZoneM=mysql_result($resultlog,$i,"TimeZone");
450 $YourDSTM=mysql_result($resultlog,$i,"DST");
451 $JoinedDate=mysql_result($resultlog,$i,"Joined");
452 $UseTheme=mysql_result($resultlog,$i,"UseTheme");
453 $NewHashSalt = salt_hmac();
454 $NewPassword = b64e_hmac($_POST['userpass'],$JoinedPass,$NewHashSalt,"sha1");
455 $NewDay=GMTimeStamp();
456 $NewIP=$_SERVER['REMOTE_ADDR'];
457 if($BanError!="yes") {
458 $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));
459 mysql_query($queryup);
460 @mysql_free_result($resultlog); @mysql_free_result($queryup);
461 //session_regenerate_id();
462 $_SESSION['Theme']=$UseTheme;
463 $_SESSION['MemberName']=$YourNameM;
464 $_SESSION['UserID']=$YourIDM;
465 $_SESSION['UserTimeZone']=$YourTimeZoneM;
466 $_SESSION['UserGroup']=$YourGroupM;
467 $_SESSION['UserDST']=$YourDSTM;
468 $_SESSION['UserPass']=$NewPassword;
469 $_SESSION['DBName']=$Settings['sqldb'];
470 if($_POST['storecookie']==true) {
471 if($cookieDomain==null) {
472 @setcookie("MemberName", $YourNameM, time() + (7 * 86400), $cbasedir);
473 @setcookie("UserID", $YourIDM, time() + (7 * 86400), $cbasedir);
474 @setcookie("SessPass", $NewPassword, time() + (7 * 86400), $cbasedir); }
475 if($cookieDomain!=null) {
476 if($cookieSecure==true) {
477 @setcookie("MemberName", $YourNameM, time() + (7 * 86400), $cbasedir, $cookieDomain, 1);
478 @setcookie("UserID", $YourIDM, time() + (7 * 86400), $cbasedir, $cookieDomain, 1);
479 @setcookie("SessPass", $NewPassword, time() + (7 * 86400), $cbasedir, $cookieDomain, 1); }
480 if($cookieSecure==false) {
481 @setcookie("MemberName", $YourNameM, time() + (7 * 86400), $cbasedir, $cookieDomain);
482 @setcookie("UserID", $YourIDM, time() + (7 * 86400), $cbasedir, $cookieDomain);
483 @setcookie("SessPass", $NewPassword, time() + (7 * 86400), $cbasedir, $cookieDomain); } } } }
485 //echo "Password was not right or user not found!! <_< ";
487 <?php if($passright==true&&$BanError!="yes") {
488 @redirect("refresh",$basedir.url_maker($exfile['index'],$Settings['file_ext'],"act=view",$Settings['qstr'],$Settings['qsep'],$prexqstr['index'],$exqstr['index'],false),"3"); ?>
490 <td><span class="TableMessage">
491 <br />Welcome to the Board <?php echo $_SESSION['MemberName']; ?>. ^_^<br />
492 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 />
495 <?php } if($passright==false||$BanError=="yes") { ?>
497 <td><span class="TableMessage">
498 <br />Password was not right or user not found or user is banned!! <_<<br />
499 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 />
505 <tr class="TableRow4">
506 <td class="TableRow4"> </td>
509 <?php } } if($_GET['act']=="signup") {
510 $membertitle = " ".$ThemeSet['TitleDivider']." Signing up";
511 if($_SESSION['UserID']!=0&&$_SESSION['UserID']!=null) {
512 redirect("location",$basedir.url_maker($exfile['member'],$Settings['file_ext'],"act=logout",$Settings['qstr'],$Settings['qsep'],$prexqstr['member'],$exqstr['member'],false));
513 ob_clean(); @header("Content-Type: text/plain; charset=".$Settings['charset']);
514 gzip_page($Settings['use_gzip'],$GZipEncode['Type']); @mysql_close(); die(); }
515 if($_SESSION['UserID']==0||$_SESSION['UserID']==null) {
517 <div class="Table1Border">
518 <table class="Table1">
519 <tr class="TableRow1">
520 <td class="TableRow1"><span style="float: left;">
521 <?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>
522 </span><span style="float: right;"> </span></td>
524 <tr class="TableRow2">
525 <th class="TableRow2" style="width: 100%; text-align: left;"> Inert your user info: </th>
527 <tr class="TableRow3">
528 <td class="TableRow3">
529 <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']); ?>">
530 <table style="text-align: left;">
531 <tr style="text-align: left;">
532 <td style="width: 30%;"><label class="TextBoxLabel" for="Name">Insert a UserName:</label></td>
533 <td style="width: 70%;"><input maxlength="24" type="text" class="TextBox" name="Name" size="20" id="Name" /></td>
535 <td style="width: 30%;"><label class="TextBoxLabel" for="Password">Insert a Password:</label></td>
536 <td style="width: 70%;"><input maxlength="30" type="password" class="TextBox" name="Password" size="20" id="Password" /></td>
538 <td style="width: 30%;"><label class="TextBoxLabel" for="RePassword">ReInsert a Password:</label></td>
539 <td style="width: 70%;"><input maxlength="30" type="password" class="TextBox" name="RePassword" size="20" id="RePassword" /></td>
541 <td style="width: 30%;"><label class="TextBoxLabel" for="Email">Insert Your Email:</label></td>
542 <td style="width: 70%;"><input type="text" class="TextBox" name="Email" size="20" id="Email" /></td>
544 <td style="width: 30%;"><label class="TextBoxLabel" for="YourOffSet">Your TimeZone:</label></td>
545 <td style="width: 70%;"><select id="YourOffSet" name="YourOffSet" class="TextBox"><?php
546 $tsa_mem = explode(":",$Settings['DefaultTimeZone']);
547 $TimeZoneArray = array("offset" => $Settings['DefaultTimeZone'], "hour" => $tsa_mem[0], "minute" => $tsa_mem[1]);
548 $plusi = 1; $minusi = 12;
549 $plusnum = 13; $minusnum = 0;
550 while ($minusi > $minusnum) {
551 if($TimeZoneArray['hour']==-$minusi) {
552 echo "<option selected=\"selected\" value=\"-".$minusi."\">GMT - ".$minusi.":00 hours</option>\n"; }
553 if($TimeZoneArray['hour']!=-$minusi) {
554 echo "<option value=\"-".$minusi."\">GMT - ".$minusi.":00 hours</option>\n"; }
556 if($TimeZoneArray['hour']==0) { ?>
557 <option selected="selected" value="0">GMT +/- 0:00 hours</option>
558 <?php } if($TimeZoneArray['hour']!=0) { ?>
559 <option value="0">GMT +/- 0:00 hours</option>
561 while ($plusi < $plusnum) {
562 if($TimeZoneArray['hour']==$plusi) {
563 echo "<option selected=\"selected\" value=\"".$plusi."\">GMT + ".$plusi.":00 hours</option>\n"; }
564 if($TimeZoneArray['hour']!=$plusi) {
565 echo "<option value=\"".$plusi."\">GMT + ".$plusi.":00 hours</option>\n"; }
569 <td style="width: 50%;"><label class="TextBoxLabel" for="MinOffSet">Minute OffSet:</label></td>
570 <td style="width: 50%;"><select id="MinOffSet" name="MinOffSet" class="TextBox"><?php
571 $mini = 0; $minnum = 60;
572 while ($mini < $minnum) {
573 if(pre_strlen($mini)==2) { $showmin = $mini; }
574 if(pre_strlen($mini)==1) { $showmin = "0".$mini; }
575 if($mini==$TimeZoneArray['minute']) {
576 echo "\n<option selected=\"selected\" value=\"".$showmin."\">0:".$showmin." minutes</option>\n"; }
577 if($mini!=$TimeZoneArray['minute']) {
578 echo "<option value=\"".$showmin."\">0:".$showmin." minutes</option>\n"; }
582 <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>
583 <td style="width: 70%;"><select id="DST" name="DST" class="TextBox"><?php echo "\n" ?>
584 <?php if($Settings['DefaultDST']=="off"||$Settings['DefaultDST']!="on") { ?>
585 <option selected="selected" value="off">off</option><?php echo "\n" ?><option value="on">on</option>
586 <?php } if($Settings['DefaultDST']=="on") { ?>
587 <option selected="selected" value="on">on</option><?php echo "\n" ?><option value="off">off</option>
588 <?php } echo "\n" ?></select></td>
590 <td style="width: 30%;"><label class="TextBoxLabel" for="YourGender">Your Gender:</label></td>
591 <td style="width: 70%;"><select id="YourGender" name="YourGender" class="TextBox">
592 <option value="Male">Male</option>
593 <option value="Female">Female</option>
594 <option value="Unknow">Unknow</option>
597 <td style="width: 30%;"><label class="TextBoxLabel" for="Website">Insert your Website:</label></td>
598 <td style="width: 70%;"><input type="text" class="TextBox" name="Website" size="20" value="http://" id="Website" /></td>
600 <td style="width: 30%;"><label class="TextBoxLabel" for="Avatar">Insert a URL for Avatar:</label></td>
601 <td style="width: 70%;"><input type="text" class="TextBox" name="Avatar" size="20" value="http://" id="Avatar" /></td>
603 <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>
604 <td style="width: 70%;"><select id="storecookie" name="storecookie" class="TextBox">
605 <option value="true">Yes</option>
606 <option value="false">No</option>
610 <table style="text-align: left;">
611 <tr style="text-align: left;">
612 <td style="width: 100%;">
613 <label class="TextBoxLabel" for="TOSBox">TOS - Please read fully and check 'I agree' box ONLY if you agree to terms</label><br />
614 <textarea rows="10" cols="58" id="TOSBox" name="TOSBox" class="TextBox" readonly="readonly" accesskey="T"><?php
615 echo file_get_contents("TOS"); ?></textarea><br />
616 <input type="checkbox" class="TextBox" name="TOS" value="Agree" id="TOS" /><label class="TextBoxLabel" for="TOS">I Agree</label><br/>
617 <input type="hidden" style="display: none;" name="act" value="makemembers" />
618 <input type="submit" class="Button" value="Sign UP" />
623 <tr class="TableRow4">
624 <td class="TableRow4"> </td>
627 <?php } } if($_GET['act']=="makemember") {
628 if($_POST['act']=="makemembers") {
629 if($_SESSION['UserID']!=0&&$_SESSION['UserID']!=null) {
630 redirect("location",$basedir.url_maker($exfile['member'],$Settings['file_ext'],"act=logout",$Settings['qstr'],$Settings['qsep'],$prexqstr['member'],$exqstr['member'],false));
631 ob_clean(); @header("Content-Type: text/plain; charset=".$Settings['charset']);
632 gzip_page($Settings['use_gzip'],$GZipEncode['Type']); @mysql_close(); die(); }
633 if($_SESSION['UserID']==0||$_SESSION['UserID']==null) {
634 $membertitle = " ".$ThemeSet['TitleDivider']." Signing up";
635 $REFERERurl = parse_url($_SERVER['HTTP_REFERER']);
636 $URL['REFERER'] = $REFERERurl['host'];
637 $URL['HOST'] = $_SERVER["SERVER_NAME"];
639 if(!isset($_POST['username'])) { $_POST['username'] = null; }
640 if(!isset($_POST['TOS'])) { $_POST['TOS'] = null; }
642 <div class="Table1Border">
643 <table class="Table1">
644 <tr class="TableRow1">
645 <td class="TableRow1"><span style="float: right;"> </span>
646 <a href="<?php echo url_maker($exfile['messenger'],$Settings['file_ext'],"act=signup",$Settings['qstr'],$Settings['qsep'],$prexqstr['messenger'],$exqstr['messenger']); ?>">Register</a></td>
648 <tr class="TableRow2">
649 <th class="TableRow2" style="width: 100%; text-align: left;"> Signup Message: </th>
651 <tr class="TableRow3">
652 <td class="TableRow3">
653 <table style="width: 100%; height: 25%; text-align: center;">
654 <?php if (pre_strlen($_POST['Password'])>="30") { $Error="Yes"; ?>
656 <td><span class="TableMessage">
657 <br />Your password is too big.<br />
660 <?php } if (pre_strlen($_POST['username'])>="24") { $Error="Yes"; ?>
662 <td><span class="TableMessage">
663 <br />Your user name is too big.<br />
666 <?php } if ($_POST['Password']!=$_POST['RePassword']) { $Error="Yes"; ?>
668 <td><span class="TableMessage">
669 <br />Your passwords did not match.<br />
672 <?php } if ($Settings['TestReferer']==true) {
673 if ($URL['HOST']!=$URL['REFERER']) { $Error="Yes"; ?>
675 <td><span class="TableMessage">
676 <br />Sorry the referering url dose not match our host name.<br />
680 $Name = stripcslashes(htmlspecialchars($_POST['Name'], ENT_QUOTES, $Settings['charset']));
681 //$Name = preg_replace("/&#(x[a-f0-9]+|[0-9]+);/i", "&#$1;", $Name);
682 $Name = @remove_spaces($Name);
683 $lonewolfqy=query("SELECT * FROM `".$Settings['sqltable']."restrictedwords` WHERE `RestrictedUserName`='yes'", array(null));
684 $lonewolfrt=mysql_query($lonewolfqy);
685 $lonewolfnm=mysql_num_rows($lonewolfrt);
686 $lonewolfs=0; $RMatches = null;
687 while ($lonewolfs < $lonewolfnm) {
688 $RWord=mysql_result($lonewolfrt,$lonewolfs,"Word");
689 $RCaseInsensitive=mysql_result($lonewolfrt,$lonewolfs,"CaseInsensitive");
690 if($RCaseInsensitive=="on") { $RCaseInsensitive = "yes"; }
691 if($RCaseInsensitive=="off") { $RCaseInsensitive = "no"; }
692 if($RCaseInsensitive!="yes"||$RCaseInsensitive!="no") { $RCaseInsensitive = "no"; }
693 $RWholeWord=mysql_result($lonewolfrt,$lonewolfs,"WholeWord");
694 if($RWholeWord=="on") { $RWholeWord = "yes"; }
695 if($RWholeWord=="off") { $RWholeWord = "no"; }
696 if($RWholeWord!="yes"||$RWholeWord!="no") { $RWholeWord = "no"; }
697 $RWord = preg_quote($RWord, "/");
698 if($RCaseInsensitive!="yes"&&$RWholeWord=="yes") {
699 $RMatches = preg_match("/\b(".$RWord.")\b/", $Name);
700 if($RMatches==true) { break 1; } }
701 if($RCaseInsensitive=="yes"&&$RWholeWord=="yes") {
702 $RMatches = preg_match("/\b(".$RWord.")\b/i", $Name);
703 if($RMatches==true) { break 1; } }
704 if($RCaseInsensitive!="yes"&&$RWholeWord!="yes") {
705 $RMatches = preg_match("/".$RWord."/", $Name);
706 if($RMatches==true) { break 1; } }
707 if($RCaseInsensitive=="yes"&&$RWholeWord!="yes") {
708 $RMatches = preg_match("/".$RWord."/i", $Name);
709 if($RMatches==true) { break 1; } }
710 ++$lonewolfs; } @mysql_free_result($lonewolfrt);
711 $sql_email_check = mysql_query(query("SELECT `Email` FROM `".$Settings['sqltable']."members` WHERE `Email`='%s'", array($_POST['Email'])));
712 $sql_username_check = mysql_query(query("SELECT `Name` FROM `".$Settings['sqltable']."members` WHERE `Name`='%s'", array($Name)));
713 $email_check = mysql_num_rows($sql_email_check);
714 $username_check = mysql_num_rows($sql_username_check);
715 @mysql_free_result($sql_email_check); @mysql_free_result($sql_username_check);
716 if ($_POST['TOS']!="Agree") { $Error="Yes"; ?>
718 <td><span class="TableMessage">
719 <br />You need to agree to the tos.<br />
722 <?php } if ($_POST['Name']==null) { $Error="Yes"; ?>
724 <td><span class="TableMessage">
725 <br />You need to enter a name.<br />
728 <?php } if ($_POST['Name']=="ShowMe") { $Error="Yes"; ?>
730 <td><span class="TableMessage">
731 <br />You need to enter a name.<br />
734 <?php } if ($_POST['Password']==null) { $Error="Yes"; ?>
736 <td><span class="TableMessage">
737 <br />You need to enter a password.<br />
740 <?php } if ($_POST['Email']==null) { $Error="Yes"; ?>
742 <td><span class="TableMessage">
743 <br />You need to enter a email.<br />
746 <?php } if($email_check > 0) { $Error="Yes"; ?>
748 <td><span class="TableMessage">
749 <br />Email address is already used.<br />
752 <?php } if($username_check > 0) { $Error="Yes"; ?>
754 <td><span class="TableMessage">
755 <br />User Name is already used.<br />
758 <?php } if($RMatches==true) { $Error="Yes"; ?>
760 <td><span class="TableMessage">
761 <br />This User Name is restricted to use.<br />
764 <?php } if ($Error=="Yes") {
765 @redirect("refresh",$basedir.url_maker($exfile['member'],$Settings['file_ext'],"act=signup",$Settings['qstr'],$Settings['qsep'],$prexqstr['member'],$exqstr['member'],FALSE),"4"); ?>
767 <td><span class="TableMessage">
768 <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 />
771 <?php } if ($Error!="Yes") {
772 $_POST['UserIP'] = $_SERVER['REMOTE_ADDR'];
773 $_POST['Group'] = $Settings['MemberGroup'];
774 $_POST['Joined'] = GMTimeStamp(); $_POST['LastActive'] = GMTimeStamp();
775 $_POST['Signature'] = ""; $_POST['Interests'] = "";
776 $_POST['Title'] = ""; $_POST['PostCount'] = "0";
777 if($Settings['AdminValidate']==true||$Settings['AdminValidate']!=false)
778 { $ValidateStats="no"; $yourgroup=$Settings['ValidateGroup']; }
779 if($Settings['AdminValidate']==false)
780 { $ValidateStats="yes"; $yourgroup=$Settings['MemberGroup']; }
781 $HashSalt = salt_hmac();
782 $NewPassword = b64e_hmac($_POST['Password'],$_POST['Joined'],$HashSalt,"sha1");
783 $_GET['YourPost'] = $_POST['Signature'];
784 //require( './'.$SettDir['misc'].'HTMLTags.php');
785 $_GET['YourPost'] = htmlspecialchars($_GET['YourPost'], ENT_QUOTES, $Settings['charset']);
786 //$_GET['YourPost'] = preg_replace("/&#(x[a-f0-9]+|[0-9]+);/i", "&#$1;", $_GET['YourPost']);
787 $NewSignature = $_GET['YourPost'];
788 $_GET['YourPost'] = preg_replace("/\t+/"," ",$_GET['YourPost']);
789 $_GET['YourPost'] = preg_replace("/\s\s+/"," ",$_GET['YourPost']);
790 $_GET['YourPost'] = remove_bad_entities($_GET['YourPost']);
791 $Avatar = stripcslashes(htmlspecialchars($_POST['Avatar'], ENT_QUOTES, $Settings['charset']));
792 //$Avatar = preg_replace("/&#(x[a-f0-9]+|[0-9]+);/i", "&#$1;", $Avatar);
793 $Avatar = @remove_spaces($Avatar);
794 $Website = stripcslashes(htmlspecialchars($_POST['Website'], ENT_QUOTES, $Settings['charset']));
795 //$Website = preg_replace("/&#(x[a-f0-9]+|[0-9]+);/i", "&#$1;", $Website);
796 $Website = @remove_spaces($Website);
797 $gquerys = query("SELECT * FROM `".$Settings['sqltable']."groups` WHERE `Name`='%s' LIMIT 1", array($yourgroup));
798 $gresults=mysql_query($gquerys);
799 $yourgroup=mysql_result($gresults,0,"id");
800 @mysql_free_result($gresults);
801 $yourid = getnextid($Settings['sqltable'],"members");
802 $_POST['Interests'] = @remove_spaces($_POST['Interests']);
803 $_POST['Title'] = @remove_spaces($_POST['Title']);
804 $_POST['Email'] = @remove_spaces($_POST['Email']);
805 if(!is_numeric($_POST['YourOffSet'])) { $_POST['YourOffSet'] = "0"; }
806 if($_POST['YourOffSet']>12) { $_POST['YourOffSet'] = "12"; }
807 if($_POST['YourOffSet']<-12) { $_POST['YourOffSet'] = "-12"; }
808 if(!is_numeric($_POST['MinOffSet'])) { $_POST['MinOffSet'] = "00"; }
809 if($_POST['MinOffSet']>59) { $_POST['MinOffSet'] = "59"; }
810 if($_POST['MinOffSet']<0) { $_POST['MinOffSet'] = "00"; }
811 $_POST['YourOffSet'] = $_POST['YourOffSet'].":".$_POST['MinOffSet'];
812 $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));
814 $querylogr = query("SELECT * FROM `".$Settings['sqltable']."members` WHERE `Name`='%s' AND `Password`='%s' LIMIT 1", array($Name,$NewPassword));
815 $resultlogr=mysql_query($querylogr);
816 $numlogr=mysql_num_rows($resultlogr);
819 $YourIDMr=mysql_result($resultlogr,$ir,"id");
820 $YourNameMr=mysql_result($resultlogr,$ir,"Name");
821 $YourGroupMr=mysql_result($resultlogr,$ir,"GroupID");
822 $gquery = query("SELECT * FROM `".$Settings['sqltable']."groups` WHERE `id`=%i LIMIT 1", array($YourGroupMr));
823 $gresult=mysql_query($gquery);
824 $YourGroupMr=mysql_result($gresult,0,"Name");
825 @mysql_free_result($gresult);
826 $YourTimeZoneMr=mysql_result($resultlogr,$ir,"TimeZone");
827 $YourDSTMr=mysql_result($resultlogr,$ir,"DST"); }
828 @mysql_free_result($resultlogr);
829 @session_regenerate_id(true);
830 $_SESSION['Loggedin']=true;
831 $_SESSION['MemberName']=$YourNameMr;
832 $_SESSION['UserID']=$YourIDMr;
833 $_SESSION['UserTimeZone']=$YourTimeZoneMr;
834 $_SESSION['UserDST']=$YourDSTMr;
835 $_SESSION['UserGroup']=$YourGroupMr;
836 $_SESSION['UserPass']=$NewPassword;
837 $_SESSION['DBName']=$Settings['sqldb'];
838 if($_POST['storecookie']==true) {
839 if($cookieDomain==null) {
840 @setcookie("MemberName", $YourNameM, time() + (7 * 86400), $cbasedir);
841 @setcookie("UserID", $YourIDM, time() + (7 * 86400), $cbasedir);
842 @setcookie("SessPass", $NewPassword, time() + (7 * 86400), $cbasedir); }
843 if($cookieDomain!=null) {
844 if($cookieSecure==true) {
845 @setcookie("MemberName", $YourNameM, time() + (7 * 86400), $cbasedir, $cookieDomain, 1);
846 @setcookie("UserID", $YourIDM, time() + (7 * 86400), $cbasedir, $cookieDomain, 1);
847 @setcookie("SessPass", $NewPassword, time() + (7 * 86400), $cbasedir, $cookieDomain, 1); }
848 if($cookieSecure==false) {
849 @setcookie("MemberName", $YourNameM, time() + (7 * 86400), $cbasedir, $cookieDomain);
850 @setcookie("UserID", $YourIDM, time() + (7 * 86400), $cbasedir, $cookieDomain);
851 @setcookie("SessPass", $NewPassword, time() + (7 * 86400), $cbasedir, $cookieDomain); } } }
853 $SendPMtoID=$_SESSION['UserID'];
855 $PMTitle = "Welcome ".$Name.".";
856 $YourMessage = "Hello ".$Name.". Welcome to ".$Settings['board_name'].". I hope you enjoy your stay here. ^_^ ";
857 $_POST['YourDate'] = $_POST['Joined'];
858 $query = query("INSERT INTO `".$Settings['sqltable']."messenger` VALUES (null,%i,%i,'%s','%s','%s','%s',0)", array($YourPMID,$SendPMtoID,'',$PMTitle,$YourMessage,$_POST['YourDate']));
859 //mysql_query($query);
860 @redirect("refresh",$basedir.url_maker($exfile['index'],$Settings['file_ext'],"act=view",$Settings['qstr'],$Settings['qsep'],$prexqstr['index'],$exqstr['index'],FALSE),"3");
864 <td><span class="TableMessage">
865 <br />Welcome to the Board <?php echo $_SESSION['MemberName']; ?>. ^_^<br />
866 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";
867 if($Settings['AdminValidate']==true||$Settings['AdminValidate']!=false) {
868 echo "<br />The admin has to validate your account befoure you can post.\n";
869 echo "<br />The admin has been notified of your registration.\n"; } ?>
876 <tr class="TableRow4">
877 <td class="TableRow4"> </td>