TOPIC:

Select List with all joomla users with user group id= 10 2 years 8 months ago #234997

  • Topic Author
  • karinkuster
  • Offline
  • Junior Breezer
  • Junior Breezer
  • Posts: 40
  • Thanks: 0
Hello
I would like to create a select list with all users with user group id = 10
Can you help me with the code to put in in form pieces - before form

thanks for your help,
Pascale

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

Select List with all joomla users with user group id= 10 2 years 8 months ago #235007

  • mihaela
  • Offline
  • Developer
  • Developer
  • Posts: 3128
  • Karma: 105
  • Thanks: 415
Hello,

Please take a look at this piece of documentation crosstec.org/en/support/online-documenta...ct-list-from-db.html .
Here it is explained how to populate select list element with values from database.

You just have to write the correct query to "#_user_usergroup_map" and "#_users" tables.

Let me know whether you have managed to do so.

Regards,

Mihaela
The following user(s) said Thank You: karinkuster

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

Select List with all joomla users with user group id= 10 2 years 8 months ago #235029

  • Topic Author
  • karinkuster
  • Offline
  • Junior Breezer
  • Junior Breezer
  • Posts: 40
  • Thanks: 0
Hi Mihaela,
Thanks for your hint. I'm not experienced in SQL-Statements. I got this code. It returns what I need. Do you see a problem with it?
best regards, Pascale

$this->execPieceByName('ff_InitLib'); //Include BreezingForms Library
$db = JFactory::getDBO();//Get Database Object

//Create your own query here
$db->setQuery('Select name From zwmbn_users Inner Join zwmbn_user_usergroup_map On zwmbn_users.id = zwmbn_user_usergroup_map.user_id Where zwmbn_user_usergroup_map.group_id =10');

$result = $db->loadColumn(); //load the result from the query
$test = "";
for ($i = 0; $i < count($result); $i++)
{
$test .= "0;".$result[$i].";".$result[$i]."\n";
}

function ff_setSelectList($name, $value)
{
global $ff_processor;
for ($r = 0; $r < $ff_processor->rowcount; $r++)
{
$row =& $ff_processor->rows[$r];
if ($row->name==$name)
$row->data2 = $value;
unset($row);
} // for
} // ff_setSelectList

ff_setSelectList('veranstalter', $test);

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

Select List with all joomla users with user group id= 10 2 years 8 months ago #235044

  • mihaela
  • Offline
  • Developer
  • Developer
  • Posts: 3128
  • Karma: 105
  • Thanks: 415
Hello,

I do not see a problem with your code. From what I see it is working correctly exactly what you wanted.
Good job :)

Regards,

Mihaela
The following user(s) said Thank You: karinkuster

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

Select List with all joomla users with user group id= 10 2 years 8 months ago #235065

  • Topic Author
  • karinkuster
  • Offline
  • Junior Breezer
  • Junior Breezer
  • Posts: 40
  • Thanks: 0
Thanks you for looking over my code.
best regards, Pascale

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

Select List with all joomla users with user group id= 10 2 years 8 months ago #235078

  • mihaela
  • Offline
  • Developer
  • Developer
  • Posts: 3128
  • Karma: 105
  • Thanks: 415
Hello again,

I'm glad I've helped. :)

Regards,

Mihaela

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

  • Page:
  • 1
Moderators: ForumSupport
Time to create page: 0.054 seconds

BreezingForms Pro 1.4.7 for WordPress Released!

Available in the membership section.

September Discount!

Massive discounts on all subscriptions!

Get Your Subscription Here

Quick Links

Downloads

BreezingForms

ContentBuilder

BreezingCommerce

Templates

Documentation

BreezingForms

ContentBuilder

BreezingCommerce

Apprendre BreezingForms (French Community)

Apprendre et maîtriser BreezingForms par des tutoriels et exemples, le tout en français

breezingforms.eddy-vh.com

Questions et réponses sur les forums de l'AFUJ

AFUJ

Special Offer

Summer Sale! All subscriptions at a special price!

Includes prio support, all of our current and future Joomla!® extensions and Joomla!® templates for the duration of your membership.

Get it from here

3rd Party Discount - 25% Off

We help you to keep your costs under control. If you are a new member and purchased a form building tool from a different form vendor, then you'll get a 25% discount on our subscription plans.

How to receive the discount:

Send us a quick email to sales@crosstec.org with a proof of purchase (for example a paypal receipt), await payment instructions and enjoy your membership!