post.php 5.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120
  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'>
  40. <h3>
  41. <?=$page->post->title?>
  42. </h3>
  43. <article>
  44. <?php
  45. if (sizeof($page->post->image) > 0){
  46. ?>
  47. <img id='main_image' alt='<?=$page->post->title?>' title='<?=$page->post->title?>' src='<?=$static["content"]?>blog/<?=$page->post->image[0]->image?>' srcset='<?=srcset("blog/" . $page->post->image[0]->image)?>'/>
  48. <?php
  49. }
  50. ?>
  51. <p>
  52. <?=$page->post->text?>
  53. </p>
  54. <div id='details'>
  55. <div class='post_details_date'>
  56. <?=format_date($page->post->dtime, $page->lang, false)?>
  57. </div>
  58. <!--<div class='post_details_tags'>
  59. <?php
  60. $tags = "";
  61. foreach($page->post->tag as $tag) {
  62. $tags = $tags . $tag . ", ";
  63. }
  64. substr($tags, 0, strlen($tags) - 2);
  65. ?>
  66. <?=$tags?>
  67. </div>-->
  68. </div>
  69. <div id='comments'>
  70. <?php
  71. $comment = "";
  72. if (sizeof($page->post->comment) == 1){
  73. $comments = $page->string["comment_1"];
  74. }
  75. else if (sizeof($page->post->comment) == 0){
  76. $comments = $page->string["comment_0"];
  77. }
  78. else{
  79. $comments = str_replace("#", sizeof($page->post->comment), $page->string["comment_n"]);
  80. }
  81. ?>
  82. <?=$comments?>
  83. <?php
  84. foreach ($page->post->comment as $comment){
  85. ?>
  86. <div id='comment_<?=$comment->id?>' class='comment'>
  87. <span class='comment_user'>
  88. <!-- <?=$comment->username?> -->
  89. </span>
  90. <span class='comment_date date'>
  91. <?=format_date($comment->dtime, $page->lang)?>
  92. </span>
  93. <p class='comment_text'>
  94. <?=$comment->text?>
  95. </p>
  96. </div>
  97. <?php
  98. }
  99. ?>
  100. </div>
  101. <div class='comment' id='comment_new'>
  102. <form id='comment_form' method='post' action='/' onsubmit='event.preventDefault();postComment($id, "<?=$page->lang?>");'>
  103. <textarea id='new_comment_text' name='text' maxlength='1800' onChange='dissmiss_comment_error();' onKeyDown='dissmiss_comment_error();' placeholder='<?=$page->string["comment_form_text"]?>'>
  104. </textarea>
  105. <input type='hidden' name='id' value='<?=$page->post->id?>'/>
  106. <br/>
  107. <div id='identification_form'>
  108. <input id='new_comment_user' name='user' maxlength='50' type='text' placeholder='<?=$page->string["comment_form_name"]?>' onChange='dissmiss_comment_error();' onKeyDown='dissmiss_comment_error();'/>
  109. <input type='submit' value='<?=$page->string["comment_form_send"]?>'/>
  110. </div>
  111. </form>
  112. </div>
  113. </article>
  114. </section>
  115. </main>
  116. <?php
  117. include $path["include"] . "footer.php";
  118. ?>
  119. </body>
  120. </html>