profile.html.php 5.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100
  1. <?php if (!defined('HTMLY')) die('HTMLy'); ?>
  2. <div class="row justify-content-center" style="padding-top: 4rem;">
  3. <div class="col-md-12 text-center">
  4. <h1 class="mt-0"><?php echo $author->name;?></h1>
  5. </div>
  6. <div class="col-md-12 text-center">
  7. <div class="lead"><?php echo $author->about;?></div>
  8. </div>
  9. </div>
  10. <?php $teaserType = config('teaser.type'); $readMore = config('read.more');?>
  11. <?php if (!empty($posts)):?>
  12. <?php foreach ($posts as $post):?>
  13. <?php $img = get_image($post->body);?>
  14. <article>
  15. <div class="card-list">
  16. <div class="card">
  17. <?php if (!empty($post->image)) {?>
  18. <a href="<?php echo $post->url;?>"><img alt="<?php echo $post->title;?>" src="<?php echo $post->image;?>" width="100%"></a>
  19. <?php } elseif (!empty($img) && $teaserType === 'trimmed' && empty($post->quote) && empty($post->video) && empty($post->audio)) {?>
  20. <a href="<?php echo $post->url;?>"><img alt="<?php echo $post->title;?>" src="<?php echo $img;?>" width="100%"></a>
  21. <?php } ?>
  22. <?php if(!empty($post->video)):?>
  23. <iframe width="100%" height="315px" class="embed-responsive-item media-wrapper" src="https://www.youtube.com/embed/<?php echo get_video_id($post->video); ?>" frameborder="0" allowfullscreen></iframe>
  24. <?php endif;?>
  25. <?php if(!empty($post->audio)):?>
  26. <iframe width="100%" height="200px" class="embed-responsive-item media-wrapper" scrolling="no" frameborder="no" src="https://w.soundcloud.com/player/?url=<?php echo $post->audio;?>&amp;auto_play=false&amp;visual=true"></iframe>
  27. <?php endif;?>
  28. <?php if(!empty($post->quote)):?>
  29. <div class="quote">
  30. <blockquote class="quote"><?php echo $post->quote ?></blockquote>
  31. </div>
  32. <?php endif;?>
  33. <div class="card-body">
  34. <?php if(!empty($post->link)) { ?>
  35. <h2>
  36. <a class="text-body" href="<?php echo $post->link;?>" target="_blank"><?php echo $post->title;?>
  37. <svg xmlns="http://www.w3.org/2000/svg" width="28" height="28" fill="currentColor" class="bi bi-link-45deg" viewBox="0 0 16 16"><path d="M4.715 6.542 3.343 7.914a3 3 0 1 0 4.243 4.243l1.828-1.829A3 3 0 0 0 8.586 5.5L8 6.086a1 1 0 0 0-.154.199 2 2 0 0 1 .861 3.337L6.88 11.45a2 2 0 1 1-2.83-2.83l.793-.792a4 4 0 0 1-.128-1.287z"/><path d="M6.586 4.672A3 3 0 0 0 7.414 9.5l.775-.776a2 2 0 0 1-.896-3.346L9.12 3.55a2 2 0 1 1 2.83 2.83l-.793.792c.112.42.155.855.128 1.287l1.372-1.372a3 3 0 1 0-4.243-4.243z"/></svg>
  38. </a>
  39. </h2>
  40. <?php } else {?>
  41. <h2><a class="text-body" href="<?php echo $post->url;?>"><?php echo $post->title;?></a></h2>
  42. <?php } ?>
  43. <div class="content-body">
  44. <?php echo get_teaser($post->body, $post->url); ?>
  45. <?php if ($teaserType === 'trimmed'):?>[...] <a class="more-link" href="<?php echo $post->url; ?>"><?php echo $readMore; ?></a><?php endif;?>
  46. </div>
  47. <p>
  48. <small>
  49. <?php echo i18n('posted_on');?> <?php echo format_date($post->date);?>
  50. <?php echo i18n('by');?>
  51. <a class="position-relative" href="<?php echo $post->authorUrl;?>">
  52. <?php echo $post->authorName;?>
  53. </a>
  54. <span class="mx-2">—</span>
  55. <strong>
  56. <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>
  57. <?php echo $post->readTime;?> min
  58. </strong>
  59. <?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>'; } ?>
  60. </small>
  61. </p>
  62. </div>
  63. </div>
  64. </div>
  65. </article>
  66. <?php endforeach;?>
  67. <?php endif;?>
  68. <?php if (!empty($pagination['next']) || !empty($pagination['prev'])): ?>
  69. <div class="docs-navigation d-flex justify-content-between">
  70. <?php if (!empty($pagination['prev'])): ?>
  71. <a href="?page=<?php echo $page - 1 ?>">
  72. <div class="card my-1">
  73. <div class="card-body py-2">
  74. ← <?php echo i18n('Newer');?>
  75. </div>
  76. </div>
  77. </a>
  78. <?php endif;?>
  79. <?php if (!empty($pagination['next'])): ?>
  80. <a class="ms-auto" href="?page=<?php echo $page + 1 ?>">
  81. <div class="card my-1">
  82. <div class="card-body py-2">
  83. <?php echo i18n('Older');?> →
  84. </div>
  85. </div>
  86. </a>
  87. <?php endif;?>
  88. </div>
  89. <?php endif;?>