Changeset 14 for global.php
- Timestamp:
- Aug 12, 2007, 2:13:09 AM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
global.php
r12 r14 1 1 <?php 2 2 3 session_start(); 3 4 include('config.php'); 5 include('database.php'); 6 include('error.php'); 7 $Database = new Database($Config['Database']['Host'], $Config['Database']['User'], $Config['Database']['Password'], $Config['Database']['Database']); 8 $Database->Prefix = $Config['Database']['Prefix']; 9 $Database->charset($Config['Database']['Charset']); 10 11 function HumanDate($DateTime) 12 { 13 $DateTimeParts = explode(' ', $DateTime); 14 $Parts = explode('-', $DateTimeParts[0]); 15 if($DateTimeParts[0] != '0000-00-00') return(($Parts[2]*1).'.'.($Parts[1]*1).'.'.$Parts[0]); 16 else return(' '); 17 } 4 18 5 19 function ShowOnlinePlayerCount() 6 20 { 7 global $WowEmuDirectory, $WoWServer;21 global $Database; 8 22 //ini_set('allow_url_fopen', 'On'); 9 23 // World of Warcraft user stat … … 12 26 //$Content = fgets($File, 1000000); 13 27 //fclose($File); 14 $ Content = file_get_contents('http://'.$WoWServer.'/mangos/inc/stat2.php');15 if(strlen($Content) > 0)16 {17 $PlayerCount = substr_count($Content, '<player>');18 $P = 'hráèù';19 20 21 echo($PlayerCount.' '.$P);22 } else echo('OFFLINE');28 $Database->select_db('realmd'); 29 $Result = $Database->select('account', 'COUNT(*)', 'online=1'); 30 $Row = $Result->fetch_array(); 31 $PlayerCount = $Row[0]; 32 33 if($PlayerCount == 1) $P = 'hráè'; 34 else if(($PlayerCount >= 2) and ($PlayerCount <= 4)) $P = 'hráèi'; 35 else $P = 'hráèù'; 36 echo($PlayerCount.' '.$P); 23 37 } 24 38 … … 42 56 { 43 57 global $Charset, $BaseUrl; 44 echo(' 45 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> 58 echo('<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> 46 59 <HTML> 47 60 <HEAD> … … 53 66 <style type="text/css" media="screen">@import url('.$BaseUrl.'css/style.css);</style> 54 67 </HEAD> 55 56 57 68 <BODY text="#cccccc"> 58 69 … … 113 124 </script> 114 125 115 <TABLE align="center" class="TableHlavni" border="0">126 <TABLE cellspacing="0" cellpadding="0" align="center" class="TableHlavni" border="0"> 116 127 <TR> 117 128 <TD> 118 < pclass="pHlavni">129 <div class="pHlavni"> 119 130 <br> 120 131 <br> … … 132 143 global $BaseUrl; 133 144 echo(' 145 </div> 134 146 </td> 135 <TD class="TdSloupec" width="240" valign="top" align="center" > 136 <div class="Nadpis">Heroes of Fantasy</div> 137 <div class="DivText"> 138 '); 139 140 ShowOnlinePlayerCount(); 147 <TD class="TdSloupec" valign="top" align="center"> 148 <div class="Nadpis">Heroes of Fantasy</div> 149 <div class="DivText">'); 150 151 ShowOnlinePlayerCount(); 141 152 142 143 144 echo(' 145 <br> 153 echo('</div> 146 154 <a href="'.$BaseUrl.'index.php" onMouseOver="swtch("2","home")" onMouseOut="swtch("1","home")"><IMG SRC="'.$BaseUrl.'images/home.jpg" name="home" alt="Home" border="0"></A> 147 155 <a href="'.$BaseUrl.'server.php" onMouseOver="swtch("30","Server")" onMouseOut="swtch("29","Server")"><IMG SRC="'.$BaseUrl.'images/server.jpg" name="Server" alt="Server" border="0"></A> 148 <a href="'.$BaseUrl.' donate.php" onMouseOver="swtch("4","donate")" onMouseOut="swtch("3","donate")"><IMG SRC="'.$BaseUrl.'images/donate.jpg" alt="donate" name="donate" border="0"></A>156 <a href="'.$BaseUrl.'finance/" onMouseOver="swtch("4","donate")" onMouseOut="swtch("3","donate")"><IMG SRC="'.$BaseUrl.'images/donate.jpg" alt="donate" name="donate" border="0"></A> 149 157 <a href="'.$BaseUrl.'download_soubory/" onMouseOver="swtch("6","download")" onMouseOut="swtch("5","download")"><IMG SRC="'.$BaseUrl.'images/download.jpg" alt="download" name="download" border="0"></A> 150 158 <a href="'.$BaseUrl.'jak_zacit.php" onMouseOver="swtch("14","how")" onMouseOut="swtch("13","how")"><IMG SRC="'.$BaseUrl.'images/how.jpg" alt="how" name="how" border="0"></A> … … 158 166 <a href="'.$BaseUrl.'Death%20Dealers%20Hratelne%20Rasy.php" onMouseOver="swtch("26","Rasy")" onMouseOut="swtch("25","Rasy")"><IMG SRC="'.$BaseUrl.'images/rasy.jpg" alt="Rasy" name="Rasy" border="0"></A> 159 167 <a href="'.$BaseUrl.'Death%20Dealers%20Povolani.php" onMouseOver="swtch("22","Povolani")" onMouseOut="swtch("21","Povolani")"><IMG SRC="'.$BaseUrl.'images/povolani.jpg" alt="Povolani" name="Povolani" border="0"></A> 160 <a href="'.$BaseUrl.'Death%20Dealers%20Profese.php" onMouseOver="swtch("24","profese")" onMouseOut="swtch("23","profese")"><IMG SRC="'.$BaseUrl.'images/profese.jpg" alt="profese" name="profese" border="0"></A> 161 162 163 <TABLE width="220" border="1" align="center"> 168 <a href="'.$BaseUrl.'Death%20Dealers%20Profese.php" onMouseOver="swtch("24","profese")" onMouseOut="swtch("23","profese")"><IMG SRC="'.$BaseUrl.'images/profese.jpg" alt="profese" name="profese" border="0"></A>'); 169 170 171 /* 172 echo('<TABLE width="220" border="1" align="center"> 164 173 <TR><TD width="15%" valign="top"> 165 174 <P class="pAktuality"> … … 168 177 169 178 include('aktuality.php'); 170 171 echo(' 172 173 <A HREF="http://www.toplist.cz/" target="_blank"><IMG alt="pocitadlo" 174 SRC="http://toplist.cz/count.asp?logo=mc&ID=324802" 179 */ 180 181 echo('<A HREF="http://www.toplist.cz/" target="_blank"><IMG alt="pocitadlo" 182 SRC="http://toplist.cz/count.asp?logo=mc&ID=324802" 175 183 border="0" width="1" height="1"></A> 176 184 177 178 </p> 179 </td> 180 </tr> 181 </table> 182 183 </div> 184 </TD> 185 </TR> 185 </td> 186 </tr> 186 187 <tr> 187 188 <td colspan="2"> … … 199 200 </I> 200 201 201 </DIV>202 </DIV> 202 203 </td> 203 204 </tr> 204 </TABLE>205 </BODY>205 </TABLE> 206 </BODY> 206 207 </HTML> 207 208 ');
Note:
See TracChangeset
for help on using the changeset viewer.