public function set_NewsInfo()
{
$news_settings = $this->get_news_settings();
$locale = fusion_get_locale('', NEWS_LOCALE);
set_title(SiteLinks::get_current_SiteLinks("", "link_name"));
add_breadcrumb(array('link' => INFUSIONS . 'news/news.php', 'title' => SiteLinks::get_current_SiteLinks("", "link_name")));
$info = array('news_cat_id' => intval(0), 'news_cat_name' => $locale['news_0007'], 'news_cat_image' => '', 'news_cat_language' => LANGUAGE, 'news_categories' => array(), 'news_image' => '', 'news_item_rows' => 0, 'news_last_updated' => 0, 'news_items' => array());
$info['allowed_filters'] = array('recent' => $locale['news_0011'], 'comment' => $locale['news_0012'], 'rating' => $locale['news_0013']);
foreach ($info['allowed_filters'] as $type => $filter_name) {
$filter_link = INFUSIONS . "news/news.php?" . (isset($_GET['cat_id']) ? "cat_id=" . $_GET['cat_id'] . "&" : '') . "type=" . $type;
$info['news_filter'][$filter_link] = $filter_name;
unset($filter_link);
}
/* News Category */
$result = dbquery("SELECT news_cat_id, news_cat_name FROM " . DB_NEWS_CATS . "\n " . (multilang_table("NS") ? "WHERE news_cat_language='" . LANGUAGE . "'" : '') . " ORDER BY news_cat_id ASC");
if (dbrows($result) > 0) {
while ($cdata = dbarray($result)) {
$info['news_categories'][$cdata['news_cat_id']] = array('link' => INFUSIONS . 'news.php?cat_id=' . $cdata['news_cat_id'], 'name' => $cdata['news_cat_name']);
}
}
$max_news_rows = dbcount("(news_id)", DB_NEWS, groupaccess('news_visibility') . " AND (news_start='0'||news_start<=NOW())\n\t\tAND (news_end='0'||news_end>=NOW()) AND news_draft='0'");
if ($max_news_rows) {
$info['news_total_rows'] = $max_news_rows;
// Xss
$_GET['rowstart'] = isset($_GET['rowstart']) && isnum($_GET['rowstart']) && $_GET['rowstart'] <= $max_news_rows ? intval($_GET['rowstart']) : 0;
$result = dbquery($this->get_NewsQuery());
$info['news_item_rows'] = dbrows($result);
if ($info['news_item_rows'] > 0) {
$news_count = 0;
while ($data = dbarray($result)) {
$news_count++;
if ($news_count == 1) {
$info['news_last_updated'] = $data['news_datestamp'];
}
$news_info[$news_count] = self::get_NewsData($data);
}
$info['news_items'] = $news_info;
}
}
$this->info = $info;
return (array) $info;
}