FIX - дата публикайии поста
This commit is contained in:
parent
ab17fd7452
commit
9469558a36
|
|
@ -131,11 +131,19 @@ class ArticleController extends Controller
|
||||||
$article->author = App::$user->id;
|
$article->author = App::$user->id;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (isset($_POST['save']) && $_POST['save'] == 'published') {
|
||||||
|
if ($article->status != 'published' || $article->pubDate == 0) {
|
||||||
|
$article->pubDate = time();
|
||||||
|
}
|
||||||
|
$article->status = 'published';
|
||||||
|
} else {
|
||||||
|
$article->status = 'draft';
|
||||||
|
}
|
||||||
|
|
||||||
$article->title = $title ? $title : 'Без названия';
|
$article->title = $title ? $title : 'Без названия';
|
||||||
$article->text = $text;
|
$article->text = $text;
|
||||||
$article->html = $html;
|
$article->html = $html;
|
||||||
$article->status = (isset($_POST['save']) && $_POST['save'] == 'published') ? 'published' : 'draft';
|
$article->status = (isset($_POST['save']) && $_POST['save'] == 'published') ? 'published' : 'draft';
|
||||||
$article->pubDate = time();
|
|
||||||
$article->photoId = Helper::getFirstImg($text);
|
$article->photoId = Helper::getFirstImg($text);
|
||||||
$article->allowComments = $allowComments;
|
$article->allowComments = $allowComments;
|
||||||
$article->save();
|
$article->save();
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue