Display Last Edited Time Information For Only Admin and Moderators

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
mouthpiece
Registered User
Posts: 12
Joined: Fri Mar 09, 2018 9:06 am

Display Last Edited Time Information For Only Admin and Moderators

Post by mouthpiece » Wed Nov 07, 2018 12:34 am

Hello everyone,
please how can I modify the Display last edited time information feature to be only visible to admin and moderators.

Thanks!

User avatar
AmigoJack
Registered User
Posts: 5358
Joined: Tue Jun 15, 2010 11:33 am
Location: グリーン ヒル ゾーン
Contact:

Re: Display Last Edited Time Information For Only Admin and Moderators

Post by AmigoJack » Wed Nov 07, 2018 8:31 am

This is not possible with any setting - you'd either have to modify files or request an extension doing this.
The worst thing about censorship is ███████████

User avatar
Restless Rancor
Registered User
Posts: 183
Joined: Tue Sep 18, 2018 1:51 pm

Re: Display Last Edited Time Information For Only Admin and Moderators

Post by Restless Rancor » Wed Nov 07, 2018 10:56 am

Hi, as AmigoJack said there is no setting to achieve this, but the file edits aren't too difficult.

You'll need FTP access to download the files we will edit, and a text editor for programming language such as Notepad++ (NOT Notepad which comes pre-installed with Windows).

We won't be making any database edits, but make a copy of the files we download, in a new folder, so if they don't achieve the desired outcome or errors are thrown, you can upload the unedited files and be back where we started.

Open root/styles/prosilver/template/viewtopic_body.html

Find:

Code: Select all

			<!-- IF postrow.DELETED_MESSAGE or postrow.DELETE_REASON -->
				<div class="notice post_deleted_msg">
					{postrow.DELETED_MESSAGE}
					<!-- IF postrow.DELETE_REASON --><br /><strong>{L_REASON}{L_COLON}</strong> <em>{postrow.DELETE_REASON}</em><!-- ENDIF -->
				</div>
			<!-- ELSEIF postrow.EDITED_MESSAGE or postrow.EDIT_REASON -->
				<div class="notice">
					{postrow.EDITED_MESSAGE}
					<!-- IF postrow.EDIT_REASON --><br /><strong>{L_REASON}{L_COLON}</strong> <em>{postrow.EDIT_REASON}</em><!-- ENDIF -->
				</div>
			<!-- ENDIF -->
On a new line, add before:

Code: Select all

<!-- IF U_ACP or U_MCP -->
On a new line, add after:

Code: Select all

<!-- ENDIF -->
Open: root/styles/prosilver/template/ucp_pm_viewmessage.html

Find:

Code: Select all

		<!-- IF EDITED_MESSAGE or EDIT_REASON -->
		<div class="notice">{EDITED_MESSAGE}
			<!-- IF EDIT_REASON --><br /><strong>{L_REASON}{L_COLON}</strong> <em>{EDIT_REASON}</em><!-- ENDIF -->
		</div>
		<!-- ENDIF -->
On a new line, add before:

Code: Select all

<!-- IF U_ACP or U_MCP -->
On a new line, add after:

Code: Select all

<!-- ENDIF -->
Save, upload and purge the board cache - Ctrl + F5 to clear your browser cache whilst reloading the page might also be needed.
This will hide the edited and deleted notice and reason to anyone who does not have Administrator or Moderator permission (specifically, access to the ACP or MCP).

If you wanted to display deletion notices + reasons, use the following in viewtopic_body.html instead:

Find:

Code: Select all

				<div class="notice">
					{postrow.EDITED_MESSAGE}
					<!-- IF postrow.EDIT_REASON --><br /><strong>{L_REASON}{L_COLON}</strong> <em>{postrow.EDIT_REASON}</em><!-- ENDIF -->
				</div>
On a new line, add before:

Code: Select all

<!-- IF U_ACP or U_MCP -->
On a new line, add after:

Code: Select all

<!-- ENDIF -->
If you have a custom style, you'll need to make the same edits to it's own viewtopic_body.html and ucp_pm_viewmessage.html (if it has those files. If it doesn't, it inherits them from prosilver, so you only need to make the changes to prosilver).

Off the top of my head, I can't think of anywhere else which displays edit/deletion notices/messages - if after the edits the messages only show to Administrators and Moderators in private messages and in topics, but they show elsewhere, let me know how you're getting to that page to see the notice (eg. via search) and I'll take a closer look to see where else they may be loaded, but it's the same principle of applying the same code.
These aren't the droids you're looking for...
My Extensions and Snippets (Ref link)

User avatar
warmweer
Registered User
Posts: 1266
Joined: Fri Jul 04, 2003 6:34 am
Location: Van Allen Belt ... well actually Belgium

Re: Display Last Edited Time Information For Only Admin and Moderators

Post by warmweer » Wed Nov 07, 2018 12:45 pm

Restless Rancor wrote:
Wed Nov 07, 2018 10:56 am
... a clean and simple solution ... :)
Reminds me of (the good old days of) modifications in 3.0.x.

