Log in

View Full Version : How t detect current page / location / script


dgeere
11-18-2007, 12:17 PM
Hi all.

I have a photo gallery (photopost / vbgallery) installed on VB.
I want to be able to print a different header out if users are looking at the photo gallery.
So I need help with the IF ELSE code that I would need to use.

Essentially, IF user is in photo album print x else print y

Any help would be really appreciated as I am totally stumped on this one.

Thanks
David

Opserty
11-18-2007, 01:58 PM
It depends on the Photo gallery. If it is done properly then it should have a line which says:

define('THIS_SCRIPT', 'blabla'); In the PHP file. If there is such a line then you can use this:

<if condition="THIS_SCRIPT == 'blabla'">
We are in Photogallery
<else />
We are not in photogallery
</if>


In which ever template you need to.

dgeere
11-18-2007, 02:20 PM
Perfect!

Thank you!

FYI for anyone else this is the code I used:

<if condition="PP_SCRIPT !== 'vBGallery'">

Stuff to show when NOT in gallery

<else />

Stuff to show when IN gallery

</if>