user-posts.html.php 2.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. <?php if (!defined('HTMLY')) die('HTMLy'); ?>
  2. <h2 class="post-index"><?php echo $heading ?></h2>
  3. <br>
  4. <a class="btn btn-primary right" href="<?php echo site_url();?>admin/content"><?php echo i18n('Add_new_post');?></a>
  5. <br><br>
  6. <?php if (!empty($posts)) { ?>
  7. <table class="table post-list">
  8. <thead>
  9. <tr class="head">
  10. <th><?php echo i18n('Title');?></th>
  11. <th><?php echo i18n('Published');?></th>
  12. <?php if (config("views.counter") == "true"): ?>
  13. <th><?php echo i18n('Views');?></th>
  14. <?php endif; ?>
  15. <th><?php echo i18n('Category');?></th>
  16. <th><?php echo i18n('Tags');?></th>
  17. <th><?php echo i18n('Operations');?></th>
  18. </tr>
  19. </thead>
  20. <tbody>
  21. <?php foreach ($posts as $p): ?>
  22. <tr>
  23. <td><a target="_blank" href="<?php echo $p->url ?>"><?php echo $p->title ?></a></td>
  24. <td><?php echo format_date($p->date) ?></td>
  25. <?php if (config("views.counter") == "true"): ?>
  26. <td><?php echo $p->views ?></td>
  27. <?php endif; ?>
  28. <td><a href="<?php echo site_url() . 'admin/categories/' . $p->categorySlug; ?>"><?php echo $p->categoryTitle;?></a></td>
  29. <td><?php echo str_replace('rel="tag"', 'rel="tag" class="badge badge-light text-primary font-weight-normal"', $p->tag); ?></td>
  30. <td><a class="btn btn-primary btn-xs" href="<?php echo $p->url ?>/edit?destination=admin/mine"><?php echo i18n('Edit');?></a> <a class="btn btn-danger btn-xs" href="<?php echo $p->url ?>/delete?destination=admin/mine"><?php echo i18n('Delete');?></a></td>
  31. </tr>
  32. <?php endforeach; ?>
  33. </tbody>
  34. </table>
  35. <?php if (!empty($pagination['prev']) || !empty($pagination['next'])): ?>
  36. <br>
  37. <div class="pager">
  38. <ul class="pagination">
  39. <?php if (!empty($pagination['prev'])) { ?>
  40. <li class="newer page-item"><a class="page-link" href="?page=<?php echo $page - 1 ?>" rel="prev">&#8592; <?php echo i18n('Newer');?></a></li>
  41. <?php } else { ?>
  42. <li class="page-item disabled" ><span class="page-link">&#8592; <?php echo i18n('Newer');?></span></li>
  43. <?php } ?>
  44. <li class="page-number page-item disabled"><span class="page-link"><?php echo $pagination['pagenum'];?></span></li>
  45. <?php if (!empty($pagination['next'])) { ?>
  46. <li class="older page-item" ><a class="page-link" href="?page=<?php echo $page + 1 ?>" rel="next"><?php echo i18n('Older');?> &#8594;</a></li>
  47. <?php } else { ?>
  48. <li class="page-item disabled" ><span class="page-link"><?php echo i18n('Older');?> &#8594;</span></li>
  49. <?php } ?>
  50. </ul>
  51. </div>
  52. <?php endif; ?>
  53. <?php } else {
  54. echo i18n('No_posts_found') . '!';
  55. } ?>