15 years on The Web
miniBB ® miniBB®
miniBB Support Forums
 | Forums | Register | Reply | Search | Statistics | Manual |
Master Class miniBB Support Forums / Master Class /   

Template tag for link to current page?

Author Vishal
Partaker
#1 | Posted: 18 Nov 2011 08:34 
Is there a template tag that I can use in say main_header.html to get the link to the current page? I'm using keyword rich URL addon. I just want to use that for <link rel="canonical"... tag.

Author Paul
Lead Developer
#2 | Posted: 18 Nov 2011 11:10 
You may try to use something like this in bb_plugins.php:

$currentUrl=$_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI'];

then paste {$currentUrl} in the place you want.

There might be some variations with the $_SERVER variables, you may check in PHP manual for more - may be another combination would work for you.

Author Vishal
Partaker
#3 | Posted: 18 Nov 2011 12:35 
Thanks Paul! Is there no direct (or combination) tag for keyword rich urls? Previously we could get URLs using: http://www.minibb.com/forums/5_5830_1.html

Author Paul
Lead Developer
#4 | Posted: 18 Nov 2011 13:11 
In the latest miniBB series, mod_rewrite functions are separated to be standalone (and possibly modified).

Pay attention at bb_functions.php -> addForumURLPage, addTopicURLPage functions etc.

Using these functions and knowing some certain params, it's possible to build the original forum/topic URL.

Master Class miniBB Support Forums / Master Class / Template tag for link to current page? Top

Your Reply Click this icon to move up to the quoted message

 Short link for this topic:

 ?
You are welcome to post anonymously, by entering a nickname with no password (if the similar Username has not been taken yet), or by leaving both fields empty. If you have a forums account, you can also sign in from this page without posting a message, or sign in and post at once.


Before posting, make sure your message is compliant with our forum posting rules. If not, it may be locked or deleted with no explanation.
 
miniBB Support Forums Powered by Forum Software miniBB ® Features  Requirements  Demo  Download  Showcase  Gallery of Arts
Compiler  Premium Extensions  Premium Support  License  Contacts
Install the Captcha add-on: protect your miniBB-forums from the automated spam and flood.
Captcha Addon for miniBB