PDA

View Full Version : How to show REQUEST URI


CarcaBot
20 Nov 2009, 13:06
Hello there,

I'm interested how to show in a template my URL address (REQUEST URI)

$_SERVER['SERVER_NAME']
$_SERVER['REQUEST_URI']


thanks.

cellarius
20 Nov 2009, 19:42
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: http://www.vbulletin.org/forum/showthread.php?t=228078

CarcaBot
21 Nov 2009, 04:52
I saw that code before, but i'm not able to show what i need...

cellarius
21 Nov 2009, 08:18
Where exactly do you want to show it? Which template?

CarcaBot
21 Nov 2009, 10:09
in bbcode_code

cellarius
21 Nov 2009, 11:42
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
21 Nov 2009, 13:40
Yes , is working, but if i have multiple code tags it's showing only at one ( first)

cellarius
21 Nov 2009, 14:56
I can't think of a way around that atm, sorry.