View Full Version : How to show REQUEST URI
CarcaBot
11-20-2009, 12:06 PM
Hello there,
I'm interested how to show in a template my URL address (REQUEST URI)
$_SERVER['SERVER_NAME']
$_SERVER['REQUEST_URI']
thanks.
cellarius
11-20-2009, 06:42 PM
AFAIK this information is not available in predefined variables. You need to create a plugin that saves that information into variables, then register/preregister them to be available in the template.
See: https://vborg.vbsupport.ru/showthread.php?t=228078
CarcaBot
11-21-2009, 03:52 AM
I saw that code before, but i'm not able to show what i need...
cellarius
11-21-2009, 07:18 AM
Where exactly do you want to show it? Which template?
CarcaBot
11-21-2009, 09:09 AM
in bbcode_code
cellarius
11-21-2009, 10:42 AM
Plugin at hook bbcode_create
$this_uri = $_SERVER['SERVER_NAME'] . $_SERVER['REQUEST_URI'];
vB_Template::preRegister('bbcode_code',array('this _uri' => $this_uri));
In the template call as
{vb:raw this_uri}
Not tested, but should work.
CarcaBot
11-21-2009, 12:40 PM
Yes , is working, but if i have multiple code tags it's showing only at one ( first)
cellarius
11-21-2009, 01:56 PM
I can't think of a way around that atm, sorry.
vBulletin® v3.8.12 by vBS, Copyright ©2000-2024, vBulletin Solutions Inc.