post.php 5.8 KB

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