2017-12-20 20:49:11 +00:00
<!DOCTYPE html>
< html lang = "fr" >
<? include('blocks/d.head.html'); ?>
< body >
<? include('blocks/d.nav.html'); ?>
2018-11-05 21:05:42 +00:00
< section id = "blog_article" < ? = $ blogArticle- > is_archive=="t"||$blogArticle->is_public=="f"?'class="archive"':''?>>
2018-11-05 21:51:13 +00:00
< h1 > <?=$blogArticle->name?> < / h1 >
2018-11-05 21:34:48 +00:00
<? if($user->rankIsHigher('premium')) { ?>
2017-12-20 20:49:11 +00:00
< span class = "subtitle" >
2018-11-05 21:34:48 +00:00
<? if(isset($blogHistory)) { ?>
2017-12-20 20:49:11 +00:00
< select id = "bloghistory" >
< ? $i = 0;
2018-11-05 21:34:48 +00:00
foreach ($blogHistory->objs as $row) { ?>
2019-01-30 20:03:48 +00:00
< option < ? = $ row- > version_id==$blogArticle->version_id?'selected':''?> value="<?=$i?> "><?=$row->is_archive=="f"?'• ':''?> <? echo strftime('%d/%m/%Y %H:%M:%S',strtotime($row->update_date)) ?> < / option >
2017-12-20 20:49:11 +00:00
< ? $i++;
} ?>
< / select >
< ? }
2018-11-05 21:34:48 +00:00
if ($user->rankIsHigher('moderator') & & isset($blogHistory)) { ?>
2017-12-20 20:49:11 +00:00
—
< ? }
2018-11-05 21:05:42 +00:00
if ($user->rankIsHigher("moderator")) { ?>
< a href = "<?=$config['rel_root_folder']?>blog/<?=$blogArticle->permalink?>/edit" > < i class = "fas fa-pencil-alt" > < / i > Éditer l'article< / a > —
<? if ($blogArticle->is_public == 't') { ?>
< a href = "<?=$config['rel_root_folder']?>blog/<?=$blogArticle->permalink?>/delete" > < i class = "fas fa-trash" > < / i > Effacer l'article< / a >
<? } else { ?>
< a href = "<?=$config['rel_root_folder']?>blog/<?=$blogArticle->permalink?>/restore" > < i class = "fas fa-eye" > < / i > Restaurer l'article< / a >
2017-12-20 20:49:11 +00:00
<? } ?>
<? } ?>
< / span >
<? } ?>
< div id = "blogContent" >
<?=$blogArticle->content_html?>
< / div >
< p id = "blogTimestamp" > Article écrit par
2018-11-05 21:05:42 +00:00
<? if ($user->rankIsHigher("blocked")) { ?>
2017-12-20 20:49:11 +00:00
< a href = "<?=$config['rel_root_folder']?>user/p/<?=$blogArticle->author?>" > <?=$blogArticle->author_name?> < / a >
< ? }
else { ?>
<?=$blogArticle->author_name?>
<? } ?>
2018-11-05 21:05:42 +00:00
le <? echo strftime('%e %B %G, %kh%Mm%Ss',strtotime($blogArticle->creation_date)) ?> < small > < abbr title = "Temps Universel Coordonné" > UTC< / abbr > < / small > < / p >
2017-12-20 20:49:11 +00:00
<!-- COMMENTS -->
2019-01-30 20:09:43 +00:00
<? if ($blogArticle->is_commentable == "t") { ?>
2017-12-20 20:49:11 +00:00
< div id = "new_comment" >
2018-11-05 21:05:42 +00:00
< form class = "form" action = "<?=$config['rel_root_folder']?>blog/<?=$blogArticle->permalink?>/new_comment" method = "post" >
< div id = "new_comment_label" < ? = $ user- > rank=="visitor"?"class='sent' ":""?>>
2019-01-30 20:09:43 +00:00
<? if ($blogArticle->is_archive == "t" || $blogArticle->is_public == "f") { ?>
< p > Impossible de commenter un article non publié< / p >
<? } else if ($user->rankIsHigher("registered")) { ?>
2017-12-20 20:49:11 +00:00
< input name = "submit" type = "submit" value = "Envoyer" >
< p > Ajouter un nouveau commentaire< / p >
<? } else { ?>
< p > Veuillez vous connecter pour ajouter un commentaire< / p >
<? } ?>
< / div >
< div id = "new_comment_form" >
< textarea id = "comment" name = "comment" rows = "5" placeholder = "Votre commentaire" > < / textarea >
< / div >
< / form >
< / div >
2018-11-18 20:59:55 +00:00
< ? if($blogArticle->is_commentable == 't') {
foreach ($blogArticles_comments->objs as $comment) { ?>
2017-12-20 20:49:11 +00:00
2018-11-18 20:59:55 +00:00
< article < ? if ( $ comment- > is_archive == 't' || $comment->is_public == 'f') echo 'class="comment_archive" '; ?>>
2017-12-20 20:49:11 +00:00
< div class = "comment_title" >
2018-11-18 20:59:55 +00:00
<? if ($comment->author_obj->is_avatar_present=='t') { ?>
< img alt = "Avatar" class = "icon avatar" src = "<?=$config['rel_root_folder']?>medias/avatars/<?=$comment->author_obj->id?>_s.jpg" >
2017-12-20 20:49:11 +00:00
<? } else { ?>
2018-11-05 21:05:42 +00:00
< i class = "icon fas fa-user-secret" > < / i >
2017-12-20 20:49:11 +00:00
<? } ?>
2018-11-05 21:05:42 +00:00
<? if ($user->rankIsHigher("blocked")) { ?>
2018-11-18 20:59:55 +00:00
< a class = "username" href = "<?=$config['rel_root_folder']?>user/p/<?=$comment->author_obj->id?>" > <?=$comment->author_obj->name?> < / a >
2017-12-20 20:49:11 +00:00
<? } else { ?>
2018-11-18 20:59:55 +00:00
<?=$comment->author_obj->name?>
2017-12-20 20:49:11 +00:00
<? } ?>
2018-11-18 20:59:55 +00:00
le <? echo strftime('%e %B %G, %kh%Mm%Ss',strtotime($comment->update_date)) ?> < small > < abbr title = "Temps Universel Coordonné" > UTC< / abbr > < / small >
<? if (($user->rankIsHigher("moderator") || $user->id == $comment->author) && $comment->is_public == 't') { ?>
< span class = "delete_link" > < a href = "<?=$config['rel_root_folder']?>blog/<?=$blogArticle->permalink?>/delete_comment/<?=$comment->id?>" > < i class = "fas fa-trash" > < / i > Effacer le commentaire< / a > < / span >
2017-12-20 20:49:11 +00:00
<? } ?>
2018-11-18 20:59:55 +00:00
<? if (($user->rankIsHigher("moderator") || $user->id == $comment->author) && $comment->is_public == 'f') { ?>
< span class = "delete_link" > < a href = "<?=$config['rel_root_folder']?>blog/<?=$blogArticle->permalink?>/restore_comment/<?=$comment->id?>" > < i class = "fas fa-eye" > < / i > Restaurer le commentaire< / a > < / span >
2017-12-20 20:49:11 +00:00
<? } ?>
< / div >
< div class = "comment_content" >
2018-11-18 20:59:55 +00:00
<?=$comment->comment_html?>
2017-12-20 20:49:11 +00:00
< / div >
< / article >
< ? }
}
} ?>
< br >
< br >
< div style = "clear: both;" > < / div >
< / section >
2018-11-05 21:05:42 +00:00
<? if($user->rankIsHigher("premium")) { ?>
2017-12-20 20:49:11 +00:00
< script type = "text/javascript" >
$( "#bloghistory" ).change(function() {
2018-11-05 21:05:42 +00:00
window.location.href = "<?=$config['rel_root_folder']?> blog/<?=$blogArticle->permalink?> /"+$( this ).val();
2017-12-20 20:49:11 +00:00
});
< / script >
<? } ?>
2019-01-30 20:09:43 +00:00
<? if($user->rankIsHigher("registered") && $blogArticle->is_archive == "f" && $blogArticle->is_public == "t") { ?>
2017-12-20 20:49:11 +00:00
< script type = "text/javascript" >
$( "#new_comment_label" ).click(function() {
$( "#new_comment_form" ).show(400);
$( "#new_comment_label input" ).show(0);
$( "#new_comment_label").addClass('sent');
});
< / script >
<? } ?>
<? include('blocks/d.footer.html'); ?>
< / body >
< / html >