1
<?php
2
/**
3
 *   File functions:
4
 *   Hall of Fame - list of all Heroes in game
5
 *
6
 *   @name                 : hof.php                            
7
 *   @copyright            : (C) 2004,2005,2006 Vallheru Team based on Gamers-Fusion ver 2.5
8
 *   @author               : thindil <thindil@users.sourceforge.net>
9
 *   @version              : 1.1
10
 *   @since                : 04.03.2006
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
//   (at your 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 = "Galeria Bohaterów";
33
require_once("includes/head.php");
34
35
/**
36
* Get the localization for game
37
*/
38
require_once("languages/".$player -> lang."/hof.php");
39
40
if ($player -> location != 'Altara') 
41
{
42
    error (ERROR);
43
44
}
45
46
$hero = $db -> Execute("SELECT * FROM halloffame");
47
$arrname = array();
48
$arroldid = array();
49
$arrid = array();
50
$arrrace = array();
51
$i = 0;
52
if (!$hero -> fields['id']) 
53
{
54
    $smarty -> assign("Message", NO_HERO."<br /><br />");
55
} 
56
    else 
57
{
58
    $smarty -> assign("Message", '');
59
}
60
while (!$hero -> EOF) 
61
{
62
    $query = $db -> Execute("SELECT id FROM players WHERE id=".$hero -> fields['newid']);
63
    $test = $query -> RecordCount();
64
    if ($test == 0) 
65
    {
66
        $arrid[$i] = HAS_LEFT;
67
    } 
68
        else 
69
    {
70
        $arrid[$i] = $hero -> fields['newid'];
71
    }
72
    $query -> Close();
73
    $arrname[$i] = $hero -> fields['oldname'];
74
    $arroldid[$i] = $hero -> fields['heroid'];
75
    $arrrace[$i] = $hero -> fields['herorace'];
76
    $hero -> MoveNext();
77
    $i = $i + 1;    
78
}
79
$hero -> Close();
80
81
/**
82
* Assign variables to template and display page
83
*/
84
$smarty -> assign(array("Hero" => $arrname, 
85
    "Oldid" => $arroldid, 
86
    "Heroid" => $arrid, 
87
    "Herorace" => $arrrace,
88
    "Hofinfo" => HOF_INFO,
89
    "Hname" => H_NAME,
90
    "Holdid" => H_OLDID,
91
    "Hid" => H_ID,
92
    "Hrace" => H_RACE,
93
    "Hofinfo2" => HOF_INFO2));
94
$smarty -> display ('hof.tpl');
95
96
require_once("includes/foot.php");
97
?>