News:

Bored?  Looking to kill some time?  Want to chat with other SMF users?  Join us in IRC chat or Discord

Main Menu

Don't Show Last Edit If Updater Is Admin

Started by 127.0.0.1, September 05, 2004, 05:12:17 PM

Previous topic - Next topic

Owdy

#20
Quote from: [Unknown] on September 05, 2004, 05:49:35 PM
Find, Sources/Post.php:

// Have admins allowed people to hide their screwups?
if (time() - $row['posterTime'] > $modSettings['edit_wait_time'] || $ID_MEMBER != $row['ID_MEMBER'])
$modifiedTime = time();


See that?  Fix it ;) like so:

// Administrator edits should not be logged!
if ($user_info['is_admin'])
$modifiedTime = 0;
// Have admins allowed people to hide their screwups?
elseif (time() - $row['posterTime'] > $modSettings['edit_wait_time'] || $ID_MEMBER != $row['ID_MEMBER'])
$modifiedTime = time();


-[Unknown]

What if i want admin and some membergroup both have this, how to edit that code?

edit:
* Owdy goes and try this:
if ( in_array(1, $GLOBALS['user_info']['groups']) )
Former Lead Support Specialist

Tarvitsetko apua SMF foorumisi kanssa? Otan työtehtäviä vastaan, lue:http://www.simplemachines.org/community/index.php?topic=375918.0

CapriSkye

so who exactly is an admin? are moderators admin? how about global moderators? and if i want this apply to just one member, do i change this if ($user_info['is_admin']) to if ($user_info['user']) where user is the name of the user? thank you

CapriSkye

i've change unknown's code to work with whichever member you want to hide modify time,

with unknown's code:

// Administrator edits should not be logged!
if ($user_info['is_admin'])
$modifiedTime = 0;
// Have admins allowed people to hide their screwups?
elseif (time() - $row['posterTime'] > $modSettings['edit_wait_time'] || $ID_MEMBER != $row['ID_MEMBER'])
$modifiedTime = time();


replace with this:

// Administrator edits should not be logged!
if ($user_info['name'] == 'CapriSkye')
$modifiedTime = 0;
// Have admins allowed people to hide their screwups?
elseif (time() - $row['posterTime'] > $modSettings['edit_wait_time'] || $ID_MEMBER != $row['ID_MEMBER'])
$modifiedTime = time();


where 'CapriSkye' is the member's name you want to hide modify time.

CapriSkye

anybody knows a way to show the new icon anyway? just not showing the modify time, but still let people know the message is edited so they can go check it out. just a thought.. :-\

CapriSkye

Quote from: CapriSkye on December 20, 2004, 04:11:04 AM
anybody knows a way to show the new icon anyway? just not showing the modify time, but still let people know the message is edited so they can go check it out. just a thought.. :-\

this trick will work for 1.0 final :)
In /Display.template.php:
Find:

if ($settings['show_modify'] && !empty($message['modified']['name']))


Replace with:

if ($settings['show_modify'] && !empty($message['modified']['name']) && $message['modified']['name'] != 'capri')


Where capri is the username

Ben Dragon

Greetings,

I've noticed in the latest version of SMF, that this "hide admin edits" hack is no longer working.

I re-edited the Post.php with the above content, (as the upgrade overwrote it).

Is there some way of making this hack work?

Have I overlooked a new setting that does this?

Thanks.

mab

#26
In post.php, I just made that :

                                                                      FIND :
// Have admins allowed people to hide their screwups?
if (time() - $row['posterTime'] > $modSettings['edit_wait_time'] || $ID_MEMBER != $row['ID_MEMBER'])
$modifiedTime = time();


                                                                      REPLACE WITH :
// Just add if (!$user_info['is_admin'])

if (!$user_info['is_admin'])
// Have admins allowed people to hide their screwups?
if (time() - $row['posterTime'] > $modSettings['edit_wait_time'] || $ID_MEMBER != $row['ID_MEMBER'])
$modifiedTime = time();



and it seems working.


ex :
a post has been written by Cain (the test user)

if admin edit the post, nothing appears
if Cain edit the post :  « Last Edit: xxxxxxxx XX, 200X, HH:MM:SS by Cain »
if Cain edit the post twice, the date/time is updates
if admin edit the post, nothing change.

So with this hack, all rules are complied.


What do you think about ?
-

Ben Dragon

Sorry for the lateness of the reply... very busy here, but...

Yes, it seems to work great! :D

I'll test it out more extensively over the next little while and will report back if I find anything additional of concern.

Other than that; thanks!
8)

Northerner

as simple as this is, it really should be turned into a mod, some people might not know its available?

Elmacik

is there anyone who could do it work at last?
Home of Elmacik

Snickers

lol, i'm confused, whats the final working version code for this?

Elijah Bliss

For 1.1 RC1, in Sources/Post.php
Code (FIND) Select

// This is an already existing message. Edit it.
if (!empty($_REQUEST['msg']))
{


Code (ADD AFTER) Select

if ($user_info['is_admin'])
$msgOptions['modify_time'] = 0;


Code (FIND) Select

if (time() - $row['posterTime'] > $modSettings['edit_wait_time'] || $ID_MEMBER != $row['ID_MEMBER'])


Code (REPLACE) Select

elseif (time() - $row['posterTime'] > $modSettings['edit_wait_time'] || $ID_MEMBER != $row['ID_MEMBER'])


ivo2296

#33
Quote from: Elijah Bliss on October 09, 2005, 03:55:11 PM
For 1.1 RC1, in Sources/Post.php
Code (FIND) Select

// This is an already existing message. Edit it.
if (!empty($_REQUEST['msg']))
{


Code (ADD AFTER) Select

if ($user_info['is_admin'])
$msgOptions['modify_time'] = 0;


Code (FIND) Select

if (time() - $row['posterTime'] > $modSettings['edit_wait_time'] || $ID_MEMBER != $row['ID_MEMBER'])


Code (REPLACE) Select

elseif (time() - $row['posterTime'] > $modSettings['edit_wait_time'] || $ID_MEMBER != $row['ID_MEMBER'])


What about 1.0.5? please!

Thank you!

coffee

i am still unable to get this to work for me...
using SMF 1.0 Beta 5 Public.

the code i have in sources/post.php is:

// Have admins allowed people to hide their screwups?
if (time() - $row['posterTime'] > $modSettings['edit_wait_time'])
$modifiedTime = time();


i've tried changing it a dozen different ways according to all the suggestions here but no matter what i do, i still see last admin edits using admin log in and guest log in. what am i doing wrong?

AliasAngel

Sorry, computer somehow posted same message twice.

AliasAngel



furiousV

A "Show Last Edit on end of post" Option should be available when making a post and showing Advanced Options.

Sometimes you want to have control over when and when this don't show and not change the source files all the time.

With my very basic PHP knowledge, I would appreciate someone to guide me in the right direction.

We all can benefit from such

fiver

#39
Hi furiousV,

I just had an 'accidental' idea. Read this link first and you will know what I mean.  ;D
http://www.simplemachines.org/community/index.php?topic=51190.msg446691#msg446691

If you are using smf1.1rc2, make the changes suggested by Elijah Bliss (Reply #31) and...
- click 'Modify' if you don't want to show admin's last edit
- click Quick Edit icon on the right of the post if you want to show admin's last edit

:D


Advertisement: