Обработка статуса статьи draft
This commit is contained in:
parent
ee6dc8cc92
commit
585312eb15
|
|
@ -27,6 +27,10 @@ class ArticleController extends Controller
|
||||||
App::error404();
|
App::error404();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ($article->status == 'draft' && (!App::$user || App::$user->id != $article->author)) {
|
||||||
|
App::error404();
|
||||||
|
}
|
||||||
|
|
||||||
App::setConfig('title', $article->title . ' – wikipoints.ru');
|
App::setConfig('title', $article->title . ' – wikipoints.ru');
|
||||||
$article->html = Helper::replaceLinks($article->html, 'html');
|
$article->html = Helper::replaceLinks($article->html, 'html');
|
||||||
$article->html = Helper::replaceImgs($article->html, 'html');
|
$article->html = Helper::replaceImgs($article->html, 'html');
|
||||||
|
|
|
||||||
|
|
@ -154,7 +154,7 @@ class IndexController extends Controller
|
||||||
$url->addChild('changefreq', "daily");
|
$url->addChild('changefreq', "daily");
|
||||||
$url->addChild('priority', "0.9");
|
$url->addChild('priority', "0.9");
|
||||||
|
|
||||||
$articles = Article::model()->getAll(array('where'=>'`author` != 0', 'order' => 'ID DESC', 'asArray' => true));
|
$articles = Article::model()->getAll(array('where'=>'`author` != 0 AND (`status` = "published" OR `status` = "system") ', 'order' => 'ID DESC', 'asArray' => true));
|
||||||
foreach ($articles as $article) {
|
foreach ($articles as $article) {
|
||||||
$url = $xml->addChild('url');
|
$url = $xml->addChild('url');
|
||||||
$url->addChild('loc', 'http://wikipoints.ru/article/' . $article['id']);
|
$url->addChild('loc', 'http://wikipoints.ru/article/' . $article['id']);
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue