e107help.org Q&A
0 like 0 dislike

Alright let me try to put this question so it's understandable. I am doing that Band database and in fact I am able to do majority of the band related content in my band plugin but there is one that I can't and it's albums. So what I am doing is that I made a plugin for albums which contains the whole discography of each band.

I have made the album form and everything else is simple but then there should be a dropdown that lists all the bands and I choose to which band that particular album belongs to. Atm my admin_config.php contains the following

$this->fields['bandid']['writeParms']['optArray'] = array('bandid_0','bandid_1', 'bandid_2'); // Example Drop-down array. And that populates dropdown like in the picture

I would need to make the dropdown according to a database query to the band table and list them on that dropdown with bandid as the option value and bandname as option text. I know how to do all the queries etc but I don't know how to place the query result to that array.

Any help would be greatly appreciated cause atm I am stuck with this.

e107 version Version 2.1.6 (git)
asked in Plugins by (69 points) 7 10
reopened by

2 Answers

2 like 0 dislike
Best answer
Look at Owe me plugin by Moc. I always copy this part of code from it. Look at init function.
answered by (1.3k points) 7 52 62
selected by
Where can I find this plugin? I tried to search from Git and also in Plugin Manager but couldn't find it. Thank you for your answer though :)
Moc is one of core developer. Check.his repository on.github. I am on mobile now. Sorry.
Glad the example is still useful. For others: https://github.com/moc/oweme
0 like 0 dislike
Ok found it and I can't believe how close I actually was. Now it's working, thank you!
answered by (69 points) 7 10
@terotolkki : looks you have found a solution (and working) May the issue be closed?
Yes it can be closed. I found a working solution with the awesome help from you guys again :)
Welcome to e107 Q&A, where you can ask questions and receive answers from other members of the e107 community.
744 questions
1,153 answers
1,963 comments
1,176 users