Template link to go directly to board root

For support and discussion related to templates, themes, and imagesets in phpBB 3.2.
Post Reply
User avatar
stevemaury
Support Team Member
Support Team Member
Posts: 49457
Joined: Thu Nov 02, 2006 12:21 am
Location: The U.P.
Name: Steve
Contact:

Template link to go directly to board root

Post by stevemaury » Sun Feb 11, 2018 7:36 pm

I need to make all the prosilver templates, other than index_body.html, contain only a link back to the root index.php file, so that no matter what .php file is typed into the browser address bar, the user only sees a link back to /index.php. If I use ../index.php, it does not work for those php files that take the user down more than on folder level. For example, typing http://MyBoardRoot/faq,php in the browser takes the user to http://MyDomainRoot/app.php/help/faq, so a link using ../index.php only goes back to http://MyDomainRoot/app.php/help/index.php.

I realize that this task is accomplished all the time in phpBB by using a link to [c]{U_INDEX}
, but I am not smart enough to construct a link that will always go back to /index.php. Something like

Code: Select all

<a href="{U_INDEX}">CLICK HERE</a>
A little help, please?
For REALLY good and VERY inexpensive hosting CLICK HERE

I can stop all your spam. PM or email me.

All unsolicited PMs will be ignored.

User avatar
pit-PL
Registered User
Posts: 3065
Joined: Sat Nov 21, 2009 12:24 pm

Re: Template link to go directly to board root

Post by pit-PL » Sun Feb 11, 2018 7:56 pm

<a href="{ROOT_PATH}">CLICK HERE</a>
or
<a href="{ROOT_PATH}index.php">CLICK HERE</a>

User avatar
stevemaury
Support Team Member
Support Team Member
Posts: 49457
Joined: Thu Nov 02, 2006 12:21 am
Location: The U.P.
Name: Steve
Contact:

Re: Template link to go directly to board root

Post by stevemaury » Sun Feb 11, 2018 11:03 pm

Thanks. Easy when you know how, eh?
For REALLY good and VERY inexpensive hosting CLICK HERE

I can stop all your spam. PM or email me.

All unsolicited PMs will be ignored.

User avatar
3Di
Registered User
Posts: 12893
Joined: Mon Apr 04, 2005 11:09 pm
Location: Milan (IT) Frankfurt (DE)
Name: Marco
Contact:

Re: Template link to go directly to board root

Post by 3Di » Mon Feb 12, 2018 1:03 am

stevemaury wrote:
Sun Feb 11, 2018 11:03 pm
Thanks. Easy when you know how, eh?
This, placed on the very top of overall_header.html, should do the follow

If the user is not a Moderator or Admin and is not already in index, then the link appears. Just one edit.

Code: Select all

	<!-- IF SCRIPT_NAME neq "index" or (U_MCP or U_ACP) -->
		<p>
			<a href="{U_INDEX}">CLICK HERE</a>
		</p>
	<!-- ENDIF -->
Just one note, I didn't test it :)
Want to compensate me for my interest? Donate
Please PM me only to request paid works. Thx.
Extensions, Scripts, MOD porting, Update/Upgrades
My development's activity º PhpStorm's proud user

User avatar
david63
Jr. Extension Validator
Posts: 14645
Joined: Thu Dec 19, 2002 8:08 am
Location: Lancashire, UK
Name: David Wood
Contact:

Re: Template link to go directly to board root

Post by david63 » Mon Feb 12, 2018 2:11 am

To be technically correct it should be
pit-PL wrote:
Sun Feb 11, 2018 7:56 pm
<a href="{ROOT_PATH}index.{PHP_EXT}">CLICK HERE</a>
David
Remember: You only know what you know and - you don't know what you don't know!
My CDB Contributions | How to install an extension
I will not be accepting translations for any of my extensions in Github - please post any translations in the appropriate topic.
No support requests via PM or email as they will be ignored

Post Reply

Return to “[3.2.x] Styles Support & Discussion”

Who is online

Users browsing this forum: v12mike and 4 guests