Changeset 705


Ignore:
Timestamp:
Apr 4, 2010, 9:37:19 AM (15 years ago)
Author:
george
Message:
  • Opraveno: Nově načítat informace o hráčích přímo ze samostatných sloupců tabulky namísto sloupce zrušeného data.
Location:
trunk/pages
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/pages/spolek.php

    r695 r705  
    1818  $DbResult = $db2->query('SELECT `guildid`, `name`, FROM_UNIXTIME(`createdate`) AS `createdate` FROM `guild` WHERE `guildid` = '.$guild_id.' LIMIT 1');
    1919  $guild_data = $DbResult->fetch_assoc();
    20   $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');
     20  $members = $db2->query('SELECT `guild_member`.`guid`, `guild_member`.`rank` AS `mrank`, `characters`.`name`, `characters`.`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` AS `k1` ON `k1`.`guid`=`characters`.`guid` WHERE `guild_member`.`guildid` = '.$guild_id.' AND `guild_member`.`guid`=`characters`.`guid` ORDER BY `mrank`');
    2121  $total_members = $members->num_rows;
    22   $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');
     22  $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');
    2323  $online_mem = $DbResult->fetch_assoc();
    2424
     
    4242      <td>'.$total_members.' (Online : '.$online_mem['online_mem'].')</td>
    4343    </tr>');
    44   $DbResult = $db->query('SELECT Homepage FROM GuildInfo WHERE Guild='.$guild_id.' AND Realm='.$Realm->Id);
     44  $DbResult = $db->query('SELECT `Homepage` FROM `GuildInfo` WHERE `Guild`='.$guild_id.' AND `Realm`='.$Realm->Id);
    4545  $DbRow = $DbResult->fetch_assoc();
    4646  $Homepage = $DbRow['Homepage'];
     
    6969  while($member = $members->fetch_row())
    7070  {   
    71     $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;');
     71    $query = $db2->query('SELECT `race`,`class`,`online`, `account`, `logout_time`, `level`, `gender` FROM `characters` WHERE `guid` = '.$member[0].' LIMIT 1;');
    7272    $online = $query->fetch_assoc();
    7373    $accid = $online['account'];
  • trunk/pages/spolky.php

    r697 r705  
    4646} else
    4747{
    48 echo('<h3 class="PageTitle">Seznam spolků</h3>');
    49 echo('<table class="BaseTable">
    50   <tr>
    51     <th>'.MakeLink('', 'fraction').'</th>
    52     <th>'.MakeLink('Jméno spolku', 'name').'</th>
    53     <th>'.MakeLink('Celkem členů', 'member_count').'</th>
    54     <th>Členů online</th>
    55     <th>Guild master</th>
    56     <th>'.MakeLink('Webové stránky', 'homepage').'</th>
    57     <th>'.MakeLink('Datum založení', 'createdate').'</th>
    58   </tr>');
     48echo('<h2 class="PageTitle">Seznam spolků</h2>');
     49echo('<table class="BaseTable">'.
     50  '<tr>'.
     51  '<th>'.MakeLink('', 'fraction').'</th>'.
     52  '<th>'.MakeLink('Jméno spolku', 'name').'</th>'.
     53  '<th>'.MakeLink('Celkem členů', 'member_count').'</th>'.
     54  '<th>Členů online</th>'.
     55  '<th>Guild master</th>'.
     56  '<th>'.MakeLink('Webové stránky', 'homepage').'</th>'.
     57  '</tr>');
    5958
    6059
     
    7271  $time = mktime($time_stp[0], $time_stp[1], $time_stp[2], $date[1], $date[2], $date[0]);
    7372  $human_date = date('d.m.Y H:i:s', $time);
    74   echo('<tr>
    75     <td align="center">'.FrakceImg($row['fraction']).'</td>
    76     <td align="center"><a href="'.$html->Link($row['URLName'].'/').'">'.$row['name'].'</a></td>
    77     <td align="center">'.$row['member_count'].'</td>
    78     <td align="center">'.$online_mem['online_mem'].'</td>
    79     <td align="center">'.$Realm->GuidToCharName($row['leader']).'</td>
    80     <td align="center">'.GuildPages($Homepage, $row['name']).'</td>
    81     <td align="center">'.$human_date.'</td>
    82   </tr>');
     73  echo('<tr>'.
     74    '<td align="center">'.FrakceImg($row['fraction']).'</td>'.
     75    '<td align="center"><a href="'.$html->Link($row['URLName'].'/').'">'.$row['name'].'</a></td>'.
     76    '<td align="center">'.$row['member_count'].'</td>'.
     77    '<td align="center">'.$online_mem['online_mem'].'</td>'.
     78    '<td align="center">'.$Realm->GuidToCharName($row['leader']).'</td>'.
     79    '<td align="center">'.GuildPages($Homepage, $row['name']).'</td>'.
     80  '</tr>');
    8381}
    8482echo('</table>');
Note: See TracChangeset for help on using the changeset viewer.