guild.php 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287
  1. <?php
  2. global $GUILD_MEMBER_GRADE;
  3. global $ARENA_RANKING_POINTS;
  4. global $ARENA_RANKING_RANK;
  5. ?>
  6. <!DOCTYPE html>
  7. <html lang='en'>
  8. <head>
  9. <meta content='text/html; charset=utf-8' http-equiv='content-type'/>
  10. <meta name='viewport' content='width=device-width, initial-scale=1, maximum-scale=1, minimum-scale=1'/>
  11. <title><?=$page->title?></title>
  12. <link rel='shortcut icon' href='<?=$page->favicon?>'/>
  13. <!-- CSS files -->
  14. <link rel='stylesheet' type='text/css' href='<?=$path["css"]?>ui.css'/>
  15. <link rel='stylesheet' type='text/css' href='<?=$path["css"]?>guild.css'/>
  16. <!-- Script files -->
  17. <script src="<?=$path["js"]?>ui.js"></script>
  18. <!-- Meta tags -->
  19. <link rel='canonical' href='<?=$page->canonical?>'/>
  20. <link rel='author' href='<?=$page->author?>'/>
  21. <link rel='publisher' href='<?=$page->author?>'/>
  22. <meta name='description' content='<?=$page->description?>'/>
  23. <meta property='og:title' content='<?=$page->title?>'/>
  24. <meta property='og:url' content='<?=$page->canonical?>'/>
  25. <meta property='og:description' content='<?=$page->description?>'/>
  26. <meta property='og:image' content='<?=$page->icon?>'/>
  27. <meta property='og:site_name' content='<?=$page->name?>'/>
  28. <meta property='og:type' content='website'/>
  29. <meta property='og:locale' content='en'/>
  30. <meta name='twitter:card' content='summary'/>
  31. <meta name='twitter:title' content='<?=$page->title?>'/>
  32. <meta name='twitter:description' content='<?=$page->description?>'/>
  33. <meta name='twitter:image' content='<?=$page->icon?>'/>
  34. <meta name='twitter:url' content='<?=$page->canonical?>'/>
  35. <meta name='robots' content='index follow'/>
  36. </head>
  37. <body>
  38. <?php
  39. include __DIR__ . "/inc/header.php";
  40. if (!isset($page->guild)){
  41. ?>
  42. <section id='no_guild'>
  43. <h2>
  44. Guild
  45. </h2>
  46. You are not currently in a guild.
  47. </section>
  48. <?php
  49. }
  50. else{
  51. ?>
  52. <section id='guild_info' class='content'>
  53. <h2>
  54. <?=$page->guild->name?>
  55. </h2>
  56. <div id='guild_details'>
  57. <span id='guild_level'>
  58. Lv. <?=$page->guild->level?>
  59. </span>
  60. <span id='guild_experience'>
  61. (Exp: <?=$page->guild->experience?>)
  62. </span>
  63. <p id='guild_comment'>
  64. <?=$page->guild->comment?>
  65. </p>
  66. <p id='guild_notice'>
  67. <?=$page->guild->notice?>
  68. </p>
  69. <div id='guild_skills'>
  70. <?php
  71. foreach ($page->skill_groups as $group){
  72. ?>
  73. <div class='skill_group'>
  74. <span class='skill_group_title'>
  75. <?=$group->name?>
  76. </span>
  77. <img class='skill_group_image' alt='<?=$group->name?>' src='<?=$group->get_image()?>'/>
  78. <ul>
  79. <li class='description'>
  80. <?=$group->description?>
  81. </li>
  82. <?php
  83. foreach ($group->skills as $skill){
  84. if ($skill->level > $page->guild->level){
  85. $unavailable = "unavailable";
  86. }
  87. else{
  88. $unavailable = "";
  89. }
  90. ?>
  91. <li class='<?=$unavailable?>'>
  92. Lv. <?=$skill->level?>: <?=$skill->effect?>
  93. </li>
  94. <?php
  95. }
  96. ?>
  97. </ul>
  98. </div>
  99. <?php
  100. }
  101. ?>
  102. </div>
  103. </div>
  104. <table id='guild_members'>
  105. <tr>
  106. <th>
  107. &nbsp;
  108. </th>
  109. <th>
  110. Name
  111. </th>
  112. <th>
  113. Lv.
  114. </th>
  115. <th colspan='2'>
  116. Arena
  117. </th>
  118. <th>
  119. War
  120. </th>
  121. <th>
  122. Def
  123. </th>
  124. <th>
  125. Login
  126. </th>
  127. </tr>
  128. <?php
  129. $odd = "";
  130. foreach ($page->guild->members as $member){
  131. ?>
  132. <tr>
  133. <td class='grade <?=$odd?>'>
  134. <?php
  135. if ($member->grade == $GUILD_MEMBER_GRADE["LEADER"]){
  136. ?>
  137. <img alt='yes' src='<?=$path["img"]["icon"] . "leader.png"?>'/>
  138. <?php
  139. }
  140. elseif ($member->grade == $GUILD_MEMBER_GRADE["VICELEADER"]){
  141. ?>
  142. <img alt='yes' src='<?=$path["img"]["icon"] . "viceleader.png"?>'/>
  143. <?php
  144. }
  145. ?>
  146. </td>
  147. <td class='name <?=$odd?>'>
  148. <?=$member->name?>
  149. </td>
  150. <td class='level <?=$odd?>'>
  151. <?=$member->level?>
  152. </td>
  153. <td class='score <?=$odd?>'>
  154. <?=$member->arena_score?>
  155. </td>
  156. <td class='score_icon <?=$odd?>'>
  157. <?php
  158. if ($member->arena_score >= $ARENA_RANKING_POINTS["BEGINER"] && ($ARENA_RANKING_RANK["BEGINER"] == null || $member->rating <= $ARENA_RANKING_RANK["BEGINER"])){
  159. $src = $path["img"]["icon"] . "rank_beg.png";
  160. $tit = "Beginer";
  161. }
  162. if ($member->arena_score >= $ARENA_RANKING_POINTS["CHALLENGER_1"] && ($ARENA_RANKING_RANK["CHALLENGER_1"] == null || $member->rating <= $ARENA_RANKING_RANK["CHALLENGER_1"])){
  163. $src = $path["img"]["icon"] . "rank_cha1.png";
  164. $tit = "Challenger 1";
  165. }
  166. if ($member->arena_score >= $ARENA_RANKING_POINTS["CHALLENGER_2"] && ($ARENA_RANKING_RANK["CHALLENGER_2"] == null || $member->rating <= $ARENA_RANKING_RANK["CHALLENGER_2"])){
  167. $src = $path["img"]["icon"] . "rank_cha2.png";
  168. $tit = "Challenger 2";
  169. }
  170. if ($member->arena_score >= $ARENA_RANKING_POINTS["CHALLENGER_3"] && ($ARENA_RANKING_RANK["CHALLENGER_3"] == null || $member->rating <= $ARENA_RANKING_RANK["CHALLENGER_3"])){
  171. $src = $path["img"]["icon"] . "rank_cha3.png";
  172. $tit = "Challenger 3";
  173. }
  174. if ($member->arena_score >= $ARENA_RANKING_POINTS["FIGHTER_1"] && ($ARENA_RANKING_RANK["FIGHTER_1"] == null || $member->rating <= $ARENA_RANKING_RANK["FIGHTER_1"])){
  175. $src = $path["img"]["icon"] . "rank_fig1.png";
  176. $tit = "Fighter 1";
  177. }
  178. if ($member->arena_score >= $ARENA_RANKING_POINTS["FIGHTER_2"] && ($ARENA_RANKING_RANK["FIGHTER_2"] == null || $member->rating <= $ARENA_RANKING_RANK["FIGHTER_2"])){
  179. $src = $path["img"]["icon"] . "rank_fig2.png";
  180. $tit = "Fighter 2";
  181. }
  182. if ($member->arena_score >= $ARENA_RANKING_POINTS["FIGHTER_3"] && ($ARENA_RANKING_RANK["FIGHTER_3"] == null || $member->rating <= $ARENA_RANKING_RANK["FIGHTER_3"])){
  183. $src = $path["img"]["icon"] . "rank_fig3.png";
  184. $tit = "Fighter 3";
  185. }
  186. if ($member->arena_score >= $ARENA_RANKING_POINTS["CONQUEROR_1"] && ($ARENA_RANKING_RANK["CONQUEROR_1"] == null || $member->rating <= $ARENA_RANKING_RANK["CONQUEROR_1"])){
  187. $src = $path["img"]["icon"] . "rank_con1.png";
  188. $tit = "Conqueror 1";
  189. }
  190. if ($member->arena_score >= $ARENA_RANKING_POINTS["CONQUEROR_2"] && ($ARENA_RANKING_RANK["CONQUEROR_2"] == null || $member->rating <= $ARENA_RANKING_RANK["CONQUEROR_2"])){
  191. $src = $path["img"]["icon"] . "rank_con2.png";
  192. $tit = "Conqueror 2";
  193. }
  194. if ($member->arena_score >= $ARENA_RANKING_POINTS["CONQUEROR_3"] && ($ARENA_RANKING_RANK["CONQUEROR_3"] == null || $member->rating <= $ARENA_RANKING_RANK["CONQUEROR_3"])){
  195. $src = $path["img"]["icon"] . "rank_con3.png";
  196. $tit = "Conqueror 3";
  197. }
  198. if ($member->arena_score >= $ARENA_RANKING_POINTS["GUARDIAN_1"] && ($ARENA_RANKING_RANK["GUARDIAN_1"] == null || $member->rating <= $ARENA_RANKING_RANK["GUARDIAN_1"])){
  199. $src = $path["img"]["icon"] . "rank_gua1.png";
  200. $tit = "Guardian 1";
  201. }
  202. if ($member->arena_score >= $ARENA_RANKING_POINTS["GUARDIAN_2"] && ($ARENA_RANKING_RANK["GUARDIAN_2"] == null || $member->rating <= $ARENA_RANKING_RANK["GUARDIAN_2"])){
  203. $src = $path["img"]["icon"] . "rank_gua2.png";
  204. $tit = "Guardian 2";
  205. }
  206. if ($member->arena_score >= $ARENA_RANKING_POINTS["GUARDIAN_3"] && ($ARENA_RANKING_RANK["GUARDIAN_3"] == null || $member->rating <= $ARENA_RANKING_RANK["GUARDIAN_3"])){
  207. $src = $path["img"]["icon"] . "rank_gua3.png";
  208. $tit = "Guardian 3";
  209. }
  210. if ($member->arena_score >= $ARENA_RANKING_POINTS["LEGEND"] && ($ARENA_RANKING_RANK["LEGEND"] == null || $member->rating <= $ARENA_RANKING_RANK["LEGEND"])){
  211. $src = $path["img"]["icon"] . "rank_leg.png";
  212. $tit = "Legend";
  213. }
  214. ?>
  215. <img alt='<?=$tit?>' src='<?=$src?>'/>
  216. </td>
  217. <td class='war <?=$odd?>'>
  218. <?php
  219. if ($member->in_war){
  220. ?>
  221. <img alt='yes' src='<?=$path["img"]["icon"] . "ok.png"?>'/>
  222. <?php
  223. }
  224. ?>
  225. </td>
  226. <td class='defense <?=$odd?>'>
  227. <?php
  228. if ($member->has_defense){
  229. ?>
  230. <img alt='yes' src='<?=$path["img"]["icon"] . "ok.png"?>'/>
  231. <?php
  232. }
  233. ?>
  234. </td>
  235. <?php
  236. $now = time();
  237. $date = (new DateTime("@$member->last_login"))->format('Y-m-d H:i:s');
  238. $days = $now - strtotime($date);
  239. $days = floor($days / (60 * 60 * 24));
  240. if ($days == 0){
  241. $hours = floor($days / (60 * 60));
  242. if ($hours == 0){
  243. $last_login = "Online";
  244. }
  245. else if ($hours == 1){
  246. $last_login = "1 hour";
  247. }
  248. else{
  249. $last_login = floor($days / (60 * 60)) . " hours";
  250. }
  251. $warning = "";
  252. }
  253. else{
  254. $last_login = "$days days";
  255. if ($days < 2){
  256. $last_login = "$days day";
  257. $warning = "";
  258. }
  259. elseif ($days < 5){
  260. $warning = "warning";
  261. }
  262. else{
  263. $warning = "danger";
  264. }
  265. }
  266. ?>
  267. <td class='last_login <?=$odd?> <?=$warning?>'>
  268. <?=$last_login?>
  269. </td>
  270. </tr>
  271. <?php
  272. if ($odd == ""){
  273. $odd = "odd";
  274. }
  275. else{
  276. $odd = "";
  277. }
  278. }
  279. ?>
  280. </table>
  281. </section>
  282. <?php
  283. }
  284. include __DIR__ . "/inc/footer.php";
  285. ?>
  286. </body>
  287. </html>