Skip to Content Skip to Menu

[SOLVED] Profile Gallery Images in user list

10 years 3 months ago - 10 years 3 months ago #246695 by fauvdesign
I would like to show up to 4 Gallery pictures for each user in the User Lists (assuming that they have added images to their gallery).

Is this possible?

If not can you give me some pointers to get me going? I am familiar with Joomla and PHP development (even writing a few of my own joomla components and modules) but am not familiar with Community Builder or its plugins.

using:
Joomla 3.3.1
CB 1.9.1
CB Gallery 1.2
Last edit: 10 years 3 months ago by krileon.

Please Log in or Create an account to join the conversation.

  • krileon
  • krileon
  • ONLINE
  • Posts: 48479
  • Thanks: 8282
  • Karma: 1443
10 years 3 months ago #246713 by krileon
Replied by krileon on topic Profile Gallery Images in user list
If they were image fields you'd be able to add all 4 image fields to the list, but as it's a plugin tab it's basically all or nothing as you can render a tab using substitutions, but you won't be able to tell it to only show 4 images. You could try using CB Query Field to query the database for 4 entries then construct their HTML manually. Example of this as follows.

Query:
Code:
SELECT `pgitemfilename` FROM `#__comprofiler_plug_profilegallery` WHERE `userid` = '[user_id]' AND `pgitempublished` = 1 AND `pgitemapproved` = 1 LIMIT 4
Output: Multiple Rows
Row:
Code:
<img src="[cb:config param="live_site" /]/images/comprofiler/plug_profilegallery/[user_id]/tn[column_pgitemfilename]" />

The above should grab the first 4 images from the users profile gallery. Then parse it into an image tag. The config substitution auto prepends the live site path. The path way is then unique based off user id which is also substituted in. Finally the filename for the image is substituted in by substituting the database column selected in the query. The "tn" before the filename ensures the thumbnail image is returned instead of fullsized as fullsized is probably too large for userlist display.


Please understand the above is just an example. It was not tested. Adjust as necessary.


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.

Please Log in or Create an account to join the conversation.

10 years 3 months ago #247212 by fauvdesign
Replied by fauvdesign on topic Profile Gallery Images in user list
Great! That was exactly what I needed.

Thank you.

Please Log in or Create an account to join the conversation.

Moderators: beatnantkrileon
Powered by Kunena Forum