Changeset 632 for trunk/pages/guilda.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/guilda.php

    r630 r632  
    1111
    1212$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']);
    1515$id = (isset($_GET['id'])) ? $_GET['id'] : 0;
    1616if($id != 0)
    1717{
    1818  $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');
    2020  $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');
    2222  $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');
    2524  $online_mem = $DbResult->fetch_assoc();
    2625
     
    4342      <th>Celkem členů: </th>
    4443      <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>
    4553    </tr>
    46   </table><br />');
     54');
     55  }
     56  echo('</table><br />');
     57
    4758 
    4859  // members info
     
    5970  while($member = $members->fetch_row())
    6071  {   
    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;');
    6273    $online = $query->fetch_assoc();
    6374    $accid = $online['account'];
Note: See TracChangeset for help on using the changeset viewer.