Community Builder Advanced Search: Search By Age Interval and Avatar Only Unofficial Hack

As I posted in joomla forum about my plan to release my hack for community builder advanced search, here I will give some notes about how to enable and implement the hack. This hack is made for Community Builder Advanced Search 2.0.4 (which might be later adapted to work with the upcoming 2.0.5).

Before you proceed

Currently this component only works in Joomla 1.0.x. It’s not recommended to install this component on Joomla 1.5 unless you want to provide assistance in reporting bugs and compatibility of this component. Please read the full article here.

What’s this hack for?

This hack will enable search for members with certain age ranges, defined by user. This hack will also add extra filter to show only member with avatar / thumbnail photo.

Who will benefit from this hack?

Community based site’s owners and webmasters who use Community Builder to power their community-based service.

Short notice before you decide to implement this hack:

This hack is intended to work with simple_menu_2 mode. If you use other modes for the search, the search won’t take any effect from this modification.

About simple_menu_2 mode:

This mode is the one where you can put several search criteria (ie. predetermined fields). and filter the search based on user input to each field. To check if this mode is enabled, go to Components > Community Builder Advanced Search > Configuration and make sure “Allow Simple Menu 2” is set to “Yes”.

Simple Menu 2 Enabled

To enable this hack, please follow the instruction given below:

1. Download the modified component from this link: http://dev.amikelive.com/joomla1/component/ option,com_remository/Itemid,5/func,fileinfo/id,2/

2. Install the component using Joomla installer from admin backend

3. From your admin panel, go to Components > Community Builder Advanced Search > Configuration

4 Scroll down. Two new config sections will appear.

New Config

The first one is config directive for search by age interval. Enable this hack and manage the interval. For the birthday field, you need to first create the field through Community Builder and make sure your new user is forced to fill his/her birtday or s/he won’t be appeared on the search result page.

For the avatar only directive, no more configuration is needed. Enabling this hack is enough.

If you follow the steps properly, your search form will now be added with two new fields: the search by age interval and search by avatar/photo only.

Search Form

Updates as of 08/14/2007:

  1. Extra sql string to check if avatar contains nophoto.jpg
  2. Tiny cosmetic change in the search template
  3. Sql error fix if “avatar only search” is enabled and user only checks that option and leaves other search criteria (if any) empty.

