- Timestamp:
- Mar 20, 2010, 9:10:18 PM (15 years ago)
- Location:
- trunk
- Files:
-
- 2 added
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/inc/html.php
r693 r695 151 151 152 152 $db->select_db($Config['Database']['Database']); 153 154 $Output = '<table class="NewsCategoryTable">'. 153 $Output = ''; 154 155 /*$Output = '<table class="NewsCategoryTable">'. 155 156 '<tr>'; 156 157 $DbResult = $db->query('SELECT * FROM ArticleCategory'); … … 161 162 $Output .= '<td><a href="?">Vše</a></td>'. 162 163 '</tr></table><br />'; 164 */ 163 165 $this->QuickNew(); 164 166 -
trunk/inc/realm.php
r693 r695 145 145 echo('</table>'); 146 146 } 147 148 function WoWEmuStat() 149 { 150 global $Config; 151 152 $Result = 153 '<?xml version="1.0" encoding="UTF-8"'."?>\r\n". 154 " <stats>\r\n". 155 " <server>\r\n". 156 " <version>0.16</version>\r\n". 157 " <owner>Admin</owner>\r\n". 158 " <servername>Server</servername>\r\n". 159 " <uptime>0 weeks 1 days 0 hours 0 mins</uptime>\r\n". 160 " </server>\r\n". 161 " <serverload>\r\n". 162 " <network>\r\n". 163 " <configsleep>200</configsleep>\r\n". 164 " <loops>0</loops>\r\n". 165 " <totaltime>0</totaltime>\r\n". 166 " <load>0.00%</load>\r\n". 167 " </network>\r\n". 168 " <world>\r\n". 169 " <configsleep>600</configsleep>\r\n". 170 " <loops>95222</loops>\r\n". 171 " <totaltime>7594525</totaltime>\r\n". 172 " <load>1.50%</load>\r\n". 173 " </world>\r\n". 174 " </serverload>\r\n". 175 " <players>\r\n"; 176 if($this->CharactersDatabase->connect_error) return(0); 177 else { 178 $DbResult = $this->CharactersDatabase->query('SELECT *, CAST( SUBSTRING_INDEX(SUBSTRING_INDEX(`data`, " ", '.$Config['Mangos']['CharacterDataOffset']['Level'].' + 1), " ", -1) AS UNSIGNED) AS level FROM `characters` WHERE `online` = 1'); 179 while($DbRow = $DbResult->fetch_assoc()) 180 { 181 $Result .= " <player>\r\n". 182 " <name>".$DbRow['name']."</name>\r\n". 183 " <race>".$DbRow['race']."</race>\r\n". 184 " <class>".$DbRow['class']."</class>\r\n". 185 " <level>".$DbRow['level']."</level>\r\n". 186 " <map>".$DbRow['map']."</map>\r\n". 187 " <zone>xxx</zone>\r\n". 188 " <ping>10</ping>\r\n". 189 " <plevel>0</plevel>\r\n". 190 " <ip>178.12.14.2</ip>\r\n". 191 " </player>\r\n"; 192 } 193 } 194 $Result .= " </players>\r\n". 195 " </stats>\r\n"; 196 return($Result); 197 } 147 198 } 148 199 -
trunk/inc/system.php
r690 r695 28 28 } 29 29 30 function SQLURLName($Name) 31 { 32 return('LOWER(REPLACE('.$Name.', " ", "-"))'); 33 } 34 30 35 function SeoUrl($Address) 31 36 { -
trunk/index.php
r694 r695 18 18 if(file_exists('inc/config.php')) include_once('inc/config.php'); 19 19 else die('Nenalezen soubor inc/config.php. Vytvořte jej z předlohy config.sample.php.'); 20 21 20 22 21 session_start(); … … 88 87 ); 89 88 89 $DbResult = $System->Database->query('SELECT '.$System->SQLURLName('Name').' AS URLName FROM Realm WHERE Id='.$_COOKIE['RealmIndex']); 90 $Realm = $DbResult->fetch_assoc(); 90 91 $RealmMenuItems = array( 91 array('link' => $html->Link('/ online-hraci/'), 'Text' => 'Online hráči'),92 array('link' => $html->Link('/svety/'.$Realm['URLName'].'/online-hraci/'), 'Text' => 'Online hráči'), 92 93 array('link' => '#', 'Text' => 'Mapa hráčů', 'OnClick' => "popup('".$html->Link("/minimanager/map/?r_id=".$_COOKIE['RealmIndex'])."', 1000, 800); return false;"), 93 array('link' => $html->Link('/ nej-hraci/'), 'Text' => 'Nej hráči'),94 array('link' => $html->Link('/s polky/'), 'Text' => 'Spolky'),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'), 95 96 array('link' => $html->Link('/armory/'), 'Text' => 'Armory'), 96 array('link' => $html->Link('/ arena/'), 'Text' => 'Arény'),97 array('link' => $html->Link('/ akce/'), 'Text' => 'Události'),98 array('link' => $html->Link('/ prikazy/'), 'Text' => 'Příkazy'),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'), 99 100 ); 100 101 -
trunk/pages/jak-zacit.php
r693 r695 24 24 <li>Můžete se zaregistrovat do diskuzního fóra serveru <a href="'.$html->Link('/forum/').'">zde</a>.</li> 25 25 <li>Ve hře se můžete připojit příkazem /join world do společného textového chat kanálu.</li> 26 <li>Prozkoumejte webové stránky serveru a sledujte <a href=" rss.php?category=articles">nejnovější informace</a> přes RSS čtečku.</li>26 <li>Prozkoumejte webové stránky serveru a sledujte <a href="'.$html->Link('/rss.php?category=articles').'">nejnovější informace</a> přes RSS čtečku.</li> 27 27 </ul> 28 28 <br /> -
trunk/pages/spolek.php
r691 r695 29 29 $time = mktime($time_stp[0], $time_stp[1], $time_stp[2], $date[1], $date[2], $date[0]); 30 30 $human_date = date('d.m.Y H:i:s', $time); 31 echo('<a href="'.$html->Link('/spolky/').'"><- Zpět na výpis</a><br />');31 //echo('<a href="'.$html->Link('/spolky/').'"><- Zpět na výpis</a><br />'); 32 32 echo('<table class="BaseTable"> 33 33 <tr> -
trunk/pages/spolky.php
r691 r695 33 33 } 34 34 35 $Realm = new Realm($System, $_COOKIE['RealmIndex']); 36 $db2 = $Realm->CharactersDatabase; 37 38 if(count($QueryItems) > 3) 39 { 40 $GuildName = $QueryItems[3]; 41 $DbResult = $db2->query('SELECT guildid FROM guild WHERE '.$System->SQLURLName('Name').'="'.$GuildName.'"'); 42 $DbRow = $DbResult->fetch_assoc(); 43 $_GET['id'] = $DbRow['guildid']; 44 include('spolek.php'); 45 } else 46 { 35 47 echo('<h3 class="PageTitle">Seznam spolků</h3>'); 36 48 echo($server->RealmSelection()); … … 46 58 </tr>'); 47 59 48 $Realm = new Realm($System, $_COOKIE['RealmIndex']);49 $db2 = $Realm->CharactersDatabase;50 60 51 $sql = $db2->query('SELECT `guild`.name, `guild`.guildid, FROM_UNIXTIME(`guild`.`createdate`) AS `createdate`, COUNT(`guild_member`.`guildid`) AS member_count ,`leader`.`race` IN (1, 3, 4, 7, 11) AS fraction , `leader`.`guid` AS leader FROM `guild` JOIN `guild_member` ON `guild_member`.`guildid` = `guild`.`guildid` JOIN `characters` AS `memebers` ON `memebers`.`guid`= `guild_member`.`guid` JOIN `characters` AS `leader` ON `leader`.`guid`= `guild`.`leaderguid` GROUP BY guild.name ORDER BY '.$order_by.' '.$order_dir.';');61 $sql = $db2->query('SELECT `guild`.name, '.$System->SQLURLName('`guild`.name').' AS URLName, `guild`.guildid, FROM_UNIXTIME(`guild`.`createdate`) AS `createdate`, COUNT(`guild_member`.`guildid`) AS member_count ,`leader`.`race` IN (1, 3, 4, 7, 11) AS fraction , `leader`.`guid` AS leader FROM `guild` JOIN `guild_member` ON `guild_member`.`guildid` = `guild`.`guildid` JOIN `characters` AS `memebers` ON `memebers`.`guid`= `guild_member`.`guid` JOIN `characters` AS `leader` ON `leader`.`guid`= `guild`.`leaderguid` GROUP BY guild.name ORDER BY '.$order_by.' '.$order_dir.';'); 52 62 while($row = $sql->fetch_assoc()) 53 63 { … … 64 74 echo('<tr> 65 75 <td align="center">'.FrakceImg($row['fraction']).'</td> 66 <td align="center"><a href="'.$html->Link( '/spolek/?id='.$row['guildid']).'">'.$row['name'].'</a></td>76 <td align="center"><a href="'.$html->Link($row['URLName'].'/').'">'.$row['name'].'</a></td> 67 77 <td align="center">'.$row['member_count'].'</td> 68 78 <td align="center">'.$online_mem['online_mem'].'</td> … … 73 83 } 74 84 echo('</table>'); 85 } 75 86 76 87 ?> -
trunk/pages/svety.php
r693 r695 1 1 <?php 2 2 3 function RealmList() 4 { 5 global $System, $html; 6 3 7 if(array_key_exists('Server', $_GET)) 4 8 { … … 31 35 '</tr>'; 32 36 33 $DbResult2 = $System->Database->query('SELECT * FROM Realm WHERE Logon='.$Server->Id.' AND Enabled=1 ORDER BY Name');37 $DbResult2 = $System->Database->query('SELECT *, '.$System->SQLURLName('Name').' AS URLName FROM Realm WHERE Logon='.$Server->Id.' AND Enabled=1 ORDER BY Name'); 34 38 while($DbRow = $DbResult2->fetch_assoc()) 35 39 { 36 40 $Realm = new Realm($System, $DbRow['Id']); 37 $Output .= '<tr><td><a href="'.$html->Link('/ online-hraci/?RealmIndex='.$Realm->Id).'">'.$Realm->Data['Name'].'</a></td><td>'.$Realm->Data['Rate'].'</td><td>'.$Realm->Data['Type'].'</td><td>'.$Server->OnlineStateImage($Realm->Data['Online']).'</td><td>'.$Realm->OnlineCharactersCount().' / '.$Realm->Data['MaxOnlinePlayers'].' / '.$Realm->CharacterCount().'</td></tr>';41 $Output .= '<tr><td><a href="'.$html->Link('/svety/'.$DbRow['URLName'].'/').'">'.$Realm->Data['Name'].'</a></td><td>'.$Realm->Data['Rate'].'</td><td>'.$Realm->Data['Type'].'</td><td>'.$Server->OnlineStateImage($Realm->Data['Online']).'</td><td>'.$Realm->OnlineCharactersCount().' / '.$Realm->Data['MaxOnlinePlayers'].' / '.$Realm->CharacterCount().'</td></tr>'; 38 42 $Output .= '<tr><td colspan="5">'.$Realm->Data['Description'].'</td></tr>'; 39 43 //if(array_key_exists($Index + 1, $Config['Mangos']['RealmList'])) … … 44 48 echo($Output); 45 49 } 50 } 51 52 function RealmInfo() 53 { 54 global $System; 55 56 $DbResult = $System->Database->query('SELECT * FROM Realm WHERE Id='.$_COOKIE['RealmIndex']); 57 $Realm = $DbResult->fetch_assoc(); 58 echo('<h2 align="center">'.$Realm['Name'].'</h2>'); 59 echo($Realm['Information']); 60 } 61 62 if(count($QueryItems) > 1) 63 { 64 $RealmName = $QueryItems[1]; 65 $DbResult = $System->Database->query('SELECT Id FROM Realm WHERE '.$System->SQLURLName('Name').'="'.$RealmName.'"'); 66 $DbRow = $DbResult->fetch_assoc(); 67 $_COOKIE['RealmIndex'] = $DbRow['Id']; 68 69 if(count($QueryItems) > 2) 70 { 71 if($QueryItems[2] == 'online-hraci') include('online-hraci.php'); 72 else if($QueryItems[2] == 'prikazy') include('prikazy.php'); 73 else if($QueryItems[2] == 'akce') include('akce.php'); 74 else if($QueryItems[2] == 'arena') include('arena.php'); 75 else if($QueryItems[2] == 'nej-hraci') include('nej-hraci.php'); 76 else if($QueryItems[2] == 'mapa') include('mapa.php'); 77 else if($QueryItems[2] == 'spolek') include('spolek.php'); 78 else if($QueryItems[2] == 'spolky') include('spolky.php'); 79 else RealmInfo(); 80 } else RealmInfo(); 81 } else RealmList(); 46 82 47 83 ?>
Note:
See TracChangeset
for help on using the changeset viewer.