Plugin to retrieve users list?

More
14 years 3 months ago #2815 by mett
Hello

I'm looking for a plugin or something similar to retrieve users list when i create a new field. What i need is to show a dropdown list box with existing users so an editor should choose one or multiple users form list. I have over 2000 users so i cannot add each user in dropdown...

How can i do that?

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

More
14 years 3 months ago #2818 by yopyop001
Hi,

If i have well understood :

You can use the field 'Select Multiple' with the parameter 'use SQL Query' to yes and 'field elements' with the query
Code:
SELECT id as value, username as text from #__users
or
Code:
SELECT id as value, name as text from #__users

You can add some lines in your query to order the list for example.

In the form, when you 'll add an item, you'll have a multiple select list whith all the users of your site.

Rgds.

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

More
14 years 1 month ago #5753 by Nudles
Hello I've a problem.
I want to built a field with a select list of countries. I have a list, jos_joomcountries with 245 Countries.
But when I put in the code

SELECT id AS value, title AS text FROM #_joomcountries

this error
Either the query is not correct or does not deliver results
is in the form.
Sorry I am not a programmer, only a sailer. Learning by doing :roll:

Someone can help me?

Moin moin und immer eine handbreit Wasser unter dem Kiel

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

More
14 years 1 month ago #5759 by yopyop001
Hi,

Can you see in PhpMyadmin what is the name of your table fields?

May be for country you will not have id and title but something else.

After looking that, you can do :
Code:
SELECT xx AS value, yy AS text FROM #_joomcountries

where xx can be the primary_key of the row (may be ISO code for country) and yy the name of the country.

I hope it helps.

Bye

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

More
14 years 1 month ago #5766 by Nudles
Hi, thanks for your quick responze.

the primary key is the id field from 1-245
code field for iso (like DE, GB, aso)
and title for the country

I played arround but everytime no result, nothing displayed.

Moin moin und immer eine handbreit Wasser unter dem Kiel

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

More
14 years 1 month ago #5768 by yopyop001
That's strange,

Does the queries
Code:
SELECT id AS value, title AS text FROM jos_joomcountries
Code:
SELECT code AS value, title AS text FROM jos_joomcountries

return values in PhpMyadmin?

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

Moderators: vistamediajoomlacornerggppdk
Time to create page: 0.269 seconds
Save
Cookies user preferences
We use cookies to ensure you to get the best experience on our website. If you decline the use of cookies, this website may not function as expected.
Accept all
Decline all
Essential
These cookies are needed to make the website work correctly. You can not disable them.
Display
Accept
Analytics
Tools used to analyze the data to measure the effectiveness of a website and to understand how it works.
Google Analytics
Accept
Decline