-
Notifications
You must be signed in to change notification settings - Fork 8
/
bios.php
69 lines (63 loc) · 2.71 KB
/
bios.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
<?php
// translator ready
// addnews ready
// mail ready
/**
* \file bios.php
* This file provides the basic block of a users bio, hence it will display a warning. Blocking and unblocking can be done from the bio of the user.
* @see bio.php
*/
require_once("common.php");
require_once("lib/systemmail.php");
require_once("lib/http.php");
tlschema("bio");
check_su_access(SU_EDIT_COMMENTS);
$op = httpget('op');
$userid = httpget('userid');
if ($op=="block"){
$sql = "UPDATE " . db_prefix("accounts") . " SET bio='`iBlocked for inappropriate usage`i',biotime='9999-12-31 23:59:59' WHERE acctid='$userid'";
$subj = array("Your bio has been blocked");
$msg = array("The system administrators have decided that your bio entry is inappropriate, so it has been blocked.`n`nIf you wish to appeal this decision, you may do so with the petition link.");
systemmail($userid, $subj, $msg);
db_query($sql);
}
if ($op=="unblock"){
$sql = "UPDATE " . db_prefix("accounts") . " SET bio='',biotime='".DATETIME_DATEMIN."' WHERE acctid='$userid'";
$subj = array("Your bio has been unblocked");
$msg = array("The system administrators have decided to unblock your bio. You can once again enter a bio entry.");
systemmail($userid,$subj,$msg);
db_query($sql);
}
$sql = "SELECT name,acctid,bio,biotime FROM " . db_prefix("accounts") . " WHERE biotime<'9999-12-31' AND bio>'' ORDER BY biotime DESC LIMIT 100";
$result = db_query($sql);
page_header("User Bios");
$block = translate_inline("Block");
output("`b`&Player Bios:`0`b`n");
while ($row = db_fetch_assoc($result)) {
if ($row['biotime']>$session['user']['recentcomments'])
rawoutput("<img src='images/new.gif' alt='>' width='3' height='5' align='absmiddle'> ");
output_notl("`![<a href='bios.php?op=block&userid={$row['acctid']}'>$block</a>]",true);
addnav("","bios.php?op=block&userid={$row['acctid']}");
output_notl("`&%s`0: `^%s`0`n", $row['name'], soap($row['bio']));
}
db_free_result($result);
require_once("lib/superusernav.php");
superusernav();
addnav("Moderation");
if ($session['user']['superuser'] & SU_EDIT_COMMENTS)
addnav("Return to Comment Moderation","moderate.php");
addnav("Refresh","bios.php");
$sql = "SELECT name,acctid,bio,biotime FROM " . db_prefix("accounts") . " WHERE biotime>'9000-01-01' AND bio>'' ORDER BY biotime DESC LIMIT 100";
$result = db_query($sql);
output("`n`n`b`&Blocked Bios:`0`b`n");
$unblock = translate_inline("Unblock");
$number=db_num_rows($result);
for ($i=0;$i<$number;$i++){
$row = db_fetch_assoc($result);
output_notl("`![<a href='bios.php?op=unblock&userid={$row['acctid']}'>$unblock</a>]",true);
addnav("","bios.php?op=unblock&userid={$row['acctid']}");
output_notl("`&%s`0: `^%s`0`n", $row['name'], soap($row['bio']));
}
db_free_result($result);
page_footer();
?>