PDA

View Full Version : Will anything break if I define index as 'gallery;?


kall
March 10th, 2005, 04:35 PM
Currently, it has

define( THIS_SCRIPT, "index" );


I would really like to define it as 'photopost' or 'gallery'...because 'index' is already defined in index.php.

What, if anything, would this break using vb3enhanced (PP 5.01 and vb 3.0.7)?

This would allow users to have conditionally-driven templates that appear different in photopost, an example of this would be: Changing the colour of the navbar link to indicate the current section.

Chuck S
March 10th, 2005, 05:30 PM
To be honest I have no idea since I am not too familiar with VB's conventions

Michael P
March 10th, 2005, 06:36 PM
We do use the index variable in at least one place I can think of - I don't recommend it, but any problems would require you to fix them as well since we can't support it.

kall
March 12th, 2005, 04:44 AM
Bugger.

Alrighty then...I think I can manage that. :)

As a suggestion, it would make the integration that much more integrated if PP didn't use an already defined name.

Chuck S
March 12th, 2005, 06:27 AM
Well its not an uncommon practice since the script is index

Here is right from my vbportal page

define('THIS_SCRIPT', 'index');

They do the same thing

kall
March 12th, 2005, 02:03 PM
But if I want to make a header with links that become greyed out on the page that you are on, I can currently use <img src="/images/forums<if condition="THIS_SCRIPT == 'index'">_off</if>.gif"> and the 'forums' image will now be greyed out on the forums index.

Unfortunately, it will also be greyed out on any page that is also defined as index.

To say it's not uncommon based on one product is a wee bit presumptuous...vBAdvanced does not use 'index' as its portal definition. I can only assume this is the reason why: When using vBulletin, with its conditional powers, it is a wise idea not to have 2 scripts defined with the same name.

Chuck S
March 13th, 2005, 08:47 AM
You can alter things as stated above to suit your needs

kall
April 2nd, 2005, 02:03 PM
You can alter things as stated above to suit your needs
I can?

But Michael says:


We do use the index variable in at least one place I can think of - I don't recommend it, but any problems would require you to fix them as well since we can't support it.