Changeset 334
- Timestamp:
- Apr 13, 2008, 9:11:05 AM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
guildy.php
r309 r334 1 <? 1 <?php 2 2 include('global.php'); 3 3 ShowHeader(); … … 32 32 echo('<h3>Seznam spolkù:</h3><div align="center">'); 33 33 echo('<table class="TableGuilda" border="1" cellpadding="3" cellspacing="0"><tr>'); 34 HeaderText('F', 'fraction'); 34 35 HeaderText('Název', 'name'); 35 36 HeaderText('Poèet èlenù', 'member_count'); 36 37 HeaderText('Souèet levelù', 'guild_level'); 37 38 HeaderText('Souèet bodù cti', 'guild_honor'); 38 HeaderText('Webové stránky', ' name');39 HeaderText('Webové stránky', ''); 39 40 echo('</tr>'); 40 41 // 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(` 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 $Result = $Database->query('SELECT `guild`.homepage, `guild`.name, guild.guildid, COUNT(`guild_member`.`guildid`) as member_count, SUM(SUBSTRING_INDEX(SUBSTRING_INDEX(`memebers`.`data`, " ", 35), " ", -1)) as guild_level, SUM(SUBSTRING_INDEX(SUBSTRING_INDEX(`memebers`.`data`, " ", '.(CHAR_DATA_OFFSET_HONOR_POINTS+1).'), " ", -1)) as guild_honor, `leader`.`race` IN (1, 3, 4, 7, 11) as fraction 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); 42 43 while($Guild = $Result->fetch_array()) 43 44 { 45 if($Guild['fraction'] == 1) $Fraction = 'aliance'; else $Fraction = 'horda'; 44 46 if($Guild['homepage'] == '') $Guild['homepage'] = ' '; 45 47 else $Guild['homepage'] = '<a href="http://'.$Guild['homepage'].'/">'.$Guild['homepage'].'</a>'; 46 echo('<tr><td>< a href="?guild='.$Guild['guildid'].'">'.$Guild['name'].'</a></td><td>'.$Guild['member_count'].'</td><td>'.$Guild['guild_level'].'</td><td>'.$Guild['guild_honor'].'</td><td>'.$Guild['homepage'].'</td></tr>');48 echo('<tr><td><img src="images/online_player/'.$Fraction.'.gif" alt="'.$Fraction.'"></td><td><a href="?guild='.$Guild['guildid'].'">'.$Guild['name'].'</a></td><td>'.$Guild['member_count'].'</td><td>'.$Guild['guild_level'].'</td><td>'.$Guild['guild_honor'].'</td><td>'.$Guild['homepage'].'</td></tr>'); 47 49 } 48 50 echo('</table></div>');
Note:
See TracChangeset
for help on using the changeset viewer.