blog.php 4.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102
  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"]?>blog.css'/>
  12. <!-- Script files -->
  13. <script type='text/javascript' src='<?=$static["script"]?>ui.js'></script>
  14. <script type='text/javascript' src='<?=$static["script"]?>blog.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. <section id='post_list'>
  40. <h3>
  41. <?=$page->title?>
  42. </h3>
  43. <?php
  44. foreach($page->post as $post) {
  45. ?>
  46. <article>
  47. <h4>
  48. <a href='<?=$base_url?>/blog/<?=$post->permalink?>'><?=$post->title?></a>
  49. </h4>
  50. <?php
  51. if (sizeof($post->image) > 0){
  52. ?>
  53. <a href='<?=$base_url?>/blog/<?=$post->permalink?>'>
  54. <img alt='<?=$post->title?>' title='<?=$post->title?>' src='<?=$static["content"]?>blog/<?=$post->image[0]->image?>' srcset='<?=srcset("blog/" . $post->image[0]->image)?>'/>
  55. </a>
  56. <?php
  57. } // if (strlen($post->image) > 0)
  58. ?>
  59. <p>
  60. <?=cut_text($post->text, 350, $page->string["keep_reading"], $base_url . "/blog/" . $post->permalink)?>
  61. </p>
  62. <div class='post_details'>
  63. <div class='post_details_date'>
  64. <?=format_date($post->dtime, $page->lang, false)?>
  65. </div>
  66. <!--<div class='post_details_tags'>
  67. <?php
  68. $tags = "";
  69. foreach($post->tag as $tag) {
  70. $tags = $tags . $tag . ", ";
  71. }
  72. substr($tags, 0, strlen($tags) - 2);
  73. ?>
  74. <?=$tags?>
  75. </div>-->
  76. <div class='post_details_comments'>
  77. <?php
  78. $comment = "";
  79. if (sizeof($post->comment) == 1){
  80. $comments = $page->string["comment_1"];
  81. }
  82. else if (sizeof($post->comment) == 0){
  83. $comments = $page->string["comment_0"];
  84. }
  85. else{
  86. $comments = str_replace("#", sizeof($post->comment), $page->string["comment_n"]);
  87. }
  88. ?>
  89. <?=$comments?>
  90. </div>
  91. </div>
  92. </article>
  93. <?php
  94. } // foreach($array as $item)
  95. ?>
  96. </section>
  97. </main>
  98. <?php
  99. include $path["include"] . "footer.php";
  100. ?>
  101. </body>
  102. </html>