inherit
189150
0
Jul 21, 2015 7:32:06 GMT -8
ermentrude
30
January 2013
ermentrude
|
Post by ermentrude on Feb 9, 2013 18:12:36 GMT -8
Let me preface this by saying I feel like a complete idiot. Clearly I'm old or completely out of touch, because I have coded before but this is all Greek to me.
The most useful thing someone could do for me (and probably others) is provide some sort of link or search criteria so I can figure out what the heck I'm doing on my own.
I need to figure out how to do the following things: 1. Is the page I'm on a thread? 2. Is the thread in one of three boards I care about? (stuff-sale, wanted-stuff, merrimans-store) 3. Is the person logged in the person who created the thread? 4. When was the last post made? 5. Hide Reply and Quick Reply
I'll then be adding logic as follows: IF One of the boards I care about THEN IF The person logged in did not create the thread THEN Hide "Reply" button and "Quick Reply" section //because we do not want conversation in this section ELSE IF The person logged in did create the thread THEN IF The last post was made < 3 days ago THEN Hide the "Reply" button & "Quick Reply" section //because bumps are allowed every 3 days ELSE Do nothing - Let the person bump at will ELSE Do nothing
While I'm showing my utter lack of knowledge, I'll ask - is it possible to know who has posted in an entire board? Because life would be perfection if I could block people from having more than one post in the above mentioned boards.
Thanks!
|
|
inherit
126477
0
Apr 21, 2023 15:18:52 GMT -8
Shrike
Re-appeared briefly after 6 years only to no doubt disappear again.
1,569
June 2008
shrike
|
Post by Shrike on Feb 9, 2013 19:19:20 GMT -8
Hi, Most of these pieces of information can be found in the proboards.data object included at the end of the document <head>. It will be a lot easier to read if you use some sort of formatter (I have a view source plugin for Chrome that does this, but you can also use something like jsbeautifier.org). I don't think there is any definitive list of what variables there are yet, but they're pretty logically laid out. 1: if (proboards.data.route.name == "thread") { //we're in a thread }2: if (/^44|27|84$/.test(proboards.data.board_id) { // we're in a board with an id of 44, 27 or 84; the board id is the number in the URL when viewing the board3: if (proboards.data.user.id == proboards.data.page.thread.created_by) { //the user id of the current user and the thread creator are the same4: I'll leave this for now because I don't think this will work for posts made pre-conversion. Essentially, data about each post is stored in the same place as these other variables and, for post-conversion threads, it starts with the latest post first and goes in order. In pre-conversion threads, the order seems to be pretty random. Aside from this, the data for the latest post is only available if you are on the last page (fine if there's only one page, not so fine otherwise) which means that you'd have to assume the latest post was made < 3 days ago (or whatever) because we can't work it out. I'll make a separate thread about this and tag some admins. 5: This would be something like $(".reply-button, .quote-button, .quick-reply").remove(); People could still get to them by entering the URL themselves, but you could also hide/prevent posting with the plugin too, although I wouldn't know how right now. Lastly, I don't think it is possible to know if someone has posted in a board without the user first clicking on the link on the number of replies for each thread (which then creates a new dialogue box and makes some AJAX call(s)). Hopefully the rest of this was of some help.
|
|
inherit
126477
0
Apr 21, 2023 15:18:52 GMT -8
Shrike
Re-appeared briefly after 6 years only to no doubt disappear again.
1,569
June 2008
shrike
|
Post by Shrike on Feb 9, 2013 19:45:20 GMT -8
I'll leave this for now because I don't think this will work for posts made pre-conversion. Essentially, data about each post is stored in the same place as these other variables and, for post-conversion threads, it starts with the latest post first and goes in order. In pre-conversion threads, the order seems to be pretty random. Aside from this, the data for the latest post is only available if you are on the last page (fine if there's only one page, not so fine otherwise) which means that you'd have to assume the latest post was made < 3 days ago (or whatever) because we can't work it out. I'll make a separate thread about this and tag some admins. Ryan Roos Michael VS AdminActually, maybe I just lucked out on the newer threads being in the right order. This is from a thread created 3 days ago and, if you look at the created_by values, it looks like both me (126477) and AshFR (184444) triple-posted when that isn't the case. I looked at a few more threads from random times/boards/etc and they all seem to be random. This was the thread with them in the right order. Oddly, it looks like the Report Bugs board is okay... Is it maybe new boards that have them in the right order? I don't know Sorry for not making it a new thread, I just wanted to post it while I could still remember the problem (it being 3:45 am here ). Feel free to split this off into a new thread if need be. ['proboards.post', { "5160890": { "thread_id": "446638", "liked": 0, "created_on": "1360441244", "url": "http://support.proboards.com/post/5160890", "created_by": "188550" }, "5161108": { "thread_id": "446638", "liked": 0, "created_on": "1360448506", "url": "http://support.proboards.com/post/5161108", "created_by": "184444" }, "5156982": { "thread_id": "446638", "liked": 0, "created_on": "1360259845", "url": "http://support.proboards.com/post/5156982", "created_by": "33409" }, "5161166": { "thread_id": "446638", "liked": 0, "created_on": "1360450728", "url": "http://support.proboards.com/post/5161166", "created_by": "184444" }, "5161370": { "thread_id": "446638", "liked": 0, "created_on": "1360458740", "url": "http://support.proboards.com/post/5161370", "created_by": "184444" }, "5156796": { "thread_id": "446638", "liked": 0, "created_on": "1360253314", "url": "http://support.proboards.com/post/5156796", "created_by": "184444" }, "5161372": { "thread_id": "446638", "liked": 0, "created_on": "1360458807", "url": "http://support.proboards.com/post/5161372", "created_by": "126477" }, "5161148": { "thread_id": "446638", "liked": 0, "created_on": "1360450067", "url": "http://support.proboards.com/post/5161148", "created_by": "126477" }, "5161190": { "thread_id": "446638", "liked": 0, "created_on": "1360451730", "url": "http://support.proboards.com/post/5161190", "created_by": "126477" }, "5161364": { "thread_id": "446638", "liked": 0, "created_on": "1360458671", "url": "http://support.proboards.com/post/5161364", "created_by": "184444" } }]
|
|
inherit
189150
0
Jul 21, 2015 7:32:06 GMT -8
ermentrude
30
January 2013
ermentrude
|
Post by ermentrude on Feb 9, 2013 19:52:09 GMT -8
That is incredibly helpful. Thank you! Is there documentation of the proboards.data object that I'm missing?
#4 is interesting. We keep the threads pruned to the top post and the last bump so it will never go beyond one page. Honestly, if I have to ask the ladies to recreate their posts for this to work, I'll do it.
#5 good catch on the quote, I forgot about that. But the rest made me laugh - I'm pretty sure that the people who usually do not follow these rules are not technical enough to figure out how to create the URL.
One more thing - I want to disable users from deleting their own previous posts. Because we do have users that will figure out to delete their previous bump and then get around the 3 day check.
Thanks again!
|
|
#e61919
Support Manager
154778
0
1
Nov 19, 2024 9:09:18 GMT -8
Michael
19,616
May 2010
wiseowl
|
Post by Michael on Feb 11, 2013 12:33:33 GMT -8
That is incredibly helpful. Thank you! Is there documentation of the proboards.data object that I'm missing? #4 is interesting. We keep the threads pruned to the top post and the last bump so it will never go beyond one page. Honestly, if I have to ask the ladies to recreate their posts for this to work, I'll do it. #5 good catch on the quote, I forgot about that. But the rest made me laugh - I'm pretty sure that the people who usually do not follow these rules are not technical enough to figure out how to create the URL. One more thing - I want to disable users from deleting their own previous posts. Because we do have users that will figure out to delete their previous bump and then get around the 3 day check. Thanks again! Hi ermentrude, There currently is not a way to disable users deleting their own posts. However, you can view when a user deletes a post from the security log.
|
|
inherit
189150
0
Jul 21, 2015 7:32:06 GMT -8
ermentrude
30
January 2013
ermentrude
|
Post by ermentrude on Feb 11, 2013 20:06:34 GMT -8
OK, I ended up getting the basics of what I need coded up, including iterating through all of the posts to find the oldest one to check the timing. I'm sure it isn't pretty, but it works. Appreciate all of the help.
|
|