$param_val){ if(!empty($param_val) && !preg_match('/^[a-zA-Z0-9- &\#]{0,255}$/', $param_val)){ die(str_replace('{x}', htmlentities($param_key), $say['bad_chars'])); } } } $story = utf8_htmlentities($story); $title = utf8_htmlentities($title); $user_query = cute_query_string($QUERY_STRING, array("search_in_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")); $user_post_query = cute_query_string($QUERY_STRING, array("search_in_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"); // Define Users $all_users = file("$cutepath/data/users.db.php"); $my_names = array(); foreach($all_users as $my_user){ if(strpos($member_db_line, '<'.'?') === false){ $user_arr = explode('|', $my_user); if($user_arr[4] != ''){ $my_names[$user_arr[2]] = $user_arr[4]; } else{ $my_names[$user_arr[2]] = $user_arr[2]; } } } // Show Search Form $nice_user = htmlentities($user); echo<< function mySelect(form){ form.select(); } function ShowOrHide(d1, d2) { if (d1 != '') DoDiv(d1); if (d2 != '') DoDiv(d2); } function DoDiv(id) { var item = null; if (document.getElementById) { item = document.getElementById(id); } else if (document.all){ item = document.all[id]; } else if (document.layers){ item = document.layers[id]; } if (!item) { } else if (item.style) { if (item.style.display == "none"){ item.style.display = ""; } else {item.style.display = "none"; } }else{ item.visibility = "show"; } }

{$say['sh_news']}

  {$say['sh_adv']}  

$user_post_query
HTML; // Don't edit below this line unless you know what you are doing !!! if($dosearch == 'yes'){ echo '
'; if(is_numeric($from_date_day) && is_numeric($from_date_month) && is_numeric($from_date_year) && is_numeric($to_date_day) && is_numeric($to_date_month) && is_numeric($to_date_year)){ $date_from = mktime(0,0,0,$from_date_month,$from_date_day,$from_date_year); $date_to = mktime(0,0,0,$to_date_month,$to_date_day,$to_date_year); $do_date = TRUE; } $story = trim($story); if($search_in_archives){ if(!$handle = opendir("$cutepath/data/archives")){ die("
Can not open directory $cutepath/data/archives "); } while (false !== ($file = readdir($handle))){ if($file != '.' and $file != '..' and strpos($file, 'news') !== false){ $files_arch[] = "$cutepath/data/archives/$file"; } } } $files_arch[] = "$cutepath/data/news.txt"; foreach($files_arch as $file){ $archive = FALSE; if(preg_match('/([[:digit:]]{0,})\.news\.arch/', $file, $regs)){ $archive = $regs[1]; } $all_news_db = file($file); foreach($all_news_db as $news_line){ $news_db_arr = explode('|', $news_line); $found = 0; $fuser = FALSE; $ftitle = FALSE; $fstory = FALSE; $title = utf8_strtolower($title); $story = utf8_strtolower($story); if($title and @preg_match("/$title/i", utf8_strtolower($news_db_arr[2]))){ $ftitle = TRUE; } if($user and @preg_match("/\b$user\b/i", "$news_db_arr[1]")){ $fuser = TRUE; } if($story and (@preg_match("/$story/i", utf8_strtolower($news_db_arr[4])) or @preg_match("/$story/i", utf8_strtolower($news_db_arr[3])))){ $fstory = TRUE; } if($title and $ftitle){ $ftitle = TRUE; }elseif(!$title){ $ftitle = TRUE; }else{ $ftitle = FALSE; } if($story and $fstory){ $fstory = TRUE; }elseif(!$story){ $fstory = TRUE; }else{ $fstory = FALSE; } if($user and $fuser) { $fuser = TRUE; }elseif(!$user) { $fuser = TRUE; }else{ $fuser = FALSE; } if($do_date){ if($date_from < $news_db_arr[0] and $news_db_arr[0] < $date_to){ $fdate = TRUE; } else{ $fdate = FALSE; } } else{ $fdate = TRUE; } if($fdate and $ftitle and $fuser and $fstory){ $found_arr[$news_db_arr[0]] = $archive; } } } echo '
'.str_replace('{x}', count($found_arr), $say['sh_found']).':
'; if($do_date){echo 'from '.@utf8_dates(date('d F Y',$date_from)).' to '.@utf8_dates(date('d F Y', $date_to)).'
';} // Display Search Results if(is_array($found_arr)){ foreach($found_arr as $news_id => $archive){ if($archive){ $all_news = file("$cutepath/data/archives/$archive.news.arch"); } else{ $all_news = file("$cutepath/data/news.txt"); } foreach($all_news as $single_line){ $item_arr = explode('|', $single_line); $local_id = $item_arr[0]; if($local_id == $news_id){ // Showing Result echo"
$item_arr[2] (".utf8_dates(date('d F, Y', $item_arr[0])).')'; // End Showing Result } } } } else{ echo $say['sh_zilch'];} }//if user wants to search elseif( ($misc == "search") and ($subaction == "showfull" or $subaction == "showcomments" or $_POST["subaction"] == "addcomment" or $subaction == "addcomment")){ require_once("$cutepath/show_news.php"); unset($action,$subaction); } ?>