Changeset 14 for guildy.php
- Timestamp:
- Aug 12, 2007, 2:13:09 AM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
guildy.php
r11 r14 1 1 <? 2 2 include('global.php'); 3 $ Charset = 'iso-8859-2';3 $Database->select_db('mangos'); 4 4 ShowHeader(); 5 5 … … 8 8 <TD valign="top"> 9 9 <div class="DivText">'); 10 11 include('test/db.php');12 DB_Init($DatabaseHost, $DatabaseUser, $DatabasePassword, 'mangos');13 DB_Query('SET NAMES latin2');14 10 15 11 $RanksEN = array('Guildmaster', 'Veteran', 'Intendant', 'Support Officer', 'PR Officer', 'Officer', 'Famed Member', … … 22 18 echo('<table class="TableGuilda" style="align: center;" border="1" cellpadding="3" cellspacing="0" ><tr><th>Název</th><th>Poèet èlenù</th><th>Souèet levelù</th><th>Souèet bodù cti</th><th>Webové stránky</th></tr>'); 23 19 // 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'); 24 DB_Query('SELECT `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`, " ", 1421), " ", -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 guild.name');25 while($Guild = DB_Row())20 $Result = $Database->query('SELECT `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`, " ", 1421), " ", -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 guild.name'); 21 while($Guild = $Result->fetch_array()) 26 22 { 27 23 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> </td></tr>'); … … 30 26 } else { 31 27 $_GET['guild'] = addslashes($_GET['guild']); 32 DB_Query('SELECT `guild`.name, guild.guildid, guild.leaderguid, 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`, " ", 1421), " ", -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='.$_GET['guild'].' GROUP BY guild.name');33 if( DB_NumRows()> 0)28 $Result = $Database->query('SELECT `guild`.name, guild.guildid, guild.leaderguid, 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`, " ", 1421), " ", -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='.$_GET['guild'].' GROUP BY guild.name'); 29 if($Result->num_rows > 0) 34 30 { 35 $Guild = DB_Row();31 $Guild = $Result->fetch_array(); 36 32 // if($Guild['homepage'] != '') $Guild['name'] = $Guild['name'].' <a href="'.$Guild['homepage'].'">WWW</a>'; 37 33 //if($Guild['info'] != '') $Guild['info'] = ''.$Guild['info'].'</i>'; 38 34 echo('<div align="center"><strong>Seznam èlenù guildy '.$Guild['name'].'</strong><br>'); 39 DB_Select('`character`', 'name', $Guild['leaderguid'].'=guid');40 $GuildMaster = DB_Row();35 $Result = $Database->select('character', 'name', $Guild['leaderguid'].'=guid'); 36 $GuildMaster = $Result->fetch_array(); 41 37 echo('Vedoucí guildy: '.$GuildMaster['name'].'<br>'); 42 38 echo('<table class="TableGuilda" border="1" cellpadding="1" cellspacing="0">'); … … 45 41 46 42 $GuildRanks = array(); 47 DB_Select('guild_rank', '*', 'guildid='.$Guild['guildid']);48 while($GuildRank = DB_Row()) $GuildRanks[$GuildRank['rid']] = $GuildRank;43 $Result = $Database->select('guild_rank', '*', 'guildid='.$Guild['guildid']); 44 while($GuildRank = $Result->fetch_array()) $GuildRanks[$GuildRank['rid']] = $GuildRank; 49 45 50 DB_Query('SELECT guild_member.rank, guild_member.guid, SUBSTRING_INDEX(SUBSTRING_INDEX(character.data," ", 35), " ", -1)*1 as level, SUBSTRING_INDEX(SUBSTRING_INDEX(character.data," ", 1421), " ", -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 character.name');51 while($Member = DB_Row())46 $Result = $Database->query('SELECT guild_member.rank, guild_member.guid, SUBSTRING_INDEX(SUBSTRING_INDEX(character.data," ", 35), " ", -1)*1 as level, SUBSTRING_INDEX(SUBSTRING_INDEX(character.data," ", 1421), " ", -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 character.name'); 47 while($Member = $Result->fetch_array()) 52 48 { 53 49 // $DataParts = explode(' ', $Member['data']);
Note:
See TracChangeset
for help on using the changeset viewer.