Changeset 632 for trunk


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ů.
Location:
trunk
Files:
1 added
3 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'];
  • 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>');
  • trunk/pages/online.php

    r630 r632  
    2929  <tr>
    3030    <th align="center">Frakce</th>
    31     <th align="center">'.MakeLink('Nick', 'name').'</th>
     31    <th align="center">'.MakeLink('Jméno', 'name').'</th>
    3232    <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>
    3535    <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>');
    3838
    3939$Realm->Database->select_db($Config['Mangos']['RealmList'][$_COOKIE['RealmIndex']]['DatabaseCharacters']);
Note: See TracChangeset for help on using the changeset viewer.