The vB Geek

Go Back   The vB Geek > vB Geek Products > Geek Article and Review System

Geek Article and Review System GARS is the mega popular system for turning forums into articles, tutorials, or even reviews.

Advertisement
This is an HTML example. Isn't it just wonderful?!?!
  Learn how to remove ads

Reply
 
Thread Tools Display Modes
  #1  
Old 04-06-2007, 01:37 PM
Lars-Christian Lars-Christian is offline
Junior Member
 
Join Date: Jan 2007
Posts: 10
Geek Article and Review System License Holder 
Default 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:

Code:
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
Reply With Quote
  #2  
Old 04-06-2007, 02:11 PM
The Geek's Avatar
The Geek The Geek is offline
Senior Member
 
Join Date: Aug 2005
Posts: 6,717
Geek Article and Review System License Holder GeekMart License Holder Geek Auto-Linker Pro License Holder Geek Advertising Banner License Holder Geek Gazette License Holder 
Default

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
Reply With Quote
  #3  
Old 04-06-2007, 03:58 PM
Lars-Christian Lars-Christian is offline
Junior Member
 
Join Date: Jan 2007
Posts: 10
Geek Article and Review System License Holder 
Default

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:

Code:
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

Last edited by Lars-Christian; 04-06-2007 at 04:07 PM..
Reply With Quote
  #4  
Old 04-06-2007, 04:38 PM
The Geek's Avatar
The Geek The Geek is offline
Senior Member
 
Join Date: Aug 2005
Posts: 6,717
Geek Article and Review System License Holder GeekMart License Holder Geek Auto-Linker Pro License Holder Geek Advertising Banner License Holder Geek Gazette License Holder 
Default

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))
{
define('VBA_PORTAL'true);
define('VBA_PAGE''include');

But that will only work if including the define's after global has started is OK.
Reply With Quote
  #5  
Old 04-06-2007, 04:52 PM
Lars-Christian Lars-Christian is offline
Junior Member
 
Join Date: Jan 2007
Posts: 10
Geek Article and Review System License Holder 
Default

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?
Reply With Quote
  #6  
Old 04-06-2007, 05:11 PM
The Geek's Avatar
The Geek The Geek is offline
Senior Member
 
Join Date: Aug 2005
Posts: 6,717
Geek Article and Review System License Holder GeekMart License Holder Geek Auto-Linker Pro License Holder Geek Advertising Banner License Holder Geek Gazette License Holder 
Default

hmmm... Think so, try updating to 2.1.6 or 2.1.5
Reply With Quote
  #7  
Old 04-06-2007, 05:23 PM
Lars-Christian Lars-Christian is offline
Junior Member
 
Join Date: Jan 2007
Posts: 10
Geek Article and Review System License Holder 
Default

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:

Code:
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.

Last edited by Lars-Christian; 04-06-2007 at 05:48 PM..
Reply With Quote
  #8  
Old 04-06-2007, 05:49 PM
The Geek's Avatar
The Geek The Geek is offline
Senior Member
 
Join Date: Aug 2005
Posts: 6,717
Geek Article and Review System License Holder GeekMart License Holder Geek Auto-Linker Pro License Holder Geek Advertising Banner License Holder Geek Gazette License Holder 
Default

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.
Reply With Quote
  #9  
Old 04-06-2007, 05:59 PM
Lars-Christian Lars-Christian is offline
Junior Member
 
Join Date: Jan 2007
Posts: 10
Geek Article and Review System License Holder 
Default

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

Code:
if (defined('VBA_PORTAL'))
{
	require_once('./includes/vba_cmps_include_template.php');
}
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.
Reply With Quote
  #10  
Old 04-11-2007, 06:20 PM
KirbyDE KirbyDE is offline
Member
 
Join Date: Sep 2005
Posts: 31
Geek Article and Review System License Holder Geek Auto-Linker Pro License Holder Geek Advertising Banner License Holder Geek Gazette License Holder 
Default

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

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
GARS not shown in AdminCP until Admin-User is Superadmin in config.php Muah Geek Article and Review System 10 08-21-2010 12:50 PM
external.php results with gars dawgbone Geek Article and Review System 4 11-14-2008 06:11 PM
PHP Website Morgan GARS Link Directory 0 08-24-2008 07:45 PM
GARS 2.0 RC 2 - gars_class_base.php missing Marris Geek Article and Review System 1 07-14-2006 06:55 AM
Changing from index.php to forum.php? Michael Lizard Lounge 2 10-04-2005 03:27 PM


All times are GMT. The time now is 02:38 AM.


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