#00AF33
Official Code Helper
19529
0
1
Nov 19, 2012 14:18:28 GMT -8
Todge
**
17,324
January 2004
todge
|
Post by Todge on Jun 27, 2016 10:53:05 GMT -8
Yup, selecting 'No' will mean that the user can only select one member, 'Yes' will allow the user to select multiple members.
|
|
inherit
217348
0
Jul 27, 2022 7:26:44 GMT -8
Lynx
5,849
January 2015
msg
|
Post by Lynx on Jun 30, 2016 22:36:02 GMT -8
Beginning to look like this is going to get scratched. Not getting anywhere with it. I'll tinker a bit more, but (if anyone is waiting for this) don't get your hopes up.
|
|
#00AF33
Official Code Helper
19529
0
1
Nov 19, 2012 14:18:28 GMT -8
Todge
**
17,324
January 2004
todge
|
Post by Todge on Jul 1, 2016 13:09:35 GMT -8
Having problems?
|
|
inherit
217348
0
Jul 27, 2022 7:26:44 GMT -8
Lynx
5,849
January 2015
msg
|
Post by Lynx on Jul 1, 2016 22:54:59 GMT -8
Yes. There's just too many things I don't know how to do, like using keys and how to do comparisons with the forum search tool when set to Members. For example, if more than one member is added in the UI, does it store it as an array (when read in via a for loop) and are the values in the array (if it does) the actual user ID's? I had another post about that forum search tool (requesting if someone could make a sample plugin that uses those - how each is read in and how comparisons are done), but since it hadn't been replied to, I deleted it - so, I struggle and I'm close to just scrapping the project and just posting a request in the request a plugin board.
|
|
#00AF33
Official Code Helper
19529
0
1
Nov 19, 2012 14:18:28 GMT -8
Todge
**
17,324
January 2004
todge
|
Post by Todge on Jul 2, 2016 13:12:18 GMT -8
Yes. There's just too many things I don't know how to do, like using keys and how to do comparisons with the forum search tool when set to Members. For example, if more than one member is added in the UI, does it store it as an array (when read in via a for loop) and are the values in the array (if it does) the actual user ID's? I had another post about that forum search tool (requesting if someone could make a sample plugin that uses those - how each is read in and how comparisons are done), but since it hadn't been replied to, I deleted it - so, I struggle and I'm close to just scrapping the project and just posting a request in the request a plugin board. The members selected in a plugin are stored as an array of user IDs. And, to check the array, your can use inArray().. So, if 'members' is the member array, and 'user' is the member ID you are checking for... if (jQuery.inArray(user, members) != '-1') { //run code if user is in member array... }
|
|
inherit
217348
0
Jul 27, 2022 7:26:44 GMT -8
Lynx
5,849
January 2015
msg
|
Post by Lynx on Jul 2, 2016 16:32:35 GMT -8
Okay. Let's see if I got this right, or if I'm completely screwing it up. Let's say the current member's ID is 3 and the members added into the UI had ID's of 1, 2, and 3. I'm not going to do the entire scripting part - just what I need to show if I understand this.
var user = pb.data('user').id; var members = []; if (pb.plugin('plugin_id').settings.memberlist) { members = pb.plugin('plugin_id').settings.memberlist; } if ($.inArray(user,members) != '-1' || user == "1") { //code to run if current user is in list of listed members (memberlist variable from UI) }
The first if checking to see if any members were added into the UI. The second if checking to see if the current user is one of those listed, or is the root admin. Am I close, or way off?
Thanks!
|
|
#00AF33
Official Code Helper
19529
0
1
Nov 19, 2012 14:18:28 GMT -8
Todge
**
17,324
January 2004
todge
|
Post by Todge on Jul 3, 2016 3:05:31 GMT -8
That is it exactly.
|
|
inherit
2671
0
May 14, 2013 14:40:03 GMT -8
Peter
🐺
10,615
February 2002
peter3
|
Post by Peter on Jul 3, 2016 9:42:18 GMT -8
Try not to cast integers to strings when you don't need too. It doesn't matter too much as you aren't doing any strict testing, but get out of the habit now. Also note that inArray is strict ( Array.prototype.indexOf), and ProBoards tends to store plugin values as strings, so either cast the user id to a string, or better, use ProBoards "inArrayLoose".
|
|
inherit
217348
0
Jul 27, 2022 7:26:44 GMT -8
Lynx
5,849
January 2015
msg
|
Post by Lynx on Jul 3, 2016 11:46:22 GMT -8
Now that I've got the Board Popup ( Board_Popup_100.pbp (1.75 KB) ) working (with a BIG thanks to Todge, Matej and Peter for their help), maybe this project won't seem so daunting. So, I'll re-start on this project when I get back, as I'll be gone on July 4th, 5th and return late afternoon (Eastern Time) on the 6th. As a note, the Board Popup plugin has not been submitted to the library, nor have I made a support thread for it. Not sure if I should submit it or not. Now submitted - awaiting approval. Support Thread here.
|
|
inherit
First Contributor
66253
0
Mar 18, 2024 11:09:20 GMT -8
aRMY83
2,925
December 2005
army83
|
Post by aRMY83 on Jul 3, 2016 12:33:18 GMT -8
Hello Lynx Now this is nice and no problems at all with the popup:
|
|
inherit
217348
0
Jul 27, 2022 7:26:44 GMT -8
Lynx
5,849
January 2015
msg
|
Post by Lynx on Jul 3, 2016 13:17:54 GMT -8
Okay. I didn't foresee it as replacing this project, but if you found a way of how to use to work as such - kudos to you. The Board Popup requires you to actually go to a board for it to show - and it'll show every time you visit that board. There's no "off" or "delay" switch anywhere for it (except for removing the autoform entry for it). The Plugin Update Reminder (when done) will actually have settings for how often and whatnot.
|
|
inherit
First Contributor
66253
0
Mar 18, 2024 11:09:20 GMT -8
aRMY83
2,925
December 2005
army83
|
Post by aRMY83 on Jul 3, 2016 14:36:37 GMT -8
Hello again LynxLooking forward to future updates and will be using this plugin on my main site soon.
|
|
inherit
217348
0
Jul 27, 2022 7:26:44 GMT -8
Lynx
5,849
January 2015
msg
|
Post by Lynx on Jul 3, 2016 14:40:56 GMT -8
Hello again LynxLooking forward to future updates and will be using this plugin on my main site soon. You do realize that the Board Popup is a completely different plugin than this Plugin Update Reminder project. The actual Plugin Update Reminder plugin is not completed yet. The Board Popup has its own support thread now and has been submitted to the library. This project will be worked on when I get back (I'll be gone the 4th, 5th and return late afternoon on the 6th).
|
|
inherit
First Contributor
66253
0
Mar 18, 2024 11:09:20 GMT -8
aRMY83
2,925
December 2005
army83
|
Post by aRMY83 on Jul 3, 2016 15:51:32 GMT -8
My bad Lynx as I should have caught that it was the Board Popup plugin. Having said... the Board Popup is surely one nice plugin.
|
|
inherit
217348
0
Jul 27, 2022 7:26:44 GMT -8
Lynx
5,849
January 2015
msg
|
Post by Lynx on Jul 3, 2016 17:25:51 GMT -8
Thanks, aRMY83. Glad you like it. I was just a pet project really (I've got a couple forums that I was doing the same thing with, but didn't feel like adding header code for each board, so I made it into a plugin).
|
|