inherit
217348
0
Jul 27, 2022 7:26:44 GMT -8
Lynx
5,824
January 2015
msg
|
Post by Lynx on Aug 19, 2015 10:09:12 GMT -8
Tagging Tim Camara, but anyone who knows can answer. I'm looking for any kind of list that shows what all of the proboards.data types are. For example: proboards.data('user') or proboards.data('route') along with "extensions", like the id in proboards.data('user').id as well as what can be tested, such as "thread_new" (and which proboards.data type it can be used with). I hope that explains what I'm looking for. If I'm not clear enough, I'll be happy to elaborate more. Thanks!
|
|
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 Aug 19, 2015 10:40:30 GMT -8
You can use proboards.dataHash; to see everything that is available to the current page. Also note that the proboards.data syntax has been deprecated in favor of the pb.data syntax.
|
|
inherit
217348
0
Jul 27, 2022 7:26:44 GMT -8
Lynx
5,824
January 2015
msg
|
Post by Lynx on Aug 19, 2015 15:49:27 GMT -8
You can use proboards.dataHash; to see everything that is available to the current page. Also note that the proboards.data syntax has been deprecated in favor of the pb.data syntax. Thanks for the reply, Tim Camara! Just curious - where would I use the proboards.dataHash; ? In the console? (I'm still new to a lot of this stuff. My apologies for my lack of knowledge on it.)
|
|
inherit
201984
0
Sept 11, 2023 1:23:07 GMT -8
P̌̓aͧś̀t̀u͒le͆o͂2̀3̃̓
Using My Talents Elsewhere
3,314
November 2013
pastuleo23
|
Post by P̌̓aͧś̀t̀u͒le͆o͂2̀3̃̓ on Aug 19, 2015 21:10:38 GMT -8
You can use proboards.dataHash; to see everything that is available to the current page. Also note that the proboards.data syntax has been deprecated in favor of the pb.data syntax. Thanks for the reply, Tim Camara! Just curious - where would I use the proboards.dataHash; ? In the console? (I'm still new to a lot of this stuff. My apologies for my lack of knowledge on it.) support.proboards.com/thread/558354/tutorial-keys-saving-data-proboardsMy thread shows an example of the data hash. However the data hash is different from every page and has no documentation. It's a giant object that you can learn how to call by reading it's makeup. This can be found near the top of each page you load on every Proboards forum. It is a script in the header of a page. If you inspect element or view source of the page, you should be able to hit find (ctrl f) and search for the word 'data' This should bring up the huge object in it's stringified form. Just pick through it to find what you need. Also would like to mention that Kitchen Sink by @ peter3 has a learning console for at least 7 keys in this object downloadable from the library.
|
|
inherit
201984
0
Sept 11, 2023 1:23:07 GMT -8
P̌̓aͧś̀t̀u͒le͆o͂2̀3̃̓
Using My Talents Elsewhere
3,314
November 2013
pastuleo23
|
Post by P̌̓aͧś̀t̀u͒le͆o͂2̀3̃̓ on Aug 19, 2015 21:11:23 GMT -8
As always you can ask me more via pm/online
|
|
inherit
217348
0
Jul 27, 2022 7:26:44 GMT -8
Lynx
5,824
January 2015
msg
|
Post by Lynx on Aug 21, 2015 13:13:32 GMT -8
P̌̓aͧś̀t̀u͒le͆o͂2̀3̃̓, I took another look at the thread you linked. While you tell what kinds of data you can get from a page, I didn't see how to get the data. In other words, what exact steps do I take to get the dataHash info from a page? I've tried hitting F12 and looking to see if there was somewhere in the Console I could type in pb.dataHash(), but I'm lost. Being able to get this info is actually holding me up on my plugins.
|
|
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 Aug 21, 2015 13:49:37 GMT -8
Assuming you're using Firefox: The part outlined in red in the bottom left corner is where you type in: proboards.dataHash; Then hit enter. After that, if you click on the word Object in italics in the console, it'll open the menu on the right side of the console, so you can easily see the structure of the object.
|
|
inherit
217348
0
Jul 27, 2022 7:26:44 GMT -8
Lynx
5,824
January 2015
msg
|
Post by Lynx on Aug 21, 2015 14:45:55 GMT -8
Thank you VERY much, Tim Camara! That's exactly what I was looking for!
|
|
inherit
217348
0
Jul 27, 2022 7:26:44 GMT -8
Lynx
5,824
January 2015
msg
|
Post by Lynx on Aug 27, 2015 8:17:51 GMT -8
A few more quick questions regarding data: If I set up the UI to use a Search > Boards entry (not in an autoform): (1) do you cycle through the boards as an array (Example: var brds = pb.data('board').id[0] (would be first board if one or more selected))? (2) would it be better to use pb.data('board').name for an if comparison, or doesn't it matter (see example if below)? (3) does (1) and (2) apply to groups as well? Example if (Note that this would be in a for loop - we'll use a variable named a for the loop)) if(pb.data('board').id == pb.plugin.get('msg_hide_links').settings.hide_on_boards[a])
I'm sort of stuck on how the Search feature works in the UI. I'm assuming the response(s) here would also apply if Members, Categories and Themes were used. Not sure how to do Custom Pages there, but I don't need that aspect right away. Thanks! EDIT: I'm asking because I don't know if those are saved as the .name or the .id when selected. (I doubt it would work very well if it saved it by NAME and I was trying to do a comparison for ID).
|
|
#eb7100
33409
0
1
Oct 19, 2024 14:37:42 GMT -8
Brian
48,130
November 2004
smashmaster3
|
Post by Brian on Aug 27, 2015 8:54:47 GMT -8
If you're referring to using the board search in a plugin it adds the numerical IDs of the boards you've selected to an array. Typically I loop through that array and check against pb.data('page').board.id on the page I'm viewing if I'm using it to determine whether or not to run something in a specific board.
Since it utilizes the IDs exclusively you'll probably not get very far checking against the name.
Groups also utilize numerical IDs which I'm guessing you know can be found in the URLs of each of their name links in the Groups tab of your profile. You'd check against these in a similar manner utilizing the properties available in pb.data('user').
|
|
inherit
217348
0
Jul 27, 2022 7:26:44 GMT -8
Lynx
5,824
January 2015
msg
|
Post by Lynx on Aug 27, 2015 9:00:58 GMT -8
Thank you for the reply, Brian! Does that mean the way I used ( pb.data('board').id) would require you to be on that board for it to register (and conceivably run)? I'm still working on learning these data types. proboards.dataHash; in the console is great, but not really good for actually learning them. Is there documentation anywhere on those? Thanks again for the reply!
|
|
#eb7100
33409
0
1
Oct 19, 2024 14:37:42 GMT -8
Brian
48,130
November 2004
smashmaster3
|
Post by Brian on Aug 27, 2015 9:29:31 GMT -8
You'd need to use pb.data('page').board.id as that's where the ID is located. pb.data('board') returns null as nothing has been defined for it. Most properties in proboards.dataHash have names that define what they stand for. For others it's simply up to whether or not you have any use for the data that they contain. The majority of my plugins only utilize pb.data('user') and pb.data('page') so I've never used the vast majority of the other properties found in the data hash. I'm not sure what else there is to learn about them.
|
|
inherit
217348
0
Jul 27, 2022 7:26:44 GMT -8
Lynx
5,824
January 2015
msg
|
Post by Lynx on Aug 27, 2015 10:42:31 GMT -8
Okay. Thanks again for the reply, Brian!
|
|
inherit
201984
0
Sept 11, 2023 1:23:07 GMT -8
P̌̓aͧś̀t̀u͒le͆o͂2̀3̃̓
Using My Talents Elsewhere
3,314
November 2013
pastuleo23
|
Post by P̌̓aͧś̀t̀u͒le͆o͂2̀3̃̓ on Aug 27, 2015 12:52:14 GMT -8
Okay. Thanks again for the reply, Brian! I can agree that the only thing to learn about them is calling them and most have no practical application in Plugins as Brian has stated. Just make sure your comparing the item as the same data type. If you have the boards.id in an array they might be numbers but in the format of a string. Don't go comparing that to the page id which is in integer form. Use if(pb.data('page').board.id==parseInt(pb.plugin.get('msg_hide_links').settings.hide_on_boards[ a ])) I'm not sure if they default as numbers, but most data from the ui does not.
|
|
inherit
217348
0
Jul 27, 2022 7:26:44 GMT -8
Lynx
5,824
January 2015
msg
|
Post by Lynx on Aug 27, 2015 13:13:16 GMT -8
Thanks for that info, P̌̓aͧś̀t̀u͒le͆o͂2̀3̃̓! Hopefully, I'll be able to get my version of Hide Links done soon now.
|
|