Changeset 632 for trunk/pages/guildy.php
- Timestamp:
- Aug 30, 2009, 8:59:02 AM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
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>');
Note:
See TracChangeset
for help on using the changeset viewer.