View Full Version : Help me think this through...
Upchurch
29th July 2005, 10:45 AM
Here's the background (http://forums.randi.org/showthread.php?s=&threadid=59917)
The current situation is everything is in place but I have been unable to populate the new thread's subject and message fields with the information from the post that is being replied to.
Looking at the newreply.php code, it is nearly identical to the newthread.php code. The exception being the 'action' variable being passed in the url, so I figure that must be the critical difference. However, I can't find where it is ever used.
Anyone familiar enough with vBulletin/PHP to have an idea about what I'm missing? I'm open to suggestions.
On a side note, I've also tried a couple of blunt methods to pass the information, like putting it in a form and posting it. That caused no end of problems.
69dodge
29th July 2005, 10:43 PM
Totally unfamiliar with vBulletin/PHP. That won't stop me from making suggestions, though. :D
The 'quote' button passes in a 'postid' variable to newreply.php. I guess that's how newreply.php knows what post to quote. If you want newthread.php to quote a post, somehow you have to tell it too what post to quote. And you need to make it use that 'postid' information, which currently it doesn't do because currently it only creates empty new threads.
Are newreply.php and newthread.php really that similar? Any way for me to look at them myself?
Soapy Sam
30th July 2005, 01:55 AM
"The addition of incomprehensible functions to software may result in unpredictable consequences. "- Murphy's Programming Manual. Ch1. Pp1.)
Can any new buttons be made red, with plastic covers over them?
Donks
30th July 2005, 05:01 AM
I poked around for a bit in the source code and found that in newreply.php the section labeled
"### start new reply ###" (well, with lots more #s on each side) is the one that constructs the post writing page. You'll notice it begins with "if ($_REQUEST['do'] == 'newreply')
" which is the action that the Quote and New Reply buttons send. The title is passed in $newpost['title']. The quoted text is passed in $newpost['message'] to the function construct_edit_toolbar.
Ok, I'm quite a bit rusty in all cgi related languages so I may be completely wrong, and I didn't look for that long, but that's what I could gather.
Upchurch
1st August 2005, 03:37 PM
Originally posted by 69dodge
Totally unfamiliar with vBulletin/PHP. That won't stop me from making suggestions, though. :DHey, we all have to start somewhere. ;)
The 'quote' button passes in a 'postid' variable to newreply.php. I guess that's how newreply.php knows what post to quote. If you want newthread.php to quote a post, somehow you have to tell it too what post to quote. And you need to make it use that 'postid' information, which currently it doesn't do because currently it only creates empty new threads.That is exactly where I started. Passing the postid (and the forumid since we're starting a new thread) is definitely necessary, but it is not sufficent. After beating my head against it for several days, I went on to vBulletin's own forum boards and confirmed that the key is in the action variable that is also passed. I think it comes down to the fact that I need to write a new action method for this button. To do that, however, I think I need to have Darat either install some stuff on the surver or provide me access so I can do it. The ability to add new actions is not standard on the Admin CP. At least not in our version of the software.
Are newreply.php and newthread.php really that similar? Any way for me to look at them myself? View source on the two pages. It'll have a bunch of garbage that you won't care about, but it has all the important stuff.
I poked around for a bit in the source code and found that in newreply.php the section labeled
"### start new reply ###" (well, with lots more #s on each side) is the one that constructs the post writing page. Whaaaa? I've looked at both the server and client side versions of the page and didn't see that. Where did you find that?
You'll notice it begins with "if ($_REQUEST['do'] == 'newreply')
" which is the action that the Quote and New Reply buttons send. The title is passed in $newpost['title']. The quoted text is passed in $newpost['message'] to the function construct_edit_toolbar.That sounds very promising, but where is it?
Donks
2nd August 2005, 08:35 AM
Hmmm sorry, I was looking at version 3. I'm now looking at version 2, whatamess. If I find it, I'll post it in a couple of hours.
Donks
2nd August 2005, 04:30 PM
Ok, found it. Near the top in newreply.php there's a line (30):
if (isset($postid)) {
My guess is that if you copy that entire block into newthread, and feed it the postid from the button, just like quote does, it just might work. You'll also need to add the quotereply template to the $templatesused variable on top. I give it a snowball's chance in hell. On a cool day.
© 2001-2009, James Randi Educational Foundation. All Rights Reserved.
vBulletin® v3.7.7, Copyright ©2000-2012, Jelsoft Enterprises Ltd.