Hack - Enable Custom Fields in Search

18 years 4 months ago #1935 by rg66
Hello,

I have modified the source code from CB to search also within the custom fields from the frontend section. The enabling is easily done from backend.

The following changes have been made:

1. Added a new field in the table #__comprofiler_fields
2. Added in the Backend "Fields" a new column to turn searchable on and off
3. Added in the class the new field
4. Added in the frontend the code to dynamically add the field if it is published and also search enabled!

I would like to share this with everyone, if the hack is needed. I would also like to see that this is added in the core. Will forward the files also to the core team if they want to have it! The modification is very little but has a huge impact on the search criteria.

I needed that as we have have many custom fields and our members could not search in/for those.

Just leave a message here and I will post tonight the hack (all files which have been modified).

Best regards,

Robert

Please Log in to join the conversation.

18 years 4 months ago #1953 by rick
Replied by rick on topic Re:Hack - Enable Custom Fields in Search
That sounds awesome and I for one would like to engourage the team to add this functionality. Or barring that maybe someone that has the knowledge can step forward and create a plugin for this funtionality.

Thanks for your efforts,

Rick

Running:
Joomla! 1.0.7 Stable
Community Builder 1.0 rc2
SMF 1.1 RC2

Please Log in to join the conversation.

18 years 4 months ago #1980 by rg66
Replied by rg66 on topic Re:Hack - Enable Custom Fields in Search
Hi,

the update can only be done via ftp! Please note if the cb core team does not consider to add this in their core script, you will have difficulties making updates, so following the below mentioned steps is your own risk. But I can say that this hack can be redone really fast.

The steps:

1. You need to add a new field in your database. Here is the sql code

[code:1]ALTER TABLE `jos_comprofiler_fields` ADD `search` TINYINT( 1 ) DEFAULT '0' NOT NULL AFTER `registration` ;[/code:1]

2. There is one front end zip file which has to loaded into components/com_comprofiler and

3. the other for the backend which has to be loaded ionto administrator/components/com_comprofiler.

As I can only upload one file I have to add another post.

Robert

Attachment comprofiler.frontend.zip not found

Attachments:

Please Log in to join the conversation.

18 years 4 months ago #1981 by rg66
Replied by rg66 on topic Re:Hack - Enable Custom Fields in Search
Here is the second file.

Please note that I believe that this should not be a plugin but should be incorporated in the source code.

Robert

Attachment comprofiler.backend.zip not found

Attachments:

Please Log in to join the conversation.

18 years 4 months ago #2086 by ggouweloos
Replied by ggouweloos on topic Re:Hack - Enable Custom Fields in Search
This is indeed a better search function than the standard CB functionality.

Even better would be a fill-in search form, with specific fields that can be searched on. Checkboxes should be displayed, radio buttons, pulldowns, text fields. If I want all people listed from the United Kingdom, I want to select this value from a pulldown ofcourse.

Please Log in to join the conversation.

18 years 4 months ago #2088 by mikko
Replied by mikko on topic Re:Hack - Enable Custom Fields in Search
I have a component a bit like that. See www.joomlapolis.com/component/option,com_joomlaboard/Itemid,38/func,view/catid,13/id,1307/

It would be quite straight forward to implement this to the front end also.

mikko

Please Log in to join the conversation.

Moderators: beatnantkrileon
Time to create page: 0.278 seconds

Facebook Twitter LinkedIn