Fix blog history view

This commit is contained in:
Léo Serre 2018-11-05 22:34:48 +01:00
parent 3ad4a6d08e
commit 41c1ea61b6
2 changed files with 7 additions and 7 deletions

View File

@ -120,8 +120,8 @@ switch ($controller->splitted_url[1]) {
else { else {
// Manage history of an article // Manage history of an article
if($user->rankIsHigher("premium")) { if($user->rankIsHigher("premium")) {
$blogArticles_history = new Kabano\BlogArticles(); $blogHistory = new Kabano\BlogArticles();
$blogArticles_history->getHistory($controller->splitted_url[1]); $blogHistory->getHistory($controller->splitted_url[1]);
} }
if (isset($controller->splitted_url[2]) && is_numeric($controller->splitted_url[2])) if (isset($controller->splitted_url[2]) && is_numeric($controller->splitted_url[2]))
$blogArticle->checkPermalink($controller->splitted_url[1],$user->rankIsHigher("premium"),$controller->splitted_url[2]); $blogArticle->checkPermalink($controller->splitted_url[1],$user->rankIsHigher("premium"),$controller->splitted_url[2]);

View File

@ -9,18 +9,18 @@
<section id="blog_article" <?=$blogArticle->is_archive=="t"||$blogArticle->is_public=="f"?'class="archive"':''?>> <section id="blog_article" <?=$blogArticle->is_archive=="t"||$blogArticle->is_public=="f"?'class="archive"':''?>>
<h1><?=$blogArticle->name?>.</h1> <h1><?=$blogArticle->name?>.</h1>
<? if($user->rankIsHigher("premium")) { ?> <? if($user->rankIsHigher('premium')) { ?>
<span class="subtitle"> <span class="subtitle">
<? if(isset($blogArticles_history_list)) { ?> <? if(isset($blogHistory)) { ?>
<select id="bloghistory"> <select id="bloghistory">
<? $i = 0; <? $i = 0;
foreach ($blogArticles_history_list as $row) { ?> foreach ($blogHistory->objs as $row) { ?>
<option <?=$row->id==$blogArticle->id?'selected':''?> value="<?=$i?>"><?=$row->archive=="f"?'&bull; ':''?><? echo strftime('%d/%m/%Y %H:%M:%S',strtotime($row->lastedit)) ?></option> <option <?=$row->id==$blogArticle->id?'selected':''?> value="<?=$i?>"><?=$row->is_archive=="f"?'&bull; ':''?><? echo strftime('%d/%m/%Y %H:%M:%S',strtotime($row->update_date)) ?></option>
<? $i++; <? $i++;
} ?> } ?>
</select> </select>
<? } <? }
if ($user->rankIsHigher("moderator") && isset($blogArticles_history_list)) { ?> if ($user->rankIsHigher('moderator') && isset($blogHistory)) { ?>
&mdash; &mdash;
<? } <? }
if ($user->rankIsHigher("moderator")) { ?> if ($user->rankIsHigher("moderator")) { ?>