View Full Version : Which Variable contains the current URL?
champ1
04-04-2007, 08:30 AM
Hi,
I want to implement small language-buttons (english, german). Therefor I need the variable that contains the current URL. I want to write it like this:
<a href="[CURRENT_URL]?langid=3"><img src="..." /></a>
Thanks in advance.!
RedTyger
04-04-2007, 09:25 AM
That is not possible without a plugin, the current URL is a PHP variable which can't be inserted directly into templates. You might be able to do something using the breadcrumb variables though or another method that escapes me for the moment.
Edit: If all you need is the root of the forum URL (i.e. http://www.vbulletinorg/forum) it's $vboptions[bburl].
WetWired
04-04-2007, 12:45 PM
Wouldn't it be $_SERVER[REQUEST_URI] ? One potential issue is that you can't tell in the templates if the URL already has parameters.
champ1
04-04-2007, 02:53 PM
hm shit...this suggested var would be a nice improvement !! ;)
WetWired
04-04-2007, 03:29 PM
Okay, I just tested it. You can use
$scriptpath
or
http://domain.com$_SERVER[SCRIPT_NAME]?$_SERVER[QUERY_STRING]
The second is better if you want to add to the query string, because it ensures that you already have a ?
vBulletin® v3.8.12 by vBS, Copyright ©2000-2025, vBulletin Solutions Inc.