Changeset 8 for guildy.php
- Timestamp:
- Aug 10, 2007, 9:15:09 PM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
guildy.php
r7 r8 1 1 <? 2 2 include('global.php'); 3 $Charset = 'iso-8859-2'; 3 4 ShowHeader(); 4 ?> 5 6 <TABLE width="100%" border="0"> 5 6 echo('<TABLE width="100%" border="0"> 7 7 <TR> 8 8 <TD valign="top"> 9 <div class="DivText"> 9 <div class="DivText">'); 10 10 11 <?12 11 include('test/db.php'); 13 12 DB_Init($DatabaseHost, $DatabaseUser, $DatabasePassword, 'mangos'); 14 DB_Query('SET NAMES cp1250'); 15 <<<<<<< .mine 13 DB_Query('SET NAMES latin2'); 16 14 17 15 $RanksEN = array('Guildmaster', 'Veteran', 'Intendant', 'Support Officer', 'PR Officer', 'Officer', 'Famed Member', … … 19 17 $RanksCZ = array('Pán cechu', 'Veterán', 'Vrchní správce', 'Pomocný dùstojník', 'PR dùstojník', 'Dùstojník', 'Proslavený èlen', 'Èlen', 'Zelenáè', 'Nováèek'); 20 18 21 echo('<h3>Seznam guild:</h3>'); 22 DB_Query('SELECT guild.*, 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'); 23 while($Guild = DB_Row()) 19 if(!array_key_exists('guild', $_GET)) 24 20 { 25 // if($Guild['homepage'] != '') $Guild['name'] = $Guild['name'].' <a href="'.$Guild['homepage'].'">WWW</a>'; 26 //if($Guild['info'] != '') $Guild['info'] = ''.$Guild['info'].'</i>'; 27 echo('<hr><div class="DivGuilda">Guilda '.$Guild['name'].'</div>'); 28 echo('<table width="100%" class="TableGuilda" border="0" cellpadding="1" cellspacing="0">'); 29 //echo('<tr><td colspan="2" Class="TdGuilda">Informace: '.$Guild['public_info'].'</td></tr>'); 21 echo('<h3>Seznam guild:</h3>'); 22 echo('<div align="center"><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 // 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()) 26 { 27 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>'); 28 } 29 echo('</table></div>'); 30 } else { 31 $_GET['guild'] = addslashes($_GET['guild']); 32 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` WHERE guild.guildid='.$_GET['guild'].' GROUP BY guild.name'); 33 if(DB_NumRows() > 0) 34 { 35 $Guild = DB_Row(); 36 // if($Guild['homepage'] != '') $Guild['name'] = $Guild['name'].' <a href="'.$Guild['homepage'].'">WWW</a>'; 37 //if($Guild['info'] != '') $Guild['info'] = ''.$Guild['info'].'</i>'; 38 echo('<h3>Seznam èlenù guildy '.$Guild['name'].':</h3>'); 39 echo('<div align="center"><table class="TableGuilda" border="1" cellpadding="1" cellspacing="0">'); 40 echo('<tr><th>Jméno</th><th>Level</th><th>Hodnost</th><th>Body cti</th></tr>'); 41 //echo('<tr><td colspan="2" Class="TdGuilda">Informace: '.$Guild['public_info'].'</td></tr>'); 42 43 $GuildRanks = array(); 44 DB_Select('guild_rank', '*', 'guildid='.$Guild['guildid']); 45 while($GuildRank = DB_Row()) $GuildRanks[$GuildRank['rid']] = $GuildRank; 30 46 31 $GuildRanks = array(); 32 DB_Save(); 33 DB_Select('guild_rank', '*', 'guildid='.$Guild['guildid']); 34 while($GuildRank = DB_Row()) $GuildRanks[$GuildRank['rid']] = $GuildRank; 35 36 DB_Query('SELECT guild_member.rank, guild_member.guid, SUBSTRING_INDEX(SUBSTRING_INDEX(character.data," ", 35), " ", -1)*1 as level, character.name FROM guild_member JOIN `character` ON guild_member.guid = character.guid AND guild_member.guildid='.$Guild['guildid']); 37 while($Member = DB_Row()) 38 { 39 ======= 40 41 $RanksEN = array('Guildmaster', 'Veteran', 'Intendant', 'Support Officer', 'PR Officer', 'Officer', 'Famed Member', 42 'Member', 'Rokie', 'Newbie'); 43 $RanksCZ = array('Pán cechu', 'Veterán', 'Vrchnà správce', 'Pomocný důstojnÃk', 'PR důstojnÃk', 'DůstojnÃk', 'Proslavený Älen', 'Älen', 'ZelenáÄ', 'NováÄek'); 44 45 echo('<h3>Seznam guild:</h3>'); 46 DB_Query('SELECT guild.*, 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'); 47 while($Guild = DB_Row()) 48 { 49 // if($Guild['homepage'] != '') $Guild['name'] = $Guild['name'].' <a href="'.$Guild['homepage'].'">WWW</a>'; 50 //if($Guild['info'] != '') $Guild['info'] = ''.$Guild['info'].'</i>'; 51 echo('<hr><div class="DivGuilda">Guilda '.$Guild['name'].'</div>'); 52 echo('<table width="100%" class="TableGuilda" border="0" cellpadding="1" cellspacing="0">'); 53 //echo('<tr><td colspan="2" Class="TdGuilda">Informace: '.$Guild['public_info'].'</td></tr>'); 54 55 $GuildRanks = array(); 56 DB_Save(); 57 DB_Select('guild_rank', '*', 'guildid='.$Guild['guildid']); 58 while($GuildRank = DB_Row()) $GuildRanks[$GuildRank['rid']] = $GuildRank; 59 60 DB_Query('SELECT guild_member.rank, guild_member.guid, SUBSTRING_INDEX(SUBSTRING_INDEX(character.data," ", 35), " ", -1)*1 as level, character.name FROM guild_member JOIN `character` ON guild_member.guid = character.guid AND guild_member.guildid='.$Guild['guildid']); 61 while($Member = DB_Row()) 62 { 63 >>>>>>> .r6 47 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'); 48 while($Member = DB_Row()) 49 { 64 50 // $DataParts = explode(' ', $Member['data']); 65 51 // $Member['level'] .= ','.$DataParts[34]; 66 echo('<tr><td width="30%">'.$Member['name'].'('.$Member['level'].')</td><td>'.$GuildRanks[$Member['rank']+1]['rname'].'</td></tr>'); 67 } 68 DB_Load(); 69 echo('</table><br>'); 52 echo('<tr><td width="30%">'.$Member['name'].'</td><td>'.$Member['level'].'</td><td>'.$GuildRanks[$Member['rank']+1]['rname'].'</td><td>'.$Member['honor'].'</td></tr>'); 53 } 54 echo('</table>'); 55 echo('<a href="guildy.php">Zpìt na seznam guild</a></div>'); 56 } else echo('Guilda nenalezena!'); 70 57 } 71 58
Note:
See TracChangeset
for help on using the changeset viewer.