problem with searching
Posted: Sun May 16, 2004 3:30 pm
I use CuteNews it's a small portal based on txt files. When i do a search it comes up with topics and dates of news containing search word. I'd like it just to show the whole news like there was (containing the word we are lookin for ofcourse)
If you don't know what i am talkin about check the site http://torrent.chrupek.com
What u guys suggest ?
Code: Select all
// 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"<br /><b><a href="$PHP_SELF?misc=search&subaction=showfull&id=$local_id&archive=$archive&cnshow=news&start_from=&$user_query">$item_arrї2]</a></b> (". date("d F, Y", $item_arrї0]) .")";
////////// End Showing Result
}
}
}
}else{ echo"There are no news matching your search criteria"; }
}//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);
}
?>What u guys suggest ?