The vB Geek

The vB Geek (
-   Geek Article and Review System (
-   -   Modifying forumview.php and showthread.php for GARS only? (

Lars-Christian 04-06-2007 01:37 PM

Modifying forumview.php and showthread.php for GARS only?
Okay, this is my predicament:

I want to include my right-menu from vBadvanced, but only on the forums where GARS is enabled.

To include the right menu, I have to include this piece of code in the corresponding php file:


define('VBA_PORTAL', true);
define('VBA_PAGE', 'include');

So for me, when I want to include the right menu on the forumview and showthread, I have to include that code in forumview.php and showthread.php - Problem is, this of course doesn't just include the right menu in the GARS forums, but the rest of the forums as well.

So my question is obviously, is it possible to alter the GARS code so that it will use modified versions of these files, for instance forumviewGARS.php and showthreadGARS.php? Or perhaps an even easier way to achieve what I'm trying to do?

Thanks in advance :)

The Geek 04-06-2007 02:11 PM

If I understand correctly, you can try to use the gars_ignition_end hook to see if gars was fired up. If so, then include the define for vba... not sure though as I havent tried :)

Lars-Christian 04-06-2007 03:58 PM

I'm a designer, and not much of a coder unfortunately, so I'm not sure exactly what the statement would look like:

Something like this:


if (defined('gars_ignition_end'))
        define('VBA_PORTAL', true);
        define('VBA_PAGE', 'include');


Edit: Well that statement I created didn't work, so I guess I'll have to wait for you assistance ;)

Please help me, I'm dumb :P

The Geek 04-06-2007 04:38 PM

You would do something like this:

Create a plugin to use the gars_ignition_end hook. In it, include the code:
PHP Code:

if (is_object($gars))

But that will only work if including the define's after global has started is OK.

Lars-Christian 04-06-2007 04:52 PM

Hmm, doesn't seem like I have that hook in my install of GARS. I only seem to have two hooks, gars_rating_select_start and gars_rating_select_end. Does this have to do with me running 2.1.4, and perhaps this hook wasn't included here?

The Geek 04-06-2007 05:11 PM

hmmm... Think so, try updating to 2.1.6 or 2.1.5

Lars-Christian 04-06-2007 05:23 PM

Okay, I think I might have found an easier way. And for the reason that I've changed quite a few templates, I can't really upgrade, so I'm looking for another solution.

If I include this in global.php:


if (THIS_SCRIPT == 'gars')
        define('VBA_PORTAL', true);
        define('VBA_PAGE', 'include');

It should work. I just need to figure out what the statement to see if GARS is running or not up there needs to look like, as that one there doesn't work.

The Geek 04-06-2007 05:49 PM

That wont work, there is no script called gars.

When global starts up, gars_ignition.php runs to see if it needs to run. If so, $gars or $vbulletin->gars will exist as an object and take over processing the forum/thread as a gars element.

Lars-Christian 04-06-2007 05:59 PM

Ah, I see, well that makes it sort of a chicken and egg situation, because the definition:


if (defined('VBA_PORTAL'))

Is added near the top of global.php - So I guess I will have to work around with that, and see if there is any way to make it work.

KirbyDE 04-11-2007 06:20 PM

You have to check the forumids to see if GARS is going to be loaded before VBAdvanced Include Top.

All times are GMT. The time now is 06:39 PM.

Powered by vBulletin® Version 3.8.5
Copyright ©2000 - 2018, Jelsoft Enterprises Ltd.