hide_panel('RIGHT'); Panels::getInstance(TRUE)->hide_panel('LEFT'); Panels::getInstance(TRUE)->hide_panel('AU_CENTER'); Panels::getInstance(TRUE)->hide_panel('U_CENTER'); Panels::getInstance(TRUE)->hide_panel('L_CENTER'); Panels::getInstance(TRUE)->hide_panel('BL_CENTER'); echo '
'; echo '

'.$locale['news_0004'].'

'; echo render_breadcrumbs(); echo '
'; if (!empty($info['news_items'])) { echo '
'; echo '
'; if (!empty($info['news_last_updated'])) { echo ''.$locale['news_0008'].': '.(is_array($info['news_last_updated']) ? showdate('newsdate', $info['news_last_updated'][1]) : $info['news_last_updated']).''; } echo ''; echo ''.$locale['show'].': '; $i = 0; foreach ($info['news_filter'] as $link => $title) { $filter_active = (!isset($_GET['type']) && $i == 0) || isset($_GET['type']) && stristr($link, $_GET['type']) ? ' text-dark' : ''; echo ''.$title.''; $i++; } echo ''; echo ''; echo '
'; echo '
'; foreach ($info['news_items'] as $id => $data) { $link = INFUSIONS.'news/news.php?readmore='.$data['news_id']; echo '
'; echo '
'; echo ''; $thumb = !empty($data['news_image_optimized']) ? $data['news_image_optimized'] : get_image('imagenotfound'); echo ''.$data['news_subject'].''; echo ''; echo ''; echo '
'; echo '
'; } echo '
'; if ($info['news_total_rows'] > $news_settings['news_pagination']) { $type_start = isset($_GET['type']) ? 'type='.$_GET['type'].'&' : ''; $cat_start = isset($_GET['cat_id']) ? 'cat_id='.$_GET['cat_id'].'&' : ''; echo '
'; echo makepagenav($_GET['rowstart'], $news_settings['news_pagination'], $info['news_total_rows'], 3, INFUSIONS.'news/news.php?'.$cat_start.$type_start); echo '
'; } echo '
'; } else { echo '
'.$locale['news_0005'].'
'; } } public static function render_news_item($info) { $locale = fusion_get_locale('', MG_LOCALE); $data = $info['news_item']; Panels::getInstance(TRUE)->hide_panel('RIGHT'); Panels::getInstance(TRUE)->hide_panel('LEFT'); Panels::getInstance(TRUE)->hide_panel('AU_CENTER'); Panels::getInstance(TRUE)->hide_panel('U_CENTER'); Panels::getInstance(TRUE)->hide_panel('L_CENTER'); Panels::getInstance(TRUE)->hide_panel('BL_CENTER'); echo '
'; echo '

'.$data['news_subject'].'

'; echo render_breadcrumbs(); echo '
'; OutputHandler::addToHead(''); OutputHandler::addToFooter(''); OutputHandler::addToJQuery(' $(".news-image-overlay").colorbox({ transition: "elasic", height: "100%", width: "100%", maxWidth: "95%", maxHeight: "95%", scrolling: false, overlayClose: true, close: false, photo: true, onComplete: function(result) {$("#colorbox").live("click", function() {$(this).unbind("click");$.fn.colorbox.close();});} }); '); echo '
'; echo '
'; echo '
'; if ($data['news_image_src']) { echo ''; $position = $data['news_image_align'] == 'news-img-center' ? 'center-x m-b-10' : $data['news_image_align']; $width = $data['news_image_align'] == 'news-img-center' ? '100%' : '200px'; echo ''.$data['news_subject'].''; echo ''; } echo '
'.$data['news_news'].'
'; echo '
'; echo $data['news_extended']; echo !empty($data['news_pagenav']) ? '
'.$data['news_pagenav'].'
' : ''; echo '
'; if (!empty($data['news_gallery'])) { echo '
'; echo '

