source: pages/user.php

Last change on this file was 1, checked in by george, 17 years ago

Prvnotní import původních kódů z wowresource.

File size: 1.7 KB
Line 
1<?php
2$id = (int) $_GET['str1'];
3$tpl->output['info_servers'] = $text['info_servers'];
4$tpl->output['info_num_of_comments'] = $text['info_num_of_comments'];
5$tpl->output['info_num_of_servers'] = $text['info_num_of_servers'];
6$user_info = $db->query_fetch_assoc('select `name`, `id`, `email`, `admin`, `ban` from `users` where `id`='.$id);
7$tpl->output['name']=$user_info['name'];
8if ($user_info['admin']==1)
9 {
10 $tpl->output['user_name']=$user_info['name'].'(Admin)';
11 }
12else
13 {
14 $tpl->output['user_name']=$user_info['name'];
15 }
16
17if ($user['admin']==1)
18 {
19 $tpl->output['user_email'] = '<tr class="table"><td align="left"><b>E-mail</b></td><td align="center"><a href="mailto:'.$user_info['email'].'">'.$user_info['email'].'</a></td></tr>';
20 if ($user_info['ban']==1)
21 {
22 $tpl->output['admin'] = '<tr class="table"><td align="center" colspan="2"><a href="action.php?do=unban&amp;id='.$id.'">UnBan</a></td></tr>';
23 }
24 else
25 {
26 $tpl->output['admin'] = '<tr class="table"><td align="center" colspan="2"><a href="action.php?do=ban&amp;id='.$id.'">Ban</a></td></tr>';
27 }
28 }
29else
30 {
31 $tpl->output['user_email'] = '';
32 $tpl->output['admin']='';
33 }
34
35$db->query('servers', 'select `name`, `id` from `servers` where `owner`='.$id);
36$tpl->output['user_num_of_servers'] = $db->query_result('select count(*) as pocet from `servers` where `owner`='.$id);
37$tpl->output['user_servers'] = '';
38while ($row = $db->fetch_assoc('servers'))
39 {
40 $tpl->output['user_servers'] .= ulink('server/'.$row['id'], $row['name']).'<br />';
41 }
42$tpl->output['user_num_of_comments'] = $db->query_result('select count(*) as pocet from `comments` where `author`='.$id);
43
44?>
Note: See TracBrowser for help on using the repository browser.