* but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with Fusion News. If not, see <http://www.gnu.org/licenses/>. */ if (!defined('FNEWS_ROOT_PATH')) { /**@ignore*/ define('FNEWS_ROOT_PATH', str_replace('\\', '/', dirname(__FILE__)) . '/'); include_once FNEWS_ROOT_PATH . 'common.php'; } if (!$enable_rss) { exit; } $file = get_ordered_toc(); $total_posts = sizeof($file); if ($total_posts <= 0) { exit; } /** * Category ID to display posts from * @global int $fn_category */ $fn_category = isset($VARS['fn_category']) ? (int) $VARS['fn_category'] : 0; $current_date = date('r'); $rss_url = $furl . '/rss.php'; if ($fn_category > 0) { $rss_url .= '?fn_category=' . $fn_category; } $category_name = '';
/** * Checks and returns the number of comments awaiting to be validated. * @return int Number of comments awaiting to be validated. */ function get_pending_comments() { global $com_validation; if (!$com_validation) { return 0; } $count = 0; $file = get_ordered_toc(); foreach ($file as $value) { $toc = get_line_data('news_toc', $value); if (!file_exists(FNEWS_ROOT_PATH . 'news/news.' . $toc['news_id'] . '.php')) { continue; } $news_file = file(FNEWS_ROOT_PATH . 'news/news.' . $toc['news_id'] . '.php'); if (sizeof($news_file) <= 2) { continue; } array_shift($news_file); array_shift($news_file); foreach ($news_file as $value2) { $comment = get_line_data('comments', $value2); if ($comment['validated'] == 0) { ++$count; } } } return $count; }