Updates as of 12/17/2007:

  • Comment is now closed. Please refer to new post “Community Builder Advanced Search (Modified Version) Bugtrack and Wishlist” if you want to submit bug or request new features
  • What to provide for a bug report:
    • Current Joomla version
    • Current Community Builder version
    • Steps to replicate bug in details (#R)
    • Online sample if I can not reproduce #R
  • What to provide for a feature request:
    • Reason for the request
    • Who will take benefit from this additional feature
    • Request details

Update as of 01/08/2008:

  • Comment section reopened after considering some requests and inputs.

Please help me by providing input if you want to make this hack better.

74 thoughts on “Community Builder Advanced Search: Search By Age Interval and Avatar Only Unofficial Hack

  1. dartagnan32

    Great work Mike!
    Ir works perfectly with my website. Just what this com cb advanced search needed! Age by search and profiles with avatar.
    When do you add search within a certain distance of a city? hehe Just joking I guess this is pretty hard unless you add a thirdparty code…
    Anyway for everybody using CB this it the definitive modified component to add to your website!

    Reply
  2. joomla

    Hey, your component doesn´t work for me…it gives a mysql error when it do something with it…Please reply by mail…Thank you

    Reply
  3. Tech Admin Post author

    @dartagnan32
    thanks.. search based on distance will need third party data (ie. zip code, latitude, and longitude) thus this can’t be implemented in the GPL’ed component unless the data is also GPL

    @joomla
    could you please put the error message here? some people might face the same error. listing it here will probably help others too.

    Reply
  4. joomla1234

    When i try to konfigure your component i get this: _CB_AS_ERR_BAD_INTERVAL

    When i try to select a field i get this: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near? at line 2 SQL= UPDATE jos_cb_search_fields SET search=1 WHERE id IN()

    Reply
  5. Tech Admin Post author

    hi,
    the _CB_AS_ERR_BAD_INTERVAL is displayed if you enter invalid age interval for the search. Please make sure the range is common sense like 16 to 85 or such (not vice versa).

    The mysql error you get is something outside of my modification. It’s probably a bug from the original component. Please send me an email with full steps to replicate the problem so that i can take a look and fix the problem.

    Reply
  6. joomla1234

    I dont know your E-Mail… my e-mail is: jooml***[removed]yahoo.de . Please send me an e-mail i would like to reply as soon as possible…

    Reply
  7. dawn

    Help – why doesn’t the advanced search work for me???? It’s returning zero results for every search even when i know there should be results for that search…

    I left a bunch of comments in the emptorum.com site but nobody seems to be watching that site.

    Is there a way to just show the simple search and not the advanced tab until we figure this issue out?

    Any help would be greatly appreciated! Thanks!!!

    Reply
  8. Mike

    When i use your hack it seems that when a member search for exampele “Female with photo” It only show 10 female but the female members are 25 members?
    How come? All the photo is jpg??So it should show 25 pictures

    /Mike

    Reply
  9. Mike

    Hi again.

    I use your mod.2.0.4

    It show all pictures and also the avatars like nophoto.jpg.
    I asume that its the jpg file it reads and think its a real photo.

    How to not include the nophoto.jpg avatars?

    Mike

    Best if you mailme direct so i can see when you answer.

    /Mike

    Reply
  10. Dumitru

    Hi there! Thank you for a great CB plugin … But still, I would appreciate if you’d tell me how to fix the thing with avatars. By selecting “” It shows all users even the one with no avatar …

    Regards,
    Dumitru

    Reply
  11. Tech Admin Post author

    @Dumitru and Mike
    I can not reproduce the bug you mentioned. Please contact me at mike at amikelive dot com if you still face the problem and want to get more detailed response

    In the meantime, I’ve updated the component. Enjoy

    Reply
  12. minghowe

    Hi, i have installed the CB Advanced Search component from the above link,

    hxxp://dev.amikelive.com/joomla1/downloads/cb_search_2.0.4_mod.zip (change xx with tt)

    Upon installation, i have set “Allow Simple Menu 2” in the config, but i still does not allow me to search by age using the hack. I also could not allow user to search by name even though i have enable “name” in the search field.

    Anybody can help me with that?

    Reply
  13. jlsaloff

    In regard to the user who had the error, I had this happen too, but had forgotten to follow the instructions inside the Advanced User Configuration which said to “click update search fields first.” Once I did that, the error message stopped.

    I need help in another means. The original Advanced Search website is apparently down. Thus the only component I got was this one. I have no options with my ASC – just the main config page and options that are available from it. Do I also need the original module that went along with the original component in order for this work? If I need the original module, can someone tell me an alternative site from where to download it or perhaps email it to me?

    Also, I have no instructions. What do I need to do to create a page with the search box on it? This type of search was exactly what I have been looking for, so I hope I can get it to work. I can see all the fields etc., but don’t know how to get the search box.

    BTW, I can find none of the info seems to say which version of Joomla this is for. I am using 1.0.8.

    JLS

    Reply
  14. jlsaloff

    Okay, here’s an update!

    I found the help menu located in the menu choices with the Advanced Search component. (duh). From there, I learned how to connect the search to the menu.

    I still need to know how to create a 3-column avatar only list. (Is that possible?) And if I have that list, does that disable my other user list?

    Also, I still need to know if I need the mambot.

    Thanks,

    JLS

    Reply
  15. Victor

    Hi,

    What kind of field do I need to create on order to search by Age interval ?

    I have tried to add “Date” field, so I asked for birthday date, but when I try searching I get this error:

    Parse error: syntax error, unexpected ‘,’, expecting T_STRING or T_VARIABLE or ‘{‘ or ‘$’ in /home/xxxxxx/public_html/xxxxxxx/components/com_cb_search/cb_search.html.php(504) : eval()’d code on line 3

    Please help.

    Reply
  16. Tech Admin Post author

    Hi Victor,
    Currently I can not reproduce your bug because I’m still at the phase of restoring data from my storage device. I’ll check this problem later and when I confirm this bug, a patch will be provided and can be downloaded at the aforementioned url.

    Reply
  17. Victor

    Hi Tech Admin,

    Thank you for your support. It is very important and useful hack.
    I will check it again and try to find more information.

    By the way, do you think to improve your hack by add an extra filter to show only online member ?

    Regards.

    Reply
  18. jak

    Two issues I’m having (otherwise it’s working great):

    1. I am having problems with dropdown selector fields. It seems there are certain values in each field that fail when selected (giving me a blank page after I press search). Other values in the same fields work perfectly fine and, inspecting the html, I can’t see anything wrong. For example, I have Male or Female as value choices on a gender dropdown select, if I select Female, it always fails.

    2. Selecting only members with photos fails with the same blank page.

    So, the age range selector is working great. FYI- I had the original advanced search com installed and tested successfully on all fields prior to reinstalling with the mod.

    Reply
  19. Flo

    hi there,

    I installed the component but the result of the search for an age interval is always “0”, changing the values in the drop down fields for age does not seem to have any effect. It seems as if the age hack is not activated although I activated it in the configuration.

    Is this possibly because I am using german language and changed the format for “date” in the joomla configuration?

    Thanks for your help!
    Flo

    Reply
  20. Andy

    I am getting massive error messages about the sql syntax to do with the dates, I am also getting a message saying windows does not support dates before January 1st 1970.

    whats going on?

    Reply
  21. andy91

    As far as I can tell Iv followed the cb_birthday instructions correctly. I seem to be getting major errors. I even went as far deleteing the original birthday field and doing it again. The error messages changed. Can I contact you away from this? Or how can I contact the owner of this site.

    I have a picture of the error message Im getting here:
    http://www.joomlapolis.com/component/option,com_joomlaboard/Itemid,38/func,view/catid,40/id,47486/

    Im at a loss as it seems to be working for everybody else apart from me!

    Reply
  22. andy99

    Its happening on every installation I try it on. That site was the last place I tried to install it. There are even more errors on my local JSAS site. Perhaps he has made some changes to the code since you downloaded it? Could you email me the version you are using from your local machine or server to andy@fitphysiques.net?

    Reply
  23. Webmaster PT

    I had the old hack and was working , in the beginnig this one was giving a error but i managed by the replys writen here .
    Now my problem is the component dont give any results ?!?!??!?
    why ?
    i don´t know 🙁
    Please i need help Urg !!!
    the website is loveknocks.com , in the left in the menu with the name
    PESQUISAR
    Please help me !!! i need this module very urgent i need for start lanch the website !
    sorry about the typos , i´m portuguese
    thanks in advance
    nunomfsilva @ netcabo.pt

    Reply
  24. andy

    When I make any search I get the message: you are not allowed to view this page, as if I were an unregistered user.
    Is there anybody facing the same problem?

    Reply
  25. K3

    Hi, I’m lost here. Where can I find the advance search component or module for Joomla/CB? I installed CB and want my users to search by criteria of last name, first name, age, and maybe some other active fields in the modified CB registrations!
    Please help!

    Reply
  26. Tech Admin Post author

    @Paul
    This component should work with CB 1.1 installed in Joomla 1.0.13 or Joomla 1.5 with legacy mode enabled.

    @K3
    You can download this component from my dev site. Please check the link in my post.
    The search you want to perform is basically provided by the native component. You just need to set up which field to be searchable.

    @all
    I’ve set up a post for bugtrack and wishlist. Feel free to post bugs found and wishlist there. I’ll also verify and resolve bugs reported in this post.

    Reply
  27. PKL

    Hi

    I have installed the component

    But, when i try to seek up myselfes i dont get any search results

    I have set the search feilds and are using advanced search

    Look like it dont find any users when seeikng

    Can you help me?

    Reply
  28. I Am N0t Sm4Rt

    I have a problem, lol

    Everything is going good except that I cant search anything. Let say I type in a user name and all it says is “There are no published user list” How do I change this?

    Reply
  29. Ian Morehead

    I am also having the error of “No published user lists” popping up. Any thoughts? Would love to have this search function as well…excellent addon!

    Reply
  30. ibexy

    Am getting errors. The component reports that item has been found but displays errors:

    Parse error: syntax error, unexpected ‘,’, expecting T_STRING or T_VARIABLE or ‘{‘ or ‘$’ in /home/albert/public_html/octoclickcom/components/com_cb_search/cb_search.html.php(469) : eval()’d code on line 10

    Reply
  31. Roni

    The link to download ‘hack’ for advanced search is down. I see this error:
    Fatal error – we should have had a valid file ID

    Is it stored in any other directory?

    Reply
  32. Extery

    I have such a problem as joomla1234.
    you have an error in your SQL syntax, check the manual that corresponds to your MySQL server version for the right syntax to use near ‘)’ at line 2 = SQL UPDATE jos_cb_search_fields SET search = 1 WHERE id IN ()
    Found a solution to this problem?

    Reply
  33. roy

    i got the same error as paul.

    quote:
    “Hello, Is there a version of CB Advance search with joomla 1.5 and CB 1.1 because i get a pattemplate error. If not, is there a workaround. Thank you”

    I run joomla 1.5.1 in legacy mode with cb 1.1

    Reply
  34. dipen

    all the things work fine. But when i search the member it gives the certain number of user and it does not the searched user. it only says: Records found with your search criteria:……
    But doesnot list the user. how can i fix that problem. any one help me.

    Reply
  35. grafika

    i installing advance searche with hak by age searche form and have problem: do not can searche any person with age 1969 and old age
    please help me!

    Reply
  36. Chenelle

    Same as another person when I try to select a field:

    Joomla 1.015, CB 1.1 : what I’m using

    You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near? at line 2 SQL= UPDATE jos_cb_search_fields SET search=1 WHERE id IN()

    Reply
  37. Tech Admin Post author

    @fungkur
    i’ll recheck the pagination issue.

    @grafika
    yes, i know this problem. i should have this component updated and be compatible with cb 1.1 (which by default supports time less than UNIX timestamp initial date: January 1st, 1970)

    @others
    i’m still working on this component and will provide newer version which is compatible with joomla 1.5 and cb 1.1. as i said, time was an issue and i need to re-allocate time for working on open source projects.

    Reply

Leave a Reply

Your email address will not be published. Required fields are marked *