summaryrefslogtreecommitdiff
path: root/tpl
diff options
context:
space:
mode:
Diffstat (limited to 'tpl')
-rw-r--r--tpl/blog/index.php37
1 files changed, 21 insertions, 16 deletions
diff --git a/tpl/blog/index.php b/tpl/blog/index.php
index 712b205..b70a80a 100644
--- a/tpl/blog/index.php
+++ b/tpl/blog/index.php
@@ -10,22 +10,27 @@ if ($can_post) {
echo '<div class="ordering_links">' . filters_html_full() . '</div>';
-foreach ($posts as $post) {
- echo '<div class="blog_post">';
- echo '<div class="small_right">écrit par ' . $post['owner'];
- if ($can_edit && $post['owner_id'] == $user['id'])
- echo ' | <a href="edit-blog-' . $post['id'] . '">modifier</a>';
- if ($can_delete && $post['owner_id'] == $user['id'])
- echo ' | <a href="delete-blog-' . $post['id'] . '">supprimer</a>';
- echo ' | <a href="view-blog-' . $post['id'] . '">lire & commenter (' . $post['comments'] . ')</a>';
- echo '</div>';
- echo '<div class="small_right">published ' . $post['date'] . '</div>';
- if ($post['tags'] != '') {
- echo '<div class="small_right">tags: ' . $post['tags'] . '</div>';
- }
- echo '<h2>' . $post['title'] . '</h2>';
- echo '<div class="inside">' . $post['text_html'] . '</div>';
- echo '</div>';
+
+if(count($posts) == 0) {
+ echo "<div class=\"message\">Aucun article trouvé.</div>";
+} else {
+ echo '<table><tr><th style="width: 70%"></th><th>Tags</th><th>Date</th><th>Auteur</th></tr>';
+ foreach ($posts as $post) {
+ echo '<tr><td><a href="view-blog-'.$post['id'].'">' . $post['title'] . '</a> <div class="small_right">';
+ $k = array();
+ if ($can_edit && $post['owner_id'] == $user['id'])
+ $k[] = '<a href="edit-blog-' . $post['id'] . '">modifier</a>';
+ if ($can_delete && $post['owner_id'] == $user['id'])
+ $k[] = '<a href="delete-blog-' . $post['id'] . '">supprimer</a>';
+ echo implode(' | ', $k);
+ echo '</div>';
+ echo '<td style="text-align: center"><span class="tool_link">' . $post['tags'] . '</span></td>';
+ echo '<td style="text-align: center">' . $post['date'] . '</td>';
+ echo '<td style="text-align: center">' . $post['owner'] . '</td>';
+ echo '</tr>';
+ }
+
+ echo '</table>';
}
echo '</div><div class="contents-left">';