1 | <?php
|
---|
2 |
|
---|
3 | if(!array_key_exists('HideWelcome', $_COOKIE)) $_COOKIE['HideWelcome'] = 0;
|
---|
4 | if(isset($_GET['Action']))
|
---|
5 | {
|
---|
6 | if($_GET['Action'] == 'HideWelcome') $_COOKIE['HideWelcome'] = 1;
|
---|
7 | if($_GET['Action'] == 'UnHideWelcome') $_COOKIE['HideWelcome'] = 0;
|
---|
8 | }
|
---|
9 | setcookie('HideWelcome', $_COOKIE['HideWelcome'], time() + 3600 * 24 * 365);
|
---|
10 |
|
---|
11 | // URL routing
|
---|
12 | $QueryString = $_SERVER['QUERY_STRING'];
|
---|
13 | if(substr($QueryString, -1, 1) == '/') $QueryString = substr($QueryString, 0, -1);
|
---|
14 | $QueryItems = explode('/', $QueryString);
|
---|
15 | //echo($_SERVER['QUERY_STRING']);
|
---|
16 | //print_r($QueryItems);
|
---|
17 | if(strpos($_SERVER['REQUEST_URI'], '?') !== false)
|
---|
18 | $_SERVER['QUERY_STRING'] = substr($_SERVER['REQUEST_URI'], strpos($_SERVER['REQUEST_URI'], '?') + 1);
|
---|
19 | else $_SERVER['QUERY_STRING'] = '';
|
---|
20 | //echo(phpinfo());
|
---|
21 |
|
---|
22 | if(count($QueryItems) > 0)
|
---|
23 | $Page = 'pages/'.$QueryItems[0].'.php';
|
---|
24 | if(!file_exists($Page)) $Page = 'pages/main.php';
|
---|
25 |
|
---|
26 | if(file_exists('inc/config.php')) include_once('inc/config.php');
|
---|
27 | else die('Nenalezen soubor inc/config.php. Vytvořte jej z předlohy config.sample.php.');
|
---|
28 |
|
---|
29 | session_start();
|
---|
30 | include_once('inc/error.php');
|
---|
31 | include_once('inc/database.php');
|
---|
32 | include_once('inc/html.php');
|
---|
33 | include_once('inc/system.php');
|
---|
34 | include_once('inc/player.php');
|
---|
35 | include_once('inc/server.php');
|
---|
36 | include_once('inc/realm.php');
|
---|
37 |
|
---|
38 | // SQL injection hack protection
|
---|
39 | foreach($_POST as $Index => $Item) $_POST[$Index] = addslashes($Item);
|
---|
40 | foreach($_GET as $Index => $Item) $_GET[$Index] = addslashes($Item);
|
---|
41 |
|
---|
42 | // classes start
|
---|
43 | $System = new System($Config);
|
---|
44 | $db = $System->Database;
|
---|
45 | $player = new Player($db);
|
---|
46 | $server = new Server($System, 1);
|
---|
47 | $html = new Html(0, $db);
|
---|
48 | $html->Start();
|
---|
49 | $_GET = $html->GetQueryStringArray();
|
---|
50 |
|
---|
51 | if(isset($_COOKIE['hof-random']) and $_COOKIE['hof-random'] == 'no') $num_headers = 1;
|
---|
52 | else $num_headers = 8;
|
---|
53 |
|
---|
54 | echo('<div id="page">'.
|
---|
55 | '<div id="header" style="background-image: url('.$html->Link('/imgs/web/headers/header'.rand(0, $num_headers - 1).'.jpg').');"></div>'.
|
---|
56 | '<div id="top"></div>'.
|
---|
57 | '<div id="menu">');
|
---|
58 |
|
---|
59 | if((count($QueryItems) > 1) and ($QueryItems['0'] == 'svety'))
|
---|
60 | {
|
---|
61 | $DbResult = $System->Database->query('SELECT Id FROM Realm WHERE '.$System->SQLURLName('Name').'="'.$QueryItems[1].'"');
|
---|
62 | if($DbResult->num_rows > 0)
|
---|
63 | {
|
---|
64 | $DbRow = $DbResult->fetch_assoc();
|
---|
65 | $Realm = new Realm($System, $DbRow['Id']);
|
---|
66 | $Realm->Data['URLName'] = $QueryItems[1];
|
---|
67 |
|
---|
68 | $MenuItems = array(
|
---|
69 | array('link' => $html->Link('/'), 'Text' => 'Úvod'),
|
---|
70 | array(),
|
---|
71 | array('link' => $html->Link('/svety/'.$Realm->Data['URLName'].'/online-hraci/'), 'Text' => 'Právě hrají'),
|
---|
72 | array('link' => '#', 'Text' => 'Mapa', 'OnClick' => "popup('".$html->Link("/minimanager/map/?r_id=".$Realm->Data['Id'])."', 1000, 800); return false;"),
|
---|
73 | array('link' => $html->Link('/svety/'.$Realm->Data['URLName'].'/nej-hraci/'), 'Text' => 'Nej'),
|
---|
74 | array('link' => $html->Link('/svety/'.$Realm->Data['URLName'].'/spolky/'), 'Text' => 'Spolky'),
|
---|
75 | array('link' => $html->Link('/armory/'), 'Text' => 'Armory'),
|
---|
76 | array('link' => $html->Link('/svety/'.$Realm->Data['URLName'].'/arena/'), 'Text' => 'Arény'),
|
---|
77 | array('link' => $html->Link('/svety/'.$Realm->Data['URLName'].'/akce/'), 'Text' => 'Události'),
|
---|
78 | array('link' => $html->Link('/svety/'.$Realm->Data['URLName'].'/prikazy/'), 'Text' => 'Příkazy'),
|
---|
79 | );
|
---|
80 | } else
|
---|
81 | {
|
---|
82 | echo('Svět nenalezen');
|
---|
83 | $MenuItems = array(
|
---|
84 | array('link' => $html->Link('/'), 'Text' => 'Úvod'),
|
---|
85 | );
|
---|
86 | }
|
---|
87 | } else
|
---|
88 | {
|
---|
89 | $MenuItems = array(
|
---|
90 | array('link' => $html->Link('/'), 'Text' => 'Úvod'),
|
---|
91 | array('link' => $html->Link('/svety/'), 'Text' => 'Světy'),
|
---|
92 | array('link' => $html->Link('/jak-zacit/'), 'Text' => 'Jak začít'),
|
---|
93 | array('link' => $html->Link('/registrace/'), 'Text' => 'Registrace'),
|
---|
94 | array('link' => $html->Link('/ucet/'), 'Text' => 'Správa účtu'),
|
---|
95 | array('link' => $html->Link('/forum/'), 'Text' => 'Fórum'),
|
---|
96 | array('link' => $html->Link('/cestina/'), 'Text' => 'Čeština'),
|
---|
97 | array('link' => $html->Link('/stahovani/'), 'Text' => 'Soubory'),
|
---|
98 | array('link' => $html->Link('/server/'), 'Text' => 'Server'),
|
---|
99 | array('link' => $html->Link('/galerie/'), 'Text' => 'Galerie'),
|
---|
100 | array('link' => $html->Link('/propagace/'), 'Text' => 'Propagace'),
|
---|
101 | array('link' => $html->Link('/odkazy/'), 'Text' => 'Odkazy'),
|
---|
102 | //array('link' => $html->Link('/blokovani-uctu/'), 'Text' => 'Bany'),
|
---|
103 | array('link' => $html->Link('/finance/'), 'Text' => 'Dotace'),
|
---|
104 | array('link' => 'http://stat.zdechov.net/game/', 'Text' => 'Časové grafy'),
|
---|
105 | array('link' => $html->Link('/teamspeak/'), 'Text' => 'Teamspeak'),
|
---|
106 | array('link' => $html->Link('/podpora/'), 'Text' => 'Podpora'),
|
---|
107 | array('link' => $html->Link('/hledani/'), 'Text' => 'Vyhledávání'),
|
---|
108 | );
|
---|
109 | }
|
---|
110 |
|
---|
111 | echo('<br /><br />');
|
---|
112 | echo('<div class="mainmenu">');
|
---|
113 | foreach($MenuItems as $Item)
|
---|
114 | {
|
---|
115 | if(array_key_exists('Text', $Item))
|
---|
116 | {
|
---|
117 | if(array_key_exists('OnClick', $Item)) $OnClick = ' onclick="'.$Item['OnClick'].'"';
|
---|
118 | else $OnClick = '';
|
---|
119 | if(array_key_exists('Target', $Item)) $Target = ' target="'.$Item['Target'].'"';
|
---|
120 | else $Target = '';
|
---|
121 | echo('<a href="'.$Item['link'].'"'.$OnClick.$Target.'>'.$Item['Text'].'</a><br />');
|
---|
122 | } else
|
---|
123 | {
|
---|
124 | echo($server->RealmSelection());
|
---|
125 | echo('<br/>');
|
---|
126 | echo('<br/>');
|
---|
127 | }
|
---|
128 | }
|
---|
129 | echo('</div>');
|
---|
130 |
|
---|
131 | echo('<div class="Banners">'.
|
---|
132 | '<br />'.
|
---|
133 | '<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 />'.
|
---|
134 | '<br/><br/>'.
|
---|
135 | '<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 />'.
|
---|
136 | '<br /><a href="http://counter.cnw.cz/">'.
|
---|
137 | '<img src="http://counter.cnw.cz/monika.cgi?wowzdechov&7&000000&FFFFFF&on" alt="CNW:Counter" /></a>'.
|
---|
138 | "\n".
|
---|
139 | '<script type="text/javascript">
|
---|
140 | <!--
|
---|
141 | 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>");
|
---|
142 | // -->
|
---|
143 | </script>'.
|
---|
144 | '</div>'.
|
---|
145 | '</div>'.
|
---|
146 | '<div id="content">');
|
---|
147 |
|
---|
148 | // obsah start
|
---|
149 | $include = 1;
|
---|
150 | if($include == 1)
|
---|
151 | {
|
---|
152 | include_once($Page);
|
---|
153 | }
|
---|
154 | echo('</div>'.
|
---|
155 | '<div id="footer"><br /><div id="copyright"><a href="'.$html->Link('/autori/').'">Vývoj webu</a></div></div></div>');
|
---|
156 |
|
---|
157 | $html->Stop();
|
---|
158 | $db->close();
|
---|
159 |
|
---|
160 | ?>
|
---|