1
<?php
2
/**
3
 *   File functions:
4
 *   Reputation preview page.
5
 *
6
 *   @name                 : help.php                            
7
 *   @copyright            : 
8
 *   @author               : albitos.snape@gmail.com
9
 *   @version              : 1.0
10
 *   @since                : 03.09.2007
11
 *
12
 */
13
14
//
15
//
16
//       This program is free software; you can redistribute it and/or modify
17
//   it under the terms of the GNU General Public License as published by
18
//   the Free Software Foundation; either version 2 of the License, or
19
//   (aty our option) any later version.
20
//
21
//   This program is distributed in the hope that it will be useful,
22
//   but WITHOUT ANY WARRANTY; without even the implied warranty of
23
//   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
24
//   GNU General Public License for more details.
25
//
26
//   You should have received a copy of the GNU General Public License
27
//   along with this program; if not, write to the Free Software
28
//   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
29
//
30
// 
31
32
$title = "Reputacja";
33
require_once("includes/head.php");
34
35
/**
36
* Get the localization for game
37
*/
38
require_once("languages/".$player -> lang."/reputation.php");
39
40
41
if(!isset($_GET['id']) || empty($_GET['id']))
42
{
43
    $aTop = $db -> getAll('SELECT sum(reputation.points ) as points , players.user, reputation.player_id
44
                            FROM reputation
45
                            LEFT JOIN players ON players.id = reputation.player_id
46
                            GROUP BY reputation.player_id ORDER BY points DESC');
47
    
48
    $smarty -> assign('Top', $aTop);
49
}
50
else
51
{
52
    $aData = $db -> getAll('SELECT * FROM reputation WHERE player_id = '.(int)$_GET['id']);
53
    $smarty -> assign('id', (int)$_GET['id']);    
54
    $smarty -> assign('Reps', $aData);
55
}
56
$smarty -> display('reputation.tpl');
57
require_once("includes/foot.php");
58
?>