Changeset 309 for guildy.php
- Timestamp:
- Mar 13, 2008, 8:45:46 PM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
guildy.php
r190 r309 39 39 echo('</tr>'); 40 40 // DB_Query(' COUNT(guild_member.guildid) as member_count FROM guild JOIN guild_member ON guild_member.guildid = guild.guildid GROUP BY guild.name ORDER BY member_count DESC'); 41 $Result = $Database->query('SELECT `guild`.homepage, `guild`.name, guild.guildid, COUNT(`guild_member`.`guildid`) as member_count, SUM(SUBSTRING_INDEX(SUBSTRING_INDEX(`character `.`data`, " ", 35), " ", -1)) as guild_level, SUM(SUBSTRING_INDEX(SUBSTRING_INDEX(`character`.`data`, " ", '.(CHAR_DATA_OFFSET_HONOR_POINTS+1).'), " ", -1)) as guild_honor FROM `guild` JOIN `guild_member` ON `guild_member`.`guildid` = `guild`.`guildid` JOIN `character` ON `character`.`guid`= `guild_member`.`guid` GROUP BY guild.name ORDER BY '.$order_by.' '.$order_dir);41 $Result = $Database->query('SELECT `guild`.homepage, `guild`.name, guild.guildid, COUNT(`guild_member`.`guildid`) as member_count, SUM(SUBSTRING_INDEX(SUBSTRING_INDEX(`characters`.`data`, " ", 35), " ", -1)) as guild_level, SUM(SUBSTRING_INDEX(SUBSTRING_INDEX(`characters`.`data`, " ", '.(CHAR_DATA_OFFSET_HONOR_POINTS+1).'), " ", -1)) as guild_honor FROM `guild` JOIN `guild_member` ON `guild_member`.`guildid` = `guild`.`guildid` JOIN `characters` ON `characters`.`guid`= `guild_member`.`guid` GROUP BY guild.name ORDER BY '.$order_by.' '.$order_dir); 42 42 while($Guild = $Result->fetch_array()) 43 43 { … … 49 49 } else { 50 50 $GuildId = addslashes($_GET['guild']); 51 $Result = $Database->query('SELECT `guild`.name, guild.guildid, guild.leaderguid, COUNT(`guild_member`.`guildid`) as member_count, SUM(SUBSTRING_INDEX(SUBSTRING_INDEX(`character `.`data`, " ", '.(CHAR_DATA_OFFSET_LEVEL+1).'), " ", -1)) as guild_level, SUM(SUBSTRING_INDEX(SUBSTRING_INDEX(`character`.`data`, " ", '.(CHAR_DATA_OFFSET_HONOR_POINTS+1).'), " ", -1)) as guild_honor FROM `guild` JOIN `guild_member` ON `guild_member`.`guildid` = `guild`.`guildid` JOIN `character` ON `character`.`guid`= `guild_member`.`guid` WHERE guild.guildid='.$GuildId.' GROUP BY guild.name');51 $Result = $Database->query('SELECT `guild`.name, guild.guildid, guild.leaderguid, COUNT(`guild_member`.`guildid`) as member_count, SUM(SUBSTRING_INDEX(SUBSTRING_INDEX(`characters`.`data`, " ", '.(CHAR_DATA_OFFSET_LEVEL+1).'), " ", -1)) as guild_level, SUM(SUBSTRING_INDEX(SUBSTRING_INDEX(`characters`.`data`, " ", '.(CHAR_DATA_OFFSET_HONOR_POINTS+1).'), " ", -1)) as guild_honor FROM `guild` JOIN `guild_member` ON `guild_member`.`guildid` = `guild`.`guildid` JOIN `characters` ON `characters`.`guid`= `guild_member`.`guid` WHERE guild.guildid='.$GuildId.' GROUP BY guild.name'); 52 52 if($Result->num_rows > 0) 53 53 { … … 56 56 //if($Guild['info'] != '') $Guild['info'] = ''.$Guild['info'].'</i>'; 57 57 echo('<h3>Seznam èlenù spolku '.$Guild['name'].'</h3><div align="center">'); 58 $Result = $Database->select('character ', 'name', $Guild['leaderguid'].'=guid');58 $Result = $Database->select('characters', 'name', $Guild['leaderguid'].'=guid'); 59 59 $GuildMaster = $Result->fetch_array(); 60 60 echo('Vedoucí spolku: '.$GuildMaster['name'].'<br>'); … … 72 72 while($GuildRank = $Result->fetch_array()) $GuildRanks[$GuildRank['rid']] = $GuildRank; 73 73 74 $Result = $Database->query('SELECT guild_member.rank, guild_member.guid, SUBSTRING_INDEX(SUBSTRING_INDEX(character .data," ", '.(CHAR_DATA_OFFSET_LEVEL+1).'), " ", -1)*1 as level, SUBSTRING_INDEX(SUBSTRING_INDEX(character.data," ", '.(CHAR_DATA_OFFSET_HONOR_POINTS+1).'), " ", -1)*1 as honor, character.name FROM guild_member JOIN `character` ON guild_member.guid = character.guid AND guild_member.guildid='.$Guild['guildid'].' ORDER BY '.$order_by.' '.$order_dir);74 $Result = $Database->query('SELECT guild_member.rank, guild_member.guid, SUBSTRING_INDEX(SUBSTRING_INDEX(characters.data," ", '.(CHAR_DATA_OFFSET_LEVEL+1).'), " ", -1)*1 as level, SUBSTRING_INDEX(SUBSTRING_INDEX(characters.data," ", '.(CHAR_DATA_OFFSET_HONOR_POINTS+1).'), " ", -1)*1 as honor, characters.name FROM guild_member JOIN `characters` ON guild_member.guid = characters.guid AND guild_member.guildid='.$Guild['guildid'].' ORDER BY '.$order_by.' '.$order_dir); 75 75 while($Member = $Result->fetch_array()) 76 76 {
Note:
See TracChangeset
for help on using the changeset viewer.