S_USER_LOGGED_IN not working in attachment.html

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
romeo_piter
Registered User
Posts: 130
Joined: Mon Nov 09, 2009 7:11 pm
Location: Paraguay

S_USER_LOGGED_IN not working in attachment.html

Post by romeo_piter »

Condition {% if S_USER_LOGGED_IN %} doesn't work for attachment.html. How to make it work?
User avatar
ssl
Registered User
Posts: 2057
Joined: Sat Feb 08, 2020 2:15 pm
Location: Le Lude, Pays de la Loire - France
Name: Fred Rimbert

Re: S_USER_LOGGED_IN not working in attachment.html

Post by ssl »

Why want to make this addition in the template when the display of the attached files for the guests is regulated with the permissions set?
Sorry for my English ... I do my best! :anger_right:

:point_right_tone3: phpBB: 3.3.14 | PHP: 8.3.12
:point_right_tone4: [Kill spam on phpBB] - [Some French translation of extensions]
"Mistress, Mistress someone is bothering me in pm"
romeo_piter
Registered User
Posts: 130
Joined: Mon Nov 09, 2009 7:11 pm
Location: Paraguay

Re: S_USER_LOGGED_IN not working in attachment.html

Post by romeo_piter »

In my case permission won't work. I need to make different view of attachments for guests and registered users. Not just hide but different view. Can anyone help?
'S_USER_LOGGED_IN' => ($user->data['user_id'] != ANONYMOUS) ? true : false, is in functions.php. It should be global, but it doesn't work in attachment.html :shock:
User avatar
RMcGirr83
Former Team Member
Posts: 22090
Joined: Wed Jun 22, 2005 4:33 pm
Location: Your display
Name: Rich McGirr

Re: S_USER_LOGGED_IN not working in attachment.html

Post by RMcGirr83 »

Find this in viewtopic.php

Code: Select all

'S_HAS_ATTACHMENTS'	=> (!empty($attachments[$row['post_id']])) ? true : false,
change it to this

Code: Select all

'S_HAS_ATTACHMENTS'	=> ($user->data['user_id'] != ANONYMOUS && !empty($attachments[$row['post_id']])) ? true : false,
Won't remove inline-attachments though.
Former Modifications/Extensions Team Member | My extensions | github | All requests for support via PM will be ignored
Appreciate the extensions/mods/support then you can support me by buying a beer 🍺

Return to “phpBB Custom Coding”