blob: e453a19a4424b64ad87f7cca7719f9869a29a30e (
plain) (
tree)
|
|
<?php
$title = $post['title'];
require("tpl/general/top.php");
echo '<div class="small_align_right">';
echo 'Écrit par ' . $post['owner'];
if ($can_edit && $post['owner_id'] == $user['id'])
echo ' | <a href="?p=edit-blog-' . $post['id'] . '">modifier</a>';
if ($can_delete && $post['owner_id'] == $user['id'])
echo ' | <a href="?p=delete-blog-' . $post['id'] . '">supprimer</a>';
if ($can_comment && !$is_draft)
echo ' | <a href="?p=comment-blog-' . $post['id'] . '">commenter</a>';
if ($is_draft)
echo ' | <a href="?p=publish-blog-' . $post['id'] . '">publier</a>';
echo '</div>';
echo '<div class="small_align_right">publié le ' . $post['date'] . '</div>';
if ($post['tags'] != '') {
echo '<div class="small_align_right">tags: ' . $post['tags'] . '</div>';
}
echo $post['text_html'];
if (!$is_draft) {
echo '<h2>Commentaires</h2>';
if (count($comments) == 0) {
echo 'Pas de commentaires pour l\'instant.';
} else {
foreach ($comments as $comment) {
echo '<div class="blog_post">';
$a = array();
if ($can_delcom) $a[] = '<a href="?p=delcom-blog-' . $comment['id'] . '">supprimer</a>';
if ($can_comment && $comment['author_id'] == $user['id'])
$a[] = '<a href="?p=edcom-blog-' . $comment['id'] . '">modifier</a>';
if (count($a) > 0)
echo '<div class="small_right">' . implode(" | ", $a) . '</div>';
echo '<h3>' . $comment['date'] . ' par ' . $comment['author'] . '</h3>';
echo '<div class="inside">' . $comment['text_html'] . '</div>';
echo '</div>';
}
}
echo '<h3>Écrire un commentaire</h3>';
if ($can_comment) {
echo '<form class="blog_post" method="POST" action="index.php?p=comment-blog-' . $post['id'] . '"><textarea name="comment" style="height: 200px"></textarea><br /><div class="empty_label"> </div><input type="submit" value="Enregistrer" /></form>';
} else {
echo 'Veuillez vous identifier pour poster un commentaire.';
}
}
require("tpl/general/bottom.php");
|