Changeset 632 for trunk/pages/guilda.php
- Timestamp:
- Aug 30, 2009, 8:59:02 AM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/pages/guilda.php
r630 r632 11 11 12 12 $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']); 15 15 $id = (isset($_GET['id'])) ? $_GET['id'] : 0; 16 16 if($id != 0) 17 17 { 18 18 $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'); 20 20 $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'); 22 22 $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'); 25 24 $online_mem = $DbResult->fetch_assoc(); 26 25 … … 43 42 <th>Celkem členů: </th> 44 43 <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> 45 53 </tr> 46 </table><br />'); 54 '); 55 } 56 echo('</table><br />'); 57 47 58 48 59 // members info … … 59 70 while($member = $members->fetch_row()) 60 71 { 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;'); 62 73 $online = $query->fetch_assoc(); 63 74 $accid = $online['account'];
Note:
See TracChangeset
for help on using the changeset viewer.