Script Names

Need some custom code changes to the phpBB core simple enough that you feel doesn't require an extension? Then post your request here so that community members can provide some assistance.

NOTE: NO OFFICIAL SUPPORT IS PROVIDED IN THIS SUB-FORUM
Forum rules
READ: phpBB.com Board-Wide Rules and Regulations

NOTE: NO OFFICIAL SUPPORT IS PROVIDED IN THIS SUB-FORUM
Post Reply
User avatar
Dan Stylez
Registered User
Posts: 183
Joined: Tue Jan 16, 2018 6:17 am
Contact:

Script Names

Post by Dan Stylez » Sun Jun 10, 2018 2:12 am

Is there a similar method to IF SCRIPT_NAME eq 'viewonline' or IF U_SITE_HOME that could be used for inbox, outbox and sent?

User avatar
thecoalman
Community Team Member
Community Team Member
Posts: 2801
Joined: Wed Dec 22, 2004 3:52 am
Location: Pennsylvania, U.S.A.
Contact:

Re: Script Names

Post by thecoalman » Sun Jun 10, 2018 5:54 am

There is is usually a large array of template variables near the end of each script that will include a switch for that particular script. For example in viewonline.php on line 503:

Code: Select all

	'S_VIEWONLINE'				=> true,
In the template you can just use:

Code: Select all

<!-- IF S_VIEWONLINE -->
//HTML to parse only for viewonline
<!-- ENDIF -->

This array doesn't exist in ucp.php since it's loads different modules but if you look in /includes/ucp/ucp_pm.php on line 359:

Code: Select all

					'S_IN_INBOX'			=> ($folder_id == PRIVMSGS_INBOX) ? true : false,
					'S_IN_OUTBOX'			=> ($folder_id == PRIVMSGS_OUTBOX) ? true : false,
					'S_IN_SENTBOX'			=> ($folder_id == PRIVMSGS_SENTBOX) ? true : false,
:D ....Quick tip here there is also an array in includes/functions.php that has template variables available in any template.

User avatar
Dan Stylez
Registered User
Posts: 183
Joined: Tue Jan 16, 2018 6:17 am
Contact:

Re: Script Names

Post by Dan Stylez » Sun Jun 10, 2018 7:11 pm

:oops: There was me searching the style templates, that's perfect and will save me some time, thank you :)

Friend switching over from SMF and wants breadcrumbs links on every page like his old forum, so now i can get the PM side sorted :)

Post Reply

Return to “phpBB Custom Coding”

Who is online

Users browsing this forum: No registered users and 2 guests