View Full Version : Is the vB4 thread structure broken
tommythejoat
02-24-2017, 06:15 PM
The two methods to reply in a thread are to reply to the post you are viewing using the reply link in the bottom border or to reply to the thread.
The reply to specific post works correctly and puts that postid in the parent postid for the new post. However, when you are replying to the thread, the parent postid is the latest post in the thread when it should be the first post in the thread.
The problem is readily visible when using hybrid or threaded view.
I would like for the parent postid to be 0 just as it is for the starting post in the thread. That gives a distinctive display for hybrid and threaded views.
We have a mod installed that appends a link in the title of the posters name linking to the parent postid. If the parent postid were 0 for reply to thread, the link would be suppressed and it would work the way we want it to.
The reference functions to prevent misunderstandings when someone thinks a reply is to their post instead of to a previous post in the thread or the thread as a whole.
MarkFL
02-24-2017, 06:58 PM
Try this plugin, hooked at "postdata_presave":
if (!$_REQUEST['p'])
{
$this->post['parentid'] = 0;
}
Bill Stuntz
02-24-2017, 09:50 PM
If it set the parentid to 0 instead of the incorrect postid that it picks now when invoked by "Reply to Thread" it shouldn't display ANY link in that new post title - which is what I want.I asked the SAME question a couple days ago in another thread, https://vborg.vbsupport.ru/showthread.php?t=324497, trying to find SOME hook somewhere that would allow me to do EXACTLY that. We described different symptoms of the same disease, caused by the same germ. Tom & I are Admins on the same MB. Needless to say, HE's the senior admin, and I'm trying to learn.
:confused: I'm curious. Why did Tom get an essentially immediate response that does EXACTLY what I've been asking for, and my thread didn't? Have I done something to offend someone?
Paul M
02-24-2017, 09:57 PM
Replies can sometimes be days.
Any response is entirely dependent on who is reading the forums at any given time
Your thread got a reply after 81 minutes, so I think you have nothing to be curious about.
Bill Stuntz
02-24-2017, 10:14 PM
Yes, you DID respond that fast. :) And your response allowed me to find the apparently undocumented plugin that gave me the hint that I had to modify parentid. But I couldn't figure out where/how to do that. MarkFL's response does exactly what I've spent days trying to figure out. It wasn't so much the SPEED of the responses that bothered me. Is MarkFL the only one who knows that trick?
It should solve the problem for future posts, but I doubt that there's any way to fix the existing misleading links.
MarkFL
02-24-2017, 10:15 PM
I asked the SAME question a couple days ago in another thread, https://vborg.vbsupport.ru/showthread.php?t=324497, trying to find SOME hook somewhere that would allow me to do EXACTLY that. We described different symptoms of the same disease, caused by the same germ. Tom & I are Admins on the same MB. Needless to say, HE's the senior admin, and I'm trying to learn.
:confused: I'm curious. Why did Tom get an essentially immediate response that does EXACTLY what I've been asking for, and my thread didn't? Have I done something to offend someone?
Hey Bill,
I do apologize if I gave the impression of preferential treatment...it wasn't my intention. Tom's initial post spoke explicitly of setting the "parentid" of posts made by replying to threads as opposed to replying to posts or quoting posts.
In your thread, you were talking about using a product that wasn't behaving as you wanted, and when I read that, I felt looking for the product thread was a good idea as suggested. Sometimes I don't connect the dots as would be desired by the person posting.
It could be the case when I read a post here, I am either idle and looking for something to do, or I am busy at the moment with other things and don't give the post as much attention as I would in the first scenario. That's my shortcoming, not that of anyone else, and is something I should try to improve. :)
Bill Stuntz
02-24-2017, 10:22 PM
Thanks Mark. It was the stuff I found, guided by Paul's post, that allowed Tom to ask the question in the way he did. THANK YOU BOTH for the help!!!!!!!!!!!!!
P.S. I think I made the same point over there, too:It works properly when replying to a specific post by using the correct non-zero parentid, but "Reply to Thread" seems to pick an inappropriate parentid.
P.P.S. I intend to install the "editor button" mod you did for me after things settle down & we get on the new system.
--------------- Added 1487982823 at 1487982823 ---------------
Tom, are you going to install the fix, or are you going to leave it as an exercise for the student?
MarkFL
02-24-2017, 10:38 PM
Thanks Mark. It was the stuff I found, guided by Paul's post, that allowed Tom to ask the question in the way he did. THANK YOU BOTH for the help!!!!!!!!!!!!!
P.S. I think I made the same point over there, too:
P.P.S. I intend to install the "editor button" mod you did for me after things settle down & we get on the new system.
Yeah, that was part of me not connecting the dots when you posted. I believe also when you posted, I was hip deep in coding a custom mod for MHB (which turned out quite well!) and my mind was elsewhere. I'm not a good multi-tasker.
By the way, and I say this not to be self-effacing, but you asked if I was the only one who knew that trick. Of all those on staff here, and many who aren't on staff, I am the new guy still learning the basics. :p
I hope the custom editor toolbar mod works well for you! :up:
Snowhog
02-25-2017, 12:03 AM
Try this plugin, hooked at "postdata_presave":
if (!$_REQUEST['p'])
{
$this->post['parentid'] = 0;
}
I don't want to assume, so will adding this have any effect if using the default Linear Mode?
MarkFL
02-25-2017, 12:09 AM
I don't want to assume, so will adding this have any effect if using the default Linear Mode?
All I can tell you for sure is that with that code in place, when a reply is made without replying to or quoting a specific post, then the "parentid" for that post will be set to zero. :)
tommythejoat
02-25-2017, 10:02 PM
All I can tell you for sure is that with that code in place, when a reply is made without replying to or quoting a specific post, then the "parentid" for that post will be set to zero. :)
Actually, the fix needed a slight tweak on our Message Board. Apparently the 'p' index does not test false unless you use isset to test it.
I was a bit confused when it did not work on the first try, but I decided it could not possibly harm to make it.
if (!isset($_REQUEST['p'])) {
$this->post['parentid'] = 0;
}
The only effect except eliminating the thread reference (that we find troubling) is that in hybrid or threaded view, the link graphics show a broken line for each new reference to the thread. It seems to me that is a benefit rather than a problem.
--------------- Added 1488068167 at 1488068167 ---------------
I do not think it is possible to make this "feature" retroactive.
In my opinion, the current vB4 behavior is broken. Clearly the reply to thread should set previous post to the starting thread post . There is no way to know what the poster intended or which button was used to create a new post since both point to the most recent post.
This fix does eliminate the problem. If one wanted the feature to actually reference the first post in the thread, that could be done or, retroactively in the future a query could be executed to set all the 0 parent postid values to the value of the first postid in the thread.
--------------- Added 1488080917 at 1488080917 ---------------
I thought I had this fixed but when I went to install it on the live site, it did not actually work and when I checked again on the test site the result was the same.
I hacked the plugin to insert a print_r on the $_REQUEST global and got this result for both reply from the border and reply with the button.
capture vBulletin $_REQUEST for post thread at postdata_presave hook
Array ([do] => postreply [t] => 139871 [message_backup] => one more [message] => one more
[wysiwyg] => 0 [signature] => 1 [fromquickreply] => 1 [s] => [securitytoken] => nnnnnnnnn
[p] => 1087469 [specifiedpost] => 1 [parseurl] => 1 [loggedinuser] => 2 [posthash] => nnnnnnnnn
[poststarttime] => 1488076181 [ajaxqrfailed] => 1 [threadid] => 139871 [postid] => 1087469 [styleid] =>
[langid] => [api] => [refererid] => [a] => [nojs] => [forumid] => [pollid] => [dofbredirect] =>
[pagenumber] => [noquote]=>) [quoteall] =>)
'p' and 'postid' are both set to the same value and not missing or 0, etc.
Is there a different hook that will work, or is one of my other mods busting this. I notice that there is a jquery flag that looks like it may be bad.
chloe101
04-29-2017, 05:28 PM
Have you found a fix for this yet? I'm running VB4.2.4 and just noticed the same exacerbating problem. I'm trying to find a fix for this and if not, I'll just remove that button because it's misleading & useless as is.
vBulletin® v3.8.12 by vBS, Copyright ©2000-2025, vBulletin Solutions Inc.