![]() |
| | LinkBack | Thread Tools | Display Modes |
| |||
| search extra fields - solution No idea if this is the cleanest way of doing this, but it seems to work. In your /libs/search.php file, look for first line, and then replace as appropriate with this: Code: if($SearchMethod == 1){
$where = " AND MATCH (link_url, link_url_title, link_title, link_content, link_tags, link_field1, link_field2, link_field3, link_field4, link_field5, link_field6, link_field7, link_field8) AGAINST ('$words' $mode) ";
}
if($SearchMethod == 2){
$where = " AND (link_url like '%$words%' or link_url_title like '%$words%' or link_title like '%$words%' or link_content like '%$words%' or link_tags like '%$words%' or link_field1 like '%$words%' or link_field1 like '%$words%' or link_field2 like '%$words%' or link_field3 like '%$words%' or link_field4 like '%$words%' or link_field5 like '%$words%') ";
}
}
return $where; I have added 8 extra fields to search method 1, but only 5 to search method 2 because it was more work ;> You can of course add as many or as few as you want. |
| Sponsored Links |
|
Check out the New Modules at the Pligg Pro Shop.
|
| |||
| Hmm, found a problem, it doesn't search across fields. So you can't look for a term in field 2 as well as a term in field 3. I wonder if it is to do with the "or" above. To my logic (Actionscript etc) it needs to be some sort of "and or". Any PHP guru want to chime in? I should point out that this is true with the default code, eg if you try to search for a tag & a title (assuming that the tag isn't in the title and vice versa) you will get no results. If you search for either one, you will get results. Last edited by cruci : 11-02-2006 at 04:31 PM. Reason: statement about original behaviour added |
| |||
| I get this error with this edit of search.php SQL/DB Error -- [Can't find FULLTEXT index matching the column list] SQL/DB Error -- [Can't find FULLTEXT index matching the column list] |
| |||
| anybody know what i could do to search extra field 1? |
| ||||
| It doesn't really help you now but the next version of Pligg will search all extra fields automatically. thank Ash for this.
__________________ I accept donations for my time helping users like you on the forum and IRC. FREE and premium Pligg Web Hosting (NO ads, Includes MySQL, PHP, PHPMyAdmin, and Control Panel) - PM me for discounts on premium packages or if you would like a custom-made package. Paypal accepted. |
| |||
| I used pligg 9.0.1 On the admin, I select "3 = is a hybrid, using method 1 if possible, but method 2 if needed." I just added the extra fields but the SQL/DB Error -- [Can't find FULLTEXT index matching the column list] still occurs any expert to share some tips ? |
| |||
| <code>define('Enable_Extra_Field_1', true); define('Field_1_Title', 'extra field 1'); define('Field_1_Instructions', 'write your extra field 1.'); define('Field_1_Searchable', true); //the variables below are not yet used in version 6.02. define('Field_1_Required', true); define('Field_1_Validation_Method', ''); define('Field_1_Validation_Error_Message', ''); </code> Although I select "searchable" as true, SQL/DB Error -- [Can't find FULLTEXT index matching the column list] still appears. On http://abetter2007.com/story.php?tit...-story-title-2 I've added one extra field : "extra field 1" extra field 1: result or outcome for extra field When I search "result" or "result or outcome" or "result or outcome for extra field" SQL/DB Error -- [Can't find FULLTEXT index matching the column list] still appears. Please advise |
![]() |
« Previous Thread
|
Next Thread »
| Thread Tools | |
| Display Modes | |
| |
Similar Threads | ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| search extra fields | cruci | General Help | 1 | 11-02-2006 04:17 PM |
| what are extra fields? | inggenia | General Help | 4 | 10-08-2006 11:51 AM |
| Extra fields does not work | casauxanh | Bug Report | 1 | 07-31-2006 01:15 AM |
| Help with extra fields and/or embeded video validation | gram | General Help | 1 | 07-22-2006 10:40 PM |
| Adding extra fields to the submit form. | AshDigg | Retired Threads | 4 | 02-27-2006 02:56 PM |




Linear Mode

