Esempio n. 1
0
        $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);
        $temp = get_template('news_a_day_temp.php', true);
        foreach ($ppp_data as $key => $value) {
            echo replace_masks($temp, array('date' => date('l', $key) . ', ' . $months[date('n', $key)] . ' ' . date('d', $key) . ' ' . date('Y', $key), 'news_a_day' => $value));
        }
    }
}
echo get_template('footer.php', true);
ob_end_flush();
Esempio n. 2
0
    array_shift($category_file);
    $category_exists = false;
    foreach ($category_file as $value) {
        $category = get_line_data('categories', $value);
        if ($category['category_id'] == $fn_category) {
            $category_exists = true;
            $category_name = $category['name'];
        }
    }
    if (!$category_exists) {
        // Fall back
        $fn_category = 0;
    }
}
$rss_title = replace_masks($rss_title, array('cat_name' => $category_name));
$rss_description = replace_masks($rss_description, array('cat_name' => $category_name));
header('Content-Type: application/rss+xml; charset=' . $rss_encoding);
ob_start();
echo <<<rss
<?xml version="1.0" encoding="{$rss_encoding}"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
rss;
?>

<channel>
	<title><?php 
echo htmlspecialchars($rss_title);
?>
</title>
	<link><?php 
echo $hurl;
Esempio n. 3
0
/**
 * Displays the output of the control panel.
 * @param string $title Page title
 * @param string $skin Skin to use
 * @param array $userdata User's login session data
 */
function display_output($title, $skin, $userdata)
{
    global $start_time, $ind163, $ind108, $ind109, $ind344, $ind169, $ind272, $ind165, $ind107, $ind281, $ind193, $ind194, $ind195, $ind170, $ind171, $ind400, $notice_buffer, $warning_buffer, $ind358, $ind357, $errored_out;
    // Now sort out the skin
    $links_list = array(array($ind163, '', GUEST), array($ind108, '?id=postnews', NEWS_REPORTER), array($ind109, '?id=editposts', NEWS_REPORTER), array($ind400, '?id=editprofile', NEWS_REPORTER), array(array(NEWS_EDITOR => $ind344, NEWS_ADMIN => $ind169), '?id=admin', NEWS_EDITOR), array($ind272, '?id=view', GUEST), array($ind165, '?id=help', NEWS_REPORTER), array($ind107, '?id=logout', NEWS_REPORTER));
    $cs1 = file_get_contents(FNEWS_ROOT_PATH . 'skins/' . $skin . '/index.html');
    if ($cs1 === false) {
        trigger_error($ind281, E_USER_ERROR);
    }
    $row_links = '';
    $col_links = '';
    $row_sep = '';
    $col_sep = '';
    $user_level = !isset($userdata['level']) ? 0 : $userdata['level'];
    foreach ($links_list as $link_data) {
        if (!is_array($link_data)) {
            continue;
        }
        if ($user_level >= $link_data[2]) {
            $row_links .= $row_sep;
            $col_links .= $col_sep;
            $row_links .= '<a href="index.php' . $link_data[1] . '">';
            $col_links .= '<a href="index.php' . $link_data[1] . '">';
            if (is_array($link_data[0])) {
                $row_links .= $link_data[0][$userdata['level']];
                $col_links .= $link_data[0][$userdata['level']];
            } else {
                $row_links .= $link_data[0];
                $col_links .= $link_data[0];
            }
            $row_links .= '</a>';
            $col_links .= '</a>';
            $row_sep = ' | ';
            $col_sep = '<br />';
        }
    }
    if (has_access(NEWS_REPORTER)) {
        switch ($userdata['level']) {
            case 3:
                $status = $ind195;
                break;
            case 2:
                $status = $ind194;
                break;
            case 1:
                $status = $ind193;
                break;
            default:
                break;
        }
        $login = $ind170 . ' <b>' . $userdata['nick'] . '</b> [<b>' . $status . '</b>]';
    } else {
        $login = $ind171;
    }
    $content = ob_get_clean();
    if (!$errored_out) {
        if ($notice_buffer != '') {
            $content = '<ul id="fn_notice"><li class="title">' . $ind357 . '</li>' . $notice_buffer . '</ul>' . $content;
        }
        if ($warning_buffer != '') {
            $content = '<ul id="fn_warning"><li class="title">' . $ind358 . '</li>' . $warning_buffer . '</ul>' . $content;
        }
    }
    $cs = replace_masks($cs1, array('main' => $content, 'title' => $title, 'linksn' => $row_links, 'linksb' => $col_links, 'login' => $login, 'curve' => FNEWS_CURVE));
    //-----------------------------------------------
    // Do this very last to get the most accurate
    // result possible
    //-----------------------------------------------
    $split = explode(' ', microtime());
    $end_time = (double) $split[0] + (double) $split[1];
    $cs = str_replace('{loadtime}', sprintf('%.6f', $end_time - $start_time), $cs);
    //-----------------------------------------------
    // Blammo, out comes the end product :p
    //-----------------------------------------------
    echo $cs;
}
Esempio n. 4
0
                        $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' => ''));
                    }
                }
                $end_time = array_sum(explode(' ', microtime()));
                printf('Took %.6f seconds.', $end_time - $start_time);
                if ($count <= 0) {
                    echo $srch12;
                }
            }
        }
    }
}
echo get_template("footer.php", true);
ob_end_flush();
unset($fn_simple_search);
Esempio n. 5
0
    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();
