Hide Forum Permissions from Guests

Post Reply
steven
Posts: 133
Joined: Sun Oct 01, 2017 3:08 pm

Hide Forum Permissions from Guests

Post by steven »

My first impression, when visiting a phpBB website was, this is a very professional looking website but not very friendly. I saw what I couldn't do with nothing about what I could do. If I visit a website as a guest and do not have permission to contribute, I prefer a friendly user message:

You need to login in order to post within this forum.
or
You need to login in order to reply to topics within this forum.

If you make this modification, when a guest visits your site and opens a forum, they will not see the permissions. If you require a login and they select post or reply, they will get the the screen to login or register and one of the messages above, which is the normal phpBB response. After the user logs in, permissions are displayed normally.

To hide permissions from guests, open the >styles>prosilver>template>viewforum_body.html file.

For phpBB 3.3.2 to 3.3.12 locate the following code: (about line 310)

Code: Select all

<!-- IF S_IS_POSTABLE and rules|length -->
Change the code to the following:

Code: Select all

<!-- IF S_IS_POSTABLE and S_USER_LOGGED_IN and rules|length -->


For phpBB 3.3 and 3.2 locate the following code: (about line 308)

Code: Select all

<!-- IF S_DISPLAY_POST_INFO -->
	<div class="stat-block permissions">
		<h3>{L_FORUM_PERMISSIONS}</h3>
		<p><!-- BEGIN rules -->{rules.RULE}<br /><!-- END rules --></p>
	</div>
<!-- ENDIF -->
Change the code to the following:

Code: Select all

<!-- IF S_DISPLAY_POST_INFO and S_USER_LOGGED_IN -->
	<div class="stat-block permissions">
		<h3>{L_FORUM_PERMISSIONS}</h3>
		<p><!-- BEGIN rules -->{rules.RULE}<br /><!-- END rules --></p>
	</div>
<!-- ENDIF -->


For phpBB 3.3.1 locate the following code: (about line 310)

Code: Select all

<!-- IF S_IS_POSTABLE and rules|length -->
	<div class="stat-block permissions">
		<h3>{L_FORUM_PERMISSIONS}</h3>
		<p><!-- BEGIN rules -->{rules.RULE}<br /><!-- END rules --></p>
	</div>
<!-- ENDIF -->
Change the code to the following:

Code: Select all

<!-- IF S_IS_POSTABLE and rules|length -->
	<!-- IF S_USER_LOGGED_IN -->
		<div class="stat-block permissions">
			<h3>{L_FORUM_PERMISSIONS}</h3>
			<p><!-- BEGIN rules -->{rules.RULE}<br /><!-- END rules --></p>
		</div>
	<!-- ENDIF -->
<!-- ENDIF -->

Modified files for phpBB v3.3.0 through 3.3.11 (If you've made other changes to your file, do not use the download)

viewforum_body_3.3.12.zip
(3.43 KiB) Downloaded 206 times


viewforum_body_3.3.11.zip
(3.42 KiB) Downloaded 448 times


viewforum_body_3.3.5.zip
(3.42 KiB) Downloaded 639 times


viewforum_body_3_3_3.zip
(3.42 KiB) Downloaded 794 times


viewforum_body_3_3_2.zip
(3.42 KiB) Downloaded 821 times


viewforum_body_3_3_1.zip
(3.41 KiB) Downloaded 882 times


viewforum_body_3_3.zip
(3.37 KiB) Downloaded 976 times

 

After you make the change or install the file, log into ACP (Admin Control Panel) and purge the cache so your change takes effect.
Post Reply