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
DTMWC
Registered User
Posts: 379
Joined: Tue Jan 16, 2018 6:17 am

Script Names

Post by DTMWC »

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?
Boom.
User avatar
thecoalman
Community Team Member
Community Team Member
Posts: 5871
Joined: Wed Dec 22, 2004 3:52 am
Location: Pennsylvania, U.S.A.
Contact:

Re: Script Names

Post by thecoalman »

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.
“Results! Why, man, I have gotten a lot of results! I have found several thousand things that won’t work.”

Attributed - Thomas Edison
User avatar
DTMWC
Registered User
Posts: 379
Joined: Tue Jan 16, 2018 6:17 am

Re: Script Names

Post by DTMWC »

: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 :)
Boom.
Post Reply

Return to “phpBB Custom Coding”