inherit
216224
0
Aug 1, 2024 1:18:46 GMT -8
Quozzo
408
November 2014
quozzo
|
Post by Quozzo on May 3, 2016 5:53:19 GMT -8
The top post "nibh" is the one containing the comments. It has a post ID of 22 but that is no where on the page. qtest.boards.net/page/recent-postspb.plugin.key('postComments').get(22);all post ids on page Object.keys(proboards.plugin.keys.data.postComments) Sweet, are they in order though. I don't want a comment saying that the post is awesome, when is was a spammer lol. EDIT: It appears to miss out posts that don't have comments, so I don't know which posts are the ones with the comments It won't be an issue if all the posts have comments, but if just one doesn't have any then they may be attached to the wrong post. PS: I've got to shoot, be back in a few hours.
|
|
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 May 3, 2016 6:29:42 GMT -8
all post ids on page Object.keys(proboards.plugin.keys.data.postComments) Sweet, are they in order though. I don't want a comment saying that the post is awesome, when is was a spammer lol. EDIT: It appears to miss out posts that don't have comments, so I don't know which posts are the ones with the comments It won't be an issue if all the posts have comments, but if just one doesn't have any then they may be attached to the wrong post. PS: I've got to shoot, be back in a few hours. You can read init permissions from var temp = $('script')
for(a=0;a<temp.length;a++){if(temp.text().indexOf('init_permissions')!=-1){console.log(temp.text())}}
|
|
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 May 3, 2016 8:16:38 GMT -8
all post ids on page Object.keys(proboards.plugin.keys.data.postComments) Sweet, are they in order though. I don't want a comment saying that the post is awesome, when is was a spammer lol. EDIT: It appears to miss out posts that don't have comments, so I don't know which posts are the ones with the comments It won't be an issue if all the posts have comments, but if just one doesn't have any then they may be attached to the wrong post. PS: I've got to shoot, be back in a few hours. This is the hack I got: var temp = $('script') var lens = temp.length temp = temp.text() for(a=0;a<lens;a++){if(temp.indexOf('init_permissions')!=-1){temp = temp.substr(temp.indexOf('init_permissions'),temp.length).match(/{(.*?)}/)[0];temp = eval('('+temp+')');temp=Object.keys(temp);var lens2=temp.length;for(b=0;b<lens2;b++){console.log(temp[b])}};break;} And yes eval is necessary since the object keys are numbers so JSON.parse and $.parseJSON throw errors. temp stores an array with every post id on the page that originally is used to initiate key permissions. So it will run even when you don't have key data. Not to mention coupled with the script with ids that you know has key data; you could fix your plugin up quite nicely.
|
|
inherit
216224
0
Aug 1, 2024 1:18:46 GMT -8
Quozzo
408
November 2014
quozzo
|
Post by Quozzo on May 3, 2016 9:46:28 GMT -8
Sweet, are they in order though. I don't want a comment saying that the post is awesome, when is was a spammer lol. EDIT: It appears to miss out posts that don't have comments, so I don't know which posts are the ones with the comments It won't be an issue if all the posts have comments, but if just one doesn't have any then they may be attached to the wrong post. PS: I've got to shoot, be back in a few hours. This is the hack I got: var temp = $('script') var lens = temp.length temp = temp.text() for(a=0;a<lens;a++){if(temp.indexOf('init_permissions')!=-1){temp = temp.substr(temp.indexOf('init_permissions'),temp.length).match(/{(.*?)}/)[0];temp = eval('('+temp+')');temp=Object.keys(temp);var lens2=temp.length;for(b=0;b<lens2;b++){console.log(temp[b])}};break;} And yes eval is necessary since the object keys are numbers so JSON.parse and $.parseJSON throw errors. temp stores an array with every post id on the page that originally is used to initiate key permissions. So it will run even when you don't have key data. Not to mention coupled with the script with ids that you know has key data; you could fix your plugin up quite nicely. Yeah, I was thinking retrieving the keys from the script tag, but eval = evil. Using regex I can just get the numbers directly. var keys = $('head script').filter(':contains(postComments)').text().match(/proboards\.plugin\.keys\.init_permissions\(\["postComments",\{((?:\d+\:\[\d\,\d\]\,?)+)/)[1].replace(/\:\[.+?\]/g, "").split(",").sort().reverse(); console.log(keys); Then checking if any comments exits for that id using Object.keys(proboards.plugin.keys.data.postComments) means I could place them in the correct post (assuming the recent posts are always in order and always descend).
|
|
inherit
Peabrained Codebreaker
107114
0
Mar 11, 2020 7:47:27 GMT -8
Boy_Wonder
6,249
July 2007
natzy24
|
Post by Boy_Wonder on May 3, 2016 10:02:21 GMT -8
This is the hack I got: var temp = $('script') var lens = temp.length temp = temp.text() for(a=0;a<lens;a++){if(temp.indexOf('init_permissions')!=-1){temp = temp.substr(temp.indexOf('init_permissions'),temp.length).match(/{(.*?)}/)[0];temp = eval('('+temp+')');temp=Object.keys(temp);var lens2=temp.length;for(b=0;b<lens2;b++){console.log(temp[b])}};break;} And yes eval is necessary since the object keys are numbers so JSON.parse and $.parseJSON throw errors. temp stores an array with every post id on the page that originally is used to initiate key permissions. So it will run even when you don't have key data. Not to mention coupled with the script with ids that you know has key data; you could fix your plugin up quite nicely. Yeah, I was thinking retrieving the keys from the script tag, but eval = evil. Using regex I can just get the numbers directly. var keys = $('head script').filter(':contains(postComments)').text().match(/proboards\.plugin\.keys\.init_permissions\(\["postComments",\{((?:\d+\:\[\d\,\d\]\,?)+)/)[1].replace(/\:\[.+?\]/g, "").split(",").sort().reverse(); console.log(keys); Then checking if any comments exits for that id using Object.keys(proboards.plugin.keys.data.postComments) means I could place them in the correct post (assuming the recent posts are always in order and always descend). -whispers- Eval is only one letter off from Evil, funny how all the other letters are in the right place
|
|
inherit
224450
0
Feb 7, 2017 11:46:28 GMT -8
blitzen
236
August 2015
blitzen
|
Post by blitzen on May 3, 2016 11:07:38 GMT -8
Well I use the widget called "Display Post" if that's of any use.
|
|
inherit
216224
0
Aug 1, 2024 1:18:46 GMT -8
Quozzo
408
November 2014
quozzo
|
Post by Quozzo on May 3, 2016 11:21:54 GMT -8
Well I use the widget called "Display Post" if that's of any use. Do you only use more than one Display Post widget and do you use the Recent Posts widget on the same page? If so (to either question) then it won't be possible, but if you only use the one then it will be. Post Comments.pbp (3.57 KB)
|
|
inherit
224450
0
Feb 7, 2017 11:46:28 GMT -8
blitzen
236
August 2015
blitzen
|
Post by blitzen on May 3, 2016 11:31:36 GMT -8
Only the one display post at the moment. Would it have to be only one Display Post per page for this? Also, how many comments can be recorded at once?
|
|
inherit
216224
0
Aug 1, 2024 1:18:46 GMT -8
Quozzo
408
November 2014
quozzo
|
Post by Quozzo on May 3, 2016 11:36:13 GMT -8
Only the one display post at the moment. Would it have to be only one Display Post per page for this? Also, how many comments can be recorded at once? It would, because the order of the displayed posts are randomised (by your choices, but the code doesn't know what order they are, so it's random) and displaying them with the Recent Posts causes a whole host of other problems. Comments have a 4kb limit per post, which is around 4000 characters but I need to use a few characters to store some info such as the username and user id which takes up a bit of room. You shouldn't have any problems though, there is ample room. Forgot to say, see my previous post for the plugin. Any problems then let me know.
|
|
inherit
224450
0
Feb 7, 2017 11:46:28 GMT -8
blitzen
236
August 2015
blitzen
|
Post by blitzen on May 3, 2016 11:54:45 GMT -8
Only the one display post at the moment. Would it have to be only one Display Post per page for this? Also, how many comments can be recorded at once? It would, because the order of the displayed posts are randomised (by your choices, but the code doesn't know what order they are, so it's random) and displaying them with the Recent Posts causes a whole host of other problems. Comments have a 4kb limit per post, which is around 4000 characters but I need to use a few characters to store some info such as the username and user id which takes up a bit of room. You shouldn't have any problems though, there is ample room. Forgot to say, see my previous post for the plugin. Any problems then let me know. Doesn't show the comment button on mentality.freeforums.net/page/blog. The only post I'll be displaying is the first post of a thread on any 'display post' box. I'm trying to make a makeshift blog for members hence why I'd like to have more 'displayed post' boxes on one page but they'd always be post 1.
|
|
inherit
216224
0
Aug 1, 2024 1:18:46 GMT -8
Quozzo
408
November 2014
quozzo
|
Post by Quozzo on May 3, 2016 12:33:32 GMT -8
It would, because the order of the displayed posts are randomised (by your choices, but the code doesn't know what order they are, so it's random) and displaying them with the Recent Posts causes a whole host of other problems. Comments have a 4kb limit per post, which is around 4000 characters but I need to use a few characters to store some info such as the username and user id which takes up a bit of room. You shouldn't have any problems though, there is ample room. Forgot to say, see my previous post for the plugin. Any problems then let me know. Doesn't show the comment button on mentality.freeforums.net/page/blog. The only post I'll be displaying is the first post of a thread on any 'display post' box. I'm trying to make a makeshift blog for members hence why I'd like to have more 'displayed post' boxes on one page but they'd always be post 1. I'll do the button Soon™. I need the post ID, not the order, otherwise they would all be "1" and I wouldn't be able to differentiate between them. If PB would place the post ID somewhere relative to the post like they do for threads then it would be possible, but sadly that's not the case.
|
|
inherit
224450
0
Feb 7, 2017 11:46:28 GMT -8
blitzen
236
August 2015
blitzen
|
Post by blitzen on May 3, 2016 12:55:29 GMT -8
So, is it definitely not possible to have several 'display post' boxes on one custom page with this comment plugin?
|
|
inherit
216224
0
Aug 1, 2024 1:18:46 GMT -8
Quozzo
408
November 2014
quozzo
|
Post by Quozzo on May 3, 2016 13:02:22 GMT -8
So, is it definitely not possible to have several 'display post' boxes on one custom page with this comment plugin? That's right.
|
|
Former Member
inherit
guest@proboards.com
229726
0
Nov 24, 2024 18:55:19 GMT -8
Former Member
0
January 1970
Former Member
|
Post by Former Member on Aug 20, 2016 14:19:44 GMT -8
I am requesting support.
Post comments Version 1.0.1 Release Is it possible for a post comment to be marked as new?
When a post is replied to people see the word new. Post Comments not showing up as new means people do not know that a post comment was posted.
|
|
inherit
216224
0
Aug 1, 2024 1:18:46 GMT -8
Quozzo
408
November 2014
quozzo
|
Post by Quozzo on Aug 22, 2016 3:50:16 GMT -8
I am requesting support. Post comments Version 1.0.1 Release Is it possible for a post comment to be marked as new? When a post is replied to people see the word new. Post Comments not showing up as new means people do not know that a post comment was posted. Not directly. It is possible with a plugin by P̌̓aͧś̀t̀u͒le͆o͂2̀3̃̓ called Interest Notification Centre. It won't display the word "new" next to new comments, but it will notify the user of new comments.
|
|