But it fits better in Custom Coding.
A bug is a feature that hasn't made it to the manual (yet)

User avatar
Restless Rancor
Registered User
Posts: 183
Joined: Tue Sep 18, 2018 1:51 pm

Re: Display Last Edited Time Information For Only Admin and Moderators

Post by Restless Rancor » Wed Nov 07, 2018 12:47 pm

warmweer wrote:
Wed Nov 07, 2018 12:45 pm
Reminds me of (the good old days of) modifications in 3.0.x.
Ha, those were the days...
warmweer wrote:
Wed Nov 07, 2018 12:45 pm

But it fits better in Custom Coding.

It certainly does ;)

I think I'll add it to my list of snippets :ugeek:
These aren't the droids you're looking for...
My Extensions and Snippets (Ref link)

User avatar
Lumpy Burgertushie
Registered User
Posts: 65195
Joined: Mon May 02, 2005 3:11 am
Contact:

Re: Display Last Edited Time Information For Only Admin and Moderators

Post by Lumpy Burgertushie » Wed Nov 07, 2018 3:53 pm

I would suggest that you do not do this to prosilver. I would suggest that if you don't already have a custom style that you create one .

make it inherit from prosilver and just include the template files listed with the edits to them.

that way, next time you update/upgrade you will not have to start over with the edits to a new prosilver and your updates will be much faster and easier.


robert
I am available for custom work on a donation basis. Please send me a PM with your needs.

Premium phpBB 3.2 Styles by PlanetStyles.net

OK, so what's the speed of dark?

User avatar
Restless Rancor
Registered User
Posts: 183
Joined: Tue Sep 18, 2018 1:51 pm

Re: Display Last Edited Time Information For Only Admin and Moderators

Post by Restless Rancor » Wed Nov 07, 2018 4:45 pm

Oh that's a good suggestion, thanks robert :geek:
These aren't the droids you're looking for...
My Extensions and Snippets (Ref link)

User avatar
axe70
Registered User
Posts: 104
Joined: Sun Nov 17, 2002 10:55 am
Location: Italy
Contact:

Re: Display Last Edited Time Information For Only Admin and Moderators

Post by axe70 » Thu Nov 08, 2018 3:58 pm

If it is not important info like this, that just need to display for specifics users, another way may is just few lines of js code into overall_footer.html.
the way is this:

Code: Select all

<!-- IF U_ACP -->
<script> .... code here ...</script>
<!-- ENDIF -->
or

Code: Select all

