Hide Post Reply and New Topic buttons/text for guests

Looking for a MOD? Have a MOD request? Post here for help. (Note: This forum is community supported; phpBB does not have official MOD authors)
Ideas Centre
Locked
User avatar
FORDification
Registered User
Posts: 112
Joined: Fri Jul 23, 2004 4:12 am
Location: Nebraska
Contact:

Hide Post Reply and New Topic buttons/text for guests

Post by FORDification »

I need to find out how to hide the Post Reply and New Topic buttons from guests. I'm reworking phpbb3 prosilver into somewhat of an article depository, and I as Admin will be the only one posting. It's actually looking pretty good, except that I'd really like to just remove these buttons for everyone but myself. Setting all forums to Read Only Access still allows these buttons to appear. Deleting the button image still allows the text under it to be visible. I could probably figure out how to delete the button reference altogether, but I as Admin still need access to them as needed, so that's not an option. I just need to hide them from everyone but myself.

Can someone help out? Thanks!
FORDification.com - The '67-'72 Ford F-Series Pickup Resource
FORDification.net - The '73-'79 Ford F-Series Pickup Resource
User avatar
JimA
Community Team Leader
Community Team Leader
Posts: 7822
Joined: Thu Jul 31, 2008 5:54 am
Location: The Netherlands
Name: Jim Mossing Holsteyn
Contact:

Re: Hide Post Reply and New Topic buttons/text for guests

Post by JimA »

Open: styles/prosilver/template/viewforum_body.html
Find:

Code: Select all

	<!-- IF not S_IS_BOT and S_DISPLAY_POST_INFO -->
		<div class="buttons">

*** lot of code for the buttons left away ***

		</div>
	<!-- ENDIF -->
Change the first line into:

Code: Select all

<!-- IF not S_IS_BOT and S_DISPLAY_POST_INFO and U_ACP -->
That will results in only administrators being able to see the buttons on the "View forum" pages.
To hide them in the topics themselves as well, open viewtopic_body in the same folder and find this:

Code: Select all

	<div class="buttons">
	<!-- IF not S_IS_BOT and S_DISPLAY_REPLY_INFO -->

*** quite some code again we don't need, so I left it away ***

	<!-- ENDIF -->
	</div>
Change the IF line into the following:

Code: Select all

<!-- IF not S_IS_BOT and S_DISPLAY_REPLY_INFO and U_ACP -->
That will hide the "Post reply" button in the "View topic" pages for non-administrators.
Afterwards, refresh your templates in Styles -> Templates -> Refresh.
Jim Mossing Holsteyn - Community Team Leader
Knowledge Base | Documentation | Board rules

If you're having any questions about the rules/customs of this website, feel free to drop me a PM.
User avatar
FORDification
Registered User
Posts: 112
Joined: Fri Jul 23, 2004 4:12 am
Location: Nebraska
Contact:

Re: Hide Post Reply and New Topic buttons/text for guests

Post by FORDification »

Thank you for replying. I tried to apply the edits you suggested, but the code you told me to find on both pages doesn't exist. However, using your suggestion, I was able to find the following code:

In viewforum_body.html

Code: Select all

			<!-- IF S_DISPLAY_POST_INFO and not S_IS_BOT -->
				<td align="{S_CONTENT_FLOW_BEGIN}" valign="middle"><a href="{U_POST_NEW_TOPIC}">{POST_IMG}</a></td>
			<!-- ENDIF -->
...and changed it to:

Code: Select all

			<!-- IF S_DISPLAY_POST_INFO and not S_IS_BOT and U_ACP -->
				<td align="{S_CONTENT_FLOW_BEGIN}" valign="middle"><a href="{U_POST_NEW_TOPIC}">{POST_IMG}</a></td>
			<!-- ENDIF -->
Then, in viewtopic_body.html I found:

Code: Select all

		<!-- IF not S_IS_BOT -->
			<!-- IF S_DISPLAY_POST_INFO --><a href="{U_POST_NEW_TOPIC}">{POST_IMG}</a>&nbsp;<!-- ENDIF -->
			<!-- IF S_DISPLAY_REPLY_INFO --><a href="{U_POST_REPLY_TOPIC}">{REPLY_IMG}</a><!-- ENDIF -->
		<!-- ENDIF -->
...and changed it to:

Code: Select all

		<!-- IF not S_IS_BOT and U_ACP -->
			<!-- IF S_DISPLAY_POST_INFO and U_ACP --><a href="{U_POST_NEW_TOPIC}">{POST_IMG}</a>&nbsp;<!-- ENDIF -->
			<!-- IF S_DISPLAY_REPLY_INFO and U_ACP --><a href="{U_POST_REPLY_TOPIC}">{REPLY_IMG}</a><!-- ENDIF -->
		<!-- ENDIF -->
I then refreshed the template, refreshed the theme and purged the cache, but the edits had no effect. I'm still able to see the Post Reply and New Topic buttons on each page.

So am I not editing the correct lines? As stated, the lines you told me to find did not exist, and the ones I edited were the closest to what you suggested I find, so I just tried them anyway to see if editing them would work, but no luck.
FORDification.com - The '67-'72 Ford F-Series Pickup Resource
FORDification.net - The '73-'79 Ford F-Series Pickup Resource
User avatar
FORDification
Registered User
Posts: 112
Joined: Fri Jul 23, 2004 4:12 am
Location: Nebraska
Contact:

Re: Hide Post Reply and New Topic buttons/text for guests

Post by FORDification »

I also tried changing:

Code: Select all

<!-- IF S_DISPLAY_POST_INFO and not S_IS_BOT -->
to

Code: Select all

<!-- IF S_USER_LOGGED_IN and S_DISPLAY_POST_INFO and not S_IS_BOT -->
and even after refreshing the templates and theme and purging the cache and then logging out and refreshing my browser, the buttons are still visible.
FORDification.com - The '67-'72 Ford F-Series Pickup Resource
FORDification.net - The '73-'79 Ford F-Series Pickup Resource
User avatar
FORDification
Registered User
Posts: 112
Joined: Fri Jul 23, 2004 4:12 am
Location: Nebraska
Contact:

Re: Hide Post Reply and New Topic buttons/text for guests

Post by FORDification »

OK, I think I just figured out why it's not working....I haven't updated my installation from 3.0.2 to 3.0.5. :oops: I downloaded a full 3.0.5 and looked at those pages, the lines you told me to look for are there. Guess that's what I'm doing this evening. Thanks!
FORDification.com - The '67-'72 Ford F-Series Pickup Resource
FORDification.net - The '73-'79 Ford F-Series Pickup Resource
User avatar
FORDification
Registered User
Posts: 112
Joined: Fri Jul 23, 2004 4:12 am
Location: Nebraska
Contact:

Re: Hide Post Reply and New Topic buttons/text for guests

Post by FORDification »

Upgraded my installation to the latest, applied your edits, and they work perfectly. Thank you very much! :D
FORDification.com - The '67-'72 Ford F-Series Pickup Resource
FORDification.net - The '73-'79 Ford F-Series Pickup Resource
Locked

Return to “[3.0.x] MOD Requests”