Changeset 697 for trunk/index.php
- Timestamp:
- Mar 21, 2010, 9:57:48 AM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/index.php
r695 r697 41 41 $_GET = $html->GetQueryStringArray(); 42 42 43 if(array_key_exists('RealmIndex', $_POST))44 {45 setcookie('RealmIndex', $_POST['RealmIndex']);46 $_COOKIE['RealmIndex'] = $_POST['RealmIndex'];47 }48 if(array_key_exists('RealmIndex', $_GET))49 {50 setcookie('RealmIndex', $_GET['RealmIndex']);51 $_COOKIE['RealmIndex'] = $_GET['RealmIndex'];52 }53 54 43 if(isset($_COOKIE['hof-random']) and $_COOKIE['hof-random'] == 'no') $num_headers = 1; 55 44 else $num_headers = 8; 56 57 // Check right RealmIndex58 if(!array_key_exists('RealmIndex', $_COOKIE))59 {60 $_COOKIE['RealmIndex'] = $Config['Web']['DefaultRealmIndex'];61 } else62 {63 $DbResult = $System->Database->query('SELECT Id FROM Realm WHERE Id='.$_COOKIE['RealmIndex']);64 if($DbResult->num_rows == 0) $_COOKIE['RealmIndex'] = $Config['Web']['DefaultRealmIndex'];65 }66 45 67 46 echo('<div id="page">'. … … 70 49 '<div id="menu">'); 71 50 72 $ServerMenuItems = array( 73 array('link' => $html->Link('/'), 'Text' => 'Úvod'), 74 array('link' => $html->Link('/jak-zacit/'), 'Text' => 'Jak začít'), 75 array('link' => $html->Link('/registrace/'), 'Text' => 'Registrace'), 76 array('link' => $html->Link('/ucet/'), 'Text' => 'Správa účtu'), 77 array('link' => $html->Link('/forum/'), 'Text' => 'Fórum'), 78 array('link' => $html->Link('/server/'), 'Text' => 'Server'), 79 array('link' => $html->Link('/galerie/'), 'Text' => 'Galerie'), 80 array('link' => $html->Link('/propagace/'), 'Text' => 'Propagace'), 81 array('link' => $html->Link('/odkazy/'), 'Text' => 'Odkazy'), 82 //array('link' => $html->Link('/blokovani-uctu/'), 'Text' => 'Bany'), 83 array('link' => $html->Link('/finance/'), 'Text' => 'Dotace'), 84 array('link' => $html->Link('/teamspeak/'), 'Text' => 'Team speak'), 85 array('link' => $html->Link('/hledani/'), 'Text' => 'Vyhledávání'), 86 array('link' => $html->Link('/svety/'), 'Text' => 'Světy'), 87 ); 88 89 $DbResult = $System->Database->query('SELECT '.$System->SQLURLName('Name').' AS URLName FROM Realm WHERE Id='.$_COOKIE['RealmIndex']); 90 $Realm = $DbResult->fetch_assoc(); 91 $RealmMenuItems = array( 92 array('link' => $html->Link('/svety/'.$Realm['URLName'].'/online-hraci/'), 'Text' => 'Online hráči'), 93 array('link' => '#', 'Text' => 'Mapa hráčů', 'OnClick' => "popup('".$html->Link("/minimanager/map/?r_id=".$_COOKIE['RealmIndex'])."', 1000, 800); return false;"), 94 array('link' => $html->Link('/svety/'.$Realm['URLName'].'/nej-hraci/'), 'Text' => 'Nej hráči'), 95 array('link' => $html->Link('/svety/'.$Realm['URLName'].'/spolky/'), 'Text' => 'Spolky'), 96 array('link' => $html->Link('/armory/'), 'Text' => 'Armory'), 97 array('link' => $html->Link('/svety/'.$Realm['URLName'].'/arena/'), 'Text' => 'Arény'), 98 array('link' => $html->Link('/svety/'.$Realm['URLName'].'/akce/'), 'Text' => 'Události'), 99 array('link' => $html->Link('/svety/'.$Realm['URLName'].'/prikazy/'), 'Text' => 'Příkazy'), 100 ); 51 if((count($QueryItems) > 1) and ($QueryItems['0'] == 'svety')) 52 { 53 $DbResult = $System->Database->query('SELECT Id FROM Realm WHERE '.$System->SQLURLName('Name').'="'.$QueryItems[1].'"'); 54 if($DbResult->num_rows > 0) 55 { 56 $DbRow = $DbResult->fetch_assoc(); 57 $Realm = new Realm($System, $DbRow['Id']); 58 $Realm->Data['URLName'] = $QueryItems[1]; 59 60 $MenuItems = array( 61 array('link' => $html->Link('/'), 'Text' => 'Úvod'), 62 array(), 63 array('link' => $html->Link('/svety/'.$Realm->Data['URLName'].'/online-hraci/'), 'Text' => 'Online hráči'), 64 array('link' => '#', 'Text' => 'Mapa hráčů', 'OnClick' => "popup('".$html->Link("/minimanager/map/?r_id=".$Realm->Data['Id'])."', 1000, 800); return false;"), 65 array('link' => $html->Link('/svety/'.$Realm->Data['URLName'].'/nej-hraci/'), 'Text' => 'Nej hráči'), 66 array('link' => $html->Link('/svety/'.$Realm->Data['URLName'].'/spolky/'), 'Text' => 'Spolky'), 67 array('link' => $html->Link('/armory/'), 'Text' => 'Armory'), 68 array('link' => $html->Link('/svety/'.$Realm->Data['URLName'].'/arena/'), 'Text' => 'Arény'), 69 array('link' => $html->Link('/svety/'.$Realm->Data['URLName'].'/akce/'), 'Text' => 'Události'), 70 array('link' => $html->Link('/svety/'.$Realm->Data['URLName'].'/prikazy/'), 'Text' => 'Příkazy'), 71 ); 72 } else 73 { 74 echo('Svět nenalezen'); 75 $MenuItems = array( 76 array('link' => $html->Link('/'), 'Text' => 'Úvod'), 77 ); 78 } 79 } else 80 { 81 $MenuItems = array( 82 array('link' => $html->Link('/'), 'Text' => 'Úvod'), 83 array('link' => $html->Link('/svety/'), 'Text' => 'Světy'), 84 array('link' => $html->Link('/jak-zacit/'), 'Text' => 'Jak začít'), 85 array('link' => $html->Link('/registrace/'), 'Text' => 'Registrace'), 86 array('link' => $html->Link('/ucet/'), 'Text' => 'Správa účtu'), 87 array('link' => $html->Link('/forum/'), 'Text' => 'Fórum'), 88 array('link' => $html->Link('/server/'), 'Text' => 'Server'), 89 array('link' => $html->Link('/galerie/'), 'Text' => 'Galerie'), 90 array('link' => $html->Link('/propagace/'), 'Text' => 'Propagace'), 91 array('link' => $html->Link('/odkazy/'), 'Text' => 'Odkazy'), 92 //array('link' => $html->Link('/blokovani-uctu/'), 'Text' => 'Bany'), 93 array('link' => $html->Link('/finance/'), 'Text' => 'Dotace'), 94 array('link' => $html->Link('/teamspeak/'), 'Text' => 'Team speak'), 95 array('link' => $html->Link('/hledani/'), 'Text' => 'Vyhledávání'), 96 ); 97 } 101 98 102 99 echo('<br /><br />'); 103 100 echo('<div class="mainmenu">'); 104 foreach($ ServerMenuItems as $Item)101 foreach($MenuItems as $Item) 105 102 { 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 } 113 echo('</div>'); 114 115 echo($server->RealmSelection('Menu')); 116 117 echo('<br /><br />'); 118 echo('<div class="mainmenu">'); 119 foreach($RealmMenuItems as $Item) 120 { 121 if(array_key_exists('OnClick', $Item)) $OnClick = ' onclick="'.$Item['OnClick'].'"'; 122 else $OnClick = ''; 123 if(array_key_exists('Target', $Item)) $Target = ' target="'.$Item['Target'].'"'; 124 else $Target = ''; 125 126 echo('<a href="'.$Item['link'].'"'.$OnClick.$Target.'>'.$Item['Text'].'</a><br />'); 103 if(array_key_exists('Text', $Item)) 104 { 105 if(array_key_exists('OnClick', $Item)) $OnClick = ' onclick="'.$Item['OnClick'].'"'; 106 else $OnClick = ''; 107 if(array_key_exists('Target', $Item)) $Target = ' target="'.$Item['Target'].'"'; 108 else $Target = ''; 109 echo('<a href="'.$Item['link'].'"'.$OnClick.$Target.'>'.$Item['Text'].'</a><br />'); 110 } else 111 { 112 echo($server->RealmSelection()); 113 echo('<br/>'); 114 echo('<br/>'); 115 } 127 116 } 128 117 echo('</div>');
Note:
See TracChangeset
for help on using the changeset viewer.