main.html.php 1.6 KB

1234567891011121314151617181920212223242526272829303132
  1. <?php if (!defined('HTMLY')) die('HTMLy'); ?>
  2. <?php echo '<h2>' . i18n('Your_recent_posts') . '</h2>';?>
  3. <br>
  4. <a class="btn btn-primary right" href="<?php echo site_url();?>admin/content"><?php echo i18n('Add_content');?></a>
  5. <br><br>
  6. <?php
  7. if (isset($_SESSION[site_url()]['user'])) {
  8. $posts = get_profile_posts($_SESSION[site_url()]['user'], 1, 10);
  9. if (!empty($posts)) {
  10. $posts = $posts[0];
  11. echo '<table class="table post-list">';
  12. echo '<tr class="head"><th>' . i18n('Title') . '</th><th>' . i18n('Published') . '</th>';
  13. if (config("views.counter") == "true")
  14. echo '<th>'.i18n('Views').'</th>';
  15. echo '<th>' . i18n('Category') . '</th><th>' . i18n('Tags') . '</th><th>' . i18n('Operations') . '</th></tr>';
  16. foreach ($posts as $p) {
  17. echo '<tr>';
  18. echo '<td><a target="_blank" href="' . $p->url . '">' . $p->title . '</a></td>';
  19. echo '<td>' . format_date($p->date) . '</td>';
  20. if (config("views.counter") == "true")
  21. echo '<td>' . $p->views . '</td>';
  22. echo '<td><a href="' . site_url() . 'admin/categories/' . $p->categorySlug . '">'. $p->categoryTitle .'</a></td>';
  23. echo '<td>' . str_replace("rel=\"tag\"", "rel=\"tag\" class=\"badge badge-light text-primary font-weight-normal\"", $p->tag) . '</td>';
  24. echo '<td><a class="btn btn-primary btn-xs" href="' . $p->url . '/edit?destination=admin">' . i18n('Edit') . '</a> <a class="btn btn-danger btn-xs" href="' . $p->url . '/delete?destination=admin">' . i18n('Delete') . '</a></td>';
  25. echo '</tr>';
  26. }
  27. echo '</table>';
  28. }
  29. }
  30. ?>