} break; } } else { /*id Month*/ $file = get_ordered_toc(); if ($flip_news) { $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;
$settings = array('category' => array($fn_category)); 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>
function save_captcha_code($session_id, $captcha_code, $news_id, $user_ip, $type) { global $error1; $file = file(FNEWS_ROOT_PATH . 'sessions.php'); array_shift($file); $current_time = time(); $data = '<?php die (\'' . $error1 . '\'); ?>' . "\n"; foreach ($file as $value) { $session = get_line_data('sessions', $value); if ($session['session_id'] == $session_id) { continue; } if ($session['last_visit'] + 600 >= $current_time && $session['ip'] != $user_ip) { $data .= $value; } } $data .= create_line_data('sessions', true, $session_id, $captcha_code, $news_id, $user_ip, $current_time, $type); safe_write('sessions.php', 'wb', $data); }
foreach ($news_file as $news_line) { $toc = get_line_data('news_toc', $news_line); if (!file_exists(FNEWS_ROOT_PATH . 'news/news.' . $toc['news_id'] . '.php')) { continue; } $cats = explode(',', $toc['categories']); foreach ($cats as $cat) { if (isset($count[$cat])) { ++$count[$cat]; } } } } $category_list = '<tbody>'; foreach ($file as $category) { $category = get_line_data('categories', $category); $cicon = !empty($category['icon']) ? '<img src="' . $category['icon'] . '" alt="" />' : ''; $user_dropdown = '<select>'; $userlist = explode(',', $category['users']); if ($category['category_id'] == 1) { foreach ($usernicks as $nick) { $user_dropdown .= '<option>' . $nick . '</option>'; } } else { if (!empty($userlist[0])) { foreach ($userlist as $user) { $user_dropdown .= '<option>' . $usernicks[$user] . '</option>'; } } } $user_dropdown .= '</select>';
} $valid_posts = array(); for ($i = 0; $i < $total_posts; $i++) { $toc = get_line_data('news_toc', $file[$i]); $categories = explode(',', $toc['categories']); // Filter category if ($num_categories > 0 && sizeof(array_intersect($fn_category, $categories)) == 0) { continue; } // Filter author if ($num_authors > 0 && !in_array($toc['author'], $fn_author)) { continue; } if (file_exists(FNEWS_ROOT_PATH . 'news/news.' . $toc['news_id'] . '.php')) { $news_file = file(FNEWS_ROOT_PATH . 'news/news.' . $toc['news_id'] . '.php'); $valid_posts[] = get_line_data('news', $news_file[1]); } } ob_start(); if (sizeof($valid_posts) > 0) { if ($fn_date_order == 'asc') { $valid_posts = array_reverse($valid_posts); } if ($fn_pagination) { $total_posts = sizeof($valid_posts); $pagination = ''; $max_pages = ceil($total_posts / $fn_news_per_page); if ($max_pages > 1) { $fn_page = $fn_page > $max_pages ? $max_pages : $fn_page; $other_qs = clean_query_string(); if ($news_pagination_arrows) {
$email = isset($VARS['sender_email']) ? ltrim($VARS['sender_email']) : ''; $friend_email = isset($VARS['friend_email']) ? ltrim($VARS['friend_email']) : ''; $message = isset($VARS['message']) ? html_entity_decode($VARS['message']) : ''; $captcha_code = isset($VARS['code']) ? $VARS['code'] : ''; $confirm_id = isset($VARS['confirm_id']) ? $VARS['confirm_id'] : ''; if ((!isset($stf_captcha) || $stf_captcha) && !is_valid_captcha_code($captcha_code, $confirm_id, $id, 'send')) { echo $com13; } else { if (!$name || !$friend_name || !$email || !$friend_email || !$message) { echo $error23; } else { if (!is_valid_email($email) || !is_valid_email($friend_email)) { echo $snd7; } else { $file = file(FNEWS_ROOT_PATH . 'news/news.' . $id . '.php'); $news_info = get_line_data('news', $file[1]); $subject = "{$snd0} {$friend_name}, {$snd1}"; $message = <<<html {$friend_name}, ======================================== {$message} ======================================== {$name} {$snd2} {$news_info['headline']}. {$snd3} {$furl}/fullnews.php?fn_id={$id} ======================================== {$snd8} {$hurl} html;
*/ $fn_category = isset($fn_category) ? $fn_category : array(); $fn_category = !is_array($fn_category) ? array($fn_category) : $fn_category; $num_categories = sizeof($fn_category); $valid_posts = array(); /** * Number of headles to show * @global int $fn_num_headlines */ $fn_num_headlines = isset($fn_num_headlines) ? $fn_num_headlines : $numofh; $max_headlines = $total_posts < $fn_num_headlines ? $total_posts : $fn_num_headlines; ob_start(); $mark = strpos($fn_news_url, '?') === false ? '?' : '&'; $settings = array('category' => $fn_category, 'news_url' => $fn_news_url); for ($i = 0, $count = 0; $i < $total_posts && $count < $max_headlines; $i++) { $toc = get_line_data('news_toc', $file[$i]); $categories = explode(',', $toc['categories']); if ($num_categories > 0 && sizeof(array_intersect($fn_category, $categories)) == 0) { continue; } 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'); $news_info = parse_news_to_view($news_file[1], $settings); $temp_head = get_template('headline_temp.php', false); $temp_head = replace_masks($temp_head, array('post_id' => $news_info['post_id'], 'subject' => $news_info['subject'], 'description' => $news_info['description'], 'user' => $news_info['writer'], 'icon' => $news_info['icon'], 'date' => $news_info['date'], 'cat_icon' => $news_info['cat_icon'], 'cat_name' => $news_info['cat_name'], 'cat_id' => $news_info['cat_id'], 'linkend' => '</a>')); if ($i >= $numofposts || $link_headline_fullstory) { $temp_head = replace_masks($temp_head, array('linkstart' => '<a href="' . $fn_news_url . $mark . 'fn_mode=fullnews&fn_id=' . $toc['news_id'] . '">')); } else { $temp_head = replace_masks($temp_head, array('linkstart' => '<a href="' . $fn_news_url . '#fus_' . $toc['news_id'] . '">'));