-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathprofile.php
577 lines (551 loc) · 25.9 KB
/
profile.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
<?php
/**
* User Control Panel / Profile
*
* @author Tim Hoeppner <[email protected]>
* @author FixITguy
* @author Jerroyd Moore
* @author Chris Kent
*/
require_once('./includes/upb.initialize.php');
require_once('./includes/class/upload.class.php');
if(!isset($_GET['action']) || $_GET['action'] == '') $_GET['action'] = 'edit';
if ($_GET['action'] == "get" || $_GET['action'] == 'view') $where = "Member Profile";
elseif ($_GET['action'] == "bookmarks") $where = "Bookmarked Topics";
elseif($_GET['action'] == "edit")$where = "User CP";
if (isset($_POST["u_edit"])) {
if (!($tdb->is_logged_in())) {
echo "<html><head><meta http-equiv='refresh' content='2;URL=login.php?ref=profile.php'></head></html>";
exit;
} else {
$rec = array();
if (!isset($_POST["u_email"])) exitPage("please enter your email!", true);
if (!preg_match("/^[_a-z0-9-]+(\.[_a-z0-9-]+)*@[a-z0-9-]+(\.[a-z0-9-]+)*$/i", $_POST["u_email"])) exitPage("please enter a valid email!", true);
$_POST['u_sig'] = stripslashes($_POST['u_sig']);
if (strlen($_POST["u_sig"]) > 500) exitPage("You cannot have more than 500 characters in your signature.", true);
$user = $tdb->get("users", $_COOKIE["id_env"]);
if (strlen($_POST["u_newpass"]) > 0) {
if ($user[0]['password'] != generateHash($_POST['u_oldpass'], $user[0]['password'])) exitPage('You old password does not match the one on file!', true);
if ($_POST["u_newpass"] != $_POST["u_newpass2"]) exitPage("your pass and pass confirm are not matching!", true);
if (strlen($_POST["u_newpass"]) < 6) exitPage("your password has to be longer then 6 characters", true);
$rec["password"] = generateHash($_POST["u_newpass"]);
setcookie("user_env", "");
setcookie("uniquekey_env", "");
setcookie("power_env", "");
setcookie("id_env", "");
$ht = "<meta http-equiv='refresh' content='2;URL=login.php'>";
}
else $ht = "<meta http-equiv='refresh' content='2;URL=profile.php'>";
if ($user[0]["email"] != $_POST["u_email"]) $rec["email"] = $_POST["u_email"];
if ($user[0]["u_sig"] != encode_text(chop($_POST["u_sig"]))) $rec["sig"] = encode_text(chop($_POST["u_sig"]));
if ($_POST['u_sig'] == "")
$rec['sig'] = "";
if (substr(trim(strtolower($_POST["u_site"])), 0, 7) != "http://") $_POST["u_site"] = "http://".$_POST["u_site"];
if ($user[0]["url"] != $_POST["u_site"])
$rec["url"] = xml_clean($_POST["u_site"]);
if ($_POST['u_site'] == "http://" or $rec['url'] == 'http://')
$rec['url'] = "";
for ($i = 1;$i <= 5; $i++)
{
if (array_key_exists("custom_profile$i",$_POST))
{
if ($user[0]["custom_profile$i"] != $_POST["custom_profile$i"])
$rec["custom_profile$i"] = xml_clean($_POST["custom_profile$i"]);
}
}
if ($_POST["u_timezone"]{0} == '+') $_POST["u_timezone"] = substr($_POST["u_timezone"], 1);
if ($_POST["show_email"] != "1") $_POST["show_email"] = "0";
if ($_POST["email_list"] != "1") $_POST["email_list"] = "0";
if ($user[0]["view_email"] != $_POST["show_email"]) $rec["view_email"] = $_POST["show_email"];
if ($user[0]["mail_list"] != $_POST["email_list"]) $rec["mail_list"] = $_POST["email_list"];
if ($user[0]["location"] != $_POST["u_loca"]) $rec["location"] = xml_clean($_POST["u_loca"]);
if (isset($_FILES['avatar2file']['tmp_name']))
{
$dim = getimagesize($_FILES['avatar2file']['tmp_name']);
}
else
{
$dim = array(0, 0);
}
if (isset($_FILES["avatar2file"]["name"]) && trim($_FILES["avatar2file"]["name"]) != "") {
if($_FILES['avatar2file']['size'] > $_REGIST['avatarupload_size']*1024)
{
$upload_err = "The filesize of the uploaded avatar is too big.<br>The maximum filesize is ".$_REGIST['avatarupload_size']."KB<br>The file you uploaded was ".ceil($_FILES['avatar2file']['size']/1024)."KB";
}
else if ($dim[0] > $_REGIST["avatarupload_dim"] or $dim[1] > $_REGIST["avatarupload_dim"])
$upload_err = "The dimensions of the uploaded avatar are too big.<br>The maximum dimensions are ".$_REGIST['avatarupload_dim']."px by ".$_REGIST['avatarupload_dim']."px";
else
{
$upload = new upload(DB_DIR, $_REGIST["avatarupload_size"], $_CONFIG["fileupload_location"]);
$uploadId = $upload->storeFile($_FILES["avatar2file"]);
}
}
elseif(isset($_POST['avatar2url']) && $_POST['avatar2url'] != '') {
$rec['avatar'] = xml_clean($_POST['avatar2url']);
}
elseif(isset($_POST['avatar']) && $_POST['avatar'] != '') {
$rec['avatar'] = xml_clean($_POST['avatar']);
}
if(isset($rec['avatar']) && FALSE !== strpos($user[0]['avatar'], 'downloadattachment.php?id=')) {
$id = substr($user[0]['avatar'], 26);
if(ctype_digit($id)) {
if(!isset($upload)) {
require_once('./includes/class/upload.class.php');
$upload = new upload(DB_DIR, $_REGIST["avatarupload_size"], $_CONFIG["fileupload_location"]);
}
$upload->deleteFile($id);
}
}
if ($user[0]["icq"] != $_POST["u_icq"]) $rec["icq"] = xml_clean($_POST["u_icq"]);
if ($user[0]["aim"] != $_POST["u_aim"]) $rec["aim"] = xml_clean($_POST["u_aim"]);
if ($user[0]["yahoo"] != $_POST["u_yahoo"]) $rec["yahoo"] = xml_clean($_POST["u_yahoo"]);
if ($user[0]["msn"] != $_POST["u_msn"]) $rec["msn"] = xml_clean($_POST["u_msn"]);
if ($user[0]["skype"] != $_POST["u_skype"]) $rec["skype"] = xml_clean($_POST["u_skype"]);
if ($user[0]["twitter"] != $_POST["u_twitter"]) $rec["twitter"] = xml_clean($_POST["u_twitter"]);
if ($user[0]["timezone"] != $_POST["u_timezone"]) {
$rec["timezone"] = (int) $_POST["u_timezone"];
setcookie("timezone", $rec["timezone"], (time() + (60 * 60 * 24 * 7)));
}
$tdb->edit("users", $_COOKIE["id_env"], $rec);
require_once('./includes/header.php');
if (!isset($upload_err))
echo "<div class='alert_confirm'>
<div class='alert_confirm_text'>
<strong>User Profile Update:</strong></div><div style='padding:4px;'>Your user profile has been successfully updated
</div>
</div>
<meta http-equiv='refresh' content='2;URL=".$_GET["ref"]."'>";
else
echo "<div class='alert'>
<div class='alert_text'>
<strong>Avatar Upload Error:</strong></div><div style='padding:4px;'>$upload_err<br><br>All other changes to your user profile has been made.<br>Click <a href='".$_GET['ref']."'>here</a> to continue.
</div>
</div>";
require_once('./includes/footer.php');
}
} elseif($_GET["action"] == 'get' || $_GET['action'] == 'view') {
if (!isset($_GET["id"])) {
echo "<html><head><meta http-equiv='refresh' content='0;URL=index.php'></head></html>";
exit;
} else {
$rec = $tdb->get("users", $_GET["id"]);
if($rec === false) {
exitPage(str_replace('__TITLE__', ALERT_GENERIC_TITLE, str_replace('__MSG__', 'This user was either deleted or not found.', ALERT_MSG)),
true);
}
$status_config = status($rec);
$status = $status_config['status'];
$statuscolor = $status_config['statuscolor'];
$statusrank = $status_config['rank'];
if ($rec[0]["status"] != "") $status = $rec[0]["status"];
require_once('./includes/header.php');
echo "";
for($i=1;$i<=5;$i++)
{
$custom = $config_tdb->basicQuery('config',"name","custom_profile$i");
if (trim($custom[0]['value']) != "")
$customs[] = array($custom[0]['value'],$rec[0]["custom_profile$i"]);
}
echoTableHeading("Viewing profile for ".$rec[0]["user_name"]."", $_CONFIG);
echo "
<tr>
<td colspan='2' id='topcontent'>
<span style='color:#".$statuscolor.";font-size:14px;'>".$rec[0]["user_name"]."</span>
<br />
<br />
";
if (@$rec[0]["avatar"] != "")
{
$resize = resize_img($rec[0]['avatar'],$_REGIST["avatarupload_dim"]);
echo "<img src='".$rec[0]["avatar"]."' $resize border='0' alt='' title='' /><br />";
}
echo "<br />
<img src='$statusrank'>
<br />
<div class='link_pm'>";
if($_COOKIE['power_env'] >= 3 && $rec[0]['level'] <= $_COOKIE['power_env']) print "<a href='admin_members.php?action=edit&id={$_GET['id']}'>Edit Member</a><br/>";
require_once('./includes/inc/privmsg.inc.php');
$blockedList = getUsersPMBlockedList($_GET["id"]);
if ($_GET["id"] == $_COOKIE["id_env"]) {
echo "";
} elseif($_COOKIE["id_env"] == "" || $_COOKIE["id_env"] == "0") {
echo "Login to contact";
} elseif(in_array($_COOKIE["id_env"], $blockedList)) {
echo "You are banned from using the PM system";
} else {
echo "<a href='newpm.php?to=".$_GET["id"]."' target='_blank'>Send private message?</a>";
}
echo "</div></td></tr>";
echo "<tr><td id='leftcontent' valign='top'>
<div class='pro_sig_name'>General</div>
<div class='pro_container'>
<div class='pro_area_1'><div class='pro_area_2'><strong>Joined: </strong></div>".gmdate("Y-m-d", user_date($rec[0]["date_added"]))."</div>
<div class='pro_area_1'><div class='pro_area_2'><strong>Posts made: </strong></div>".$rec[0]["posts"]."</div>";
echo "
<div class='pro_area_1'><div class='pro_area_2'><strong>Homepage: </strong></div>";
if (strlen($rec[0]['url']) != 0)
echo "<a href='".$rec[0]["url"]."' target='_blank'>".$rec[0]["url"]."</a>";
echo " </div>
<div class='pro_area_1' style='white-space:nowrap;'><div class='pro_area_2'><strong>Status: </strong></div>
<span style='color:#".$statuscolor."'><strong>".preg_replace("/<br\s*\/?>/i", " / ", $status)." </strong></span></div>
<div class='pro_area_1'><div class='pro_area_2'><strong>Email: </strong></div>";
if ((bool)$rec[0]["view_email"]) echo "<a href='mailto:".$rec[0]["email"]."'>".$rec[0]["email"]."</a>";
else echo "not public";
echo "</div>";
echo "<div class='pro_area_1'><div class='pro_area_2'><strong>Location: </strong></div>".$rec[0]["location"]." </div>";
echo "</div></td>";
echo "<td id='rightcontent' valign='top'>
<div class='pro_sig_name'>Contact</div>
<div class='pro_container'>";
echo "<div class='pro_area_1'><div class='pro_area_2'><img src='images/icq.gif' border='0' align='absmiddle'> <strong>ICQ:</strong></div>".$rec[0]["icq"]." </div>";
echo "<div class='pro_area_1'><div class='pro_area_2'><img src='images/aol.gif' border='0' align='absmiddle'> <strong>AIM:</strong></div>".$rec[0]["aim"]." </div>";
echo "<div class='pro_area_1'><div class='pro_area_2'><img src='images/yahoo.gif' border='0' align='absmiddle'> <strong>Yahoo!:</strong></div>".$rec[0]["yahoo"]." </div>";
echo "<div class='pro_area_1'><div class='pro_area_2'><img src='images/msn.gif' border='0' align='absmiddle'> <strong>MSN:</strong></div>".$rec[0]["msn"]." </div>";
echo "<div class='pro_area_1'><div class='pro_area_2'><img src='images/twitter.png' border='0' align='absmiddle'> <strong>Twitter:</strong></div>".$rec[0]["twitter"]." </div>";
echo "<div class='pro_area_1'><div class='pro_area_2'><img src='images/skype.gif' border='0' align='absmiddle'> <strong>Skype:</strong></div>".$rec[0]["skype"]." </div>";
echo "</div></td></tr>
<tr>
<td id='bottomcontent' colspan='2'>";
if(is_array($customs) && !empty($customs)) {
echo "<div class='pro_sig_name'>More</div>";
foreach ($customs as $key => $value) {
echo "
<div class='pro_area_1'><div class='pro_area_2'><strong>".$value[0].":</strong></div>".$value[1]." </div>\n";
}
}
if (@$rec[0]["sig"] != "") echo "
<div class='pro_sig_name'>".$rec[0]["user_name"]."'s Signature:</div>
<div class='pro_sig_area'>
<div class='pro_signature'>".format_text(UPBcoding(filterLanguage($rec[0]["sig"], $_CONFIG)))."</div>
</div>"; #
echo " </div>
</td>
</tr>";
echoTableFooter(SKIN_DIR);
if(!isset($_GET["showPrevPosts"])) {
echoTableHeading("View Previous Posts", $_CONFIG);
echo "<tr><td><div class='pro_area_1' align='center'><a href='./profile.php?action=get&id={$_GET["id"]}&showPrevPosts=1'>Show all posts</a>";
echoTableFooter(SKIN_DIR);
} else {
$fRecs = $tdb->listRec("forums", 1);
if(!empty($fRecs[0])) {
$posts_tdb = new tdb(DB_DIR, "posts");
foreach($fRecs as $fRec) {
if ((int)$_COOKIE["power_env"] < $fRec["view"]) {
continue;
}
$posts_tdb->setFp("p", $fRec["id"]);
$posts_tdb->setFp("t", $fRec["id"] . "_topics");
$pRecs = $posts_tdb->query("p", "user_id='{$_GET["id"]}'");
if(!empty($pRecs[0])) {
$posts = array();
foreach($pRecs as $pRec) {
$i = $pRec["t_id"];
if(!isset($posts[$i]))
$posts[$i] = array();
$posts[$i][] = $pRec;
}
unset($pRecs);
echoTableHeading("In forum \"{$fRec["forum"]}\"", $_CONFIG);
foreach($posts as $pRecs) {
$tRec = $posts_tdb->get("t", $pRecs[0]["t_id"]);
$tRec[0]["p_ids"] = ',' . $tRec[0]["p_ids"] . ',';
echo "<tr><th><div style='float:left;'>In topic \"{$tRec[0]["subject"]}\"</div>";
foreach($pRecs as $pRec) {
// display each post in the current topic
if ($x == 0) {
$table_color = 'area_1';
$x++;
} else {
$table_color = 'area_2';
$x--;
}
$pos = strpos($tRec[0]["p_ids"], ','.$pRec["id"].',');
if($pos == 0) $page = 1;
else {
$countpost = substr_count($tRec[0]["p_ids"], ',', 0, $pos) + 1;
$page = ceil($countpost / $_CONFIG["posts_per_page"]);
}
$msg = display_msg($pRec['message']);
$msg .= $tdb->getUploads($_GET['id'],$_GET['t_id'],$pRec['id'],$pRec['upload_id'],$_CONFIG['fileupload_location'],$pRec['user_id']);
echo "
<tr>
<td class='$table_color' valign='top'>
<div style='float:right;'><div class='button_pro2'><a href='viewtopic.php?id={$fRec["id"]}&t_id={$pRec["t_id"]}&page=$page#{$pRec["id"]}'>View Post</a></div></div>
$msg";
echo "</td></tr>";
}
}
echoTableFooter(SKIN_DIR);
}
}
} else echo "<div align='center'>No Posts</div>";
}
require_once('./includes/footer.php');
}
} elseif($_GET['action'] == 'edit') {
if (!($tdb->is_logged_in())) {
echo "<html><head><meta http-equiv='refresh' content='2;URL=login.php?ref=profile.php'></head></html>";
exit;
} else {
$rec = $tdb->get("users", $_COOKIE["id_env"]);
require_once('./includes/header.php');
@$rec[0]["sig"] = str_replace("<br />", "\n", $rec[0]["sig"]);
echo "<form action='{$_SERVER['PHP_SELF']}' id='newentry' name='newentry' method='post' enctype=\"multipart/form-data\">";
echo "
<div id='tabstyle_2'>
<ul>
<li><a href='profile.php?action=edit'><span>User CP</span></a></li>
<!--<li><a href='profile.php?action=bookmarks'><span>View Bookmarks</span></a></li>-->
</ul>
</div>
<div style='clear:both;'></div>";
echoTableHeading("Account settings - Edit profile information", $_CONFIG);
echo "
<tr>
<td class='area_1' style='width:45%;'><strong>login:</strong></td>
<td class='area_2'>".$rec[0]["user_name"]."</td>
</tr>
<tr>
<td class='area_1'><strong>Old password:</strong><br /><i>Submit your old password only if you are changing your password</i></td>
<td class='area_2'><input type='password' name='u_oldpass' /></td>
</tr>
<tr>
<td class='area_1'><strong>New password:</strong></td>
<td class='area_2'><input type='password' name='u_newpass' /></td>
</tr>
<tr>
<td class='area_1'><strong>New password confirmation:</strong></td>
<td class='area_2'><input type='password' name='u_newpass2' /></td>
</tr>";
if ($_COOKIE["power_env"] >= 2) {
echo "
<tr>
<td class='area_1'><strong>email:</strong></td>
<td class='area_2'><input type='text' name='u_email' value='".$rec[0]["email"]."' /> ".$rec[0]["email"]."</td>
</tr>";
} else {
echo "
<tr>
<td class='area_1'><strong>email:</strong><br /><font size='1' face='$font_face'>Email the Forum Administrator to change your email address.</a></td>
<td class='area_2'><input type='hidden' name='u_email' value='".$rec[0]["email"]."' /> ".$rec[0]["email"]."</td>
</tr>";
}
if ((bool) $rec[0]["view_email"]) $email_checked = "CHECKED";
else $email_checked = "";
echo "
<tr>
<td class='area_1'>Make email address public in profile?
<a href=\"javascript: window.open('privacy.php','','status=no, width=800,height=50'); void('');\">
Privacy Policy</a></td>
<td class='area_2'><input type='checkbox' name='show_email' value = '1' $email_checked /></td>
</tr>
<tr>
<td class='area_1'><strong>location:</strong></td>
<td class='area_2'><input type='text' name='u_loca' value='".$rec[0]["location"]."' /></td>
</tr>
<tr>
<td class='footer_3' colspan='2'><img src='".SKIN_DIR."/images/spacer.gif' alt='' title='' /></td>
</tr>";
echoTableFooter(SKIN_DIR);
$custom_avatar = (($rec[0]['posts'] >= $_REGIST['newuseravatars'] || $_COOKIE['power_env'] > 1) && $_REGIST['custom_avatars']);
echoTableHeading("Avatar Options", $_CONFIG);
echo "
<tr>
<th style='text-align:center;'>Current avatar</th>
<th style='text-align:center;'>Select a local avatar</th>
</tr>
<tr>
<td class='area_1' valign='middle' style='text-align:center;padding:20px;height:150px;'>";
if (@$rec[0]["avatar"] != "")
{
$resize = resize_img($rec[0]['avatar'],$_REGIST["avatarupload_dim"]);
echo "<img src='".$rec[0]["avatar"]."' $resize border='0'><br />";
}
else echo "<img src='images/avatars/noavatar.gif' alt='' title='' />";
echo "</td>
<td class='area_2' valign='middle' style='text-align:center;padding:20px;height:150px;'>
<table cellspacing='0px' style='width:100%;'>
<tr>
<td style='text-align:center;width:50%;'>
<img src='images/avatars/blank.gif' id='myImage' alt='' title='' /></td>
<td><select class='select' size='5' name='avatar' onchange='swap(this.options[selectedIndex].value)'>\n";
returnimages();
echo "</select></td></tr>
</table>
</td></tr>";
if ($custom_avatar)
{
echo "<tr><th style='text-align:center;' colspan='2'>Custom Avatar</th></tr>";
echo "<tr><td class='area_1'><strong>Custom Avatar:</strong><p>Maximum avatar size is ".$_REGIST["avatarupload_dim"]."px by ".$_REGIST["avatarupload_dim"]."px";
if ($_REGIST['custom_avatars'] > '2' and $_REGIST['avatarupload_size'] > 0)
echo '<br>Valid filetypes are jpg, jpeg and gif.<br>Maximum filesize is '.$_REGIST["avatarupload_size"].'KB.';
echo "<td class='area_2' valign='middle' style='text-align:center;padding:20px;height:150px;'>";
echo "You may upload a custom image using the control(s) below.";
if ($_REGIST['custom_avatars'] == 1)
echo "<p>Enter the URL of an image below<br />
<input type='text' size='40' name='avatar2url' value='' />";
else if ($_REGIST['custom_avatars'] == 2)
echo "<p>Upload image from your computer <br />
<input type='file' size='40' name='avatar2file' />";
else
{
echo "<p>Option 1 - Enter the URL of an image below<br />
<input type='text' size='40' name='avatar2url' value='' />";
if ($_REGIST['avatarupload_size'] > 0)
echo "<p>Option 2 - Upload image from your computer <br />
<input type='file' size='40' name='avatar2file' />";
}
echo "<p>If either the width or height exceeds this limit the avatar will be resized maintaining the correct ratio</td></tr>";
}
echo "
<tr>
<td class='footer_3' colspan='2'><img src='".SKIN_DIR."/images/spacer.gif' alt='' title='' /></td>
</tr>";
echoTableFooter(SKIN_DIR);
echoTableHeading("Other Information", $_CONFIG);
echo "
<tr>
<td class='area_1' style='width:20%;'><strong>Homepage:</strong></td>
<td class='area_2'><input type='text' name='u_site' size='50' value='";
if ($rec[0]["url"] == '')
echo "http://";
else
echo $rec[0]["url"];
echo "' /></td>
</tr>
<tr>
<td class='footer_3' colspan='2'><img src='".SKIN_DIR."/images/spacer.gif' alt='' title='' /></td>
</tr>
<tr>
<td class='area_1'><img src='images/icq.gif' border='0' align='absmiddle'> <strong>ICQ:</strong></td>
<td class='area_2'><input type='text' name='u_icq' size='50' value='".$rec[0]["icq"]."' /></td>
</tr>
<tr>
<td class='area_1'><img src='images/aol.gif' border='0' align='absmiddle'> <strong>AIM:</strong></td>
<td class='area_2'><input type='text' name='u_aim' size='50' value='".$rec[0]["aim"]."' /> </td>
</tr>
<tr>
<td class='area_1'><img src='images/yahoo.gif' border='0' align='absmiddle'> <strong>Yahoo!:</strong></td>
<td class='area_2'><input type='text' name='u_yahoo' size='50' value='".$rec[0]["yahoo"]."' /></td>
</tr>
<tr>
<td class='area_1'><img src='images/msn.gif' border='0' align='absmiddle'> <strong>MSN:</strong></td>
<td class='area_2'><input type='text' name='u_msn' size='50' value='".$rec[0]["msn"]."' /></td>
</tr>
<tr>
<td class='area_1'><img src='images/twitter.png' border='0' align='absmiddle'> <strong>Twitter:</strong></td>
<td class='area_2'><input type='text' name='u_twitter' size='50' value='".$rec[0]["twitter"]."' /></td>
</tr>
<tr>
<td class='area_1'><img src='images/skype.gif' border='0' align='absmiddle'> <strong>Skype:</strong></td>
<td class='area_2'><input type='text' name='u_skype' size='50' value='".$rec[0]["skype"]."' /></td>
</tr>
";
for ($i=1;$i<=5;$i++)
{
$custom = $config_tdb->basicQuery('config',"name","custom_profile$i");
if (trim($custom[0]['value']) != "")
echo "<tr>
<td class='area_1'><strong>{$custom[0]['value']}</strong></td>
<td class='area_2'><input size='50' name='custom_profile$i' value='".$rec[0]["custom_profile$i"]."'/></td>
</tr>";
}
echo "<tr>
<td class='footer_3' colspan='2'><img src='".SKIN_DIR."/images/spacer.gif' alt='' title='' /></td>
</tr>
<tr>
<td class='area_1' valign='top'><strong>Signature:</strong></td>
<td class='area_2'>".bbcodebuttons('u_sig','sig')."<textarea id='u_sig' name='u_sig' cols='45' rows='10'>".format_text($rec[0]["sig"],'edit')."</textarea><br /><input type='button' onclick=\"javascript:sigPreview(document.getElementById('u_sig'),'".$_COOKIE['id_env']."','set');\" value='Preview Signature' /></td></tr>
<tr>
<td class='area_1' valign='top'><div id='sig_title'><strong>Current Signature:</strong></div></td>
<td class='area_2'><div style='display:inline;' id='sig_preview'>".display_msg($rec[0]["sig"])."</div></td>
</tr>
<tr>
<td class='footer_3' colspan='2'><img src='".SKIN_DIR."/images/spacer.gif' alt='' title='' /></td>
</tr>
<tr>
<td class='area_1'><strong>Timezone Setting:</strong></td>
<td class='area_2'>";
print timezonelist($rec[0]["timezone"]);
echo "</td></tr>
<tr>
<td class='footer_3a' colspan='2' style='text-align:center;'><input type='reset' name='reset' value='Reset' onclick=\"javascript:sigPreview(document.getElementById('u_sig'),'".$_COOKIE['id_env']."','reset');\" /><input type='submit' name='u_edit' value='Submit' /></td>
</tr>";
echoTableFooter(SKIN_DIR);
echo "</form>";
require_once('./includes/footer.php');
}
} elseif($_GET['action'] == 'bookmarks') {
require_once('./includes/header.php');
$topics = array();
if(isset($_SESSION['newTopics']) && is_array($_SESSION['newTopics'])) while(list($forum, $arr) = each($_SESSION['newTopics'])) {
if($forum == 'lastVisitForums') continue;
while(list($topic, $val) = each($arr)) {
if($val == 2) $topics[] = substr($forum, 1).','.substr($topic, 1);
}
}
echo "
<div id='tabstyle_2'>
<ul>
<li><a href='profile.php?action=edit'><span>User CP</span></a></li>
<li><a href='profile.php?action=bookmarks'><span>View Bookmarks</span></a></li>
</ul>
</div>
<div style='clear:both;'></div>";
echoTableHeading("Bookmarked Topics", $_CONFIG);
echo "
<tr>
<th style='width: 75%;'>Topic</th>
<th style='width:25%;text-align:center;'>Last Post</th>
</tr>";
if(empty($topics)) {
echo "
<tr>
<td colspan='6' class='area_2' style='text-align:center;font-weight:bold;padding:20px;'>you have no bookmarked topics</td>
</tr>";
} else {
require_once('./includes/class/posts.class.php');
$posts_tdb = new posts(DB_DIR."/", "posts.tdb");
while(list(, $tmp) = each($topics)) {
list($f_id, $t_id) = explode(',', $tmp);
$posts_tdb->setFp("topics", $f_id."_topics");
$fRec = $tdb->get("forums", $f_id);
$tRec = $posts_tdb->get('topics', $t_id);
if ($tRec[0]["icon"] == "") continue;
$tRec[0]['subject'] = "<a href='viewforum.php?id=".$f_id."'>".$fRec[0]["forum"]."</a> " .$_CONFIG["where_sep"] . " <a href='viewtopic.php?id=".$f_id."&t_id=".$tRec[0]["id"]."'>".$tRec[0]["subject"]."</a>";
settype($tRec[0]["replies"], "integer");
$total_posts = $tRec["replies"] + 1;
$num_pages = ceil($total_posts / $_CONFIG["posts_per_page"]);
if ($num_pages == 1) {
$r_ext = "";
} else {
$r_ext = "<br /><div class='pagination_small'> Pages: ( ";
for($m = 1; $m <= $num_pages; $m++) {
$r_ext .= "<a href='viewtopic.php?id=".$f_id."&t_id=".$tRec[0]["id"]."&page=$m'>$m</a> ";
}
$r_ext .= ")</div>";
}
if ($tRec[0]["topic_starter"] == "guest") $tRec[0]["topic_starter"] = "<i>guest</i>";
echo "
<tr>
<td class='area_2' onmouseover=\"this.className='area_2_over'\" onmouseout=\"this.className='area_2'\">
<span class='link_1'>".$tRec[0]["subject"].$r_ext."</span>
<div class='description'>Started By: <span style='color:#".$statuscolor."'>".$tRec[0]["topic_starter"]."</span></div>
<div class='box_posts'><strong>Views:</strong> ".$tRec[0]["views"]."</div>
<div class='box_posts'><strong>Replies:</strong> ".$tRec[0]["replies"]."</div></td>
<td class='area_1' style='text-align:center;'>
<img src='icon/".$tRec[0]["icon"]."' class='post_image'>
<span class='latest_topic'><span class='date'>".gmdate("M d, Y g:i:s a", user_date($tRec[0]["last_post"]))."</span>
<br />
<strong>By:</strong> ";
if ($tRec[0]["user_id"] != "0") echo "<span class='link_2'><a href='profile.php?action=get&id=".$tRec[0]["user_id"]."'>".$tRec[0]["user_name"]."</a></span></td>
</tr>";
else echo "a ".$tRec[0]["user_name"]."</span></td>
</tr>";
}
}
echoTableFooter(SKIN_DIR);
require_once('./includes/footer.php');
} else redirect('index.php', 0);
?>