} // IP address functions include INCLUDES . "ip_handling_include.php"; // Error Handling require_once INCLUDES . "error_handling_include.php"; // Redirects to the index if the URL is invalid (eg. file.php/folder/) if ($_SERVER['SCRIPT_NAME'] != $_SERVER['PHP_SELF']) { redirect($settings['siteurl']); } // Load the Global language file include LOCALE . LOCALESET . "global.php"; // Define aidlink if (iADMIN) { //@todo: to remove this part for non-global approach define("iAUTH", substr(md5($userdata['user_password'] . USER_IP), 16, 16)); $aidlink = fusion_get_aidlink(); // Generate a session aid every turn $token_time = time(); $algo = fusion_get_settings('password_algorithm'); $key = $userdata['user_id'] . $token_time . iAUTH . SECRET_KEY; $salt = md5($userdata['user_admin_salt'] . SECRET_KEY_SALT); $_SESSION['aid'] = $userdata['user_id'] . "." . $token_time . "." . hash_hmac($algo, $key, $salt); } // PHP-Fusion user cookie functions if (!isset($_COOKIE[COOKIE_PREFIX . 'visited'])) { $result = dbquery("UPDATE " . DB_SETTINGS . " SET settings_value=settings_value+1 WHERE settings_name='counter'"); setcookie(COOKIE_PREFIX . "visited", "yes", time() + 31536000, "/", "", "0"); } $lastvisited = Authenticate::setLastVisitCookie(); // Check file types of the uploaded file with known mime types list to prevent uploading unwanted files if enabled if ($settings['mime_check'] == "1") {
/** * Displays error logs HTML * @return string */ private function getErrorLogs() { $aidlink = fusion_get_aidlink(); $locale = self::$locale; $html = openform('error_logform', 'post', FUSION_REQUEST, array("class" => "text-center well m-t-5 m-b-5")); $html .= "<div class='display-inline-block text-right m-r-10'>" . $locale['440'] . "</div>\n"; $html .= "<div class='display-inline-block'>\n"; $html .= form_select('delete_status', "", "", array("allowclear" => TRUE, "options" => self::get_logTypes(), "class" => "m-b-10", "inline" => TRUE)) . form_button('delete_entries', $locale['453'], $locale['453'], array('class' => 'm-l-10 btn-primary')); $html .= "</div>\n"; $html .= closeform(); if (!empty($this->errors) or !empty($this->new_errors)) { $html .= "<a name='top'></a>\n"; $html .= "<table class='table table-responsive center'>"; $html .= "<tr>"; $html .= "<th class='col-xs-5'>" . $locale['410'] . "</th>"; $html .= "<th>Options</th>"; $html .= "<th>" . $locale['454'] . "</th>"; $html .= "<th class='col-xs-4'>" . $locale['414'] . "</th>\n"; $html .= "</tr>\n"; if (!empty($this->errors)) { foreach ($this->errors as $i => $data) { $link = ADMIN . "errors.php" . fusion_get_aidlink() . "&rowstart=" . $this->rowstart . "&error_id=" . $data['error_id'] . "#file"; $file = $data['error_file']; $link_title = $this->getMaxFolders($data['error_file'], 2); $html .= "<tr id='rmd-" . $data['error_id'] . "'>"; $html .= "<td style='text-align:left;'>"; $html .= "<a href='" . $link . "' title='" . $file . "'>" . $link_title . "</a><br/>\n"; $html .= "<i>" . $data['error_page'] . "</i><br/>\n"; $html .= "<small>" . $data['error_message'] . "</small><br/>"; $html .= "<strong>" . $locale['415'] . " " . $data['error_line'] . "</strong><br/>\n"; $html .= "<small>" . timer($data['error_timestamp']) . "</small>\n"; $html .= "</td><td>" . $this->getGitsrc($data['error_file'], $data['error_line']) . "</td>\n"; $html .= "<td>" . $this->get_errorTypes($data['error_level']) . "</td>\n"; $html .= "<td id='ecmd_" . $data['error_id'] . "' style='white-space:nowrap;'>\n"; $html .= "<a data-id='" . $data['error_id'] . "' data-type='0' class='btn " . ($data['error_status'] == 0 ? 'active' : '') . " e_status_0 button btn-default move_error_log'>\n"; $html .= $locale['450'] . "</a>\n"; $html .= "<a data-id='" . $data['error_id'] . "' data-type='1' class='btn " . ($data['error_status'] == 1 ? 'active' : '') . " e_status_1 button btn-default move_error_log'>\n"; $html .= $locale['451'] . "</a>\n"; $html .= "<a data-id='" . $data['error_id'] . "' data-type='2' class='btn " . ($data['error_status'] == 2 ? 'active' : '') . " e_status_2 button btn-default move_error_log'>\n"; $html .= $locale['452'] . "</a>\n"; $html .= "<a data-id='" . $data['error_id'] . "' data-type='999' class='btn e_status_999 button btn-default move_error_log'>\n"; $html .= $locale['delete'] . "</a>\n"; } } if (!empty($this->new_errors)) { foreach ($this->new_errors as $i => $data) { $link = FUSION_SELF . $aidlink . "&rowstart=" . $this->rowstart . "&error_id=" . $data['error_id'] . "#file"; $file = stripslashes($data['error_file']); $link_title = $this->getMaxFolders($data['error_file'], 2); $html .= "<tr id='rmd-" . $data['error_id'] . "'>"; $html .= "<td>"; $html .= "<a href='" . $link . "' title='" . $file . "'>" . $link_title . "</a><br/>\n"; $html .= "<code class='error_page'>" . $data['error_page'] . "</code><br/>\n"; $html .= "<small>" . $data['error_message'] . "</small><br/>"; $html .= "<strong>" . $locale['415'] . " " . $data['error_line'] . "</strong><br/>\n"; $html .= "<small>" . timer($data['error_timestamp']) . "</small>\n"; $html .= "</td><td>" . $this->getGitsrc($data['error_file'], $data['error_line']) . "</td>\n"; $html .= "<td><label class='label label-success'>" . $locale['450'] . "</label> " . $this->get_errorTypes($data['error_level']) . "</td>\n"; $html .= "<td id='ecmd_" . $data['error_id'] . "' style='white-space:nowrap;'>\n"; $html .= "<a data-id='" . $data['error_id'] . "' data-type='0' class='btn " . ($data['error_status'] == 0 ? 'active' : '') . " e_status_0 button btn-default move_error_log'>\n"; $html .= $locale['450'] . "</a>\n"; $html .= "<a data-id='" . $data['error_id'] . "' data-type='1' class='btn " . ($data['error_status'] == 1 ? 'active' : '') . " e_status_1 button btn-default move_error_log'>\n"; $html .= $locale['451'] . "</a>\n"; $html .= "<a data-id='" . $data['error_id'] . "' data-type='2' class='btn " . ($data['error_status'] == 2 ? 'active' : '') . " e_status_2 button btn-default move_error_log'>\n"; $html .= $locale['452'] . "</a>\n"; $html .= "<a data-id='" . $data['error_id'] . "' data-type='999' class='btn e_status_999 button btn-default move_error_log'>\n"; $html .= $locale['delete'] . "</a>\n"; } } $html .= "</table>\n"; if ($this->rows > 20) { $html .= "<div class='m-t-10 text-center'>\n"; $html .= makepagenav($this->rowstart, 20, $this->rows, 3, ADMIN . "errors.php" . $aidlink . "&"); $html .= "</div>\n"; } } else { $html .= "<div class='text-center well'>" . $locale['418'] . "</div>\n"; } $this->errorjs(); return $html; }
/** * Displays News Listing */ function display_news_listing() { $aidlink = fusion_get_aidlink(); $locale = fusion_get_locale(); // Run functions $allowed_actions = array_flip(array("publish", "unpublish", "sticky", "unsticky", "delete")); if (isset($_POST['table_action']) && isset($allowed_actions[$_POST['table_action']])) { $input = isset($_POST['news_id']) ? explode(",", form_sanitizer($_POST['news_id'], "", "news_id")) : ""; if (!empty($input)) { foreach ($input as $news_id) { // check input table if (dbcount("('news_id')", DB_NEWS, "news_id='" . intval($news_id) . "'") && defender::safe()) { switch ($_POST['table_action']) { case "publish": dbquery("UPDATE " . DB_NEWS . " SET news_draft='0' WHERE news_id='" . intval($news_id) . "'"); break; case "unpublish": dbquery("UPDATE " . DB_NEWS . " SET news_draft='1' WHERE news_id='" . intval($news_id) . "'"); break; case "sticky": dbquery("UPDATE " . DB_NEWS . " SET news_sticky='1' WHERE news_id='" . intval($news_id) . "'"); break; case "unsticky": dbquery("UPDATE " . DB_NEWS . " SET news_sticky='0' WHERE news_id='" . intval($news_id) . "'"); break; case "delete": $result = dbquery("SELECT news_image, news_image_t1, news_image_t2 FROM " . DB_NEWS . " WHERE news_id='" . intval($news_id) . "'"); if (dbrows($result) > 0) { $photo = dbarray($result); if (!empty($photo['news_image']) && file_exists(IMAGES_N . $photo['news_image'])) { unlink(IMAGES_N . $photo['news_image']); } if (!empty($photo['news_image_t1']) && file_exists(IMAGES_N_T . $photo['news_image_t1'])) { unlink(IMAGES_N_T . $photo['news_image_t1']); } if (!empty($photo['news_image_t2']) && file_exists(IMAGES_N_T . $photo['news_image_t2'])) { unlink(IMAGES_N_T . $photo['news_image_t2']); } if (!empty($photo['news_image_t2']) && file_exists(IMAGES_N . $photo['news_image_t2'])) { unlink(IMAGES_N . $photo['news_image_t2']); } } dbquery("DELETE FROM " . DB_NEWS . " WHERE news_id='" . intval($news_id) . "'"); break; default: addNotice("warning", "News ID {$news_id} is not valid and update aborted"); redirect(FUSION_REQUEST); } } } addNotice("success", "News listing has been updated"); redirect(FUSION_REQUEST); } addNotice("warning", "No news item selected. Please check a news item and try again"); redirect(FUSION_REQUEST); } if (isset($_POST['news_clear'])) { redirect(FUSION_SELF . $aidlink); } // Switch to post $sql_condition = ""; $search_string = array(); if (isset($_POST['p-submit-news_text'])) { $search_string['news_subject'] = array("input" => form_sanitizer($_POST['news_text'], "", "news_text"), "operator" => "LIKE"); } if (!empty($_POST['news_status']) && isnum($_POST['news_status'])) { switch ($_POST['news_status']) { case 1: // is a draft $search_string['news_draft'] = array("input" => 1, "operator" => "="); break; case 2: // is a sticky $search_string['news_sticky'] = array("input" => 1, "operator" => "="); break; } } if (!empty($_POST['news_visibility'])) { $search_string['news_visibility'] = array("input" => form_sanitizer($_POST['news_visibility'], "", "news_visibility"), "operator" => "="); } if (!empty($_POST['news_category'])) { $search_string['news_cat_id'] = array("input" => form_sanitizer($_POST['news_category'], "", "news_category"), "operator" => "="); } if (!empty($_POST['news_language'])) { $search_string['news_language'] = array("input" => form_sanitizer($_POST['news_language'], "", "news_language"), "operator" => "="); } if (!empty($_POST['news_author'])) { $search_string['news_name'] = array("input" => form_sanitizer($_POST['news_author'], "", "news_author"), "operator" => "="); } if (!empty($search_string)) { foreach ($search_string as $key => $values) { $sql_condition .= " AND `{$key}` " . $values['operator'] . ($values['operator'] == "LIKE" ? "'%" : "'") . $values['input'] . ($values['operator'] == "LIKE" ? "%'" : "'"); } } $result2 = dbquery("\n\tSELECT n.*, nc.*, IF(nc.news_cat_name !='', nc.news_cat_name, 'Uncategorized') 'news_cat_name',\n\tcount('c.comment_id') 'comments_count',\n\tcount('r.rating_id') 'ratings_count',\n\tu.user_id, u.user_name, u.user_status, u.user_avatar\n\tFROM " . DB_NEWS . " n\n\tLEFT JOIN " . DB_NEWS_CATS . " nc on nc.news_cat_id=n.news_cat\n\tLEFT JOIN " . DB_COMMENTS . " c on c.comment_item_id= n.news_id AND c.comment_type='N'\n\tLEFT JOIN " . DB_RATINGS . " r on r.rating_item_id= n.news_id AND r.rating_type='N'\n\tINNER JOIN " . DB_USERS . " u on u.user_id= n.news_name\n\tWHERE " . (multilang_table("NS") ? "news_language='" . LANGUAGE . "'" : "") . "\n\t{$sql_condition}\n\tGROUP BY n.news_id\n\tORDER BY news_draft DESC, news_sticky DESC, news_datestamp DESC\n\t"); ?> <div class="m-t-15"> <?php echo openform("news_filter", "post", FUSION_REQUEST); echo "<div class='clearfix'>\n"; echo "<div class='pull-right'>\n"; echo "<a class='btn btn-success btn-sm m-r-10' href='" . clean_request("ref=news_form", array("ref"), FALSE) . "'>Add New</a>"; echo "<a class='btn btn-default btn-sm m-r-10' onclick=\"run_admin('publish');\"><i class='fa fa-check fa-fw'></i> " . $locale['publish'] . "</a>"; echo "<a class='btn btn-default btn-sm m-r-10' onclick=\"run_admin('unpublish');\"><i class='fa fa-ban fa-fw'></i> " . $locale['unpublish'] . "</a>"; echo "<a class='btn btn-default btn-sm m-r-10' onclick=\"run_admin('sticky');\"><i class='fa fa-sticky-note fa-fw'></i> " . $locale['sticky'] . "</a>"; echo "<a class='btn btn-default btn-sm m-r-10' onclick=\"run_admin('unsticky');\"><i class='fa fa-sticky-note-o fa-fw'></i> " . $locale['unsticky'] . "</a>"; echo "<a class='btn btn-default btn-sm m-r-10' onclick=\"run_admin('delete');\"><i class='fa fa-trash-o fa-fw'></i> " . $locale['delete'] . "</a>"; echo "</div>\n"; ?> <script> function run_admin(action) { $('#table_action').val(action); $('#news_table').submit(); } </script> <?php $filter_values = array("news_text" => !empty($_POST['news_text']) ? form_sanitizer($_POST['news_text'], "", "news_text") : "", "news_status" => !empty($_POST['news_status']) ? form_sanitizer($_POST['news_status'], "", "news_status") : "", "news_category" => !empty($_POST['news_category']) ? form_sanitizer($_POST['news_category'], "", "news_category") : "", "news_visibility" => !empty($_POST['news_visibility']) ? form_sanitizer($_POST['news_visibility'], "", "news_visibility") : "", "news_language" => !empty($_POST['news_language']) ? form_sanitizer($_POST['news_language'], "", "news_language") : "", "news_author" => !empty($_POST['news_author']) ? form_sanitizer($_POST['news_author'], "", "news_author") : ""); $filter_empty = TRUE; foreach ($filter_values as $val) { if ($val) { $filter_empty = FALSE; } } echo "<div class='display-inline-block pull-left m-r-10' style='width:300px;'>\n"; echo form_text("news_text", "", $filter_values['news_text'], array("placeholder" => "News Subject", "append_button" => TRUE, "append_value" => "<i class='fa fa-search'></i>", "append_form_value" => "search_news", "width" => "250px")); echo "</div>\n"; echo "<div class='display-inline-block'>"; echo "<a class='btn btn-sm " . ($filter_empty == FALSE ? "btn-info" : " btn-default'") . "' id='toggle_options' href='#'>Search Options\n <span id='filter_caret' class='fa " . ($filter_empty == FALSE ? "fa-caret-up" : "fa-caret-down") . "'></span></a>\n"; echo form_button("news_clear", "Clear", "clear"); echo "</div>\n"; echo "</div>\n"; add_to_jquery("\n \$('#toggle_options').bind('click', function(e) {\n \$('#news_filter_options').slideToggle();\n var caret_status = \$('#filter_caret').hasClass('fa-caret-down');\n if (caret_status == 1) {\n \$('#filter_caret').removeClass('fa-caret-down').addClass('fa-caret-up');\n \$(this).removeClass('btn-default').addClass('btn-info');\n } else {\n \$('#filter_caret').removeClass('fa-caret-up').addClass('fa-caret-down');\n \$(this).removeClass('btn-info').addClass('btn-default');\n }\n });\n\n // Select change\n \$('#news_status, #news_visibility, #news_category, #news_language, #news_author').bind('change', function(e){\n \$(this).closest('form').submit();\n });\n "); unset($filter_values['news_text']); echo "<div id='news_filter_options'" . ($filter_empty == FALSE ? "" : " style='display:none;'") . ">\n"; echo "<div class='display-inline-block'>\n"; echo form_select("news_status", "", $filter_values['news_status'], array("allowclear" => TRUE, "placeholder" => "- Select Status -", "options" => array(0 => "All Status", 1 => "Draft", 2 => "Sticky"))); echo "</div>\n"; echo "<div class='display-inline-block'>\n"; echo form_select("news_visibility", "", $filter_values['news_visibility'], array("allowclear" => TRUE, "placeholder" => "- Select Access -", "options" => fusion_get_groups())); echo "</div>\n"; echo "<div class='display-inline-block'>\n"; $news_cats_opts = array(0 => "All Categories"); $result = dbquery("SELECT * FROM " . DB_NEWS_CATS . " ORDER BY news_cat_name ASC"); if (dbrows($result) > 0) { while ($data = dbarray($result)) { $news_cats_opts[$data['news_cat_id']] = $data['news_cat_name']; } } echo form_select("news_category", "", $filter_values['news_category'], array("allowclear" => TRUE, "placeholder" => "- Select Category -", "options" => $news_cats_opts)); echo "</div>\n"; echo "<div class='display-inline-block'>\n"; $language_opts = array(0 => "All Language"); $language_opts += fusion_get_enabled_languages(); echo form_select("news_language", "", $filter_values['news_language'], array("allowclear" => TRUE, "placeholder" => "- Select Language -", "options" => $language_opts)); echo "</div>\n"; echo "<div class='display-inline-block'>\n"; $author_opts = array(0 => "All Author"); $result = dbquery("SELECT n.news_name, u.user_id, u.user_name, u.user_status\n FROM " . DB_NEWS . " n\n LEFT JOIN " . DB_USERS . " u on n.news_name = u.user_id\n GROUP BY u.user_id\n ORDER BY user_name ASC"); if (dbrows($result) > 0) { while ($data = dbarray($result)) { $author_opts[$data['user_id']] = $data['user_name']; } } echo form_select("news_author", "", $filter_values['news_author'], array("allowclear" => TRUE, "placeholder" => "- Select Author -", "options" => $author_opts)); echo "</div>\n"; echo "</div>\n"; echo closeform(); ?> </div> <?php echo openform("news_table", "post", FUSION_REQUEST); ?> <?php echo form_hidden("table_action", "", ""); ?> <table class="table table-responsive table-striped"> <thead> <tr> <td></td> <td class="strong col-xs-4">News Subject</td> <td class="strong">News Category</td> <td class="strong">Access</td> <td class="strong">Sticky</td> <td class="strong">Draft</td> <td class="strong">Comments</td> <td class="strong">Ratings</td> <td class="strong">News Author</td> <td class="strong">Actions</td> <td class="strong">ID</td> </tr> </thead> <tbody> <?php if (dbrows($result2) > 0) { while ($data = dbarray($result2)) { ?> <?php $edit_link = FUSION_SELF . $aidlink . "&action=edit&ref=news_form&news_id=" . $data['news_id']; $cat_edit_link = FUSION_SELF . $aidlink . "&action=edit&ref=news_category&cat_id=" . $data['news_cat_id']; $image_thumb = get_news_image_path($data['news_image'], $data['news_image_t1'], $data['news_image_t2']); if (!$image_thumb) { $image_thumb = IMAGES . "imagenotfound70.jpg"; } ?> <tr> <td><?php echo form_checkbox("news_id[]", "", "", array("value" => $data['news_id'], "class" => 'm-0')); ?> </td> <td> <a class="text-dark" href="<?php echo $edit_link; ?> "> <?php echo $data['news_subject']; ?> </a> </td> <td> <a class="text-dark" href="<?php echo $cat_edit_link; ?> "> <?php echo $data['news_cat_name']; ?> </a> </td> <td> <?php echo getgroupname($data['news_visibility']); ?> </td> <td> <span class="badge"><?php echo $data['news_sticky'] ? $locale['yes'] : $locale['no']; ?> </span> </td> <td> <span class="badge"><?php echo $data['news_draft'] ? $locale['yes'] : $locale['no']; ?> </span> </td> <td><?php echo $data['comments_count']; ?> </td> <td><?php echo $data['ratings_count']; ?> </td> <td> <div class="pull-left"><?php echo display_avatar($data, "20px", "", FALSE, "img-rounded"); ?> </div> <div class="overflow-hide"><?php echo profile_link($data['user_id'], $data['user_name'], $data['user_status']); ?> </div> </td> <td> <div class="btn-group"> <a class="btn btn-xs btn-default" href="<?php echo $edit_link; ?> "> <?php echo $locale['edit']; ?> </a> <a class="btn btn-xs btn-default" href="<?php echo FUSION_SELF . $aidlink . "&action=delete&news_id=" . $data['news_id']; ?> " onclick="return confirm('<?php echo $locale['news_0251']; ?> ')"> <?php echo $locale['delete']; ?> </a> </div> </td> <td><?php echo $data['news_id']; ?> </td> </tr> <?php } } else { ?> <tr> <td colspan="10" class="text-center strong"><?php echo $locale['news_0254']; ?> </td> </tr> <?php } ?> </tbody> </table> <?php closeform(); }
/** * News Item Page Template * @param $info */ function render_news_item($info) { $locale = fusion_get_locale(); $aidlink = fusion_get_aidlink(); $news_settings = \PHPFusion\News\NewsServer::get_news_settings(); $data = $info['news_item']; add_to_head("<link rel='stylesheet' href='" . INFUSIONS . "news/templates/css/news.css' type='text/css'>"); add_to_head("<link rel='stylesheet' href='" . INCLUDES . "jquery/colorbox/colorbox.css' type='text/css' media='screen' />"); add_to_head("<script type='text/javascript' src='" . INCLUDES . "jquery/colorbox/jquery.colorbox.js'></script>"); add_to_footer('<script type="text/javascript"> $(document).ready(function() { $(".news-image-overlay").colorbox({ transition: "elasic", height:"100%", width:"100%", maxWidth:"98%", maxHeight:"98%", scrolling:false, overlayClose:true, close:false, photo:true, onComplete: function(result) { $("#colorbox").live("click", function(){ $(this).unbind("click"); $.fn.colorbox.close(); }); }, onLoad: function () { } }); }); </script>'); opentable($locale['news_0004']); echo render_breadcrumbs(); echo "<!--news_pre_readmore-->"; echo "<article class='news-item' style='display:block; width:100%; overflow:hidden;'>\n"; echo "<h2 class='text-center'>" . $data['news_subject'] . "</h2>\n"; echo "<div class='news_news text-dark m-t-20 m-b-20'>\n"; if ($data['news_image_src']) { echo "<a class='" . $data['news_ialign'] . " news-image-overlay' href='" . $data['news_image_src'] . "'>\n <img class='img-responsive' src='" . $data['news_image_src'] . "' alt='" . $data['news_subject'] . "' style='padding:5px; max-height:" . $news_settings['news_photo_h'] . "px; overflow:hidden;' /></a>"; } elseif (!empty($data['news_cat_name']) && !empty($data['news_cat_image_src'])) { echo "<a class='" . $data['news_ialign'] . "' href='" . INFUSIONS . "news/news.php?cat_id=" . $data['news_cat_id'] . "'>\n <img class='img-responsive' src='" . IMAGES_NC . $data['news_cat_image_src'] . "' style='padding:5px; max-height:" . $news_settings['news_photo_h'] . "px; alt='" . $data['cat_name'] . "' />\n </a>"; } echo $data['news_news']; echo "</div>\n"; echo "<div class='news_extended text-dark m-t-20 m-b-20'>" . $data['news_extended'] . "</div>\n"; echo "<div style='clear:both;'></div>\n"; echo "<div class='well m-t-5 text-center'>\n"; echo "<span class='news-action m-r-10'><i class='fa fa-user'></i>" . profile_link($data['user_id'], $data['user_name'], $data['user_status']) . "</span>\n"; echo "<span class='news-action m-r-10'><i class='fa fa-calendar'></i>" . showdate("newsdate", $data['news_datestamp']) . "</span>\n"; echo "<span class='news-action'><i class='fa fa-eye'></i><span class='text-dark m-r-10'>" . number_format($data['news_reads']) . "</span>\n</span>"; echo $data['news_allow_comments'] ? display_comments($data['news_comments'], INFUSIONS . "news/news.php?readmore=" . $data['news_id'] . "#comments") : ''; echo $data['news_allow_ratings'] ? "<span class='m-r-10'>" . display_ratings($data['news_sum_rating'], $data['news_count_votes'], INFUSIONS . "news/news.php?readmore=" . $data['news_id'] . "#ratings") . " </span>" : ''; echo "<a class='m-r-10' title='" . $locale['news_0002'] . "' href='" . BASEDIR . "print.php?type=N&item_id=" . $data['news_id'] . "'><i class='fa fa-print'></i></a>"; echo iADMIN && checkrights("N") ? "<a title='" . $locale['news_0003'] . "' href='" . INFUSIONS . "news/news_admin.php" . $aidlink . "&action=edit&section=news_form&news_id=" . $data['news_id'] . "' title='" . $locale['news_0003'] . "' />" . $locale['news_0003'] . "</a>\n" : ""; echo "</div>"; echo "<!--news_sub_readmore-->"; echo !isset($_GET['readmore']) && $data['news_ext'] == "y" ? "<div class='m-t-20'>\n<a href='" . INFUSIONS . "news/news.php?readmore=" . $data['news_id'] . "' class='button'>" . $locale['news_0001'] . "</a>\n</div>\n" : ""; if ($data['page_count'] > 0) { echo "<div class='text-center m-t-10'>\n" . makepagenav($_GET['rowstart'], 1, $data['page_count'], 3, INFUSIONS . "news/news.php?readmore=" . $_GET['readmore'] . "&") . "\n</div>\n"; } if ($data['news_allow_comments']) { echo "<hr />" . showcomments("N", DB_NEWS, "news_id", $_GET['readmore'], INFUSIONS . "news/news.php?readmore=" . $_GET['readmore']) . "\n"; } if ($data['news_allow_ratings']) { echo "<hr />" . showratings("N", $_GET['readmore'], INFUSIONS . "news/news.php?readmore=" . $_GET['readmore']) . "\n"; } echo "</article>\n"; closetable(); }