- Timestamp:
- Mar 19, 2010, 9:22:00 PM (15 years ago)
- Location:
- trunk/inc
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/inc/config.sample.php
r682 r690 38 38 ( 39 39 'Charset' => 'utf-8', 40 ' BaseURL' => 'http://localhost/',40 'Host' => 'george-virt.zdechov.net', 41 41 'Description' => 'Neoficiální herní server hry World of Warcraft', 42 42 'Keywords' => 'wowserver, world of warcraft, free, wow, server, hof, heroes of fantasy, zdechov, mangos', -
trunk/inc/html.php
r684 r690 32 32 } 33 33 } 34 35 function Link($Path) 36 { 37 global $Config; 38 39 if(substr($Path, 0, 1) == '/') return($Config['Web']['BaseURL'].$Path); 40 return($Path); 41 } 34 42 35 43 private function CfgChck($value) … … 60 68 '<meta name="description" content="'.$Config['Web']['Description'].'" />'. 61 69 '<meta name="keywords" content="'.$Config['Web']['Keywords'].'" />'. 62 '<link rel="stylesheet" type="text/css" href=" styles/style.css" />'.63 '<link href=" inc/teamspeakdisplay/teamspeakdisplay.css" rel="stylesheet" type="text/css" />'.64 '<link rel="alternate" title="Články" href=" rss.php?category=articles" type="application/rss+xml" />'.65 '<link rel="alternate" title="Finanční přispěvky" href=" rss.php?category=finance" type="application/rss+xml" />'.66 '<script type="text/javascript" src=" styles/global.js"></script>'.67 '<!--[if IE]><link rel="stylesheet" type="text/css" href=" styles/ie.css" /><![endif]-->'.70 '<link rel="stylesheet" type="text/css" href="'.$this->Link('/styles/style.css.php').'" />'. 71 '<link href="'.$this->Link('/inc/teamspeakdisplay/teamspeakdisplay.css').'" rel="stylesheet" type="text/css" />'. 72 '<link rel="alternate" title="Články" href="'.$this->Link('/rss.php?category=articles').'" type="application/rss+xml" />'. 73 '<link rel="alternate" title="Finanční přispěvky" href="'.$this->Link('rss.php?category=finance').'" type="application/rss+xml" />'. 74 '<script type="text/javascript" src="'.$this->Link('/styles/global.js').'"></script>'. 75 '<!--[if IE]><link rel="stylesheet" type="text/css" href="'.$this->Link('styles/ie.css').'" /><![endif]-->'. 68 76 '</head>'. 69 77 '<body>'; … … 100 108 } 101 109 102 public function Pager($get, $dir_pages, $def)103 {104 $anti_ref = array105 (106 'server' => 5,107 'events' => 2,108 'aukce' => 2,109 'gmlog' => 300,110 'online' => 2,111 );112 $site_show = $dir_pages.'/'.$get.'.php';113 if(isset($anti_ref[$get]))114 {115 if(!$this->Antirefresh($anti_ref[$get], $get))116 {117 if(($site_show != '') and is_readable($site_show)) return($site_show);118 else return('./'.$dir_pages.'/'.$def.'.php');119 } else120 {121 $this->RefreshMsg($this->Antirefresh($anti_ref[$get], $get), $get);122 return($dir_pages.'/free.php');123 }124 } else125 {126 if(($site_show != '') and is_readable($site_show)) return($site_show);127 else return($dir_pages.'/'.$def.'.php');128 }129 }130 131 public function Antirefresh($value, $page)132 {133 $hash = md5($page);134 if(isset($_SESSION['rf'.$hash.'rsh']))135 {136 $refresh = $_SESSION['rf'.$hash.'rsh'] + $value;137 if(time() < $refresh)138 {139 $dif = $refresh - time();140 return($dif);141 }142 }143 $_SESSION['rf'.$hash.'rsh'] = time();144 }145 146 public function RefreshMsg($dif, $get)147 {148 if($dif != 0)149 {150 if($dif > 60)151 {152 $dif = round($dif / 60).' min';153 $refresh = 30;154 } else155 {156 $dif = $dif.' s';157 $refresh = 2;158 }159 echo('<center><h3>Refresh omezení</h3></center>160 Stránka nepovoluje tak krátký čas pro refresh (znovunačtení).<br />161 Další načtení stránky <b>?page='.$get.'</b> bude možné za <b>'.$dif.'</b>.<br />162 Pokud tento čas vyčkáte budete přesměrován automaticky !163 <meta http-equiv="refresh" content="'.$refresh.';url=">');164 }165 }166 167 110 public function PrgStart() 168 111 { 169 echo('<table align="center" width="346" height="417" border="0" style="background-image: url(imgs/web/prg.gif);"> 112 global $html; 113 114 echo('<table align="center" width="346" height="417" border="0" style="background-image: url('.$html->Link('/imgs/web/prg.gif').');"> 170 115 <tr height="80"> 171 116 <td width="20"></td> … … 262 207 function QuickNew() 263 208 { 264 global $server, $Config, $System ;209 global $server, $Config, $System, $html; 265 210 266 211 // Check servers online state. … … 280 225 '<tr>'. 281 226 '<td colspan="2">'. 282 '<strong>Server : </strong>'.$server->OnlineStateImage($OnlineState).'<b> (<a href=" ?page=realmlist">'.$server->OnlineCharactersCount().' hráčů celkem</a>) | Patch '.$Config['Mangos']['ClientVersion'].' | <a href="'.$Config['Web']['BaseURL'].'/pages/realmlist.wtf">Realmlist</a> | <a href="?page=server">Server info</a> | <a href="?page=realmlist">Seznam světů</a></b>'.227 '<strong>Server : </strong>'.$server->OnlineStateImage($OnlineState).'<b> (<a href="'.$html->Link('/realmlist/').'">'.$server->OnlineCharactersCount().' hráčů celkem</a>) | Patch '.$Config['Mangos']['ClientVersion'].' | <a href="'.$html->Link('/pages/realmlist.wtf').'">Realmlist</a> | <a href="'.$html->Link('/server/').'">Server info</a> | <a href="'.$html->Link('/realmlist/').'">Seznam světů</a></b>'. 283 228 '</td></tr></table><br />'); 284 229 } … … 294 239 { 295 240 $Item = explode('=', $Part); 296 $Result[$Item[0]] = $Item[1]; 241 if(count($Item) > 1) $Result[$Item[0]] = $Item[1]; 242 else $Result[$Item[0]] = ''; 297 243 } 298 244 } -
trunk/inc/player.php
r685 r690 14 14 private function Msg($text, $err) 15 15 { 16 if($err == 0) echo('<img src="imgs/inc/on.gif"> <font color="#234303" size="4">'.$text.'</font><br />'); 17 else echo('<img src="imgs/inc/off.gif"> <font color="#990000" size="4\">'.$text.'</font><br />'); 16 global $html; 17 18 if($err == 0) echo('<img src="'.$html->Link('/imgs/inc/on.gif').'"> <font color="#234303" size="4">'.$text.'</font><br />'); 19 else echo('<img src="'.$html->Link('imgs/inc/off.gif').'"> <font color="#990000" size="4\">'.$text.'</font><br />'); 18 20 } 19 21 … … 31 33 ' VALUES (NULL , "'.$acc_name.'", "'.$sha_pass.'", 0, NULL , NULL , NULL , "'.$email.'", CURRENT_TIMESTAMP , "'.$_SERVER['REMOTE_ADDR'].'", 0, 0, "0000-00-00 00:00:00", 0, "'.$tbc.'", 0, 0)'); 32 34 $this->Msg('Účet založen úspěšně', 0); 33 echo('<meta http-equiv="refresh" content="0; ?page=acc">');35 echo('<meta http-equiv="refresh" content="0;'.$html->Link('/ucet/').'">'); 34 36 } else 35 37 { … … 80 82 public function LoginForm() 81 83 { 82 echo('<form method="post" action="?page=acc">'. 84 global $html; 85 86 echo('<form method="post" action="'.$html->Link('/ucet/').'">'. 83 87 '<table>'. 84 88 '<tr>'. … … 94 98 </form> 95 99 <div align="left"> 96 <a href=" ?page=register">Registrace</a><br />'. //<a href="?page=lostpass">Obnova hesla</a>100 <a href="'.$html->Link('/registrace/').'">Registrace</a><br />'. //<a href="?page=lostpass">Obnova hesla</a> 97 101 '</div>'); 98 102 } -
trunk/inc/server.php
r684 r690 39 39 function ParseCopper($copper_in) 40 40 { 41 global $html; 42 41 43 $copper = $copper_in; 42 44 $golds = floor($copper / 10000); … … 44 46 $silver = floor($num / 100); 45 47 $copper = $num - $silver * 100; 46 $show_golds = '<font size="4">'.$golds.'</font> <img src=" imgs/inc/g.gif">';47 $show_silver = '<font size="4">'.$silver.'</font> <img src=" imgs/inc/s.gif">';48 $show_copper = '<font size="4">'.$copper.'</font> <img src=" imgs/inc/c.gif">';48 $show_golds = '<font size="4">'.$golds.'</font> <img src="'.$html->Link('/imgs/inc/g.gif').'">'; 49 $show_silver = '<font size="4">'.$silver.'</font> <img src="'.$html->Link('/imgs/inc/s.gif').'">'; 50 $show_copper = '<font size="4">'.$copper.'</font> <img src="'.$html->Link('/imgs/inc/c.gif').'">'; 49 51 return($show_golds.' '.$show_silver.' '.$show_copper); 50 52 } … … 64 66 function OnlineStateImage($Status) 65 67 { 66 if($Status) return('<img src="imgs/inc/on.gif" alt="online" /> <span style="text-color: #234303; text-size: 4;">Online</span>'); 67 else return('<img src="imgs/inc/off.gif" alt="offline" /> <span style="text-color: #990000; text-size: 4;">Offline</span>'); 68 global $html; 69 70 if($Status) return('<img src="'.$html->Link('/imgs/inc/on.gif').'" alt="online" /> <span style="text-color: #234303; text-size: 4;">Online</span>'); 71 else return('<img src="'.$html->Link('/imgs/inc/off.gif').'" alt="offline" /> <span style="text-color: #990000; text-size: 4;">Offline</span>'); 68 72 } 69 73 -
trunk/inc/system.php
r630 r690 28 28 } 29 29 30 function SeoUrl($ title)30 function SeoUrl($Address) 31 31 { 32 $address = $title; 33 $diakritika = array("á","ä","č","ď","é","ě","ë","í","ň","ó","ö","ř","š","ť","ú","ů","ü","ý","ž","Á","Ä","Č","Ď","É","Ě","Ë","Í","Ň","Ó","Ö","Ř","Š","Ť","Ú","Ů","Ü","Ý","Ž"); 34 $nediakritika = array("a","a","c","d","e","e","e","i","n","o","o","r","s","t","u","u","u","y","z","A","A","C","D","E","E","E","I","N","O","O","R","S","T","U","U","U","Y","Z"); 35 $address = str_replace($diakritika, $nediakritika, $address); 36 $address = strtolower ($address); 37 $address = preg_replace ("/[^[:alpha:][:digit:]]/", "-", $address); 38 $address = trim ($address, "-"); 39 $address = preg_replace ("/[-]+/", "-", $address); 40 return($address); 32 $Diakritika = array("á","ä","č","ď","é","ě","ë","í","ň","ó","ö","ř","š","ť","ú","ů","ü","ý","ž","Á","Ä","Č","Ď","É","Ě","Ë","Í","Ň","Ó","Ö","Ř","Š","Ť","Ú","Ů","Ü","Ý","Ž"); 33 $Nediakritika = array("a","a","c","d","e","e","e","i","n","o","o","r","s","t","u","u","u","y","z","A","A","C","D","E","E","E","I","N","O","O","R","S","T","U","U","U","Y","Z"); 34 $Address = str_replace($Diakritika, $Nediakritika, $Address); 35 $Address = strtolower($Address); 36 $Address = preg_replace("/[^[:alpha:][:digit:]]/", "-", $Address); 37 $Address = trim($Address, "-"); 38 $Address = preg_replace("/[-]+/", "-", $Address); 39 return($Address); 41 40 } 42 41 -
trunk/inc/teamspeakdisplay/teamspeakdisplay.php
r607 r690 332 332 // be hard to read >:) 333 333 function displayTeamspeakEx($settings) { 334 global $html; 335 334 336 $serverInfo = $this->queryTeamspeakServerEx($settings); 335 337 … … 343 345 } 344 346 echo("<table><tr><td>"); 345 echo("<img src=\" inc/teamspeakdisplay/teamspeak_offline.png\" alt=\"\" title=\"" . $popupInfo . "\">");347 echo("<img src=\"".$html->Link('/inc/teamspeakdisplay/teamspeak_offline.png')."\" alt=\"\" title=\"" . $popupInfo . "\">"); 346 348 echo("</td><td class=\"teamspeakserver\" title=\"" . $popupInfo . "\">"); 347 349 echo("Server offline"); … … 410 412 // Print the topmost element of the teamspeak tree 411 413 echo("<table><tr><td>"); 412 echo("<img src=\" inc/teamspeakdisplay/teamspeak_online.png\" alt=\"\" title=\"" . $popupInfo . "\">");414 echo("<img src=\"".$html->Link("/inc/teamspeakdisplay/teamspeak_online.png")."\" alt=\"\" title=\"" . $popupInfo . "\">"); 413 415 echo("</td><td class=\"teamspeakserver\" title=\"" . $popupInfo . "\">"); 414 416 echo("<a class=\"teamspeakserver\" href=\"javascript:enterServer_" . $jsTeamspeakId . "();\">"); … … 450 452 // Display channel: 451 453 echo("<table><tr><td>"); 452 echo("<img src=\" inc/teamspeakdisplay/treeimage" . ((($counter + 1) == $currentchannels) ? "3" : "2") . ".png\" alt=\"\">");453 echo("<img src=\" inc/teamspeakdisplay/channel.png\" alt=\"\" title=\"" . $popupInfo . "\">");454 echo("<img src=\"".$html->Link("/inc/teamspeakdisplay/treeimage" . ((($counter + 1) == $currentchannels) ? "3" : "2") . ".png")."\" alt=\"\">"); 455 echo("<img src=\"".$html->Link("/inc/teamspeakdisplay/channel.png")."\" alt=\"\" title=\"" . $popupInfo . "\">"); 454 456 echo("</td><td class=\"teamspeakchannel\" title=\"" . $popupInfo . "\">"); 455 457 echo("<a class=\"teamspeakchannel\" href=\"javascript:enterChannel_" . $jsTeamspeakId . "('" . str_replace("'", "\'", $channelInfo["channelname"]) . "', " . (($channelInfo["password"]) == "1" ? "true" : "false") . ");\">"); … … 471 473 // Display player: 472 474 echo("<table><tr><td>"); 473 echo("<img src=\" inc/teamspeakdisplay/treeimage" . ((($counter + 1) == $currentchannels) ? "4" : "1") . ".png\" alt=\"\">");474 echo("<img src=\" inc/teamspeakdisplay/treeimage" . ((($counter_playerandsubchannels + 1) == $currentplayersandsubchannels) ? "3" : "2") . ".png\" alt=\"\">");475 echo("<img src=\" inc/teamspeakdisplay/player_" . $playerInfo["displayimage"] . ".png\" alt=\"" . $playerInfo["displayimage"] . "\" title=\"" . $popupInfo . "\">");475 echo("<img src=\"".$html->Link("/inc/teamspeakdisplay/treeimage" . ((($counter + 1) == $currentchannels) ? "4" : "1") . ".png")."\" alt=\"\">"); 476 echo("<img src=\"".$html->Link("/inc/teamspeakdisplay/treeimage" . ((($counter_playerandsubchannels + 1) == $currentplayersandsubchannels) ? "3" : "2") . ".png")."\" alt=\"\">"); 477 echo("<img src=\"".$html->Link("/inc/teamspeakdisplay/player_" . $playerInfo["displayimage"] . ".png")."\" alt=\"" . $playerInfo["displayimage"] . "\" title=\"" . $popupInfo . "\">"); 476 478 echo("</td><td class=\"teamspeakplayer\" title=\"" . $popupInfo . "\">"); 477 479 echo(str_replace(" ", " ", $this -> Kodovani($playerInfo["displayname"]))); … … 496 498 // Display channel: 497 499 echo("<table><tr><td>"); 498 echo("<img src=\" inc/teamspeakdisplay/treeimage" . ((($counter + 1) == $currentchannels) ? "4" : "1") . ".png\" alt=\"\">");499 echo("<img src=\" inc/teamspeakdisplay/treeimage" . ((($counter_playerandsubchannels + 1) == $currentplayersandsubchannels) ? "3" : "2") . ".png\" alt=\"\">");500 echo("<img src=\" inc/teamspeakdisplay/channel.png\" alt=\"\" title=\"" . $popupInfo . "\">");500 echo("<img src=\"".$html->Link("/inc/teamspeakdisplay/treeimage" . ((($counter + 1) == $currentchannels) ? "4" : "1") . ".png")."\" alt=\"\">"); 501 echo("<img src=\"".$html->Link("/inc/teamspeakdisplay/treeimage" . ((($counter_playerandsubchannels + 1) == $currentplayersandsubchannels) ? "3" : "2") . ".png")."\" alt=\"\">"); 502 echo("<img src=\"".$html->Link("/inc/teamspeakdisplay/channel.png")."\" alt=\"\" title=\"" . $popupInfo . "\">"); 501 503 echo("</td><td class=\"teamspeaksubchannel\" title=\"" . $popupInfo . "\">"); 502 504 echo("<a class=\"teamspeaksubchannel\" href=\"javascript:enterSubChannel_" . $jsTeamspeakId . "('" . str_replace("'", "\'", $channelInfo["channelname"]) . "', " . (($channelInfo["password"]) == "1" ? "true" : "false") . ", '" . str_replace("'", "\'", $subchannelInfo["channelname"]) . "');\">"); … … 518 520 // Display player: 519 521 echo("<table><tr><td>"); 520 echo("<img src=\" inc/teamspeakdisplay/treeimage" . ((($counter + 1) == $currentchannels) ? "4" : "1") . ".png\" alt=\"\">");521 echo("<img src=\" inc/teamspeakdisplay/treeimage" . ((($counter_playerandsubchannels + 1) == $currentplayersandsubchannels) ? "4" : "1") . ".png\" alt=\"\">");522 echo("<img src=\" inc/teamspeakdisplay/treeimage" . ((($counter_player + 1) == $currentplayers) ? "3" : "2") . ".png\" alt=\"\">");523 echo("<img src=\" inc/teamspeakdisplay/player_" . $playerInfo["displayimage"] . ".png\" alt=\"" . $playerInfo["displayimage"] . "\" title=\"" . $popupInfo . "\">");522 echo("<img src=\"".$html->Link("/inc/teamspeakdisplay/treeimage" . ((($counter + 1) == $currentchannels) ? "4" : "1") . ".png")."\" alt=\"\">"); 523 echo("<img src=\"".$html->Link("/inc/teamspeakdisplay/treeimage" . ((($counter_playerandsubchannels + 1) == $currentplayersandsubchannels) ? "4" : "1") . ".png")."\" alt=\"\">"); 524 echo("<img src=\"".$html->Link("/inc/teamspeakdisplay/treeimage" . ((($counter_player + 1) == $currentplayers) ? "3" : "2") . ".png")."\" alt=\"\">"); 525 echo("<img src=\"".$html->Link("/inc/teamspeakdisplay/player_" . $playerInfo["displayimage"] . ".png")."\" alt=\"" . $playerInfo["displayimage"] . "\" title=\"" . $popupInfo . "\">"); 524 526 echo("</td><td class=\"teamspeakplayer\" title=\"" . $popupInfo . "\">"); 525 527 echo(str_replace(" ", " ", $this -> Kodovani($playerInfo["displayname"])));
Note:
See TracChangeset
for help on using the changeset viewer.