vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB4 Programming Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=252)
-   -   Retrieving server request URI in VB (https://vborg.vbsupport.ru/showthread.php?t=307261)

howarde 01-20-2014 12:09 PM

Retrieving server request URI in VB
 
Is there a way to retrieve the URL in VB code similar to a php function that would be like:

PHP Code:

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

<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

Quote:

Originally Posted by howarde (Post 2475517)
Is there a way to retrieve the URL in VB code similar to a php function that would be like:

PHP Code:

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

<vb:if condition="$_SERVER['REQUEST_URI']=='/gallery/'">
{#Do What I Need Done;}
</vb:if>



All times are GMT. The time now is 09:22 AM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01003 seconds
  • Memory Usage 1,725KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (2)bbcode_code_printable
  • (2)bbcode_php_printable
  • (1)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (7)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete