PDA

View Full Version : Parsed Hack On Forum Index Causing Problems With PMs


MarkB
11-25-2001, 06:43 AM
Hiyis

I have the active topics hack on board - I did have them displayed only on my nonVB main site page, but I decided I wanted them on my forum index as well -- except now, whenever anyone sends a PM, instead of the set subject, the subject is replaced by the title of the last topic displayed by the parsed PHP.

At first I thought it might have been because I have multiple parse groups (ie, :

require("review20.php");
$reviews = ob_get_contents();
ob_end_clean();

(I had a couple for different things - $livegigs, $songs etc)

But I cut it down to just one, and it still caused problems...

Any ideas? Am i going about having active topics on a vB completely arse-about-tit?

Help :(

Admin
11-25-2001, 11:21 AM
You forgot to start output buffering:
ob_start();
require("review20.php");
$reviews = ob_get_contents();
ob_end_clean();

MarkB
11-25-2001, 11:26 AM
Sorry - I pasted incorrectly. Each block of code had ob_start(); as required...

Any other ideas?:(

Thanks for the reply :)

Admin
11-25-2001, 11:31 AM
Ok, I'm guessing there's a variable in the new script that's called $title or something like that, and because the PHP include template is parsed before anything else in vBulletin but after the form, the variable is set a bad value.

Annnnyway, :) can you attach the hack file here?
Or just give the link to the thread. :)

MarkB
11-25-2001, 11:41 AM
Spot on! There was a $title variable in the include files :) changed it, and now it works fine :D

Thanks yet again :) You rock! :)

Admin
11-25-2001, 12:41 PM
My pure pleasure. :)

BTW, this might not be the end of it.
Go through the script and make sure there are no variables that might interfere with vBulletin... like $message, $userid, etc.

MarkB
11-25-2001, 12:47 PM
Err... :eek:

Here's one of the files, in case you want to take a look :o

Admin
11-25-2001, 12:52 PM
Umm ok, I just skimmed through it and I think it's fine. :)

MarkB
11-26-2001, 12:24 AM
Actually, there was one problem - the include files had '$query' specified, which was causing search to come up with no results! doh! :)

Changes it to $query1 and now all is working :) Huzzah!