 |
 |
 |
 |
 |
| Author |
Message |
FI-DD
Admin

Joined: 22 Sep 2005 Posts: 2683 Location: Germany |
|
How to search in XFields |
|
With this little hack you can search in XFields, too.
1. Open search.php and find this:
 |  | <tr>
<td colspan="2"><input type="submit" value=" Search "> |
add above:
 |  | <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:
 |  | global $search, $sql; |
change to this:
 |  | global $search, $sql, $search_in_xfield; |
3. Find this:
 |  | if ($select){ |
add above:
 |  | 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 |
|
 |
Guest
|
|
|
Please login to hide the ads.
|
|
|
|
 |
|
|
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
|
|
 |
 |
 |
|