| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326 |
- <?php
- /**
- * Guild view.
- *
- * Contains the view layout and some code to present the data.
- *
- * @category View
- * @var Guild_Page $page The page model.
- */
- ?>
- <!DOCTYPE html>
- <html lang='en'>
- <head>
- <meta content='text/html; charset=utf-8' http-equiv='content-type'/>
- <meta name='viewport' content='width=device-width, initial-scale=1, maximum-scale=1, minimum-scale=1'/>
- <title><?=$page->title?></title>
- <link rel='shortcut icon' href='<?=$page->favicon?>'/>
- <!-- CSS files -->
- <link rel='stylesheet' type='text/css' href='<?=URL::CSS?>ui.css'/>
- <?php
- if ($MODE == GAME_MODE_ID::RTA){
- ?>
- <link rel='stylesheet' type='text/css' href='<?=URL::CSS?>ui-rta.css'/>
- <?php
- }
- ?>
- <link rel='stylesheet' type='text/css' href='<?=URL::CSS?>guild.css'/>
- <!-- Meta tags -->
- <link rel='canonical' href='<?=$page->canonical?>'/>
- <link rel='author' href='<?=$page->author?>'/>
- <link rel='publisher' href='<?=$page->author?>'/>
- <meta name='description' content='<?=$page->description?>'/>
- <meta property='og:title' content='<?=$page->title?>'/>
- <meta property='og:url' content='<?=$page->canonical?>'/>
- <meta property='og:description' content='<?=$page->description?>'/>
- <meta property='og:image' content='<?=$page->icon?>'/>
- <meta property='og:site_name' content='<?=$page->name?>'/>
- <meta property='og:type' content='website'/>
- <meta property='og:locale' content='en'/>
- <meta name='twitter:card' content='summary'/>
- <meta name='twitter:title' content='<?=$page->title?>'/>
- <meta name='twitter:description' content='<?=$page->description?>'/>
- <meta name='twitter:image' content='<?=$page->icon?>'/>
- <meta name='twitter:url' content='<?=$page->canonical?>'/>
- <meta name='robots' content='index follow'/>
- </head>
- <body>
- <?php
- include __DIR__ . "/inc/header.php";
- ?>
- <aside>
- <?php
- if (!isset($page->guild)){
- ?>
- <h2>
- Guild
- </h2>
- <p>
- You are not currently in a guild.
- </p>
- <?php
- }
- else{
- ?>
- <h2>
- <?=$page->guild->name?>
- </h2>
- <span id='guild_level'>
- Lv. <?=$page->guild->level?>
- </span>
- <span id='guild_experience'>
- (Exp: <?=$page->guild->experience?>)
- </span>
- <p id='guild_comment'>
- <?=$page->guild->comment?>
- </p>
- <p id='guild_notice'>
- <?=$page->guild->notice?>
- </p>
- <?php
- }
- ?>
- </aside>
- <main>
- <?php
- if (!isset($page->guild)){
- ?>
- <section id='no_guild'>
- <h2>
- Guild
- </h2>
- You are not currently in a guild.
- </section>
- <?php
- }
- else{
- ?>
- <section id='guild_info' class='content'>
- <h2>
- <?=$page->guild->name?>
- </h2>
- <div id='guild_details'>
- <div id='guild_skills'>
- <?php
- foreach ($page->skill_groups as $group){
- ?>
- <div class='skill_group'>
- <span class='skill_group_title'>
- <?=$group->name?>
- </span>
- <img class='skill_group_image' alt='<?=$group->name?>' src='<?=$group->get_image()?>'/>
- <div class='skill_group_content'>
- <span class='description'>
- <?=$group->description?>
- </span>
- <ul>
- <?php
- foreach ($group->skills as $skill){
- if ($skill->level > $page->guild->level){
- $unavailable = "unavailable";
- }
- else{
- $unavailable = "";
- }
- ?>
- <li class='<?=$unavailable?>'>
- Lv. <?=$skill->level?>: <?=$skill->effect?>
- </li>
- <?php
- }
- ?>
- </ul>
- </div>
- </div>
- <?php
- }
- ?>
- </div>
- </div>
- <table id='guild_members'>
- <tr>
- <th>
-
- </th>
- <th>
- Name
- </th>
- <th>
- Lv.
- </th>
- <th colspan='2'>
- Arena
- </th>
- <th>
- War
- </th>
- <th>
- Def
- </th>
- <th>
- Login
- </th>
- </tr>
- <?php
- $odd = "";
- foreach ($page->guild->members as $member){
- ?>
- <tr>
- <td class='grade <?=$odd?>'>
- <?php
- if ($member->grade == GUILD_MEMBER_GRADE_ID::LEADER){
- ?>
- <img alt='yes' src='<?=URL::IMG["ICON"] . "leader.png"?>'/>
- <?php
- }
- elseif ($member->grade == GUILD_MEMBER_GRADE_ID::VICELEADER){
- ?>
- <img alt='yes' src='<?=URL::IMG["ICON"] . "viceleader.png"?>'/>
- <?php
- }
- ?>
- </td>
- <td class='name <?=$odd?>'>
- <?=$member->name?>
- </td>
- <td class='level <?=$odd?>'>
- <?=$member->level?>
- </td>
- <td class='score <?=$odd?>'>
- <?=$member->arena_score?>
- </td>
- <td class='score_icon <?=$odd?>'>
- <?php
- if ($member->arena_score >= ARENA_RANKING_POINTS::BEGINER && (ARENA_RANKING_RANK::BEGINER == null || $member->rating <= ARENA_RANKING_RANK::BEGINER)){
- $src = URL::IMG["RANK"] . "0900.png";
- $tit = "Beginer";
- }
- if ($member->arena_score >= ARENA_RANKING_POINTS::CHALLENGER_1 && (ARENA_RANKING_RANK::CHALLENGER_1 == null || $member->rating <= ARENA_RANKING_RANK::CHALLENGER_1)){
- $src = URL::IMG["RANK"] . "1001.png";
- $tit = "Challenger 1";
- }
- if ($member->arena_score >= ARENA_RANKING_POINTS::CHALLENGER_2 && (ARENA_RANKING_RANK::CHALLENGER_2 == null || $member->rating <= ARENA_RANKING_RANK::CHALLENGER_2)){
- $src = URL::IMG["RANK"] . "1002.png";
- $tit = "Challenger 2";
- }
- if ($member->arena_score >= ARENA_RANKING_POINTS::CHALLENGER_3 && (ARENA_RANKING_RANK::CHALLENGER_3 == null || $member->rating <= ARENA_RANKING_RANK::CHALLENGER_3)){
- $src = URL::IMG["RANK"] . "1003.png";
- $tit = "Challenger 3";
- }
- if ($member->arena_score >= ARENA_RANKING_POINTS::FIGHTER_1 && (ARENA_RANKING_RANK::FIGHTER_1 == null || $member->rating <= ARENA_RANKING_RANK::FIGHTER_1)){
- $src = URL::IMG["RANK"] . "2001.png";
- $tit = "Fighter 1";
- }
- if ($member->arena_score >= ARENA_RANKING_POINTS::FIGHTER_2 && (ARENA_RANKING_RANK::FIGHTER_2 == null || $member->rating <= ARENA_RANKING_RANK::FIGHTER_2)){
- $src = URL::IMG["RANK"] . "2002.png";
- $tit = "Fighter 2";
- }
- if ($member->arena_score >= ARENA_RANKING_POINTS::FIGHTER_3 && (ARENA_RANKING_RANK::FIGHTER_3 == null || $member->rating <= ARENA_RANKING_RANK::FIGHTER_3)){
- $src = URL::IMG["RANK"] . "2003.png";
- $tit = "Fighter 3";
- }
- if ($member->arena_score >= ARENA_RANKING_POINTS::CONQUEROR_1 && (ARENA_RANKING_RANK::CONQUEROR_1 == null || $member->rating <= ARENA_RANKING_RANK::CONQUEROR_1)){
- $src = URL::IMG["RANK"] . "3001.png";
- $tit = "Conqueror 1";
- }
- if ($member->arena_score >= ARENA_RANKING_POINTS::CONQUEROR_2 && (ARENA_RANKING_RANK::CONQUEROR_2 == null || $member->rating <= ARENA_RANKING_RANK::CONQUEROR_2)){
- $src = URL::IMG["RANK"] . "3002.png";
- $tit = "Conqueror 2";
- }
- if ($member->arena_score >= ARENA_RANKING_POINTS::CONQUEROR_3 && (ARENA_RANKING_RANK::CONQUEROR_3 == null || $member->rating <= ARENA_RANKING_RANK::CONQUEROR_3)){
- $src = URL::IMG["RANK"] . "3003.png";
- $tit = "Conqueror 3";
- }
- if ($member->arena_score >= ARENA_RANKING_POINTS::GUARDIAN_1 && (ARENA_RANKING_RANK::GUARDIAN_1 == null || $member->rating <= ARENA_RANKING_RANK::GUARDIAN_1)){
- $src = URL::IMG["RANK"] . "4001.png";
- $tit = "Guardian 1";
- }
- if ($member->arena_score >= ARENA_RANKING_POINTS::GUARDIAN_2 && (ARENA_RANKING_RANK::GUARDIAN_2 == null || $member->rating <= ARENA_RANKING_RANK::GUARDIAN_2)){
- $src = URL::IMG["RANK"] . "4002.png";
- $tit = "Guardian 2";
- }
- if ($member->arena_score >= ARENA_RANKING_POINTS::GUARDIAN_3 && (ARENA_RANKING_RANK::GUARDIAN_3 == null || $member->rating <= ARENA_RANKING_RANK::GUARDIAN_3)){
- $src = URL::IMG["RANK"] . "4003.png";
- $tit = "Guardian 3";
- }
- if ($member->arena_score >= ARENA_RANKING_POINTS::LEGEND && (ARENA_RANKING_RANK::LEGEND == null || $member->rating <= ARENA_RANKING_RANK::LEGEND)){
- $src = URL::IMG["RANK"] . "5001.png";
- $tit = "Legend";
- }
- ?>
- <img alt='<?=$tit?>' src='<?=$src?>'/>
- </td>
- <td class='war <?=$odd?>'>
- <?php
- if ($member->in_war){
- ?>
- <img alt='yes' src='<?=URL::IMG["ICON"] . "ok.png"?>'/>
- <?php
- }
- ?>
- </td>
- <td class='defense <?=$odd?>'>
- <?php
- if ($member->has_defense){
- ?>
- <img alt='yes' src='<?=URL::IMG["ICON"] . "ok.png"?>'/>
- <?php
- }
- ?>
- </td>
- <?php
- $now = time();
- $date = (new DateTime("@$member->last_login"))->format('Y-m-d H:i:s');
- $days = $now - strtotime($date);
- $days = floor($days / (60 * 60 * 24));
- if ($days == 0){
- $hours = floor($days / (60 * 60));
- if ($hours == 0){
- $last_login = "Online";
- }
- else if ($hours == 1){
- $last_login = "1 hour";
- }
- else{
- $last_login = floor($days / (60 * 60)) . " hours";
- }
- $warning = "";
- }
- else{
- $last_login = "$days days";
- if ($days < 2){
- $last_login = "$days day";
- $warning = "";
- }
- elseif ($days < 5){
- $warning = "warning";
- }
- else{
- $warning = "danger";
- }
- }
- ?>
- <td class='last_login <?=$odd?> <?=$warning?>'>
- <?=$last_login?>
- </td>
- </tr>
- <?php
- if ($odd == ""){
- $odd = "odd";
- }
- else{
- $odd = "";
- }
- }
- ?>
- </table>
- </section>
- <?php
- }
- ?>
- </main>
- <?php
- include __DIR__ . "/inc/footer.php";
- ?>
- </body>
- </html>
|