Hiding file attachments from guests (using style template)

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

Re: Hiding file attachments from guests (using style template)

Post by thecoalman »

warmweer wrote: Wed Sep 04, 2024 8:29 am Don't shoot me if I've overlooked/missed something....
If you were going to do what you suggested you can just do it with permissions. He's only trying to hide large files that are links. You can't use global template variables in the attachment.html template so you need to add some.

That template is special case because it's parsed before viewtopic_body.html. The inline images are presumably similar to BBcode and it's parsed with topic text. The attachments at end of posts are parsed and held in {postrow.attachment.DISPLAY_ATTACHMENT}, It's already HTML.
“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
thecoalman
Community Team Member
Community Team Member
Posts: 6341
Joined: Wed Dec 22, 2004 3:52 am
Location: Pennsylvania, U.S.A.

Re: Hiding file attachments from guests (using style template)

Post by thecoalman »

kebev wrote: Wed Sep 04, 2024 10:06 am I'm wondering if I can convert this solution into some sort of extension or is this beyond the current capability of phpBB? Presumably I will otherwise lose these changes every time I update phpBB?

Thanks!
You can check out the extension documentation and forum. If you have any questions about that start a new topic there.

viewforum.php?f=461
“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
warmweer
Jr. Extension Validator
Posts: 11749
Joined: Fri Jul 04, 2003 6:34 am
Location: Van Allen Bel ... gium

Re: Hiding file attachments from guests (using style template)

Post by warmweer »

thecoalman wrote: Wed Sep 04, 2024 4:39 pm
warmweer wrote: Wed Sep 04, 2024 8:29 am Don't shoot me if I've overlooked/missed something....
... You can't use global template variables in the attachment.html template so you need to add some.

That template is special case because it's parsed before viewtopic_body.html. The inline images are presumably similar to BBcode and it's parsed with topic text. The attachments at end of posts are parsed and held in {postrow.attachment.DISPLAY_ATTACHMENT}, It's already HTML.
Ow, special case: interesting, very tempting to fool around in there to see what's happening. (something for long winter nights)
Spelling is freeware, which means you can use it for free.
On the other hand, it is not open source, which means you cannot change it or publish it in a modified form.


Time flies like an arrow, but fruit flies like a banana.
kebev
Registered User
Posts: 7
Joined: Mon Sep 02, 2024 9:01 am

Re: Hiding file attachments from guests (using style template)

Post by kebev »

thecoalman wrote: Wed Sep 04, 2024 4:42 pm
kebev wrote: Wed Sep 04, 2024 10:06 am I'm wondering if I can convert this solution into some sort of extension or is this beyond the current capability of phpBB? Presumably I will otherwise lose these changes every time I update phpBB?

Thanks!
You can check out the extension documentation and forum. If you have any questions about that start a new topic there.

viewforum.php?f=461
Awesome - thank you again for your help. Technically I'm not sure if it's possible so I'm not sure if I'm up to giving it a try, especially since it looks like it will take many months to become as knowledgeable as you ;)

Return to “phpBB Custom Coding”