home.php 10.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225
  1. <!DOCTYPE html>
  2. <html lang='<?=$page->lang?>'>
  3. <head>
  4. <meta content='text/html; charset=utf-8' http-equiv='content-type'/>
  5. <meta charset='utf-8'/>
  6. <meta name='viewport' content='width=device-width, initial-scale=1, maximum-scale=1, minimum-scale=1'/>
  7. <title><?=$page->title?></title>
  8. <link rel='shortcut icon' href='<?=$page->favicon?>'/>
  9. <!-- CSS files -->
  10. <link rel='stylesheet' type='text/css' href='<?=$static["css"]?>ui.css'/>
  11. <link rel='stylesheet' type='text/css' href='<?=$static["css"]?>home.css'/>
  12. <!-- Script files -->
  13. <script type='text/javascript' src='<?=$static["script"]?>ui.js'></script>
  14. <script type='text/javascript' src='<?=$static["script"]?>home.js'></script>
  15. <!-- Meta tags -->
  16. <link rel='canonical' href='<?=$page->canonical?>'/>
  17. <link rel='author' href='<?=$page->author?>'/>
  18. <link rel='publisher' href='<?=$page->author?>'/>
  19. <meta name='description' content='<?=$page->description?>'/>
  20. <meta property='og:title' content='<?=$page->title?>'/>
  21. <meta property='og:url' content='<?=$page->canonical?>'/>
  22. <meta property='og:description' content='<?=$page->description?>'/>
  23. <meta property='og:image' content='<?=$page->icon?>'/>
  24. <meta property='og:site_name' content='<?=$page->name?>'/>
  25. <meta property='og:type' content='website'/>
  26. <meta property='og:locale' content='<?=$page->lang?>'/>
  27. <meta name='twitter:card' content='summary'/>
  28. <meta name='twitter:title' content='<?=$page->title?>'/>
  29. <meta name='twitter:description' content='<?=$page->description?>'/>
  30. <meta name='twitter:image' content='<?=$page->icon?>'/>
  31. <meta name='twitter:url' content='<?=$page->canonical?>'/>
  32. <meta name='robots' content='index follow'/>
  33. </head>
  34. <body>
  35. <?php
  36. include $path["include"] . "header.php";
  37. ?>
  38. <main>
  39. <!-- TODO: Festivals -->
  40. <?php
  41. if (sizeof($page->future) > 0){
  42. ?>
  43. <section id='future'>
  44. <h3>
  45. <?=$page->string["activities_upcoming"]?>
  46. </h3>
  47. <?php
  48. foreach($page->future as $activity) {
  49. ?>
  50. <article>
  51. <h4>
  52. <a href='<?=$base_url?>/actividades/<?=$activity->permalink?>'><?=$activity->title?></a>
  53. </h4>
  54. <h5>
  55. <?=$activity->city?> - <?=format_date($activity->date, $page->lang, false)?>
  56. </h5>
  57. <?php
  58. if (sizeof($activity->image) > 0){
  59. ?>
  60. <a href='<?=$base_url?>/actividades/<?=$activity->permalink?>'>
  61. <img alt='<?=$activity->title?>' title='<?=$activity->title?>' src='<?=$static["content"]?>actividades/<?=$activity->image[0]->image?>' srcset='<?=srcset("blog/" . $activity->image[0]->image)?>'/>
  62. </a>
  63. <?php
  64. } // if (strlen($activity->image) > 0)
  65. ?>
  66. <p>
  67. <?=cut_text($activity->text, 100, $page->string["keep_reading"], $base_url . "/actividades/" . $activity->permalink)?>
  68. </p>
  69. <div class='details'>
  70. <div class='details_tags'>
  71. <?php
  72. $tags = "";
  73. foreach($activity->tag as $tag) {
  74. $tags = $tags . $tag . ", ";
  75. }
  76. substr($tags, 0, strlen($tags) - 2);
  77. ?>
  78. <?=$tags?>
  79. </div>
  80. <div class='details_comments'>
  81. <?php
  82. $comment = "";
  83. if (sizeof($activity->comment) == 1){
  84. $comments = $page->string["comment_1"];
  85. }
  86. else if (sizeof($activity->comment) == 0){
  87. $comments = $page->string["comment_0"];
  88. }
  89. else{
  90. $comments = str_replace("#", sizeof($activity->comment), $page->string["comment_n"]);
  91. }
  92. ?>
  93. <?=$comments?>
  94. </div>
  95. </div>
  96. </article>
  97. <?php
  98. } // foreach($page->future as $activity)
  99. ?>
  100. </section>
  101. <?php
  102. }
  103. ?>
  104. <section id='past'>
  105. <h3>
  106. <?=$page->string['activities_latest']?>
  107. </h3>
  108. <?php
  109. foreach($page->past as $activity) {
  110. ?>
  111. <article>
  112. <h4>
  113. <a href='<?=$base_url?>/actividades/<?=$activity->permalink?>'><?=$activity->title?></a>
  114. </h4>
  115. <h5>
  116. <?=$activity->city?> - <?=format_date($activity->date, $page->lang, false)?>
  117. </h5>
  118. <?php
  119. if (sizeof($activity->image) > 0){
  120. ?>
  121. <a href='<?=$base_url?>/actividades/<?=$activity->permalink?>'>
  122. <img alt='<?=$activity->title?>' title='<?=$activity->title?>' src='<?=$static["content"]?>actividades/<?=$activity->image[0]->image?>' srcset='<?=srcset("blog/" . $activity->image[0]->image)?>'/>
  123. </a>
  124. <?php
  125. } // if (strlen($activity->image) > 0)
  126. ?>
  127. <p>
  128. <?=cut_text($activity->text, 100, $page->string["keep_reading"], $base_url . "/actividades/" . $activity->permalink)?>
  129. </p>
  130. <div class='details'>
  131. <div class='details_tags'>
  132. <?php
  133. $tags = "";
  134. foreach($activity->tag as $tag) {
  135. $tags = $tags . $tag . ", ";
  136. }
  137. substr($tags, 0, strlen($tags) - 2);
  138. ?>
  139. <?=$tags?>
  140. </div>
  141. <div class='details_comments'>
  142. <?php
  143. $comment = "";
  144. if (sizeof($activity->comment) == 1){
  145. $comments = $page->string["comment_1"];
  146. }
  147. else if (sizeof($activity->comment) == 0){
  148. $comments = $page->string["comment_0"];
  149. }
  150. else{
  151. $comments = str_replace("#", sizeof($activity->comment), $page->string["comment_n"]);
  152. }
  153. ?>
  154. <?=$comments?>
  155. </div>
  156. </div>
  157. </article>
  158. <?php
  159. } // foreach($page->future as $activity)
  160. ?>
  161. </section> <!-- #past -->
  162. <section id='blog'>
  163. <h3>
  164. <?=$page->string["blog_latest"]?>
  165. </h3>
  166. <?php
  167. foreach($page->post as $post) {
  168. ?>
  169. <article>
  170. <h4>
  171. <a href='<?=$base_url?>/blog/<?=$post->permalink?>'><?=$post->title?></a>
  172. </h4>
  173. <?php
  174. if (sizeof($post->image) > 0){
  175. ?>
  176. <a href='<?=$base_url?>/blog/<?=$post->permalink?>'>
  177. <img alt='<?=$post->title?>' title='<?=$post->title?>' src='<?=$static["content"]?>blog/<?=$post->image[0]->image?>' srcset='<?=srcset("blog/" . $post->image[0]->image)?>'/>
  178. </a>
  179. <?php
  180. } // if (strlen($post->image) > 0)
  181. ?>
  182. <p>
  183. <?=cut_text($post->text, 100, $page->string["keep_reading"], $base_url . "/blog/" . $post->permalink)?>
  184. </p>
  185. <div class='details'>
  186. <div class='details_date'>
  187. <?=format_date($post->dtime, $page->lang, false)?>
  188. </div>
  189. <div class='details_tags'>
  190. <?php
  191. $tags = "";
  192. foreach($post->tag as $tag) {
  193. $tags = $tags . $tag . ", ";
  194. }
  195. substr($tags, 0, strlen($tags) - 2);
  196. ?>
  197. <?=$tags?>
  198. </div>
  199. <div class='details_comments'>
  200. <?php
  201. $comment = "";
  202. if (sizeof($post->comment) == 1){
  203. $comments = $page->string["comment_1"];
  204. }
  205. else if (sizeof($post->comment) == 0){
  206. $comments = $page->string["comment_0"];
  207. }
  208. else{
  209. $comments = $comments = str_replace("#", sizeof($post->comment), $page->string["comment_n"]);
  210. }
  211. ?>
  212. <?=$comments?>
  213. </div>
  214. </div>
  215. </article>
  216. <?php
  217. } foreach($page->post as $post)
  218. ?>
  219. </section> <!-- #blog -->
  220. </main>
  221. <?php
  222. include $path["include"] . "footer.php";
  223. ?>
  224. </body>
  225. </html>