mirror of
https://github.com/slawkens/myaac.git
synced 2025-11-20 09:16:23 +01:00
Don't display hidden news for admin - it's confusing
This commit is contained in:
@@ -122,7 +122,7 @@ if(!$news_cached)
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
$tickers_db = $db->query('SELECT * FROM `' . TABLE_PREFIX . 'news` WHERE `type` = ' . TICKER .($canEdit ? '' : ' AND `hide` != 1') .' ORDER BY `date` DESC LIMIT ' . setting('core.news_ticker_limit'));
|
$tickers_db = $db->query('SELECT * FROM `' . TABLE_PREFIX . 'news` WHERE `type` = ' . TICKER . ' AND `hide` != 1 ORDER BY `date` DESC LIMIT ' . setting('core.news_ticker_limit'));
|
||||||
$tickers_content = '';
|
$tickers_content = '';
|
||||||
if($tickers_db->rowCount() > 0)
|
if($tickers_db->rowCount() > 0)
|
||||||
{
|
{
|
||||||
@@ -142,7 +142,8 @@ if(!$news_cached)
|
|||||||
if($cache->enabled() && !$canEdit)
|
if($cache->enabled() && !$canEdit)
|
||||||
$cache->set('news_' . $template_name . '_' . TICKER, $tickers_content, 60 * 60);
|
$cache->set('news_' . $template_name . '_' . TICKER, $tickers_content, 60 * 60);
|
||||||
|
|
||||||
$featured_article_db =$db->query('SELECT `id`, `title`, `article_text`, `article_image`, `hide` FROM `' . TABLE_PREFIX . 'news` WHERE `type` = ' . ARTICLE . ($canEdit ? '' : ' AND `hide` != 1') .' ORDER BY `date` DESC LIMIT 1');
|
$featured_article_db =$db->query('SELECT `id`, `title`, `article_text`, `article_image`, `hide` FROM `' . TABLE_PREFIX . 'news` WHERE `type` = ' . ARTICLE . ' AND `hide` != 1 ORDER BY `date` DESC LIMIT 1');
|
||||||
|
|
||||||
$article = '';
|
$article = '';
|
||||||
if($featured_article_db->rowCount() > 0) {
|
if($featured_article_db->rowCount() > 0) {
|
||||||
$article = $featured_article_db->fetch();
|
$article = $featured_article_db->fetch();
|
||||||
@@ -175,7 +176,7 @@ else {
|
|||||||
if(!$news_cached)
|
if(!$news_cached)
|
||||||
{
|
{
|
||||||
ob_start();
|
ob_start();
|
||||||
$newses = $db->query('SELECT * FROM ' . $db->tableName(TABLE_PREFIX . 'news') . ' WHERE type = ' . NEWS . ($canEdit ? '' : ' AND hide != 1') . ' ORDER BY date' . ' DESC LIMIT ' . setting('core.news_limit'));
|
$newses = $db->query('SELECT * FROM ' . $db->tableName(TABLE_PREFIX . 'news') . ' WHERE type = ' . NEWS . ' AND hide != 1 ORDER BY date' . ' DESC LIMIT ' . setting('core.news_limit'));
|
||||||
if($newses->rowCount() > 0)
|
if($newses->rowCount() > 0)
|
||||||
{
|
{
|
||||||
foreach($newses as $news)
|
foreach($newses as $news)
|
||||||
|
|||||||
Reference in New Issue
Block a user