Skip to Content Skip to Menu

🎃 Happy Halloween! Treat yourself with an awesome discount on memberships! Get 20% off now with code SPOOKY-2024!

[SOLVED] Advanced List: External Table

  • Cypher666
  • Cypher666
  • OFFLINE
  • Posts: 26
  • Thanks: 4
  • Karma: 0
8 years 8 months ago - 8 years 7 months ago #278471 by Cypher666
[SOLVED] Advanced List: External Table was created by Cypher666
Hi,

i want to get a list of favourites displayed.

The favourites are stored in an EXTERNAL table ( #__user_favourites ) with this structure:

self_user_id
Example value: 23

favourite_user_id
Example values: 30,40,63

When i (user id 23) click on the list, i woul like the users with the id 30, 40 and 63 get displayed.

I read a tons of threads an tried some solution, but without success...


Hope someone can help me...
Last edit: 8 years 7 months ago by krileon.

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

  • krileon
  • krileon
  • ONLINE
  • Posts: 48460
  • Thanks: 8280
  • Karma: 1443
8 years 8 months ago #278547 by krileon
Replied by krileon on topic Advanced List: External Table
You want to display those values as a CB field or you want to display a userlist of users with similar favorites? Sorry, I don't understand what you're trying to do. Please be more specific.


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.

  • Cypher666
  • Cypher666
  • OFFLINE
  • Posts: 26
  • Thanks: 4
  • Karma: 0
8 years 7 months ago #278579 by Cypher666
Replied by Cypher666 on topic Advanced List: External Table
I want to display a personal userlist, with all my personal favourites (users)

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

  • krileon
  • krileon
  • ONLINE
  • Posts: 48460
  • Thanks: 8280
  • Karma: 1443
8 years 7 months ago #278604 by krileon
Replied by krileon on topic Advanced List: External Table
You'll need to edit your userlist then under filtering select advanced. Now you can supply a custom AND statement that is added to the userlist query. Example as follows.

Code:
( ( SELECT COUNT(*) FROM `#__user_favourites` AS fav WHERE fav.`self_user_id` = '[user_id]' AND u.`user_id` = fav.`favourite_user_id` ) >= 1 )

Since you can't specify a custom join it has to be done through a subquery. Adjust as needed, but should work.


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: Cypher666

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

  • Cypher666
  • Cypher666
  • OFFLINE
  • Posts: 26
  • Thanks: 4
  • Karma: 0
8 years 7 months ago #278736 by Cypher666
Replied by Cypher666 on topic Advanced List: External Table
Perfect. Great support! Thank you so much!

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

Moderators: beatnantkrileon
Powered by Kunena Forum