예제 #1
0
foreach ($tmp_cats_arr as $key => $value) {
    if ($value != "") {
        $requested_cats[$value] = true;
    }
}
if (empty($archive)) {
    $news_file = SERVDIR . "/cdata/news.txt";
    $comm_file = SERVDIR . "/cdata/comments.txt";
} elseif (is_numeric($archive)) {
    $news_file = SERVDIR . "/cdata/archives/{$archive}.news.arch";
    $comm_file = SERVDIR . "/cdata/archives/{$archive}.comments.arch";
} else {
    die_stat(false, "Archive variable is invalid");
}
if ($subaction == "" or !isset($subaction)) {
    $user_query = cute_query_string($QUERY_STRING, array("start_from", "archive", "subaction", "id", "ucat"));
    if (!($handle = opendir(SERVDIR . "/cdata/archives"))) {
        die_stat(false, "Cannot open directory " . SERVDIR . "/cdata/archives ");
    }
    while (false !== ($file = readdir($handle))) {
        $file_arr = explode(".", $file);
        if ($file != "." and $file != ".." and $file_arr[1] == "news") {
            $arch_arr[] = $file_arr[0];
        }
    }
    closedir($handle);
    if (is_array($arch_arr)) {
        $arch_arr = array_reverse($arch_arr);
        foreach ($arch_arr as $arch_file) {
            $news_lines = file(SERVDIR . "/cdata/archives/{$arch_file}.news.arch");
            $count = count($news_lines);
예제 #2
0
                 } else {
                     $cjnumber++;
                 }
                 $output = run_filters('news-comment', $output);
                 $output = replace_comment("show", $output);
                 echo $output;
             }
         }
     }
 }
 # Comments Pagination
 if ($config_comments_pagination == "Yes") {
     $cprev_next_msg = $template_cprev_next;
     $nextcstart = $cstart + $cnum;
     $prevcstart = $cstart - $cnum;
     $COM_REQUEST_URI = $PHP_SELF . "?" . cute_query_string($QUERY_STRING, array("cstart"));
     # <--- Previous
     if ($cstart > 1 + $cghost) {
         $cprev_next_msg = preg_replace("'\\[prev-link\\](.*?)\\[/prev-link\\]'si", "<a href=\"{$COM_REQUEST_URI}&amp;cstart={$prevcstart}\">\\1</a>", $cprev_next_msg);
     } else {
         $cprev_next_msg = preg_replace("'\\[prev-link\\](.*?)\\[/prev-link\\]'si", "\\1", $cprev_next_msg);
         $no_cprev = TRUE;
     }
     # |<-- Previous
     # {pages}
     $cnumadd = 0;
     $cpages = "";
     for ($k = 1; $cnumadd < $total_comments; $k++) {
         $cstartnum = $cnum * ($k - 1) + 1 + $cghost;
         if ($cstartnum != $cstart) {
             $cpages .= "<a href=\"{$COM_REQUEST_URI}&amp;cstart={$cstartnum}\">{$k}</a> ";
예제 #3
0
}
if (empty($from_date_year)) {
    $from_date_year = 2003;
}
if (empty($to_date_day)) {
    $to_date_day = intval(date('d', time() + 3600 * 24));
}
if (empty($to_date_month)) {
    $to_date_month = date('m');
}
if (empty($to_date_year)) {
    $to_date_year = date('Y');
}
$files_arch = array();
// check for bad _GET and _POST
$user_post_query = cute_query_string($QUERY_STRING, array("archives", "start_from", "archive", "subaction", "id", "cnshow", "ucat", "dosearch", "story", "title", "user", "from_date_day", "from_date_month", "from_date_year", "to_date_day", "to_date_month", "to_date_year"), "post");
$date_from = mktime(0, 0, 0, intval($from_date_month), intval($from_date_day), intval($from_date_year));
$date_to = mktime(0, 0, 0, intval($to_date_month), intval($to_date_day), intval($to_date_year));
if (empty($search_form_hide) || isset($search_form_hide) && empty($dosearch)) {
    // Make parameters -----------------------------------------------------------------------------------------------------
    list($day_from, $month_from, $year_from) = make_postponed_date($date_from);
    list($day_to, $month_to, $year_to) = make_postponed_date($date_to);
    $selected_search_arch = empty($archives) ? false : "checked='checked'";
    $story = htmlspecialchars(urldecode($story));
    $title = htmlspecialchars(urldecode($title));
    $author = htmlspecialchars(urldecode($author));
    $hide = ($title or $author or !empty($archives)) ? false : true;
    echo proc_tpl('search');
}
// Do Search -------------------------------------------------------------------------------------------------------
if ($dosearch == "yes") {
예제 #4
0
<?php

if (!defined('INIT_INSTANCE')) {
    die('Access restricted');
}
$CNpass = isset($_COOKIE['CNpass']) && $_COOKIE['CNpass'] ? $_COOKIE['CNpass'] : false;
$captcha_enabled = $CNpass ? false : true;
// ---------------------------------------------------------------------------------------------------------------------
do {
    // plugin tells us: he is fork, stop
    if (hook('fork_shows_inc', false)) {
        break;
    }
    // Used if we want to display some error to the user and halt the rest of the script
    $user_query = cute_query_string($QUERY_STRING, array("comm_start_from", "start_from", "archive", "subaction", "id", "ucat"));
    $user_post_query = cute_query_string($QUERY_STRING, array("comm_start_from", "start_from", "archive", "subaction", "id", "ucat"), "post");
    // Define Categories
    $cat = array();
    $cat_lines = file(SERVDIR . "/cdata/category.db.php");
    foreach ($cat_lines as $single_line) {
        $cat_arr = explode("|", $single_line);
        $cat[$cat_arr[CAT_ID]] = $cat_arr[CAT_NAME];
        $cat_icon[$cat_arr[CAT_ID]] = $cat_arr[CAT_ICON];
    }
    // Define Users
    $all_users = file(SERVDIR . "/cdata/users.db.php");
    unset($all_users[UDB_ID]);
    foreach ($all_users as $user) {
        $user_arr = user_decode($user);
        // nick exists?
        if ($user_arr[UDB_NICK]) {