1 | <?php
|
---|
2 |
|
---|
3 | // SQL injection hack protection
|
---|
4 | foreach($_POST as $Index => $Item) $_POST[$Index] = addslashes($Item);
|
---|
5 | foreach($_GET as $Index => $Item) $_GET[$Index] = addslashes($Item);
|
---|
6 |
|
---|
7 | include_once('inc/config.php');
|
---|
8 |
|
---|
9 | if(array_key_exists('RealmIndex', $_POST))
|
---|
10 | {
|
---|
11 | setcookie('RealmIndex', $_POST['RealmIndex']);
|
---|
12 | $_COOKIE['RealmIndex'] = $_POST['RealmIndex'];
|
---|
13 | }
|
---|
14 | if(!array_key_exists('RealmIndex', $_COOKIE)) $_COOKIE['RealmIndex'] = 1;
|
---|
15 | else
|
---|
16 | {
|
---|
17 | if(!array_key_exists($_COOKIE['RealmIndex'], $Config['Mangos']['RealmList']))
|
---|
18 | $_COOKIE['RealmIndex'] = 1;
|
---|
19 | }
|
---|
20 |
|
---|
21 | session_start();
|
---|
22 | include_once('inc/error.php');
|
---|
23 | include_once('inc/db.php');
|
---|
24 | include_once('inc/html.php');
|
---|
25 | include_once('inc/player.php');
|
---|
26 | include_once('inc/server.php');
|
---|
27 |
|
---|
28 | // classes start
|
---|
29 | $player = new Player($db);
|
---|
30 | $server = new Server($db);
|
---|
31 | $html = new Html(0, $db);
|
---|
32 | $html->Start();
|
---|
33 | if(isset($_COOKIE['hof-random']) and $_COOKIE['hof-random'] == 'no') $num_headers = 1;
|
---|
34 | else $num_headers = 8;
|
---|
35 |
|
---|
36 | echo('<div id="page">'.
|
---|
37 | '<div id="header" style="background-image: url(imgs/web/headers/header'.rand(0, $num_headers - 1).'.jpg);"></div>'.
|
---|
38 | '<div id="top"></div>'.
|
---|
39 | '<div id="menu">');
|
---|
40 |
|
---|
41 | $ServerMenuItems = array(
|
---|
42 | array('link' => '?page=main', 'Text' => 'Úvod'),
|
---|
43 | array('link' => '?page=begin', 'Text' => 'Jak začít'),
|
---|
44 | array('link' => '?page=register', 'Text' => 'Registrace'),
|
---|
45 | array('link' => '?page=acc', 'Text' => 'Správa účtu'),
|
---|
46 | array('link' => 'forum/', 'Text' => 'Fórum'),
|
---|
47 | array('link' => '?page=server', 'Text' => 'Server'),
|
---|
48 | array('link' => 'bug_tracker/', 'Text' => 'Nahlaš chybu'),
|
---|
49 | array('link' => 'gallery/', 'Text' => 'Galerie'),
|
---|
50 | array('link' => '?page=download', 'Text' => 'Stahování'),
|
---|
51 | array('link' => '?page=links', 'Text' => 'Odkazy'),
|
---|
52 | array('link' => '?page=banlist', 'Text' => 'Bany'),
|
---|
53 | array('link' => '?page=dotation', 'Text' => 'Dotace'),
|
---|
54 | array('link' => '?page=teamspeak', 'Text' => 'Team speak'),
|
---|
55 | array('link' => '?page=client', 'Text' => 'HoF Client'),
|
---|
56 | array('link' => '?page=search', 'Text' => 'Vyhledávání'),
|
---|
57 | array('link' => '?page=realmlist', 'Text' => 'Světy'),
|
---|
58 | );
|
---|
59 |
|
---|
60 | $RealmMenuItems = array(
|
---|
61 | array('link' => '?page=online', 'Text' => 'Online hráči'),
|
---|
62 | array('link' => '#', 'Text' => 'Mapa hráčů', 'OnClick' => "popup('../minimanager/pomm/pomm.php?realmid=".$_COOKIE['RealmIndex']."', 1000, 800); return false;"),
|
---|
63 | array('link' => '?page=tophraci', 'Text' => 'Nej hráči'),
|
---|
64 | array('link' => '?page=guildy', 'Text' => 'Spolky'),
|
---|
65 | array('link' => '?page=gmteam', 'Text' => 'GM Tým'),
|
---|
66 | array('link' => '?page=gh', 'Text' => 'Domky spolků'),
|
---|
67 | array('link' => '?page=arena', 'Text' => 'Arény'),
|
---|
68 | array('link' => '?page=events', 'Text' => 'Události'),
|
---|
69 | array('link' => '?page=gmlog', 'Text' => 'GM log'),
|
---|
70 | );
|
---|
71 |
|
---|
72 | echo('<br /><br />');
|
---|
73 | echo('<div id="mainmenu">');
|
---|
74 | foreach($ServerMenuItems as $Item)
|
---|
75 | {
|
---|
76 | if(array_key_exists('OnClick', $Item)) $OnClick = ' onclick="'.$Item['OnClick'].'"';
|
---|
77 | else $OnClick = '';
|
---|
78 | if(array_key_exists('Target', $Item)) $Target = ' target="'.$Item['Target'].'"';
|
---|
79 | else $Target = '';
|
---|
80 |
|
---|
81 | echo('<a href="'.$Item['link'].'"'.$OnClick.$Target.'>'.$Item['Text'].'</a><br />');
|
---|
82 | }
|
---|
83 | echo('</div>');
|
---|
84 |
|
---|
85 | if(count($Config['Mangos']['RealmList']) > 1)
|
---|
86 | {
|
---|
87 | echo('Výběr světa:');
|
---|
88 | echo('<form name="realm_selection" action="" method="post">'.
|
---|
89 | '<select name="RealmIndex" style="width: 100%" onchange="document.realm_selection.submit()">');
|
---|
90 | foreach($Config['Mangos']['RealmList'] as $Index => $Realm)
|
---|
91 | {
|
---|
92 | if($_COOKIE['RealmIndex'] == $Index) $Selected = ' selected="selected"';
|
---|
93 | else $Selected = '';
|
---|
94 | echo('<option value="'.$Index.'"'.$Selected.'>'.$Realm['Name'].'</option>');
|
---|
95 | }
|
---|
96 | echo('</select>'.
|
---|
97 | '</form>');
|
---|
98 | }
|
---|
99 |
|
---|
100 | echo('<br /><br />');
|
---|
101 | echo('<div id="mainmenu">');
|
---|
102 | foreach($RealmMenuItems as $Item)
|
---|
103 | {
|
---|
104 | if(array_key_exists('OnClick', $Item)) $OnClick = ' onclick="'.$Item['OnClick'].'"';
|
---|
105 | else $OnClick = '';
|
---|
106 | if(array_key_exists('Target', $Item)) $Target = ' target="'.$Item['Target'].'"';
|
---|
107 | else $Target = '';
|
---|
108 |
|
---|
109 | echo('<a href="'.$Item['link'].'"'.$OnClick.$Target.'>'.$Item['Text'].'</a><br />');
|
---|
110 | }
|
---|
111 | echo('</div>');
|
---|
112 |
|
---|
113 | echo('<div class="Banners">'.
|
---|
114 | '<strong>Naše ikonka :</strong><br />'.
|
---|
115 | '<a href="'.$Config['Web']['BaseURL'].'"><img src="imgs/web/hof_ban.png" alt="WoW Server Heroes of Fantasy" /></a><br />'.
|
---|
116 | '<strong>Odkazy :</strong><br />'.
|
---|
117 | '<a href="http://servery.wowresource.eu/"><img src="http://servery.wowresource.eu/templates/img/bannery/banner_maly.gif" alt="WoW Server status" /></a><br />'.
|
---|
118 | '<a href="http://www.wowhead.com"><img src="http://www.wowhead.com/images/badge_88x31.gif" width="88" height="31" alt="" /></a><br />'.
|
---|
119 | '<a href="http://wowpreklad.zdechov.net/"><img src="http://wowpreklad.zdechov.net/banners/baner_88_31.jpg" alt="baner_http://wowpreklad.zdechov.net/" height="31" width="88" /></a><br />'.
|
---|
120 | '<strong>Statistika :</strong><br />'.
|
---|
121 | '<a href="http://www.toplist.cz/"><img src="http://toplist.cz/count.asp?logo=mc&ID=324802" width="88" height="60" alt="counter" /></a><br /><br />'.
|
---|
122 | 'Počet přístupů: <br /><a href="http://counter.cnw.cz/">'.
|
---|
123 | '<img src="http://counter.cnw.cz/monika.cgi?wowzdechov&7&000000&FFFFFF&on" alt="CNW:Counter" /></a>'.
|
---|
124 | '<script type="text/javascript">
|
---|
125 | <!--
|
---|
126 | document.write("<a href=\"http://counter.cnw.cz\" target=\"_parent\"><img src=\"http://counter.cnw.cz/trackit.cgi?wowzdechov&t4&" + escape(top.document.referrer) + "\" alt=\"CNW:Tracker\" border=\"0\" width=\"0\" height=\"0\"></a>");
|
---|
127 | // -->
|
---|
128 | </script>'.
|
---|
129 | '</div>'.
|
---|
130 | '</div>'.
|
---|
131 | '<div id="content">');
|
---|
132 |
|
---|
133 | // obsah start
|
---|
134 | $include = 1;
|
---|
135 | if(isset($_GET['logout']) and $player->Check())
|
---|
136 | {
|
---|
137 | echo('<center>');
|
---|
138 | $player->Logout();
|
---|
139 | echo('</center>');
|
---|
140 | $include = 0;
|
---|
141 | }
|
---|
142 | if($include == 1)
|
---|
143 | {
|
---|
144 | if(isset($_GET['page'])) include_once($html->Pager($_GET['page'], 'pages', 'main'));
|
---|
145 | else include_once('pages/main.php');
|
---|
146 | }
|
---|
147 | echo('</div>'.
|
---|
148 | '<div id="footer"><br /><div id="copyright"><a href="?page=autori">Vývoj webu</a></div></div></div>');
|
---|
149 |
|
---|
150 | $html->Stop();
|
---|
151 | $db->close();
|
---|
152 |
|
---|
153 | ?>
|
---|