foreach ($file as $newsdata) { $toc = get_line_data('news_toc', $newsdata); $categories = explode(',', $toc['categories']); if ($fn_category !== 0 && !in_array($fn_category, $categories)) { continue; } if (!file_exists(FNEWS_ROOT_PATH . 'news/news.' . $toc['news_id'] . '.php')) { continue; } if ($count > 25) { break; } ++$count; $news_file = file(FNEWS_ROOT_PATH . 'news/news.' . $toc['news_id'] . '.php'); $article = get_line_data('news', $news_file[1]); $news_info = parse_news_to_view($article, $settings); $writer = get_author($article['author']); $news_info['date'] = date('r', $article['timestamp']); $author = $news_info['email'] ? "\n\t\t" . '<author>' . $news_info['email'] . ' (' . htmlspecialchars($writer['nick']) . ')</author>' . "\n" : ''; $description = $news_info['description']; if ($news_info['description'] == '') { $lines = explode("\n", $news_info['news']); $description = array_shift($lines); } ?> <item> <title><?php echo htmlspecialchars($news_info['subject']); ?> </title> <link><?php
$file = array_reverse($file); } if ($post_per_day) { $ppp_data = array(); } $specified_time = mktime(0, 0, 0, $month, 1, $year); $settings = array('news_url' => $fn_news_url); foreach ($file as $value) { $toc = get_line_data('news_toc', $value); $time = mktime(0, 0, 0, date('n', $toc['timestamp']), 1, date('y', $toc['timestamp'])); if (!file_exists(FNEWS_ROOT_PATH . 'news/news.' . $toc['news_id'] . '.php')) { continue; } if ($time == $specified_time) { $file_news = file(FNEWS_ROOT_PATH . 'news/news.' . $toc['news_id'] . '.php'); $news_info = parse_news_to_view($file_news[1], $settings); $tem = get_template('arch_news_temp.php', true); $tem = replace_masks($tem, array('post_id' => $news_info['post_id'], 'user' => $news_info['writer'], 'date' => $news_info['date'], 'icon' => $news_info['icon'], 'nrc' => $news_info['nrc'], 'comments' => $news_info['link_comments'], 'send' => $news_info['link_tell_friend'], 'cat_icon' => $news_info['cat_icon'], 'cat_id' => $news_info['cat_id'], 'cat_name' => $news_info['cat_name'], 'news' => $news_info['news'], 'fullstory' => $news_info['link_full_news'], 'subject' => $news_info['subject'], 'description' => $news_info['subject'])); if ($post_per_day) { $day_time = mktime(0, 0, 0, date('n', $toc['timestamp']), date('j', $toc['timestamp']), date('y', $toc['timestamp'])); if (!isset($ppp_data[$day_time])) { $ppp_data[$day_time] = ''; } $ppp_data[$day_time] .= $tem; } else { echo $tem; } } } if ($post_per_day) { krsort($ppp_data);
for ($i = $end - $fn_news_per_page; $i < $end; $i++) { if (!isset($valid_posts[$i])) { continue; } if ($post_per_day) { $posts[mktime(0, 0, 0, date('n', $valid_posts[$i]['timestamp']), date('j', $valid_posts[$i]['timestamp']), date('Y', $valid_posts[$i]['timestamp']))][] = $valid_posts[$i]; } else { $news_info = parse_news_to_view($valid_posts[$i], $parse_settings); echo $news_info['display']; } } if ($post_per_day) { $temp = get_template('news_a_day_temp.php', false); foreach ($posts as $key => $value) { $news_display = ''; $display = replace_masks($temp, array('date' => date($ppp_date, $key))); foreach ($value as $post) { $news = parse_news_to_view($post, $fn_category); $news_display .= $news['display']; } echo replace_masks($display, array('news_a_day' => $news_display)); } } if ($fn_pagination && $max_pages > 1) { echo $pagination; } } $out = ob_get_clean(); echo $out; // Now remove the variables delete_user_settings();
if (preg_match_all($regex, $fullnews, $n)) { ++$result; } if (preg_match_all($regex, $toc['headline'], $o)) { ++$result; } if (preg_match_all($regex, $article['description'], $p)) { ++$result; } if ($result > 0) { $m[2] = array_unique($m[2]); $n[2] = array_unique($n[2]); $o[2] = array_unique($o[2]); $p[2] = array_unique($p[2]); ++$count; $news_info = parse_news_to_view($article); foreach ($m[2] as $text) { $news_info['news'] = str_replace($text, '<span style="background-color:yellow;color:red">' . $text . '</span>', $shortnews); } foreach ($n[2] as $text) { $news_info['fullnews'] = str_replace($text, '<span style="background-color:yellow;color:red">' . $text . '</span>', $fullnews); } foreach ($o[2] as $text) { $news_info['subject'] = str_replace($text, '<span style="background-color:yellow;color:red">' . $text . '</span>', $news_info['subject']); } foreach ($p[2] as $text) { $news_info['description'] = str_replace($text, '<span style="background-color:yellow;color:red">' . $text . '</span>', $news_info['description']); } echo replace_masks($news_tmpl, array('post_id' => $toc['news_id'], 'subject' => '<a id="fus_' . $toc['news_id'] . '"></a>' . $news_info['subject'], 'description' => $news_info['description'], 'user' => $news_info['writer'], 'date' => $news_info['date'], 'icon' => $news_info['icon'], 'send' => $news_info['link_tell_friend'], 'nrc' => $news_info['nrc'], 'comments' => $news_info['link_comments'], 'cat_id' => $news_info['cat_id'], 'cat_name' => $news_info['cat_name'], 'cat_icon' => $news_info['cat_icon'], 'news' => '<p>' . $news_info['news'] . '</p><p>' . $news_info['fullnews'] . '</p>', 'fullstory' => '')); } }
if (!defined('FNEWS_ROOT_PATH')) { /**@ignore*/ define('FNEWS_ROOT_PATH', str_replace('\\', '/', dirname(__FILE__)) . '/'); include_once FNEWS_ROOT_PATH . 'common.php'; } $id = isset($VARS['fn_id']) ? (int) $VARS['fn_id'] : 0; $action = isset($VARS['fn_action']) ? $VARS['fn_action'] : ''; ob_start(); if (!file_exists(FNEWS_ROOT_PATH . 'news/news.' . $id . '.php')) { echo $com11; exit; } if (!$action) { $session_id = create_security_id(); $file = file(FNEWS_ROOT_PATH . "news/news." . $id . ".php"); $news_info = parse_news_to_view($file[1]); //replace user variables $tem = get_template('sendtofriend_temp.php', TRUE); $tem = '<script src="' . $furl . '/jsfunc.js" type="text/javascript"></script>' . "\n" . $tem; $tem = replace_masks($tem, array('post_id' => $news_info['post_id'], 'subject' => $news_info['subject'], 'user' => $news_info['writer'], 'date' => $news_info['date'], 'news' => $news_info['news'], 'icon' => $news_info['icon'], 'nrc' => $news_info['nrc'], 'com' => $news_info['link_comments'], 'fullstory' => $news_info['fullnews'], 'cat_name' => $news_info['cat_name'], 'cat_id' => $news_info['cat_id'], 'cat_icon' => $news_info['cat_icon'])); $qs = clean_query_string(); $tem = str_replace('[form]', '<form action="?fn_mode=send&fn_action=send&fn_id=' . $id . $qs . '" method="post" id="newsposting">', $tem); $tem = str_replace('[/form]', '</form>', $tem); $tem = str_replace('[buttons]', '<input type="hidden" name="confirm_id" value="' . $session_id . '" /> <input type="submit" value="' . $ind125 . '"> <input type="reset" value="' . $ind16 . '">', $tem); $tem = preg_replace('/\\[sendnamefld,\\s*([0-9]+)\\]/', '<input type="text" size="\\1" name="sender_name" />', $tem); $tem = preg_replace('/\\[recnamefld,\\s*([0-9]+)\\]/', '<input type="text" size="\\1" name="friend_name" />', $tem); $tem = preg_replace('/\\[sendmailfld,\\s*([0-9]+)\\]/', '<input type="text" size="\\1" name="sender_email" />', $tem); $tem = preg_replace('/\\[recmailfld,\\s*([0-9]+)\\]/', '<input type="text" size="\\1" name="friend_email" />', $tem); if (!isset($stf_captcha) || $stf_captcha) { generate_captcha_code($session_id, $id, get_ip(), 'send');