post.html.php 5.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110
  1. <?php if (!defined('HTMLY')) die('HTMLy'); ?>
  2. <article>
  3. <div class="blog-header">
  4. <?php if(!empty($post->link)) { ?>
  5. <h1>
  6. <a href="<?php echo $post->link;?>" target="_blank"><?php echo $post->title;?>
  7. <svg xmlns="http://www.w3.org/2000/svg" height="28" width="28" fill="currentColor" class="icon icon-tabler bi bi-link" viewBox="0 0 16 16"><path d="M6.354 5.5H4a3 3 0 0 0 0 6h3a3 3 0 0 0 2.83-4H9q-.13 0-.25.031A2 2 0 0 1 7 10.5H4a2 2 0 1 1 0-4h1.535c.218-.376.495-.714.82-1z"/><path d="M9 5.5a3 3 0 0 0-2.83 4h1.098A2 2 0 0 1 9 6.5h3a2 2 0 1 1 0 4h-1.535a4 4 0 0 1-.82 1H12a3 3 0 1 0 0-6z"/></svg>
  8. </a>
  9. </h1>
  10. <?php } else {?>
  11. <h1><?php echo $post->title;?></h1>
  12. <?php } ?>
  13. <p>
  14. <small>
  15. <?php echo i18n('posted_on');?> <?php echo format_date($post->date);?>
  16. <?php echo i18n('by');?>
  17. <a class="stretched-link position-relative" href="<?php echo $post->authorUrl;?>"><?php echo $post->authorName;?></a>
  18. <span class="mx-2">—</span>
  19. <strong>
  20. <svg xmlns="http://www.w3.org/2000/svg" class="icon icon-tabler icon-tabler-clock" width="24" height="24" viewBox="0 0 24 24" stroke-width="2" stroke="currentcolor" fill="none" stroke-linecap="round" stroke-linejoin="round"><path stroke="none" d="M0 0h24v24H0z" fill="none"></path><path d="M3 12a9 9 0 1018 0A9 9 0 003 12"></path><path d="M12 7v5l3 3"></path></svg>
  21. <?php echo $post->readTime;?> min
  22. </strong>
  23. <?php if (authorized($post)) { echo ' <span class="mx-2">—</span> <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentcolor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-edit-2"><path d="M17 3a2.828 2.828.0 114 4L7.5 20.5 2 22l1.5-5.5L17 3z"></path></svg> <span class="edit-post"><a href="'. $post->url .'/edit?destination=post">' . i18n('Edit') . '</a></span>'; } ?>
  24. </small>
  25. </p>
  26. </div>
  27. <div class="content-media">
  28. <?php if(!empty($post->image)):?>
  29. <img alt="<?php echo $post->title;?>" src="<?php echo $post->image;?>"/>
  30. <?php endif;?>
  31. <?php if(!empty($post->video)):?>
  32. <iframe width="100%" height="315px" class="embed-responsive-item" src="https://www.youtube.com/embed/<?php echo get_video_id($post->video); ?>" frameborder="0" allowfullscreen></iframe>
  33. <?php endif;?>
  34. <?php if(!empty($post->audio)):?>
  35. <iframe width="100%" height="200px" class="embed-responsive-item" scrolling="no" frameborder="no" src="https://w.soundcloud.com/player/?url=<?php echo $post->audio;?>&amp;auto_play=false&amp;visual=true"></iframe>
  36. <?php endif;?>
  37. <?php if(!empty($post->quote)):?>
  38. <div class="quote"><blockquote class="quote"><?php echo $post->quote ?></blockquote></div>
  39. <?php endif;?>
  40. </div>
  41. <div class="content-body post-<?php echo $p->date;?>" id="content">
  42. <?php echo $post->body;?>
  43. <p class="post-footer">
  44. <small>
  45. <svg xmlns="http://www.w3.org/2000/svg" width="18" height="18" fill="currentColor" class="icon bi bi-folder" viewBox="0 0 18 18"><path d="M.54 3.87.5 3a2 2 0 0 1 2-2h3.672a2 2 0 0 1 1.414.586l.828.828A2 2 0 0 0 9.828 3h3.982a2 2 0 0 1 1.992 2.181l-.637 7A2 2 0 0 1 13.174 14H2.826a2 2 0 0 1-1.991-1.819l-.637-7a2 2 0 0 1 .342-1.31zM2.19 4a1 1 0 0 0-.996 1.09l.637 7a1 1 0 0 0 .995.91h10.348a1 1 0 0 0 .995-.91l.637-7A1 1 0 0 0 13.81 4zm4.69-1.707A1 1 0 0 0 6.172 2H2.5a1 1 0 0 0-1 .981l.006.139q.323-.119.684-.12h5.396z"/></svg>
  46. <span class="cat-meta"><?php echo $post->category;?></span>
  47. <svg xmlns="http://www.w3.org/2000/svg" width="18" height="18" fill="currentColor" class="bi bi-tag" viewBox="0 0 18 18"><path d="M6 4.5a1.5 1.5 0 1 1-3 0 1.5 1.5 0 0 1 3 0m-1 0a.5.5 0 1 0-1 0 .5.5 0 0 0 1 0"/><path d="M2 1h4.586a1 1 0 0 1 .707.293l7 7a1 1 0 0 1 0 1.414l-4.586 4.586a1 1 0 0 1-1.414 0l-7-7A1 1 0 0 1 1 6.586V2a1 1 0 0 1 1-1m0 5.586 7 7L13.586 9l-7-7H2z"/></svg>
  48. <span class="tag-meta"><?php echo $post->tag;?></span>
  49. </small>
  50. </p>
  51. </div>
  52. <div class="related docs-navigation">
  53. <small>
  54. <strong><?php echo i18n("Related_posts");?></strong>
  55. <?php echo get_related($post->related);?>
  56. </small>
  57. </div>
  58. </article>
  59. <?php if (disqus()): ?>
  60. <?php echo disqus($post->title, $post->url) ?>
  61. <?php endif; ?>
  62. <?php if (facebook() || disqus()): ?>
  63. <div class="comments-area" id="comments">
  64. <?php if (facebook()): ?>
  65. <div class="fb-comments" data-href="<?php echo $post->url ?>" data-numposts="<?php echo config('fb.num') ?>" data-colorscheme="<?php echo config('fb.color') ?>"></div>
  66. <?php endif; ?>
  67. <?php if (disqus()): ?>
  68. <div id="disqus_thread"></div>
  69. <?php endif; ?>
  70. </div>
  71. <?php endif; ?>
  72. <?php if (!empty($next) || !empty($prev)): ?>
  73. <div class="docs-navigation d-flex justify-content-between">
  74. <?php if (!empty($next)): ?>
  75. <a href="<?php echo($next['url']); ?>">
  76. <div class="card my-1">
  77. <div class="card-body py-2">
  78. ← <?php echo i18n('next_post');?>
  79. </div>
  80. </div>
  81. </a>
  82. <?php endif;?>
  83. <?php if (!empty($prev)): ?>
  84. <a class="ms-auto" href="<?php echo($prev['url']); ?>">
  85. <div class="card my-1">
  86. <div class="card-body py-2">
  87. <?php echo i18n('prev_post');?> →
  88. </div>
  89. </div>
  90. </a>
  91. <?php endif;?>
  92. </div>
  93. <?php endif;?>