#00AF33
Bark Different.
102833
0
1
Feb 12, 2023 16:57:46 GMT -8
RedBassett
I'm a Marxist/Lennonist of the Groucho/John variety.
15,405
April 2007
applecomputer
RedBassett's Mini-Profile
|
Post by RedBassett on Nov 7, 2012 9:31:47 GMT -8
I am working on a plugin that requires the ability to select members from the forum for the plugin to apply to. I tried using the "forum search" interface element, set to "members", but instead of giving my script the members selected, it only gives the number of members selected.
Is there a way to get a series of users and know who they are?
|
|
inherit
The Dream Crusher (Ret.)
164921
0
Apr 1, 2014 11:00:25 GMT -8
Tim Camara
Teach a man to fish, etc., etc.
1,721
March 2011
tcamara
|
Post by Tim Camara on Nov 7, 2012 13:57:24 GMT -8
|
|
#00AF33
Bark Different.
102833
0
1
Feb 12, 2023 16:57:46 GMT -8
RedBassett
I'm a Marxist/Lennonist of the Groucho/John variety.
15,405
April 2007
applecomputer
RedBassett's Mini-Profile
|
Post by RedBassett on Nov 7, 2012 14:05:22 GMT -8
I am putting the variable (as given to me by the plugin builder) into console.log():
console.log($[plugin.settings.users_allowed]);
I tried selecting the first index (there are currently two users selected in my installation) like below, but I get "undefined".
console.log($[plugin.settings.users_allowed][0]);
|
|
inherit
The Dream Crusher (Ret.)
164921
0
Apr 1, 2014 11:00:25 GMT -8
Tim Camara
Teach a man to fish, etc., etc.
1,721
March 2011
tcamara
|
Post by Tim Camara on Nov 7, 2012 14:31:47 GMT -8
So, it looks like what you're doing is putting javascript in a header & footer box. This is fine, but when you insert the variable from your plugin component, you need to make sure to use the javascript version of the variable. In your case, this would look like:
proboards.plugin.get('[plugin name here]').settings.users_allowed
Of course, the better solution is to put your javascript code into a javascript component rather than a header and footer component. Anything in a javascript component is automatically added to the page the same way a header and footer component is, only you don't have to wrap your code in <script> tags, and the insert variable ability will work correctly.
|
|
#00AF33
Bark Different.
102833
0
1
Feb 12, 2023 16:57:46 GMT -8
RedBassett
I'm a Marxist/Lennonist of the Groucho/John variety.
15,405
April 2007
applecomputer
RedBassett's Mini-Profile
|
Post by RedBassett on Nov 7, 2012 15:14:11 GMT -8
Thank you for clarifying. I had used the Javascript component before, but for some reason I have forgotten, it was giving me trouble and I reverted to the header/footer which worked for me.
Glad to know that the variables work in the appropriate components, though I wish some clarification could be provided (possibly in the developer's guide?) as two Javascript vs templating access to variables.
|
|
inherit
The Dream Crusher (Ret.)
164921
0
Apr 1, 2014 11:00:25 GMT -8
Tim Camara
Teach a man to fish, etc., etc.
1,721
March 2011
tcamara
|
Post by Tim Camara on Nov 7, 2012 15:15:50 GMT -8
Yeah, we're discussing doing that now, sorry for the confusion.
|
|
#00AF33
Bark Different.
102833
0
1
Feb 12, 2023 16:57:46 GMT -8
RedBassett
I'm a Marxist/Lennonist of the Groucho/John variety.
15,405
April 2007
applecomputer
RedBassett's Mini-Profile
|
Post by RedBassett on Nov 7, 2012 15:17:59 GMT -8
No problem. Looking forward to not having to figure this all out through trial and error!
|
|