problem with searching

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
User avatar
baks
Forum Newbie
Posts: 3
Joined: Sat May 15, 2004 3:46 am

problem with searching

Post by baks »

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)

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&#1111;2]</a></b> (". date("d F, Y", $item_arr&#1111;0]) .")";

////////// End Showing Result
               &#125;
     &#125;
    &#125;
    &#125;else&#123; echo"There are no news matching your search criteria"; &#125;

&#125;//if user wants to search
elseif( ($misc == "search") and ($subaction == "showfull" or $subaction == "showcomments" or $_POST&#1111;"subaction"] == "addcomment" or $subaction == "addcomment"))&#123;

require_once("$cutepath/show_news.php");

unset($action,$subaction);
&#125;

?>
If you don't know what i am talkin about check the site http://torrent.chrupek.com

What u guys suggest ?
Post Reply