Commit | Line | Data |
---|---|---|
bc13d5d6 H |
1 | <?php |
2 | ||
3 | //$subaction=_GET['subaction']; | |
4 | ||
5 | function show_user($user_id, $user_name, $user_action, $user_action_id, $user_action_name, $user_mode, $user_idle) | |
6 | { | |
7 | echo "<table align=center><tr><td colspan=2 align=center><b>$user_name</b></td></tr>"; | |
8 | echo "<tr><td><a href='?action=userinfo&node_id=$user_id'><img width='50' height='50' src='/images/users/".strtolower($user_name).".gif' border='0' alt='$user_name'></a></td>"; | |
9 | if ($user_action == "forum") echo "<td valign=top width=100>[<a href='?action=forum&node_id=$user_action_id'>$user_action_name</a>"; | |
10 | elseif ($user_action == "journaux" && $user_action_name != "") echo "<td valign=top width=100>[<a href='?action=journaux&node_id=$user_action_id'>$user_action_name</a>"; | |
11 | elseif ($user_action == "article" && $user_action_name != "") echo "<td valign=top width=100>[<a href='?action=article&node_id=$user_action_id'>$user_action_name</a>"; | |
12 | elseif ($user_action == "userinfo" && $user_action_name != "") echo "<td valign=top width=100>[<a href='?action=userinfo&node_id=$user_action_id'>$user_action_name</a>"; | |
13 | else echo "<td width=100 valign=top align=left>[<a href='?action=$user_action'>$user_action</a>"; | |
14 | echo "]<br>"; | |
15 | $time=$user_idle; | |
16 | if ($time<0) $time+=(60*1440); | |
17 | echo floor($time/60)," min,",($time%60)," sec<br>"; | |
18 | if ($user_mode != 'normal') echo "$user_mode<br>"; | |
19 | echo "</td></tr></table>"; | |
20 | } | |
21 | ||
22 | ||
23 | if($subaction == 'active') | |
24 | $query = "select (time_to_sec(NOW())-time_to_sec(user_idle)) as idle,user_id,session.* from session group by user_name"; | |
25 | elseif($subaction == 'activefriends') | |
26 | $query = "select (time_to_sec(NOW())-time_to_sec(user_idle)) as idle, friends.*, session.* from friends left join session on friends.friend_id=session.user_id where friends.friend_id=session.user_id and friends.user_id=$user_id"; | |
27 | ||
28 | ||
29 | ||
30 | if($subaction == 'friends') include("friends.inc"); | |
31 | ||
32 | else | |
33 | { | |
34 | ||
35 | echo "<table>"; | |
36 | $set=$kyberia->query($query); | |
37 | while ($set->next()) { | |
38 | ||
39 | echo "<tr><td>"; | |
40 | show_user($set->getString('user_id'), $set->getString('user_name'), $set->getString('user_action'), $set->getString('user_action_id'), $set->getString('user_action_name'), $set->getString('user_mode'), $set->getString('idle')); | |
41 | echo "</td>"; | |
42 | ||
43 | if ($set->next()) { | |
44 | echo "<td>"; | |
45 | show_user($set->getString('user_id'), $set->getString('user_name'), $set->getString('user_action'), $set->getString('user_action_id'), $set->getString('user_action_name'), $set->getString('user_mode'), $set->getString('idle')); | |
46 | echo "</td>"; | |
47 | } | |
48 | ||
49 | if ($set->next()) { | |
50 | echo "<td>"; | |
51 | show_user($set->getString('user_id'), $set->getString('user_name'), $set->getString('user_action'), $set->getString('user_action_id'), $set->getString('user_action_name'), $set->getString('user_mode'), $set->getString('idle')); | |
52 | echo "</td>"; | |
53 | } | |
54 | ||
55 | echo "</tr>"; | |
56 | ||
57 | } | |
58 | } | |
59 | ||
60 | echo "</table>"; |