Changeset 8 for guildy.php


Ignore:
Timestamp:
Aug 10, 2007, 9:15:09 PM (17 years ago)
Author:
george
Message:

Nové zobrazení a prohlízení seznamu guild. Nová aktualita.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • guildy.php

    r7 r8  
    11<?
    22  include('global.php');
     3  $Charset = 'iso-8859-2';
    34  ShowHeader();
    4 ?>
    5 
    6 <TABLE width="100%" border="0">
     5 
     6  echo('<TABLE width="100%" border="0">
    77<TR>
    88<TD valign="top">
    9 <div class="DivText">
     9<div class="DivText">');
    1010
    11 <?
    1211include('test/db.php');
    1312DB_Init($DatabaseHost, $DatabaseUser, $DatabasePassword, 'mangos');
    14 DB_Query('SET NAMES cp1250');
    15 <<<<<<< .mine
     13DB_Query('SET NAMES latin2');
    1614
    1715$RanksEN = array('Guildmaster', 'Veteran', 'Intendant', 'Support Officer', 'PR Officer', 'Officer', 'Famed Member',
     
    1917$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');
    2018
    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())
     19if(!array_key_exists('guild', $_GET))
    2420{
    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>&nbsp;</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;
    3046 
    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    {
    6450//    $DataParts = explode(' ', $Member['data']);
    6551//    $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!');
    7057}
    7158
Note: See TracChangeset for help on using the changeset viewer.