[go: up one dir, main page]

Menu

[r63]: / trunk / users.php  Maximize  Restore  History

Download this file

38 lines (32 with data), 1.2 kB

 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
<?php
session_start();
if (!isset($_GET['u'])) {
header("Location: index.php");
}
include_once('inc/config.php');
mysql_connect($db_server, $db_username, $db_password);
mysql_select_db($db_database);
include_once('inc/util.inc');
// Setup Theme
$modules = getModules();
$pageTitle = _('User Profile');
$curPage = 'user';
$theme = getTheme();
include($theme.'header.php');
$sql = "SELECT `username`, `first`, `last`, `email`, `joindate`
FROM `sam_user`
WHERE `username` = '".escape_string($_GET['u'])."' LIMIT 1";
$result = mysql_query($sql) or die('ERROR ' . __FILE__ . ' [' . __LINE__ . ']<br/><br/>' . mysql_error() . "<br/><br/>$sql");
if (mysql_num_rows($result) > 0) {
$r = mysql_fetch_array($result);
echo '
<h2>'.$r['username'].'</h2>
<p><b>'._('Name').'</b> '.$r['first'].' '.$r['last'].'</p>
<p><b>'._('Joined').'</b> '.daysAgo($r['joindate']).'</p>
<p><b>'._('Email').'</b> '.$r['email'].'</p>
<h2>'._('Reputation').'</h2>';
} else {
echo '
<div class="error-alert">'.sprintf(_('%s does not exist'), $_GET['u']).'</div>';
}
include($theme.'footer.php');