PDA

View Full Version : Integrating Entire Forum into vBa


flarecde
08-24-2005, 09:43 PM
Ok, so one of the biggest reasons I wanted to try this out was to have modules not just on the front page (which noone ever looks at anyways), but the forums and my own custom pages. I'd like to basically have the left bar persist regardless of which page you visit. The guide just shows how to do forumhome, I'd like the same effect for all pages.

Following the guide here:
http://www.vbadvanced.com/membersarea.php?do=viewusermanual&productid=4&pageid=6

Came across this error on forumdisplay.php:
Fatal error: Cannot redeclare exec_postvar_call_back() (previously declared in ****/public_html/forums/forumdisplay.php:64) in ****/public_html/forums/forumdisplay.php on line 62

Lines 62-64:
function exec_postvar_call_back()
{
global $vbulletin;

Commenting out that function oddly enough makes it work, but breaks some other things.

Is it even possible to get what I want to achieve, and if so, could there possibly be an easier way of doing it than editing every one of the forum pages?

Brian
08-25-2005, 01:56 PM
If you're getting an error like that then you did not modify the file correctly.

Our Sponsors
 

flarecde
08-25-2005, 03:09 PM
3 lines changed:
define('VBA_PORTAL', true);
define('VBA_PAGE', 'forumdisplay');
added to the top of the page after <? php (inserted between lines 1 and 2)

eval('$HTML = "' . fetch_template('FORUMDISPLAY') . '";');
print_portal_output($home, $HTML);
replaces line 969:
eval('print_output("' . fetch_template('FORUMDISPLAY') . '");');

Created page (type: PHP) named/identified as forumdisplay. This procedure worked fine on forumhome. I've reverted all changes for the time being.

I'm wondering if it could be because I named it the same, or because I should be using a different type of page. That guide does not specify, and all my searches on the forum just led me back to it.

Thanks for any insight you might be able to provide. Likely it's something I've overlooked.

(Notes: I'm not running any hacks to the php code itself, other than this. I am running a few plugins and using a few modified templates.)

Brian
08-25-2005, 03:21 PM
That is a little odd... Try changing the page type to a module page instead and see if that helps. You may also want to note that if the modules and such are going to be the same, you can use the same page for each vB file.

Our Sponsors
 

flarecde
08-25-2005, 09:03 PM
Aight, I'll give it a shot. I'm pretty sure the modules will be the same, yes, so that would definately save a bit of time.

Okay, this is too weird. I got it working... here's what I did:

ADD (1):
define('VBA_PORTAL', true);
define('VBA_PAGE', 'forumdisplay');

REPLACE(969):
eval('$HTML = "' . fetch_template('FORUMDISPLAY') . '";');
print_portal_output($home, $HTML);

Created a PHP page, set id to forums, path to file as forumdisplay.php. And it works. If I change the id to forumdisplay, I get that error. If I change the define to forums, I get that error. This is all by trying to access it by forumdisplay.php (clicking a link in the forums). So, it seems if id = VBA_PAGE define, I get that error. Otherwise, it worked fine.

I think I got it. When you call forumdisplay.php from a link on index.php, it calls the eval, which, in the case of using the php type page, would call the original page (forumdisplay) again, hence the already loaded function error. If I didn't specify a proper page (define mismatch), it seems to have just used the default settings.

I also got it to work using a module page with the id forums, and forums in the define. This is optimal, I think, because I can use that same page for all the forum pages. I've made the change to my index.php and it works.

Well, sort of. Using page=forums brings up the page without the forum. Calling forumdisplay.php or index.php brings up the proper display. Which is the desired result anyways.

So for the forums (or any other page you want to call by it's URI, and not a page=), you'd want to use a module type page, because you'll be calling the pages by the forum URLs.

At any rate, you can take a look at the results on my site: http://www.kingsguardguild.net/forums/index.php