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
Registered
#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
Registered
#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: {$main_url}/{$forum}_{$topic}_{$page}.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:

 ?
Only registered users are allowed to post here. Please, enter your username/password details upon posting a message, or register first.


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
Try the Captcha add-on: protect your miniBB-forums from the automated spam and flood.
Captcha Addon for miniBB