diff options
author | root <root@adnab.me> | 2014-01-31 17:59:33 +0100 |
---|---|---|
committer | root <root@adnab.me> | 2014-01-31 17:59:33 +0100 |
commit | 2a274c011d177f5ad1e863301b8b88c560a3829d (patch) | |
tree | b9570b1809a12cd386d7f4db8e72d414518fccfc /tpl/blog | |
parent | 1ed8a37bea8882cd3a1aa0f421dbc15493a781a0 (diff) | |
download | Bits-2a274c011d177f5ad1e863301b8b88c560a3829d.tar.gz Bits-2a274c011d177f5ad1e863301b8b88c560a3829d.zip |
Style bizarre
Diffstat (limited to 'tpl/blog')
-rw-r--r-- | tpl/blog/index.php | 37 |
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">'; |