Esempio n. 6
0
}
$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&amp;fn_action=send&amp;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 . '">&nbsp;<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');
        $tem = str_replace('[securityimg]', '<img src="' . $furl . '/captcha.php?fn_type=send&amp;fn_id=' . $id . '&amp;fn_sid=' . $session_id . '&amp;t=' . time() . '" alt="CAPTCHA" id="captcha" />', $tem);
        $tem = str_replace('[securityfld]', '<input type="text" name="code" size="5" maxlength="5" />', $tem);
    } else {
        $tem = str_replace('[securityimg]', '', $tem);
Esempio n. 7
0
 *
 * This file is part of Fusion News.
 *
 * Fusion News is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 * Fusion News is distributed in the hope that it will be useful,
 * 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';
}
$id = isset($VARS['fn_id']) ? (int) $VARS['fn_id'] : 0;
ob_start();
if (!file_exists(FNEWS_ROOT_PATH . 'news/news.' . $id . '.php')) {
    echo $flns0;
} else {
    $file = file(FNEWS_ROOT_PATH . 'news/news.' . $id . '.php');
    $news_info = parse_news_to_view($file[1]);
    $temp_full = get_template('fullnews_temp.php', true);
    echo replace_masks($temp_full, array('post_id' => $news_info['post_id'], 'subject' => $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_icon' => $news_info['cat_icon'], 'cat_id' => $news_info['cat_id'], 'cat_name' => $news_info['cat_name'], 'shortnews' => $news_info['news'], 'fullnews' => $news_info['fullnews']));
}
ob_end_flush();
Esempio n. 8
0
    $temp_short = replace_masks($temp_short, array('post_id' => $news_info['post_id'], 'subject' => $news_info['subject'], 'description' => $news_info['description'], 'user' => $news_info['writer'], 'date' => $news_info['date'], 'send' => $news_info['link_tell_friend'], 'news' => $news_info['news'], 'fullstory' => $news_info['fullnews'], 'icon' => $news_info['icon'], 'nrc' => $news_info['nrc'], 'com' => $news_info['link_comments'], 'cat_id' => $news_info['cat_id'], 'cat_name' => $news_info['cat_name'], 'cat_icon' => $news_info['cat_icon'], 'pagination' => $pagination));
    $temp_short = preg_replace('#{prev_page\\|(.+)}#U', $prev_page, $temp_short);
    $temp_short = preg_replace('#{next_page\\|(.+)}#U', $next_page, $temp_short);
    $count = 0;
    $comment_template = get_template('com_temp.php', true);
    $comments = '';
    $validated_comments = array_reverse($validated_comments);
    foreach ($validated_comments as $comment) {
        if ($count < $start || $count >= $end) {
            // Valid comment, but not to be displayed on this post.
            $count++;
            continue;
        }
        parse_comments($comment['message'], $comment['author'], $comment['email']);
        $commenthtml = $comment_template;
        $comments .= replace_masks($commenthtml, array('poster' => $comment['author'], 'comment' => $comment['message'], 'date' => date($datefor, (int) $comment['timestamp']), 'posterip' => $comment['ip']));
        $count++;
    }
    if (empty($comments)) {
        $comments = $com12;
    }
    $extras = show_extras('comment_form', 'comment', $smilcom, $bbc);
    $box = $extras . '<textarea id="comment" name="comment" rows="$2" cols="$1"></textarea>';
    $temp_short = str_replace('{comments}', $comments, $temp_short);
    $temp_short = str_replace('[form]', '<form action="?fn_mode=comments&amp;fn_action=post&amp;fn_id=' . $id . $qs . '" method="post" id="comment_form">', $temp_short);
    $temp_short = str_replace('[/form]', '</form>', $temp_short);
    $temp_short = str_replace('[buttons]', '<input type="hidden" name="confirm_id" value="' . $session_id . '" />
<input type="hidden" name="fn_next" value="' . current_url() . '" />
<input type="submit" id="com_Submit" value="' . $com15 . '" />
<input type="reset" value="' . $com16 . '" />', $temp_short);
    $comlen = '';
Esempio n. 9
0
 * 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 ? '?' : '&amp;';
$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&amp;fn_id=' . $toc['news_id'] . '">'));
    } else {
        $temp_head = replace_masks($temp_head, array('linkstart' => '<a href="' . $fn_news_url . '#fus_' . $toc['news_id'] . '">'));
    }
    ++$count;
    echo $temp_head;
}
ob_end_flush();
unset($fn_news_url, $fn_category, $fn_num_headlines);