Changeset 632 for trunk/pages/guildy.php


Ignore:
Timestamp:
Aug 30, 2009, 8:59:02 AM (15 years ago)
Author:
george
Message:
  • Upraveno: Doplňující informace ke spolkům jako jsou webové stránky spolku jsou nyní uloženy v samostatné tabulce bez nutnosti zasahování do tabulek emulátoru.
  • Opraveno: Zobrazování seznamu spolků a výpisu členů.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/pages/guildy.php

    r630 r632  
    4444
    4545$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']);
    4848
    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.';');
    5050while($row = $sql->fetch_assoc())
    5151{
    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');
    5353  $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'];
    5457  $date_arr = explode(' ', $row['createdate']);
    5558  $date = explode('-', $date_arr[0]);
     
    6265    <td align="center">'.$row['member_count'].'</td>
    6366    <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>
    6669    <td align="center">'.$human_date.'</td>
    6770  </tr>');
Note: See TracChangeset for help on using the changeset viewer.