TinyPortal
Development => Support => Topic started by: Inge Jones on May 22, 2012, 12:56:48 PM
I would like to be able to get the value of my forum's base url from within a php TP block. I can't see it obviously in the $context array. Is it available within a block?
You'd have to use the variable "$scripturl" for that, and, of course, you'll have to declare the global for that variable at the top of the code as well ...
global $scripturl;
echo $scripturl;
ZarPrime
Modified ZarPrimes code to reflect how you can echo it out. Hope you don't mind Zar.
No problem Ichbin. ;) I don't even remember exactly what I posted but I know it wasn't the actual code. Inge Jones seems quite knowledgeable about php so I figured that it wouldn't be a problem for her to figure it out. :)
Thanks both :) While I was waiting I got hold of the link_tree and stripped that down to get the base url, but $scripturl looks a lot more direct :D