1. jimbo
  2. Support
  3. Wednesday, August 12 2015, 08:21 AM
Hi,

I'm trying to display a user list of profiles in the same company. I have so far;

company_name IN (SELECT company_name FROM #__jsn_users WHERE company_name='My Company Name')

This works but I want it to be dynamic so I need to swap 'My Company Name' for [company_name of user] (I think) but I'm unsure how to do that..

Any help would be much appreciated. Thanks.
Accepted Answer
admin Accepted Answer
Admin
try with this:
company_name LIKE "{user company_name displayedOrMe}" AND company_name IS NOT NULL AND company_name<>''


NOTE: in some version of MySQL you need to use
!=
instead
<>
  1. more than a month ago
  2. Support
  3. # Permalink
admin Accepted Answer
Admin
Hi,
our content plugin is triggered also in SQL custom Where, so you can use something like this
company_name LIKE "{user company_name}"


if company name is select,radio or checkbox you need to use {user company_name raw}, because you need to search by Database values

here docs of our content plugin: https://www.easy-profile.com/docs/26-plugin-content.html
  1. more than a month ago
  2. Support
  3. # 1
jimbo Accepted Answer
Basic
Hi,

thank you for your reply.

Your example worked well for the logged in user. I wanted to make it work for the displayed profile, which I think this does;

company_name LIKE "{user company_name displayedOrMe}"

but it has thrown up an unexpected bug of listing users with NULL company names. I can fix by making the company name mandatory but I don't want to do this so I think I may have to edit the mod_jsnusers/default.php file.

Many thanks.
  1. more than a month ago
  2. Support
  3. # 2
jimbo Accepted Answer
Basic
Perfect. Thank you very much.
  1. more than a month ago
  2. Support
  3. # 3
  • Page :
  • 1


There are no replies made for this post yet.
However, you are not allowed to reply to this post.
Sorry, the discussion is currently locked. You will not be able to post a reply at the moment.