Notice

The forum is in read only mode.

Support Forum

Welcome! Support Forums have been reactivated
Welcome the Technical Support section. Help us in assisting you by providing us with a concise and descriptive elaboration of your issues. Be specific and if possible, provide us with a step-by-step instruction in replicating your problem.

Search by both Username and Full name

8 years 8 months ago
Licenses:
JomSocial Expired Socialize Expired

Can you please tell me in which version you are going to implement search for both Username and Full name of each profile? Currently only one out of two is allowed in my site.

Thank you.

8 years 8 months ago
  • Dimas's Avatar
  • Dimas
  • Visitor
  • Thank you received: 0
Licenses:

Hi,

You need hack the code to achive this please you follow this topic www.jomsocial.com/forum/technical-issues...?limitstart=0#132688

thank you

8 years 8 months ago
Licenses:
JomSocial Expired Socialize Expired

Ok I replaced the code. In the meantime, I have enabled search only by name. Can you send me detailed info on how to add a search field by Username ?


I see, please open this file components/com_community/models/search.php, find this code :
$nameType = $db->quoteName( $config->get( 'displayname' ) );
$filter[] = 'UCASE(' . $nameType . ') LIKE UCASE(' . $db->Quote( '%' . $value . '%' ) . ')';

replace to :
$nameType = $db->quoteName( $config->get( 'displayname' ) );
$filter[] = '(UCASE(' . $nameType . ') LIKE UCASE(' . $db->Quote( '%' . $value . '%' ) . ') OR UCASE(`name`) LIKE UCASE (' . $db->Quote( '%' . $value . '%' ) . ') )';

This is not tested yet, but I hope it will work

8 years 8 months ago
  • Dimas's Avatar
  • Dimas
  • Visitor
  • Thank you received: 0
Licenses:

You can try this code :

$nameType	= $db->quoteName( $config->get( 'displayname' ) );
$filter[]	= '(UCASE(' . $nameType . ') LIKE UCASE(' . $db->Quote( '%' . $value . '%' ) . ') OR UCASE(`username`) LIKE UCASE (' . $db->Quote( '%' . $value . '%' ) . ') )';

Moderators: Piotr Garasiński
Powered by Kunena Forum

Join 180,000 websites creating Amazing communities

JomSocial is the most complete, easy-to-use addon that turns Joomla CMS into a
full -fledged, social networking site

TRY NOW BUY NOW