Changeset 690 for trunk/index.php
- Timestamp:
- Mar 19, 2010, 9:22:00 PM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/index.php
r688 r690 1 1 <?php 2 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); 3 // URL routing 4 $QueryString = $_SERVER['QUERY_STRING']; 5 if(substr($QueryString, -1, 1) == '/') $QueryString = substr($QueryString, 0, -1); 6 $QueryItems = explode('/', $QueryString); 7 //echo($_SERVER['QUERY_STRING']); 8 //print_r($QueryItems); 9 if(strpos($_SERVER['REQUEST_URI'], '?') !== false) 10 $_SERVER['QUERY_STRING'] = substr($_SERVER['REQUEST_URI'], strpos($_SERVER['REQUEST_URI'], '?') + 1); 11 else $_SERVER['QUERY_STRING'] = ''; 12 echo(phpinfo()); 13 14 if(count($QueryItems) > 0) 15 $Page = 'pages/'.$QueryItems[0].'.php'; 16 if(!file_exists($Page)) $Page = 'pages/main.php'; 6 17 7 18 if(file_exists('inc/config.php')) include_once('inc/config.php'); … … 28 39 include_once('inc/realm.php'); 29 40 41 // SQL injection hack protection 42 foreach($_POST as $Index => $Item) $_POST[$Index] = addslashes($Item); 43 foreach($_GET as $Index => $Item) $_GET[$Index] = addslashes($Item); 44 30 45 // classes start 31 46 $System = new System($Config); … … 35 50 $html = new Html(0, $db); 36 51 $html->Start(); 52 $_GET = $html->GetQueryStringArray(); 53 37 54 if(isset($_COOKIE['hof-random']) and $_COOKIE['hof-random'] == 'no') $num_headers = 1; 38 55 else $num_headers = 8; … … 49 66 50 67 echo('<div id="page">'. 51 '<div id="header" style="background-image: url( imgs/web/headers/header'.rand(0, $num_headers - 1).'.jpg);"></div>'.68 '<div id="header" style="background-image: url('.$html->Link('/imgs/web/headers/header'.rand(0, $num_headers - 1).'.jpg').');"></div>'. 52 69 '<div id="top"></div>'. 53 70 '<div id="menu">'); 54 71 55 72 $ServerMenuItems = array( 56 array('link' => '?page=main', 'Text' => 'Úvod'),57 array('link' => '?page=begin', 'Text' => 'Jak začít'),73 array('link' => $html->Link('/'), 'Text' => 'Úvod'), 74 array('link' => $html->Link('/jak-zacit/'), 'Text' => 'Jak začít'), 58 75 //array('link' => '?page=rules', 'Text' => 'Pravidla'), 59 array('link' => '?page=register', 'Text' => 'Registrace'),60 array('link' => '?page=acc', 'Text' => 'Správa účtu'),61 array('link' => 'forum/', 'Text' => 'Fórum'),62 array('link' => '?page=server', 'Text' => 'Server'),76 array('link' => $html->Link('/registrace/'), 'Text' => 'Registrace'), 77 array('link' => $html->Link('/ucet/'), 'Text' => 'Správa účtu'), 78 array('link' => $html->Link('/forum/'), 'Text' => 'Fórum'), 79 array('link' => $html->Link('/server'), 'Text' => 'Server'), 63 80 //array('link' => '?page=gmteam', 'Text' => 'GM Tým'), 64 81 //array('link' => 'bug_tracker/', 'Text' => 'Nahlaš chybu'), 65 array('link' => 'gallery/', 'Text' => 'Galerie'),66 array('link' => '?page=reklama', 'Text' => 'Reklama'),82 array('link' => $html->Link('/galerie/'), 'Text' => 'Galerie'), 83 array('link' => $html->Link('/propagace/'), 'Text' => 'Propagace'), 67 84 //array('link' => '?page=download', 'Text' => 'Stahování'), 68 array('link' => '?page=links', 'Text' => 'Odkazy'),69 array('link' => '?page=banlist', 'Text' => 'Bany'),70 array('link' => '?page=dotation', 'Text' => 'Dotace'),71 array('link' => '?page=teamspeak', 'Text' => 'Team speak'),72 array('link' => '?page=search', 'Text' => 'Vyhledávání'),73 array('link' => '?page=realmlist', 'Text' => 'Světy'),85 array('link' => $html->Link('/odkazy/'), 'Text' => 'Odkazy'), 86 //array('link' => $html->Link('/blokovani-uctu/'), 'Text' => 'Bany'), 87 array('link' => $html->Link('/finance/'), 'Text' => 'Dotace'), 88 array('link' => $html->Link('/teamspeak/'), 'Text' => 'Team speak'), 89 array('link' => $html->Link('/hledani/'), 'Text' => 'Vyhledávání'), 90 array('link' => $html->Link('/realmlist/'), 'Text' => 'Světy'), 74 91 ); 75 92 76 93 $RealmMenuItems = array( 77 array('link' => '?page=online', 'Text' => 'Online hráči'),78 array('link' => '#', 'Text' => 'Mapa hráčů', 'OnClick' => "popup(' ../minimanager/pomm/pomm.php?realmid=".$_COOKIE['RealmIndex']."', 1000, 800); return false;"),79 array('link' => '?page=tophraci', 'Text' => 'Nej hráči'),80 array('link' => '?page=guildy', 'Text' => 'Spolky'),81 array('link' => 'armory/', 'Text' => 'Armory'),94 array('link' => $html->Link('/online-hraci/'), 'Text' => 'Online hráči'), 95 array('link' => '#', 'Text' => 'Mapa hráčů', 'OnClick' => "popup('".$html->Link("/minimanager/pomm/pomm.php?realmid=".$_COOKIE['RealmIndex'])."', 1000, 800); return false;"), 96 array('link' => $html->Link('/nej-hraci/'), 'Text' => 'Nej hráči'), 97 array('link' => $html->Link('/spolky/'), 'Text' => 'Spolky'), 98 array('link' => $html->Link('/armory/'), 'Text' => 'Armory'), 82 99 //array('link' => '?page=gh', 'Text' => 'Domky spolků'), 83 array('link' => '?page=arena', 'Text' => 'Arény'),84 array('link' => '?page=events', 'Text' => 'Události'),100 array('link' => $html->Link('/arena/'), 'Text' => 'Arény'), 101 array('link' => $html->Link('/akce/'), 'Text' => 'Události'), 85 102 //array('link' => '?page=gmlog', 'Text' => 'GM log'), 86 array('link' => '?page=commands', 'Text' => 'Příkazy'),103 array('link' => $html->Link('/prikazy/'), 'Text' => 'Příkazy'), 87 104 ); 88 105 … … 116 133 117 134 echo('<div class="Banners">'. 118 '<strong>Naše ikonka :</strong><br />'. 119 '<a href="'.$Config['Web']['BaseURL'].'"><img src="imgs/web/hof_ban.png" alt="WoW Server Heroes of Fantasy" /></a><br />'. 120 '<strong>Odkazy :</strong><br />'. 121 '<a href="http://servery.wowresource.eu/"><img src="http://servery.wowresource.eu/templates/img/bannery/banner_maly.gif" alt="WoW Server status" /></a><br />'. 122 '<a href="http://www.wowhead.com"><img src="http://www.wowhead.com/images/badge_88x31.gif" width="88" height="31" alt="" /></a><br />'. 135 '<br />'. 123 136 '<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 />'. 124 '< strong>Statistika :</strong><br/>'.125 '<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 />'.126 ' Počet přístupů:<br /><a href="http://counter.cnw.cz/">'.137 '<br/><br/>'. 138 '<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 />'. 139 '<br /><a href="http://counter.cnw.cz/">'. 127 140 '<img src="http://counter.cnw.cz/monika.cgi?wowzdechov&7&000000&FFFFFF&on" alt="CNW:Counter" /></a>'. 128 141 "\n". … … 147 160 if($include == 1) 148 161 { 149 if(isset($_GET['page'])) include_once($html->Pager($_GET['page'], 'pages', 'main')); 150 else include_once('pages/main.php'); 162 include_once($Page); 151 163 } 152 164 echo('</div>'. 153 '<div id="footer"><br /><div id="copyright"><a href=" ?page=autori">Vývoj webu</a></div></div></div>');165 '<div id="footer"><br /><div id="copyright"><a href="'.$html->Link('/autori/').'">Vývoj webu</a></div></div></div>'); 154 166 155 167 $html->Stop();
Note:
See TracChangeset
for help on using the changeset viewer.