Dynamic Parameter in SQL CUSTOM FIELD

  • Martin Breza
  • Topic Author
  • Offline
  • New Member
  • New Member
More
2 years 11 months ago - 2 years 11 months ago #143268 by Martin Breza
Dynamic Parameter in SQL CUSTOM FIELD was created by Martin Breza
Hello,
from your documentation following SQL statement can be used to populate SQL Custom Field:
Code:
SELECT name AS value, name AS text FROM table WHERE published = 1 ORDER BY name

Is it possible to use variables in WHERE condition? Preferably USER ID or MEMBERSHIP ID? Something like this:

Code:
$user   = JFactory::getUser(); $userId  = $user->get('id'); SELECT name AS value, name AS text FROM table WHERE UserId = {$userId}


Thank you,
Martin
Last edit: 2 years 11 months ago by Martin Breza.

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

  • Tuan Pham Ngoc
  • Away
  • Administrator
  • Administrator
More
2 years 11 months ago #143269 by Tuan Pham Ngoc
Replied by Tuan Pham Ngoc on topic Dynamic Parameter in SQL CUSTOM FIELD
Hi Martin

No, it is not possible at the moment. Please note that use something like:

$user = JFactory::getUser();

is not right. The reason is because the field not only being displayed for user but also when admin view/edit the subscription record, so use current user ID like that is not right

Tuan

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

  • Martin Breza
  • Topic Author
  • Offline
  • New Member
  • New Member
More
2 years 11 months ago #143285 by Martin Breza
Replied by Martin Breza on topic Dynamic Parameter in SQL CUSTOM FIELD
Hi Tuan,
I believe I've finally find exactly what I need. I will try to use PHP Script plugin ( joomdonation.com/forum/membership-pro-ge...membership-card.html ).

Thank you,
Martin

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

  • Tuan Pham Ngoc
  • Away
  • Administrator
  • Administrator
More
2 years 11 months ago #143286 by Tuan Pham Ngoc
Replied by Tuan Pham Ngoc on topic Dynamic Parameter in SQL CUSTOM FIELD
Great. But please note that the script plugin is only executed after subscription store, active or expired

It has nothing with SQL custom fields.

Tuan

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

More
2 years 8 months ago #145980 by Joshua Goldberg
Replied by Joshua Goldberg on topic Dynamic Parameter in SQL CUSTOM FIELD
Hi Martin,

Did you get this working?

Kind regards,

Josh

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