Changeset 632
- Timestamp:
- Aug 30, 2009, 8:59:02 AM (15 years ago)
- Location:
- trunk
- Files:
-
- 1 added
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/pages/guilda.php
r630 r632 11 11 12 12 $Realm = new Realm($System, $_COOKIE['RealmIndex']); 13 $db = $Realm->Database;14 $db ->select_db($Config['Mangos']['RealmList'][$Realm->Id]['DatabaseCharacters']);13 $db2 = $Realm->Database; 14 $db2->select_db($Config['Mangos']['RealmList'][$Realm->Id]['DatabaseCharacters']); 15 15 $id = (isset($_GET['id'])) ? $_GET['id'] : 0; 16 16 if($id != 0) 17 17 { 18 18 $guild_id = $id; 19 $DbResult = $db ->query('SELECT `guildid`, `name`, `createdate` FROM `guild` WHERE `guildid` = '.$guild_id.' LIMIT 1');19 $DbResult = $db2->query('SELECT `guildid`, `name`, `createdate` FROM `guild` WHERE `guildid` = '.$guild_id.' LIMIT 1'); 20 20 $guild_data = $DbResult->fetch_assoc(); 21 $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');21 $members = $db2->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'); 22 22 $total_members = $members->num_rows; 23 $members_data = $members->fetch_assoc(); 24 $DbResult = $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'); 23 $DbResult = $db2->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'); 25 24 $online_mem = $DbResult->fetch_assoc(); 26 25 … … 43 42 <th>Celkem členů: </th> 44 43 <td>'.$total_members.' (Online : '.$online_mem['online_mem'].')</td> 44 </tr>'); 45 $DbResult = $db->query('SELECT Homepage FROM GuildInfo WHERE Guild='.$guild_id); 46 $DbRow = $DbResult->fetch_assoc(); 47 $Homepage = $DbRow['Homepage']; 48 if($Homepage != '') 49 { 50 echo(' <tr> 51 <th>Webové stránky: </th> 52 <td><a href="http://'.$Homepage.'/">'.$Homepage.'</a></td> 45 53 </tr> 46 </table><br />'); 54 '); 55 } 56 echo('</table><br />'); 57 47 58 48 59 // members info … … 59 70 while($member = $members->fetch_row()) 60 71 { 61 $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;');72 $query = $db2->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;'); 62 73 $online = $query->fetch_assoc(); 63 74 $accid = $online['account']; -
trunk/pages/guildy.php
r630 r632 44 44 45 45 $Realm = new Realm($System, $_COOKIE['RealmIndex']); 46 $db = $Realm->Database;47 $db ->select_db($Config['Mangos']['RealmList'][$Realm->Id]['DatabaseCharacters']);46 $db2 = $Realm->Database; 47 $db2->select_db($Config['Mangos']['RealmList'][$Realm->Id]['DatabaseCharacters']); 48 48 49 $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.';');49 $sql = $db2->query('SELECT `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.';'); 50 50 while($row = $sql->fetch_assoc()) 51 51 { 52 $DbResult = $db ->query('SELECT count(*) AS online_mem FROM `guild_member`, `characters`, `guild` WHERE guild.guildid = '.$row['guildid'].' AND guild_member.guildid = guild.guildid AND guild_member.guid = characters.guid AND characters.online = 1');52 $DbResult = $db2->query('SELECT COUNT(*) AS online_mem FROM `guild_member`, `characters`, `guild` WHERE guild.guildid = '.$row['guildid'].' AND guild_member.guildid = guild.guildid AND guild_member.guid = characters.guid AND characters.online = 1'); 53 53 $online_mem = $DbResult->fetch_assoc(); 54 $DbResult = $db->query('SELECT Homepage FROM GuildInfo WHERE Guild='.$row['guildid']); 55 $DbRow = $DbResult->fetch_assoc(); 56 $Homepage = $DbRow['Homepage']; 54 57 $date_arr = explode(' ', $row['createdate']); 55 58 $date = explode('-', $date_arr[0]); … … 62 65 <td align="center">'.$row['member_count'].'</td> 63 66 <td align="center">'.$online_mem['online_mem'].'</td> 64 <td align="center">'.$ server->GuidToCharName($row['leader']).'</td>65 <td align="center">'.GuildPages($ row['homepage'],$row['name']).'</td>67 <td align="center">'.$Realm->GuidToCharName($row['leader']).'</td> 68 <td align="center">'.GuildPages($Homepage, $row['name']).'</td> 66 69 <td align="center">'.$human_date.'</td> 67 70 </tr>'); -
trunk/pages/online.php
r630 r632 29 29 <tr> 30 30 <th align="center">Frakce</th> 31 <th align="center">'.MakeLink(' Nick', 'name').'</th>31 <th align="center">'.MakeLink('Jméno', 'name').'</th> 32 32 <th align="center">'.MakeLink('Rasa', 'race').'</th> 33 <th align="center">'.MakeLink(' Class', 'class').'</th>34 <th align="center">'.MakeLink(' Lvl', 'level').'</th>33 <th align="center">'.MakeLink('Třída', 'class').'</th> 34 <th align="center">'.MakeLink('Úroveň', 'level').'</th> 35 35 <th align="center">'.MakeLink('Mapa', 'map').'</th> 36 <th align="center">'.MakeLink(' Honory', 'highest_rank').'<br />'.37 MakeLink(' Aréna body', 'arena_points').'</th></tr>');36 <th align="center">'.MakeLink('Body cti', 'highest_rank').'<br />'. 37 MakeLink('Body arén', 'arena_points').'</th></tr>'); 38 38 39 39 $Realm->Database->select_db($Config['Mangos']['RealmList'][$_COOKIE['RealmIndex']]['DatabaseCharacters']);
Note:
See TracChangeset
for help on using the changeset viewer.