source: branches/new/index.php@ 659

Last change on this file since 659 was 654, checked in by Bidi, 16 years ago

Úklid repozitáře + zkopírování aktuálního webu do větve new

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