inherit
217348
0
Jul 27, 2022 7:26:44 GMT -8
Lynx
5,846
January 2015
msg
|
Post by Lynx on Feb 17, 2020 6:51:45 GMT -8
Reference: support.proboards.com/post/7223430/threadI see that in the build, one can do a Forum Search > Themes option in a plugin. I've never used that one before, so I'm inquiring as to how that works in a plugin - as in, how do I test to know what theme a person is using and checking to see if it's the theme that was selected in the UI for that particular link. I suspect that an array is involved. I'm guessing something like: pb.data('user').theme_idwould get me the user's current theme. If so, should I parseInt that value: parseInt(pb.data('user').theme_id, 10)for testing purposes? I'm also guessing that something like this is needed to check the theme(s) selected in the plugin: if (pb.plugin.get('plugin_ID').settings.msg_navlink.use_theme.length) { for (x = 0; x < pb.plugin.get('plugin_ID').settings.msg_navlink.use_theme.length; x++) { isTheme.push(pb.plugin.get('plugin_ID').settings.msg_navlink[x].use_theme); } };
If my assumptions are correct, this is basically the same "procedure" as testing for board ID's, member ID's, etc. I'm mostly looking to see if I'm correct in my assumptions above before proceeding and adding that into the plugin. Thank you!
|
|
inherit
2671
0
May 14, 2013 14:40:03 GMT -8
Peter
🐺
10,615
February 2002
peter3
|
Post by Peter on Feb 17, 2020 15:40:44 GMT -8
Yep, pretty much got it. The array that you test against will contain strings which represent the theme index (starting at 1). If you aren't doing strict testing, then don't worry too much about converting to an int. Though it's a good habit to get into, especially when dealing with data that could come from the user.
|
|
inherit
217348
0
Jul 27, 2022 7:26:44 GMT -8
Lynx
5,846
January 2015
msg
|
Post by Lynx on Feb 23, 2020 13:14:37 GMT -8
Thanks for the confirmation, Peter!
|
|