guild.php 14 KB

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