<!-- IF U_MCP -->
<script> .... code here ...</script>
<!-- ENDIF -->
may would be easy to add 2 lines of javascript needed to search for the div with class notice nested on specifics elements on this specific dom part, (so you'll not go to hide other elements on page that may use same class name) and injecting (maybe) the display:none attribute. Cheers ;)

User avatar
Restless Rancor
Registered User
Posts: 183
Joined: Tue Sep 18, 2018 1:51 pm

Re: Display Last Edited Time Information For Only Admin and Moderators

Post by Restless Rancor » Thu Nov 08, 2018 4:58 pm

The only issue there would be <div class="notice"> is also used for bumped notices. For example, if turning this into an extension we could use CSS display:none; to hide the notices:

Code: Select all

.notice {
	display: none;
}
...but this would also hide the bumped notice.

Come to think of it, we could then play with <!-- EVENT viewtopic_body_postrow_post_notices_before --> and/or <!-- EVENT viewtopic_body_postrow_post_notices_after --> by inserting our own bump notice which could be an exact replica of the default one, just with a different CSS class. This shouldn't be too difficult, and could even have configuration added so the groups who can view the notices can be configured via the ACP.

I haven't approached javascript yet, so am uncertain if your suggestion would be more efficient.
Maybe this is something I could play around with over the weekend :lol:
These aren't the droids you're looking for...
My Extensions and Snippets (Ref link)

User avatar
axe70
Registered User
Posts: 104
Joined: Sun Nov 17, 2002 10:55 am
Location: Italy
Contact:

Re: Display Last Edited Time Information For Only Admin and Moderators

Post by axe70 » Thu Nov 08, 2018 5:16 pm

Hi! to aim to only this inside the post, then you'll use this (assuming in prosilver):

Code: Select all

div.inner div.postbody div.notice{
	display:none;
}
but i'm not sure what you mean with the bumped.
Yes the js way is just another way: unique advantage of it, you can add hacks like this all into one point. About the rest, it is just another solution.

User avatar
Restless Rancor
Registered User
Posts: 183
Joined: Tue Sep 18, 2018 1:51 pm

Re: Display Last Edited Time Information For Only Admin and Moderators

Post by Restless Rancor » Thu Nov 08, 2018 5:26 pm

axe70 wrote:
Thu Nov 08, 2018 5:16 pm
...but i'm not sure what you mean with the bumped...
From viewtopic_body.html:

Code: Select all

			<!-- EVENT viewtopic_body_postrow_post_notices_before -->
			<!-- IF postrow.S_DISPLAY_NOTICE --><div class="rules">{L_DOWNLOAD_NOTICE}</div><!-- ENDIF -->
			<!-- IF postrow.DELETED_MESSAGE or postrow.DELETE_REASON -->
				<div class="notice post_deleted_msg">
					{postrow.DELETED_MESSAGE}
					<!-- IF postrow.DELETE_REASON --><br /><strong>{L_REASON}{L_COLON}</strong> <em>{postrow.DELETE_REASON}</em><!-- ENDIF -->
				</div>
			<!-- ELSEIF postrow.EDITED_MESSAGE or postrow.EDIT_REASON -->
				<!-- IF U_ACP or U_MCP --><div class="notice">
					{postrow.EDITED_MESSAGE}
					<!-- IF postrow.EDIT_REASON --><br /><strong>{L_REASON}{L_COLON}</strong> <em>{postrow.EDIT_REASON}</em><!-- ENDIF -->
				</div><!-- ENDIF -->
			<!-- ENDIF -->

			<!-- IF postrow.BUMPED_MESSAGE --><div class="notice"><br /><br />{postrow.BUMPED_MESSAGE}</div><!-- ENDIF -->
			<!-- EVENT viewtopic_body_postrow_post_notices_after -->
Ignoring the rules notice, we first have the deletion notice (if someone has deleted the post), then the edited notice (if someone has edited the post) and the bumped notice (if someone has bumped the topic).

The edited and bumped notices are using the same <div class="notice">, so using display:none; would also hide the bumped notice, but as I said we can just use one of the two events to insert our own:

Code: Select all

<!-- IF postrow.BUMPED_MESSAGE --><div class="xxx"><br /><br />{postrow.BUMPED_MESSAGE}</div><!-- ENDIF -->
... replacing xxx with our new CSS class which is a copy/paste of the notice one.

There's still a lot for me to pick up on CSS, so there could be more efficient ways for me to do this, but that's how I'd initially approach it if writing an extension for it.
These aren't the droids you're looking for...
My Extensions and Snippets (Ref link)

User avatar
axe70
Registered User
Posts: 104
Joined: Sun Nov 17, 2002 10:55 am
Location: Italy
Contact:

Re: Display Last Edited Time Information For Only Admin and Moderators

Post by axe70 » Thu Nov 08, 2018 9:11 pm

BUMP! ah! ok i see, but i ignore how to bump a post ... and what it mean... hihihih ... i can't traduce, nor used so... what shame ehehehe

so let go another time with css pure solution, that may will fit your need, that should work (the other way remain js)
try this:

Code: Select all

div.inner div.content+div.notice{
	display:none;
}
assuming ever we are on prosilver.
this should hide only the first sibiling and not the second (the bumped).

But can you explain me in other words what evil mean and how i should bump a post!

User avatar
kinerity
Community Team Member
Community Team Member
Posts: 1944
Joined: Mon Sep 01, 2014 1:00 am
Location: sudo rm -rf /
Name: Kailey Truscott
Contact:

Re: Display Last Edited Time Information For Only Admin and Moderators

Post by kinerity » Fri Nov 09, 2018 4:33 am

axe70 wrote:
Thu Nov 08, 2018 9:11 pm
how i should bump a post!
I believe you have to the the first post (topic author).

bump.png
Kailey Truscott - Community Team

User avatar
Restless Rancor
Registered User
Posts: 183
Joined: Tue Sep 18, 2018 1:51 pm

Re: Display Last Edited Time Information For Only Admin and Moderators

Post by Restless Rancor » Fri Nov 09, 2018 5:54 am

axe70 wrote:
Thu Nov 08, 2018 9:11 pm

this should hide only the first sibiling and not the second (the bumped).
Awesome, I'll give it a go thanks :)
These aren't the droids you're looking for...
My Extensions and Snippets (Ref link)

User avatar
axe70
Registered User
Posts: 104
Joined: Sun Nov 17, 2002 10:55 am
Location: Italy
Contact:

Re: Display Last Edited Time Information For Only Admin and Moderators

Post by axe70 » Fri Nov 09, 2018 10:41 am

Hi all! Thank you!
I believe you have to the the first post (topic author)
Ok! i note there is existent icon (option) for the admin ...
So i bumped the topic.
Last bumped by admin on Fri Nov 09, 2018 10:33 am.
But i feel like a stupid now (like often happen by the way) ... because i not understand what it mean apart this new message that display. The Topic has been Bumped!? What it mean ... be patient for this "off topic", i'm little confused ehehehe
p.s i've also search for this and i understand nothing by the way ... Bump nightmare at moment :shock:

Post Reply

Return to “phpBB Custom Coding”

Who is online

Users browsing this forum: No registered users and 265 guests