source: trunk/index.php@ 578

Last change on this file since 578 was 578, checked in by george, 16 years ago
  • Opraveno: Některé chyby a varování.
File size: 4.4 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
7session_start();
8include_once('inc/db.php');
9include_once('inc/db.php');
10include_once('inc/html.php');
11include_once('inc/player.php');
12include_once('inc/server.php');
13
14// classes start
15$player = new Player($db);
16$server = new Server($db);
17$html = new Html(0, $db);
18$html->Start();
19if(isset($_COOKIE['hof-random']) and $_COOKIE['hof-random'] == 'no') $num_headers = 1;
20 else $num_headers = 8;
21
22echo('<div id="page">'.
23 '<div id="header" style="background-image: url(imgs/web/headers/header'.rand(0, $num_headers - 1).'.jpg);"></div>'.
24 '<div id="top"></div>'.
25 '<div id="menu">');
26
27$MenuItems = array(
28 array('link' => '?page=main', 'Text' => 'Úvod'),
29 array('link' => '?page=server', 'Text' => 'Server'),
30 array('link' => '?page=register', 'Text' => 'Registrace'),
31 array('link' => '?page=begin', 'Text' => 'Jak začít'),
32 array('link' => 'forum/', 'Text' => 'Fórum'),
33 array('link' => '?page=gmteam', 'Text' => 'GM Tým'),
34 array('link' => '?page=acc', 'Text' => 'Správa účtu'),
35 array('link' => 'bug_tracker/', 'Text' => 'Nahlaš Bug'),
36 array('link' => '?page=download', 'Text' => 'Stahování'),
37 array('link' => '?page=links', 'Text' => 'Odkazy'),
38 array('link' => '?page=online', 'Text' => 'Online hráči'),
39 array('link' => '#', 'Text' => 'Mapa hráčů', 'OnClick' => "popup('../mmadmin/pomm_public/pomm.php', 758, 525); return false;"),
40 array('link' => '?page=banlist', 'Text' => 'Ban List'),
41 array('link' => '?page=guildy', 'Text' => 'Guildy'),
42 array('link' => '?page=gh', 'Text' => 'Domky Guild'),
43 array('link' => '?page=arena', 'Text' => 'Arény'),
44 array('link' => '?page=events', 'Text' => 'Eventy'),
45 array('link' => '?page=dotation', 'Text' => 'Dotace'),
46 array('link' => '?page=teamspeak', 'Text' => 'Team speak'),
47 array('link' => '?page=gmlog', 'Text' => 'GM log'),
48 array('link' => '?page=search', 'Text' => 'Vyhledávání'),
49);
50
51echo('<div id="mainmenu"><br /><br />');
52foreach($MenuItems as $Item)
53{
54 if(array_key_exists('OnClick', $Item)) $OnClick = ' onclick="'.$Item['OnClick'].'"';
55 else $OnClick = '';
56 if(array_key_exists('Target', $Item)) $Target = ' target="'.$Item['Target'].'"';
57 else $Target = '';
58
59 echo('<a href="'.$Item['link'].'"'.$OnClick.$Target.'>'.$Item['Text'].'</a><br />');
60}
61echo('</div>');
62
63echo('<div class="Banners">'.
64 '<strong>Naše ikonka :</strong><br />'.
65 '<a href="'.$Config['Web']['BaseURL'].'"><img src="imgs/web/hof_ban.png" alt="WoW Server Heroes of Fantasy" /></a><br />'.
66 '<strong>Odkazy :</strong><br />'.
67 '<a href="http://servery.wowresource.eu/"><img src="http://servery.wowresource.eu/templates/img/bannery/banner_maly.gif" alt="WoW Server status" /></a><br />'.
68 '<a href="http://www.wowhead.com"><img src="http://www.wowhead.com/images/badge_88x31.gif" width="88" height="31" alt="" /></a><br />'.
69 '<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>'.
70 '<strong>Statistika :</strong><br />'.
71 '<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 />'.
72 'Počet přístupů: <br /><a href="http://counter.cnw.cz/">'.
73 '<img src="http://counter.cnw.cz/monika.cgi?wowzdechov&amp;7&amp;000000&amp;FFFFFF&amp;on" alt="CNW:Counter" /></a>'.
74 '<script type="text/javascript">
75 <!--
76 document.write("<a href=\"http://counter.cnw.cz\" target=\"_parent\"><img src=\"http://counter.cnw.cz/trackit.cgi?wowzdechov&amp;t4&amp;" + escape(top.document.referrer) + "\" alt=\"CNW:Tracker\" border=\"0\" width=\"0\" height=\"0\"></a>");
77 // -->
78 </script>'.
79 '</div>'.
80 '</div>'.
81 '<div id="content">');
82
83// obsah start
84$include = 1;
85if(isset($_GET['logout']) and $player->Check())
86{
87 echo('<center>');
88 $player->Logout();
89 echo('</center>');
90 $include = 0;
91}
92if($include == 1)
93{
94 if(isset($_GET['page'])) include_once($html->Pager($_GET['page'], 'pages', 'main'));
95 else include_once('pages/main.php');
96}
97echo('</div><div id="footer"><br /><div id="copyright"><a href="?page=autori">Vývoj webu</a></div></div>');
98
99$html->Stop();
100$db->close();
101
102?>
Note: See TracBrowser for help on using the repository browser.