PDA

View Full Version : Retrieving server request URI in VB


howarde
01-20-2014, 12:09 PM
Is there a way to retrieve the URL in VB code similar to a php function that would be like:

<?php if ($_SERVER['REQUEST_URI']=='/gallery/' ) {#Do What I Need Done;} ?>

Basically, I need to insert an ad zone, in the gallery, which in forums, I just use

vb:if condition="$GLOBALS[forumid]== foo"

But for /gallery, any suggestions??

ozzy47
01-20-2014, 12:14 PM
Maybe this:

<vb:if condition="in_array($forum['forumid'], array(1,2,3))">
Show this in forum 1, 2 and 3
</vb:if>

howarde
01-20-2014, 12:20 PM
Yes, except that it's not a forumid, it's the photopost photo gallery, so I need to parse the URL containing myforum.com/gallery/blah

know what I mean?

ozzy47
01-20-2014, 12:29 PM
Questions/Problems regarding modifications/styles need to be asked in the modification/style thread. That is where the support for modification/style is - not out here in the main forums. Please note that if a modification/style is unsupported (or even if it says it is supported), you may be on your own if you chose to install it.

howarde
01-20-2014, 12:32 PM
Could you move this thread then? My Bad.

ozzy47
01-20-2014, 12:34 PM
No sorry, you would need to repost it in the mods thread. :)

kh99
01-20-2014, 03:36 PM
Is there a way to retrieve the URL in VB code similar to a php function that would be like:

<?php if ($_SERVER['REQUEST_URI']=='/gallery/' ) {#Do What I Need Done;} ?>

Basically, I need to insert an ad zone, in the gallery, which in forums, I just use

vb:if condition="$GLOBALS[forumid]== foo"

But for /gallery, any suggestions??


If that works in php, then in a template you should be able to do:
<vb:if condition="$_SERVER['REQUEST_URI']=='/gallery/'">
{#Do What I Need Done;}
</vb:if>