forked from wosenbo/happyfactory
-
Notifications
You must be signed in to change notification settings - Fork 0
/
topuser.php
31 lines (26 loc) · 886 Bytes
/
topuser.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
<?php
/* $Id:topuser.php 2010/4/26 22:24 xiaogang $ */
function get_top_users($site_id) {
global $db;
$query = $db->query("SELECT u.*, up.* FROM game_users u LEFT JOIN game_userproperty up ON up.uid = u.uid WHERE u.siteid = '{$site_id}' ORDER BY up.money DESC LIMIT 10");
$list = array();
while ($row = $db->fetch_array($query)) {
$list[] = $row;
}
return $list;
}
require_once './include/common.inc.php';
// $sql = "SELECT u.*, u_p.* FROM game_users u
// LEFT JOIN game_userproperty u_p ON u.uid = u_p.uid
// WHERE u.siteid = '$siteid' AND u.unstalled = 0
// ORDER BY u_p.usermoney
// LIMIT 10";
// $query = $db->query($sql);
// $users = array();
// while($row = $db->fetch_array($query)) {
// $users[] = $row;
// }
$site_id = gp('site_id', 100);
$smarty->assign('top_user', get_top_users($site_id));
$smarty->display('topuser.html');
?>