Forum Index
RegisterSearchFAQMemberlistUsergroupsLog in
How to search in XFields

 
Reply to topic    Forum Index » FAQ View previous topic
View next topic
How to search in XFields
Author Message
FI-DD
Admin


Joined: 22 Sep 2005
Posts: 2683
Location: Germany

Post How to search in XFields Reply with quote
With this little hack you can search in XFields, too.



1. Open search.php and find this:

Code:
<tr>

  <td colspan="2"><input type="submit" value=" Search ">




add above:

Code:
<tr><td></td><td><input id="chk_xfield" type="checkbox" name="search_in_xfield" value="yes" <?=($_GET['search_in_xfield'] ? 'checked' : '');?>> <label for="chk_xfield">Search in XFields</label></td>

 </tr>




2. Find this:

Code:
global $search, $sql;




change to this:

Code:
global $search, $sql, $search_in_xfield;




3. Find this:

Code:
if ($select){




add above:

Code:
  if($search_in_xfield == "yes"){

      $file = file('../data/xfields-data.txt');//Change the path if necessary

      foreach($file as $line){

         $line_arr = explode("|>|", $line);

         $all_values = explode("||", $line_arr[1]);

         foreach($all_values as $single_value){

            $single = explode("|", $single_value);

            if(@preg_match("/$search/i", $single[1])){

               $select[] = $line_arr[0];

            }

         }

      }

   }

Thu Jul 20, 2006 4:34 pm View user's profile Send private message
Guest








Please login to hide the ads.

Display posts from previous:    
Reply to topic    Forum Index » FAQ All times are GMT + 1 Hour
Page 1 of 1

 
Jump to: 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You cannot download files in this forum



Powered by phpBB © 2001, 2005 phpBB Group
Design by Freestyle XL / Music Lyrics.