'.$locale['news_0019'].'

'; echo '
'; foreach ($data['news_gallery'] as $id => $image) { echo '
'; echo colorbox(IMAGES_N.$image['news_image'], 'Image #'.$id, TRUE); echo '
'; } echo '
'; } echo '
'; $url = (isset($_SERVER['HTTPS']) ? 'https' : 'http').'://'.$_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI']; echo '
'; echo social_media_links($url); echo '
'; echo '
'; echo '
'; echo ' '.profile_link($data['user_id'], $data['user_name'], $data['user_status']).''; echo ' '.showdate('newsdate', $data['news_datestamp']).''; echo ' '.number_format($data['news_reads']).''; if ($data['news_allow_comments'] && fusion_get_settings('comments_enabled') == 1) { echo ' '.$data['news_display_comments'].''; } if ($data['news_allow_ratings'] && fusion_get_settings('ratings_enabled') == 1) { echo ''.$data['news_display_ratings'].''; } echo '
'; echo $data['news_show_comments'] ? '
'.$data['news_show_comments'].'
' : ''; echo $data['news_show_ratings'] ? '
'.$data['news_show_ratings'].'
' : ''; echo '
'; echo '
'; $action = $data['news_admin_actions']; if (!empty($action)) { echo '
'; echo ''; echo ''; echo ''; echo '
'; } else { echo ''; } echo '
    '; $i = 0; foreach ($info['news_filter'] as $link => $title) { $filter_active = (!isset($_GET['type']) && $i == 0) || isset($_GET['type']) && stristr($link, $_GET['type']) ? ' class="text-dark"' : ''; echo ''.$title.''; $i++; } echo '
'; openside($locale['news_0009'], 'shadow p-t-0'); echo '
    '; foreach ($info['news_categories'][0] as $id => $data) { $active = isset($_GET['cat_id']) && $_GET['cat_id'] == $id ? ' class="text-dark"' : ''; echo '
  • '.$data['name'].'
  • '; if ($id != 0 && $info['news_categories'] != 0) { foreach ($info['news_categories'] as $sub_cats_id => $sub_cats) { foreach ($sub_cats as $sub_cat_id => $sub_cat_data) { if (!empty($sub_cat_data['parent']) && $sub_cat_data['parent'] == $id) { $active = isset($_GET['cat_id']) && $_GET['cat_id'] == $sub_cat_id ? 'text-dark ' : ''; echo '
  • '.$sub_cat_data['name'].'
  • '; } } } } } echo '
'; closeside(); // Popular News $result = dbquery("SELECT n.*, nc.*, ni.news_image, count(c.comment_item_id) AS news_comments FROM ".DB_NEWS." n LEFT JOIN ".DB_NEWS_CATS." nc ON n.news_cat=nc.news_cat_id LEFT JOIN ".DB_NEWS_IMAGES." ni ON ni.news_id=n.news_id LEFT JOIN ".DB_COMMENTS." c ON (c.comment_item_id = n.news_id AND c.comment_type = 'N') ".(multilang_table('NS') ? "WHERE ".in_group('news_language', LANGUAGE)." AND " : "WHERE ").groupaccess('news_visibility')." AND (news_start='0'||news_start<='".TIME."') AND (news_end='0'||news_end>='".TIME."') AND news_draft='0' GROUP BY n.news_id ORDER BY n.news_reads DESC, n.news_datestamp ASC LIMIT 6 "); if (dbrows($result)) { openside($locale['MG_102'], 'shadow popular-items'); while ($data = dbarray($result)) { $image = \PHPFusion\News\News::get_NewsImage($data); echo '
'; echo ''.$image.''; echo '
'; echo ''.$data['news_subject'].''; echo showdate('newsdate', $data['news_datestamp']).' | '; echo ''.$data['news_cat_name'].''; echo '
'.$data['news_reads'].'
'; echo '
'; echo '
'; } closeside(); } echo '
'; echo '
'; } }