5 * @author Ant P <p@cpi.merseine.nu>
6 * @license file://COPYING
11 SO2
::$Page->title
= 'User Details';
13 $uid = is_numeric($_SERVER['QUERY_STRING']) ?
intval($_SERVER['QUERY_STRING']) : SO2
::$User->userid
;
15 if ( SO2
::$User->userid
!= $uid && ! SO2
::$DB->q('SELECT COUNT(*) FROM users WHERE userid = ?', $uid, SO2_PDO
::QVALUE
) ) {
16 SO2
::$Page->message(Page
::ERR_NOUSER
);
19 if ( SO2
::$User->userid
== $uid ) { // Own details
20 if ( ! (SO2
::$User instanceof User_Authenticated
) ) {
21 SO2
::$Page->message(Page
::ERR_LOGIN
);
23 SO2
::$Page->title
= 'Your Details';
24 SO2
::$Page->usernav
= array_merge(SO2
::$Page->usernav
, array( // Add usermenus
25 'General Options' => 'options',
26 'Customise Theme' => 'theme',
27 'Change Password' => 'passwd'
30 if ( 0 < SO2
::$User->points
) {
31 SO2
::$Page->usernav
= array_merge(SO2
::$Page->usernav
, array( // Add more usermenus
32 'User Directory' => 'userlist',
33 'Invites' => 'invites'
36 SO2
::$Page->pageheader();
38 } else { // Whois page
39 $user2 = new User_Registered($uid);
40 SO2
::$Page->title
= 'User Details for '.$user2;
41 SO2
::$Page->pageheader();
44 // Userlevel descriptions
46 'none' => 'Suspended',
47 'normal' => 'Normal account',
52 // Details shown to anyone, logged in or not
54 'Account ID' => $user2->userid
,
55 'Points' => $user2->points
,
56 'User Level' => $userlevels[$user2->level
],
57 'Mod Level' => $user2->has_access('moderate'),
60 if ( SO2
::$User->points
> 0 ) {
61 $sig = new Post_Plaintext($user2->sig
);
62 $quote = new Post_Plaintext($user2->quote
);
64 $contact = new Post_Default($user2->public_contact
);
65 } catch ( Exception
$e ) {
66 $contact = new Post_Plaintext($user2->public_contact
);
69 $fields = array_merge($fields, array (
70 'Posts' => $user2->posts
,
71 'Registration Date' => SO2
::$Page->fdate($user2->register_date
),
72 'Invited By' => ($user2->referrer ? SO2
::$Page->namelink($user2->referrer
) : 'N/A'),
73 'Last Active At' => SO2
::$Page->fdate($user2->last_active_date
),
74 'Timezone' => $user2->tz
,
75 'Signature' => $sig->getOutput(),
76 'Quote' => $quote->getOutput(),
77 'Public Contact Address' => $contact->getOutput(),
78 'Browser' => htmlspecialchars($user2->useragent
),
82 if ( SO2
::$User->admin
) {
83 $fields = array_merge($fields, array (
84 'Private Contact Address' => htmlspecialchars($user2->private_contact
),
85 'Signup Contact Address' => htmlspecialchars($user2->reg_contact
),
86 'Last Seen Online' => SO2
::$Page->fdate($user2->last_passive_date
),
87 'Last Login From' => $user2->last_login_ip
,
88 'Last Active From' => $user2->last_ip
,
89 'Signed Up From' => $user2->reg_ip
,
95 <caption
>User Details
for <strong
><?php
echo $user2 ?
></strong
></caption
>
96 <tbody
><?php
$a = 1; foreach ( $fields as $key => $value ) {
97 echo ' <tr><th scope="row">',$key,'</th><td class="content c',(++
$a&1),'">',$value,"</td></tr>\n";
102 if ( 0 == SO2
::$User->points
) {
103 SO2
::$Page->message('Only registered active accounts can view full profile information.', E_USER_NOTICE
);