vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB4 Programming Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=252)
-   -   [SOLVED] How to get the Current URL Page Location (https://vborg.vbsupport.ru/showthread.php?t=241277)

Mr Happy 04-26-2010 12:33 AM

[SOLVED] How to get the Current URL Page Location
 
Basically what I had on a vBulletin 3 skin was:
PHP Code:

href="$_SERVER[PHP_SELF]?<vb:if condition="$_SERVER['QUERY_STRING']">$_SERVER[QUERY_STRING]&amp;</vb:if>styleid=1 

and it was a quick link that would return you to the default skin.

Problem is none of the $_SERVER bit's work in vBulletin 4 templates. I'm wondering if their's a variable like {vb:raw url} or something that I could use to get the current page url address.
That or any other suggestion on how to do it from just editing the template would be great.

--------------- Added [DATE]1272257252[/DATE] at [TIME]1272257252[/TIME] ---------------

I stumbled across {vb:raw relpath} while working in who's online where it's used to refresh the page your on. I managed to get something to work with this for anyone who comes across this in Google with a similar problem :)

dr.tawy 09-11-2010 06:28 AM

U Sir are a GOD

What an amazing Post

i was looking for the current url code for 3 hours now and finally i found it

Thanks alot

=========

for all those looking for VBulletin Current Page Url Code (just to make sure google gets it now)

the code is

{vb:raw relpath}

jayrobinson 03-22-2011 09:01 PM

Thanks, `{vb:raw relpath}` is the best answer. I found this when I searched for "current URL in vBulletin templates".

The variable spits out the current page like `$_SERVER['PHP_SELF']`, without anything else. If you are on the Forum homepage, for example, it won't spit out anything. Here is how I used this code to submit an email signup form back to the current page on our site:

Code:

<form action="/forum/{vb:raw relpath}#footer" ...

fxdigi-cash 06-11-2013 02:45 PM

This solution is what I was looking for... brilliant idea. Big Thanks


All times are GMT. The time now is 08:01 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.01070 seconds
  • Memory Usage 1,717KB
  • 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
  • (1)bbcode_code_printable
  • (1)bbcode_php_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (4)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