Link('/imgs/inc/up.gif').'" alt="nahoru">' : 'dolu'; function MakeLink($show, $sort) { global $dir, $dir_img, $html; if (isset($_GET['order']) and $_GET['order'] == $sort) $arrow = $dir_img; else $arrow = ''; return($arrow.''.$show.''); } function GuildPages($row, $name) { global $server; if($row != '') return('www'); else return(''); } function FrakceImg($frakce) { global $html; if($frakce == 0) return('horda'); else return('aliance'); } if(isset($Realm)) { $db2 = $Realm->CharactersDatabase; if(count($QueryItems) > 3) { $GuildName = $QueryItems[3]; $DbResult = $db2->query('SELECT guildid FROM guild WHERE '.$System->SQLURLName('Name').'="'.$GuildName.'"'); $DbRow = $DbResult->fetch_assoc(); $_GET['id'] = $DbRow['guildid']; include('spolek.php'); } else { echo('

Seznam spolků

'); echo(''. ''. ''. ''. ''. ''. ''. ''. ''); $sql = $db2->query('SELECT `guild`.name, '.$System->SQLURLName('`guild`.name').' AS URLName, `guild`.guildid, FROM_UNIXTIME(`guild`.`createdate`) AS `createdate`, COUNT(`guild_member`.`guildid`) AS member_count ,`leader`.`race` IN (1, 3, 4, 7, 11) AS fraction , `leader`.`guid` AS leader 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.';'); while($row = $sql->fetch_assoc()) { $DbResult = $db2->query('SELECT COUNT(*) AS online_mem FROM `guild_member`, `characters`, `guild` WHERE guild.guildid = '.$row['guildid'].' AND guild_member.guildid = guild.guildid AND guild_member.guid = characters.guid AND characters.online = 1'); $online_mem = $DbResult->fetch_assoc(); $DbResult = $db->query('SELECT Homepage FROM GuildInfo WHERE Guild='.$row['guildid'].' AND Realm='.$Realm->Id); $DbRow = $DbResult->fetch_assoc(); $Homepage = $DbRow['Homepage']; $date_arr = explode(' ', $row['createdate']); $date = explode('-', $date_arr[0]); $time_stp = explode(':', $date_arr[1]); $time = mktime($time_stp[0], $time_stp[1], $time_stp[2], $date[1], $date[2], $date[0]); $human_date = date('d.m.Y H:i:s', $time); echo(''. ''. ''. ''. ''. ''. ''. ''); } echo('
'.MakeLink('', 'fraction').''.MakeLink('Jméno spolku', 'name').''.MakeLink('Celkem členů', 'member_count').'Členů onlineGuild master'.MakeLink('Webové stránky', 'homepage').'
'.FrakceImg($row['fraction']).''.$row['name'].''.$row['member_count'].''.$online_mem['online_mem'].''.$Realm->GuidToCharName($row['leader']).''.GuildPages($Homepage, $row['name']).'
'); } } else echo('Musíte vybrat svět'); ?>