[SOLVED] Show an image based on ACL group

7 years 10 months ago - 7 years 10 months ago #283644 by paxx
Hi
I need some help with showing an image that are based on Joomla ACL group.

Here is the scenario:
I have 4 special ACL groups A, B, C and D. Based on in which ACL group the member is in I want to show a "member badge" for this member showing in which membergroup he/she is in (guess a little like you have here).

So step 1 is to create a field. But I have no clue of what kind of field I should create (guess it should be an image field)
Step 2 should be to create a query I guess perhaps something like this
SELECT `title` FROM `#_usergroups` WHERE `MY_OWN_FIELD` = [value]

But how will I get the corresponding image to show up in my field?
In root/images/member I put my images for the different membership.

I do not use CB Subs but another membership extension to put the users in different ACL groups.
Using Joomla 3.5.1
CB 2.0.14 Latest

All other plugins are up to date (the latest ones)

Should also mention that I have no experience in coding so what ever so if something I wrote is wrong be patient with me I'm learning :)

If the problem can be solved why worry? If the problem cannot be solved, worrying will do you no good.

Please Log in to join the conversation.

7 years 10 months ago #283661 by krileon
Replied by krileon on topic Show an image based on ACL group
If it's ACL based I'd simply make a Custom HTML field and use IF substitutions to display an image, badge, or whatever you want based off that user having that usergroup. Example as follows.

[cb:if usergroup includes "2"]I have Registered Usergroup[/cb:if]

See the below substitution tutorial for further usage information.

www.joomlapolis.com/documentation/279-community-builder/tutorials/18353-using-substitutions-throughout-cb

For our usage we're using CBSubs and CBSubs Plans Image and it's as simple as assigning an image to a plan then displaying the plans image field. CBSubs can also manage usergroups and being a developer you've access to CBSubs as well; something to consider ;).


Kyle (Krileon)
Community Builder Team Member
Before posting on forums: Read FAQ thoroughly + Read our Documentation + Search the forums
CB links: Documentation - Localization - CB Quickstart - CB Paid Subscriptions - Add-Ons - Forge
--
If you are a Professional, Developer, or CB Paid Subscriptions subscriber and have a support issue please always post in your respective support forums for best results!
--
If I've missed your support post with a delay of 3 days or greater and are a Professional, Developer, or CBSubs subscriber please send me a private message with your thread and will reply when possible!
--
Please note I am available Monday - Friday from 8:00 AM CST to 4:00 PM CST. I am away on weekends (Saturday and Sunday) and if I've missed your post on or before a weekend after business hours please wait for the next following business day (Monday) and will get to your issue as soon as possible, thank you.
--
My role here is to provide guidance and assistance. I cannot provide custom code for each custom requirement. Please do not inquire me about custom development.
The following user(s) said Thank You: paxx

Please Log in to join the conversation.

7 years 10 months ago #283687 by paxx
Replied by paxx on topic Show an image based on ACL group
Hi Kyle
Thanks a lot for your advice, this way was a lot easier.

Regarding CB Subs, yes I will consider using that but first I'll need to translate it via Transifex.
It's only translated to 8% in Swedish for now.

Cheers
Stephen

If the problem can be solved why worry? If the problem cannot be solved, worrying will do you no good.
The following user(s) said Thank You: krileon

Please Log in to join the conversation.

Moderators: beatnantkrileon
Time to create page: 0.193 seconds

Facebook Twitter LinkedIn