Changeset 577 for trunk/pages
- Timestamp:
- Apr 29, 2009, 9:04:21 PM (16 years ago)
- Location:
- trunk/pages
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/pages/autori.php
r549 r577 6 6 7 7 8 echo('Aktivní programátoři: Zork, Amun, Barny, Chronos<br /><br />'); 8 echo('Aktivní programátoři: Barny, Chronos<br />'); 9 echo('Dřívější programátoři: Zork, Amun, bbtrash<br /><br />'); 9 10 echo('Některé části webu převzaty ze starého webu vytvořeného maronem a chronosem<br />'); 10 11 echo('Původní návrh nového webu: bbtrash (<a href="hhttp://www.isystems.cz/?r=apesc/">http://www.isystems.cz/</a>)<br /><br />'); -
trunk/pages/guilda.php
r547 r577 1 1 <?php 2 $id = (isset($_GET["id"])) ? $db->real_escape_string($_GET["id"]) : 0; 3 function count_days( $a, $b)2 3 function count_days($a, $b) 4 4 { 5 $gd_a = getdate( $a);6 $gd_b = getdate( $b);7 $a_new = mktime( 12, 0, 0, $gd_a['mon'], $gd_a['mday'], $gd_a['year']);8 $b_new = mktime( 12, 0, 0, $gd_b['mon'], $gd_b['mday'], $gd_b['year']);9 return round( abs( $a_new - $b_new ) / 86400);5 $gd_a = getdate($a); 6 $gd_b = getdate($b); 7 $a_new = mktime(12, 0, 0, $gd_a['mon'], $gd_a['mday'], $gd_a['year']); 8 $b_new = mktime(12, 0, 0, $gd_b['mon'], $gd_b['mday'], $gd_b['year']); 9 return round(abs($a_new - $b_new) / 86400); 10 10 } 11 if ($id != 0) 11 12 $db->select_db($Config['Mangos']['DatabaseCharacters']); 13 $id = (isset($_GET['id'])) ? $_GET['id'] : 0; 14 if($id != 0) 12 15 { 13 $db -> select_db($db_characters);14 16 $guild_id = $id; 15 17 $guild_data = $db -> query("SELECT `guildid`, `name`, `createdate` FROM `guild` WHERE `guildid` = ".$guild_id." LIMIT 1;") -> fetch_array(); 16 $members = $db -> query("SELECT guild_member.guid, guild_member.rank AS mrank, `characters`.name, SUBSTRING_INDEX(SUBSTRING_INDEX(`characters`.`data`, ' ', 35), ' ', -1) AS level, (SELECT rname FROM guild_rank WHERE guildid =".$guild_id." AND rid = mrank+1) AS rname, guild_member.pnote, guild_member.offnote FROM guild_member,`characters` LEFT JOIN guild_member k1 ON k1.`guid`=`characters`.`guid` WHERE guild_member.guildid = ".$guild_id." AND guild_member.guid=`characters`.guid ORDER BY mrank");18 $members = $db -> query("SELECT guild_member.guid, guild_member.rank AS mrank, `characters`.name, SUBSTRING_INDEX(SUBSTRING_INDEX(`characters`.`data`, ' ', ".$Config['Mangos']['CharacterDataOffset']['Level']." + 1), ' ', -1) AS level, (SELECT rname FROM guild_rank WHERE guildid =".$guild_id." AND rid = mrank+1) AS rname, guild_member.pnote, guild_member.offnote FROM guild_member,`characters` LEFT JOIN guild_member k1 ON k1.`guid`=`characters`.`guid` WHERE guild_member.guildid = ".$guild_id." AND guild_member.guid=`characters`.guid ORDER BY mrank"); 17 19 $total_members = $members -> num_rows; 18 20 $members_data = $members -> fetch_array(); 19 21 $online_mem = $db -> query("SELECT count(*) AS online_mem FROM `guild_member`, `characters`, `guild` WHERE guild.guildid = ".$guild_id." AND guild_member.guildid = guild.guildid AND guild_member.guid = characters.guid AND characters.online = 1;") -> fetch_array();; 20 22 // guild info 21 $date_arr = explode(" ",$guild_data["createdate"]); 22 $date = explode("-",$date_arr[0]); 23 $time_stp = explode(":",$date_arr[1]); 24 $time = mktime($time_stp[0],$time_stp[1],$time_stp[2],$date[1],$date[2],$date[0]); 25 $human_date = date ("d.m.Y H:i:s",$time); 26 echo "<a href=\"?page=guildy\"><- Zpět na výpis</a><br />"; 27 echo " 28 <table border=\"1\"> 23 $date_arr = explode(' ', $guild_data['createdate']); 24 $date = explode('-', $date_arr[0]); 25 $time_stp = explode(':', $date_arr[1]); 26 $time = mktime($time_stp[0], $time_stp[1], $time_stp[2], $date[1], $date[2], $date[0]); 27 $human_date = date('d.m.Y H:i:s', $time); 28 echo('<a href="?page=guildy"><- Zpět na výpis</a><br />'); 29 echo('<table border="1"> 29 30 <tr> 30 <td colspan= \"2\"><font size=\"5\">Guilda : ".$guild_data["name"]."</font></td>31 <td colspan="2"><font size="5">Guilda : '.$guild_data['name'].'</font></td> 31 32 </tr> 32 33 <tr> 33 34 <th>Datum založení: </th> 34 <td> ".$human_date."</td>35 <td>'.$human_date.'</td> 35 36 </tr> 36 37 <tr> 37 38 <th>Celkem členů: </th> 38 <td> ".$total_members." (Online : ".$online_mem["online_mem"].")</td>39 <td>'.$total_members.' (Online : '.$online_mem['online_mem'].')</td> 39 40 </tr> 40 </table> 41 ";41 </table>'); 42 42 43 // members info 43 echo " 44 <table border=\"1\"> 44 echo('<table border="1"> 45 45 <tr> 46 <th align=\"center\">Jméno</th> 47 <th align=\"center\">Rasa</th> 48 <th align=\"center\">Class</th> 49 <th align=\"center\">Úroveň</th> 50 <th align=\"center\">Rank</th> 51 <th align=\"center\">Poslední přihlášení (Dny)</th> 52 <th align=\"center\">Online</th> 53 </tr> 54 "; 55 while ($member = $members -> fetch_row()) 56 { 57 58 $query = $db -> query("SELECT `race`,`class`,`online`, `account`, `logout_time`, SUBSTRING_INDEX(SUBSTRING_INDEX(`characters`.`data`, ' ', 53+1), ' ', -1) AS level, mid(lpad( hex( CAST(substring_index(substring_index(data,' ',".(36+1)."),' ',-1) as unsigned) ),8,'0'),4,1) as gender FROM `characters` WHERE `guid` = '".$member[0]."' LIMIT 1;"); 46 <th align="center">Jméno</th> 47 <th align="center">Rasa</th> 48 <th align="center">Class</th> 49 <th align="center">Úroveň</th> 50 <th align="center">Rank</th> 51 <th align="center">Poslední přihlášení (Dny)</th> 52 <th align="center">Online</th> 53 </tr>'); 54 while($member = $members->fetch_row()) 55 { 56 $query = $db->query("SELECT `race`,`class`,`online`, `account`, `logout_time`, SUBSTRING_INDEX(SUBSTRING_INDEX(`characters`.`data`, ' ', ".$Config['Mangos']['CharacterDataOffset']['Level']."+1), ' ', -1) AS level, mid(lpad( hex( CAST(substring_index(substring_index(data,' ',".($Config['Mangos']['CharacterDataOffset']['Gender'] + 1)."),' ',-1) as unsigned) ),8,'0'),4,1) as gender FROM `characters` WHERE `guid` = '".$member[0]."' LIMIT 1;"); 59 57 $online = $query -> fetch_array(); 60 58 $accid = $online["account"]; … … 145 143 "; 146 144 } 147 echo "</table>"; 148 149 150 151 152 153 154 } 155 else 156 {echo "<meta http-equiv=\"refresh\" content=\"0;url=?page=guildy\">";} 145 echo('</table>'); 146 } else echo('<meta http-equiv="refresh" content="0;url=?page=guildy">'); 157 147 158 159 160 161 162 163 164 165 148 ?> -
trunk/pages/guildy.php
r407 r577 27 27 if ($row != "") 28 28 { 29 return "<a href=\"http://".$row."/\" target=\"_blank\"> ".$name."</a>";29 return "<a href=\"http://".$row."/\" target=\"_blank\">www</a>"; 30 30 } 31 31 else … … 50 50 <table border=\"1\" width=\"540\"> 51 51 <tr> 52 <th align=\"center\">".MakeLink(" Frakce","fraction")."</th>52 <th align=\"center\">".MakeLink("","fraction")."</th> 53 53 <th align=\"center\">".MakeLink("Jméno guildy","name")."</th> 54 54 <th align=\"center\">".MakeLink("Celkem členů","member_count")."</th> … … 57 57 <th align=\"center\">".MakeLink("Stránky guildy","homepage")."</th> 58 58 <th align=\"center\">".MakeLink("Založena","createdate")."</th> 59 </tr> 60 "; 59 </tr>"; 61 60 62 63 64 65 $db -> select_db($db_characters); 61 $db->select_db($Config['Mangos']['DatabaseCharacters']); 66 62 67 63 $sql = $db -> query('SELECT `guild`.homepage, `guild`.name, `guild`.guildid, `guild`.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.';'); -
trunk/pages/online.php
r567 r577 1 1 <?php 2 2 3 // razeni 4 $order_by = (isset($_GET["order"])) ? $db->real_escape_string($_GET["order"]) : "name"; 5 $dir = (isset($_GET["dir"])) ? $db->real_escape_string($_GET["dir"]) : "down"; 6 $order_dir = ($dir == "up") ? "ASC" : "DESC"; 7 $dir = ($dir == "down") ? "up" : "down"; 8 $dir_img = ($dir == "down") ? "<img src=\"imgs/inc/up.gif\">" : "<img src=\"imgs/inc/down.gif\">"; 3 $order_by = (isset($_GET['order'])) ? $db->real_escape_string($_GET['order']) : 'name'; 4 $dir = (isset($_GET['dir'])) ? $db->real_escape_string($_GET['dir']) : 'down'; 5 $order_dir = ($dir == 'up') ? 'ASC' :'DESC'; 6 $dir = ($dir == 'down') ? 'up' : 'down'; 7 $dir_img = ($dir == 'down') ? '<img src="imgs/inc/up.gif" alt="vzestupně" />' : '<img src="imgs/inc/down.gif" alt="sestupně"/>'; 9 8 10 function MakeLink ($show,$sort)9 function MakeLink($show, $sort) 11 10 { 12 global $dir 13 if (isset($_GET["order"]) AND $_GET["order"] == $sort)11 global $dir, $dir_img; 12 if(isset($_GET['order']) and $_GET['order'] == $sort) 14 13 { 15 $arrow = $dir_img ."";14 $arrow = $dir_img; 16 15 } 17 16 else 18 17 { 19 $arrow = "";18 $arrow = ''; 20 19 } 21 return $arrow."<a href=\"?page=online&order=".$sort."&dir=".$dir."\">".$show."</a>";22 } 23 echo " 24 Ve hře se právě nachází ".$server -> MangosOnline()." hráčů.25 <center>26 <table border= \"1\" width=\"540\">20 return($arrow.'<a href="?page=online&order='.$sort.'&dir='.$dir.'">'.$show.'</a>'); 21 } 22 23 echo('Ve hře se právě nachází '.$server->MangosOnline().' hráčů.'. 24 '<center> 25 <table border="1" width="540"> 27 26 <tr> 28 <th align= \"center\">Frakce</th>29 <th align= \"center\">".MakeLink("Nick","name")."</th>30 <th align= \"center\">".MakeLink("Rasa","race")."</th>31 <th align= \"center\">".MakeLink("Class","class")."</th>32 <th align= \"center\">".MakeLink("Lvl","level")."</th>33 <th align= \"center\">".MakeLink("Mapa","map")."</th>34 <th align= \"center\">".MakeLink("Honory","highest_rank")."<br />".MakeLink("Aréna body","arena_points")."</th>35 </tr>36 "; 37 $db -> select_db($db_characters);38 $sql = $db -> query("SELECT guid,name,race,class,zone,map, 39 CAST( SUBSTRING_INDEX(SUBSTRING_INDEX(`data`, ' ', 1648+1), ' ', -1) AS UNSIGNED) AS highest_rank,40 CAST( SUBSTRING_INDEX(SUBSTRING_INDEX(`data`, ' ', 53+1), ' ', -1) AS UNSIGNED) AS level,41 CAST( SUBSTRING_INDEX(SUBSTRING_INDEX(`data`, ' ', 1649+1), ' ', -1) AS UNSIGNED) AS arena_points,42 mid(lpad( hex( CAST(substring_index(substring_index(data,' ',36+1),' ',-1) as unsigned) ),8,'0'),4,1) AS gender43 FROM `characters` WHERE `online`= 1 ORDER BY `".$order_by."` $order_dir;");44 while($row = $sql -> fetch_array())27 <th align="center">Frakce</th> 28 <th align="center">'.MakeLink('Nick', 'name').'</th> 29 <th align="center">'.MakeLink('Rasa', 'race').'</th> 30 <th align="center">'.MakeLink('Class', 'class').'</th> 31 <th align="center">'.MakeLink('Lvl', 'level').'</th> 32 <th align="center">'.MakeLink('Mapa', 'map').'</th> 33 <th align="center">'.MakeLink('Honory', 'highest_rank').'<br />'. 34 MakeLink('Aréna body', 'arena_points').'</th></tr>'); 35 36 $db->select_db($Config['Mangos']['DatabaseCharacters']); 37 $sql = $db->query('SELECT guid, name, race, class, zone, map, '. 38 'CAST( SUBSTRING_INDEX(SUBSTRING_INDEX(`data`, " ", '.$Config['Mangos']['CharacterDataOffset']['HonorPoints'].'+1), " ", -1) AS UNSIGNED) AS highest_rank, '. 39 'CAST( SUBSTRING_INDEX(SUBSTRING_INDEX(`data`, " ", '.$Config['Mangos']['CharacterDataOffset']['Level'].' + 1), " ", -1) AS UNSIGNED) AS level, '. 40 'CAST( SUBSTRING_INDEX(SUBSTRING_INDEX(`data`, " ", '.$Config['Mangos']['CharacterDataOffset']['ArenaPoints'].' + 1), " ", -1) AS UNSIGNED) AS arena_points, '. 41 'mid(lpad( hex( CAST(substring_index(substring_index(data, " ", '.$Config['Mangos']['CharacterDataOffset']['Gender'].' + 1), " ", -1) as unsigned) ), 8, 0), 4, 1) AS gender '. 42 'FROM `characters` WHERE `online`= 1 ORDER BY `'.$order_by.'` '.$order_dir); 43 while($row = $sql->fetch_assoc()) 45 44 { 46 $aliance = array (1, 3, 4, 7, 11); 47 $frakce = (in_array($row["race"],$aliance))?"<img src=\"imgs/inc/a.gif\">":"<img src=\"imgs/inc/h.gif\">"; 48 $gender = ($row["gender"] == 0)?"m":"f"; 49 echo " 50 <tr> 51 <td align=\"center\">".$frakce."</td> 52 <td align=\"center\">".$row["name"]."</td> 53 <td align=\"center\"><img src=\"imgs/icons/".$player -> GetPlayerRace($row["race"])."-".$gender.".gif\"></td> 54 <td align=\"center\"><img src=\"imgs/icons/".$player -> GetPlayerClass($row["class"]).".gif\"></td> 55 <td align=\"center\">".$row["level"]."</td> 56 <td align=\"center\">".$server -> MapName($row["map"])."<br />(".$server -> ZoneName($row["zone"]).")</td> 57 <td align=\"center\">".$row["highest_rank"]."<br />".$row["arena_points"]."</td> 58 </tr> 59 "; 60 61 62 63 45 $aliance = array(1, 3, 4, 7, 11); 46 $frakce = (in_array($row['race'], $aliance)) ? '<img src="imgs/inc/a.gif" alt="aliance"/>' : '<img src="imgs/inc/h.gif" alt="horda" />'; 47 $gender = ($row['gender'] == 0) ? 'm' : 'f'; 48 echo('<tr> 49 <td align="center">'.$frakce.'</td> 50 <td align="center">'.$row['name'].'</td> 51 <td align="center"><img src="imgs/icons/'.$player->GetPlayerRace($row['race']).'-'.$gender.'.gif" alt="rasa" /></td> 52 <td align="center"><img src="imgs/icons/'.$player->GetPlayerClass($row['class']).'.gif" alt="třída" /></td> 53 <td align="center">'.$row['level'].'</td> 54 <td align="center">'.$server->MapName($row['map']).'<br />('.$server->ZoneName($row['zone']).')</td> 55 <td align="center">'.$row['highest_rank'].'<br />'.$row['arena_points'].'</td></tr>'); 64 56 } 65 echo "</table></center>"; 66 67 68 57 echo('</table></center>'); 69 58 70 59 ?>
Note:
See TracChangeset
for help on using the changeset viewer.