I'm trying to write a little mod that does what is stated in the topic. I successfully wrote one for YaBBSE and it looked like this...
// dont update modified time or name if updater is admin
if ($settings[7] != 'Administrator')
{
$request = mysql_query("UPDATE {$db_prefix}messages SET subject='$subject',icon='$icon', body='$message', modifiedTime=" . time() . ", modifiedName='" . addslashes($realname) . "', smiliesEnabled=$smilies WHERE ID_MSG=$postid $doLimitOne;") or database_error(__FILE__, __LINE__);
}
else
{
$request = mysql_query("UPDATE {$db_prefix}messages SET subject='$subject',icon='$icon', body='$message', smiliesEnabled=$smilies WHERE ID_MSG=$postid $doLimitOne;") or database_error(__FILE__, __LINE__);
}
There is no more modifymessage.php in SMF, but I'm pretty sure the mod would be done in post.php. What would I need to change?
Or better yet, maybe I can accomplish this by modding the display.template.php?
Check post.php lines 1110 - 1126
The table with the check for admin is in smf_members titled "ID_GROUP"
From my understanding, if ID_GROUP = 1 then the user is administrator.
There are several members lookups in post.php. You should be able to find one that does what you want if you can't write it yourself.
I hope this helps.
Would it look like this?
// Do not update modified time if poster is admin.
if ($_POST['ID_GROUP'] == 1)
$modifiedTime = '';
I know this is wrong because it doesn't work. $_POST['ID_GROUP'] is probably a non-existant variable. I'm trying to figure out what the proper variable is that identifies if the poster is an admin.
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]
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]
This doesn't work for me, I still get the "last edit" below posts I modify.
I think you will see it, as you are the administrator.
But have you checked with a test account to see if the normal user still can see it?
You could just change the Display.template.php file, but then you will not see your own edits. And you have to do it on every theme.
Just find this in Display.template.php:
// Show "« Last Edit: Time by Person »" if this post was edited.
if ($settings['show_modify'] && !empty($message['modified']['name']))
and replace with
// Show "« Last Edit: Time by Person »" if this post was edited.
if ($settings['show_modify'] && !empty($message['modified']['name']) && $context['user']['is_admin']!=1)
Quote from: Skoen on September 08, 2004, 01:38:06 PM
I think you will see it, as you are the administrator.
But have you checked with a test account to see if the normal user still can see it?
Yeah, normal users can still see edits as well.
Quote from: Bloc on September 08, 2004, 01:50:18 PM
You could just change the Display.template.php file, but then you will not see your own edits. And you have to do it on every theme.
Just find this in Display.template.php:
// Show "« Last Edit: Time by Person »" if this post was edited.
if ($settings['show_modify'] && !empty($message['modified']['name']))
and replace with
// Show "« Last Edit: Time by Person »" if this post was edited.
if ($settings['show_modify'] && !empty($message['modified']['name']) && $context['user']['is_admin']!=1)
Now this mod worked but in reverse, the admin can't see his/hers "Last Edits" but everyone else can.
I just changed this from:if ($settings['show_modify'] && !empty($message['modified']['name']) && $context['user']['is_admin']!=1)
to
if ($settings['show_modify'] && !empty($message['modified']['name']) && $context['user']['is_admin']!=0)
and it worked.
it worked fine for me
Of course....now I see that it actually makes all edits invisible - but not for admin. Oh,well. ;) Not exactly what was asked for but could be of use anyway?
??? The mod keeps all edits visible, except for an admin edit.
Quote from: 127.0.0.1 on September 08, 2004, 06:38:28 PM
??? The mod keeps all edits visible, except for an admin edit.
I logged on as a regular user and I could still see the admin edit.
Quote from: Elijah Bliss on September 09, 2004, 12:24:55 AM
Quote from: 127.0.0.1 on September 08, 2004, 06:38:28 PM
??? The mod keeps all edits visible, except for an admin edit.
I logged on as a regular user and I could still see the admin edit.
Ok, I got a bit confused here, but this is more correct:
1.$settings['show_modify']...............................show if settings for showing edits are ON
2.&& !empty($message['modified']['name']).....AND if the name of the person editing is NOT empty
3.&& $context['user']['is_admin']==1)..............AND if person watching IS admin.
What $context['user']['is_admin']!=1) would do is show for all BUT the admin, and $context['user']['is_admin']!=0 - show for all that has 1 or nothing...which us unsafe.
So to be sure only the admin see edits ( all edits btw not just admin's edits) use $context['user']['is_admin']==1.
One must make sure all themes has it too...or else the persons with different themes from you will see it anyway.
Sorry for the confusion. :)
Quote from: Bloc on September 09, 2004, 04:19:55 AM$context['user']['is_admin']!=1
Quote$context['user']['is_admin']!=0
Actually, it's not a number at all. It's better to just say:
$context['user']['is_admin'] means they are an admin.
!$context['user']['is_admin'] means they aren't an admin.
In other words, I would suggest using:
$context['user']['is_admin'] instead of $context['user']['is_admin']!=0
!$context['user']['is_admin'] instead of $context['user']['is_admin']!=1
Regardless of that, this is not really a good way to do what at least the topic is about, and I don't see why they way I posted shouldn't work. (as long as you replace all the code I mentioned, event the elseif.)
-[Unknown]
Quote from: [Unknown] on September 10, 2004, 03:54:08 AM
Regardless of that, this is not really a good way to do what at least the topic is about, and I don't see why they way I posted shouldn't work. (as long as you replace all the code I mentioned, event the elseif.)
-[Unknown]
Agreed on that. It was a merely a alternative suggestion that got a bit out of hand ;)
Quote from: [Unknown] on September 10, 2004, 03:54:08 AM
Quote from: Bloc on September 09, 2004, 04:19:55 AM$context['user']['is_admin']!=1
Quote$context['user']['is_admin']!=0
Actually, it's not a number at all. It's better to just say:
$context['user']['is_admin'] means they are an admin.
!$context['user']['is_admin'] means they aren't an admin.
In other words, I would suggest using:
$context['user']['is_admin'] instead of $context['user']['is_admin']!=0
!$context['user']['is_admin'] instead of $context['user']['is_admin']!=1
Regardless of that, this is not really a good way to do what at least the topic is about, and I don't see why they way I posted shouldn't work. (as long as you replace all the code I mentioned, event the elseif.)
-[Unknown]
I dunno. I copied and pasted the code exactly the way you had it and as a regular user I can still see the last edit of the admin.
Quote from: Elijah Bliss on September 08, 2004, 01:30:52 PM
This doesn't work for me, I still get the "last edit" below posts I modify.
What happens is, any message you edit
after you add the code, will not have an 'edit line', but a message that has already been edited will still have its 'edit line'. Also, on a previously edited post, the edit date will no longer change.
If you want the edit line to be gone from all of your posts, you will have to go into your database and set modifiedTime to 0, and modifiedName to NULL. Then the edit line will no longer appear on any of your posts. There is probably a relativily quick to do this, but I couldn't outline one for you. If you're relatively knowleagable of mySQL, you could probably write a script to go through all posts with posterName = yourname, and reset the values for modifiedName and modifiedTime.
Quote from: tenera on September 19, 2004, 02:37:53 PM
What happens is, any message you edit after you add the code, will not have an 'edit line', but a message that has already been edited will still have its 'edit line'. Also, on a previously edited post, the edit date will no longer change.
Ah. I thought that was implied. I didn't realize it might be expected to be retroactive. Thanks for clearing it up.
QuoteIf you want the edit line to be gone from all of your posts, you will have to go into your database and set modifiedTime to 0, and modifiedName to NULL. Then the edit line will no longer appear on any of your posts. There is probably a relativily quick to do this, but I couldn't outline one for you. If you're relatively knowleagable of mySQL, you could probably write a script to go through all posts with posterName = yourname, and reset the values for modifiedName and modifiedTime.
UPDATE smf_messages
SET modifiedTime = 0, modifiedName = NULL
WHERE modifiedName = 'admin';
Where 'admin' is your username.
-[Unknown]
Hm...The very first code [Unknown] gave works straigh away excellent for me.
Indeed I can see the Edits from before adding the code but for the new one it works perfect, i don't even see my own (new) edits.
Very helpful topic this one.
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:
/me goes and try this:
if ( in_array(1, $GLOBALS['user_info']['groups']) )
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
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.
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.. :-\
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
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.
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 ?
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)
as simple as this is, it really should be turned into a mod, some people might not know its available?
is there anyone who could do it work at last?
lol, i'm confused, whats the final working version code for this?
For 1.1 RC1, in Sources/Post.php
// This is an already existing message. Edit it.
if (!empty($_REQUEST['msg']))
{
if ($user_info['is_admin'])
$msgOptions['modify_time'] = 0;
if (time() - $row['posterTime'] > $modSettings['edit_wait_time'] || $ID_MEMBER != $row['ID_MEMBER'])
elseif (time() - $row['posterTime'] > $modSettings['edit_wait_time'] || $ID_MEMBER != $row['ID_MEMBER'])
THANKS!
Quote from: Elijah Bliss on October 09, 2005, 03:55:11 PM
For 1.1 RC1, in Sources/Post.php
// This is an already existing message. Edit it.
if (!empty($_REQUEST['msg']))
{
if ($user_info['is_admin'])
$msgOptions['modify_time'] = 0;
if (time() - $row['posterTime'] > $modSettings['edit_wait_time'] || $ID_MEMBER != $row['ID_MEMBER'])
elseif (time() - $row['posterTime'] > $modSettings['edit_wait_time'] || $ID_MEMBER != $row['ID_MEMBER'])
What about 1.0.5? please!
Thank you!
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?
Sorry, computer somehow posted same message twice.
What about for 1.1 RC2?
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
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 (http://216.67.249.136/ThemeImages/newsite/icons/modify_inline.gif)on the right of the post if you want to show admin's last edit
:D
Quote from: mab on March 09, 2005, 05:24:59 PM
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 ?
this worked for me :)
if (!$user_info['is_admin'])
Its works for my forum (http://www.forumbebas.net) with Simplicity Themes :)
Thanks..
Tried all the codes that is provided in this thread but none of it working. :'( :'( :'(
I am using SMF 1.1 RC 2 :'( :'( :'(
And what if the forum got founder, admin & global mods that i want them to have this function ?
all your doing is adding 1 line of code to Post.php
if (!$user_info['is_admin'])
add that where its saying, right before
// Have admins allowed people to hide their screwups?
Quote from: sawz on May 14, 2006, 02:19:27 PM
all your doing is adding 1 line of code to Post.php
if (!$user_info['is_admin'])
add that where its saying, right before
// Have admins allowed people to hide their screwups?
Did that. Even tried Bliss code but none of it working. :'( :'( :'(
it won't remove old edited by messages, those will remain.
Quote from: sawz on May 14, 2006, 02:39:20 PM
it won't remove old edited by messages, those will remain.
Hmm ... I c. Then I think i did actually get it to work coz i notice the time different but though it was just a forum error. Will try it out again. Thanks :)
Quote from: sawz on May 14, 2006, 02:39:20 PM
it won't remove old edited by messages, those will remain.
Followed Bliss code and its working fine now.
Ermmm ... Another question is. If my global mods edit the text ... will the "edit notice" came out ?
i was wondering the same thing, you'll probaby have to
add a line of code for them too. let us know how it works out.
it works for me.. but i hope on the next release, there would be a button if you want to see last edit when you edit post.. ;)
Quote from: Elijah Bliss on September 08, 2004, 03:18:14 PM
Quote from: Bloc on September 08, 2004, 01:50:18 PM
You could just change the Display.template.php file, but then you will not see your own edits. And you have to do it on every theme.
Just find this in Display.template.php:
// Show "« Last Edit: Time by Person »" if this post was edited.
if ($settings['show_modify'] && !empty($message['modified']['name']))
and replace with
// Show "« Last Edit: Time by Person »" if this post was edited.
if ($settings['show_modify'] && !empty($message['modified']['name']) && $context['user']['is_admin']!=1)
Now this mod worked but in reverse, the admin can't see his/hers "Last Edits" but everyone else can.
I just changed this from:
if ($settings['show_modify'] && !empty($message['modified']['name']) && $context['user']['is_admin']!=1)
to
if ($settings['show_modify'] && !empty($message['modified']['name']) && $context['user']['is_admin']!=0)
and it worked.
I just upgrade my forum board to RC3 and did this edit .... till today only i noticed i fall for this trick.
I thought i can't see the "edited by : " and all my forummers can't see it too :D
I am using RC3 and was wondering which code will work for this feature with my post.php.
The code that is being changed is not like any listed here:
Quote// Have admins allowed people to hide their screwups?
if (time() - $row['posterTime'] > $modSettings['edit_wait_time'] || $ID_MEMBER != $row['ID_MEMBER'])
{
$msgOptions['modify_time'] = time();
$msgOptions['modify_name'] = addslashes($user_info['name']);
}
Thanks in advance to anyone who can offer some assistance!
Blessings!
Susie
Quote from: mab on March 09, 2005, 05:24:59 PM
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 ?
This is my favourite code :D ;D
Thanks.
I swear I feel so dumb...of course...there is the line. I don't know why when I kept looking at it before it didn't look right for some reason... :P I think I need to take a break lol
Thanks for the repost...for some reason it "clicked" and I see it now...
Blessings!
Susie
What about 1.1? please!
Thank you!
Quote from: Marko_ on December 13, 2006, 12:32:43 PM
What about 1.1? please!
Thank you!
Same modification to 1.1 and 1.1.1 in Post.php
Note: this change only applies to using the "Modify" function to edit a post - NOT the quick edit feature.
which modifecation we are talking here?
do you mean this:
Quote from: bcswebco.com on January 02, 2007, 10:49:49 AM
Quote from: Marko_ on December 13, 2006, 12:32:43 PM
What about 1.1? please!
Thank you!
Same modification to 1.1 and 1.1.1 in Post.php
Note: this change only applies to using the "Modify" function to edit a post - NOT the quick edit feature.
Quote from: Vinspire on October 09, 2006, 05:51:14 PM
Quote from: mab on March 09, 2005, 05:24:59 PM
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 ?
This is my favourite code :D ;D
Thanks.
Quote from: bcswebco.com on January 02, 2007, 10:49:49 AM
Note: this change only applies to using the "Modify" function to edit a post - NOT the quick edit feature.
I was just about to post and say this works but not on admin's own posts. But then I read this quoted post and realised I'd used the quick edit.
Can we get a similar tweak that also does the quick edit? :D
Hey everyone. Sorry to bother, but I'm a bit confused by what's happened here. Can someone distill all that to tell me what find/replace I should do to implement this mod on 1.1.2? Thanks!!
Go to your Sources directory...find Post.php...in it find // Have admins allowed people to hide their screwups?
above that add if (!$user_info['is_admin'])
...and that's it.
I have the following code in Post.php, and it is not working as everyone has said they would:
// This is an already existing message. Edit it.
if (!empty($_REQUEST['msg']))
{
// Administrator edits should not be logged!
if ($user_info['is_admin'])
$modifiedTime = 0;
// Have admins allowed people to hide their screwups?
if (time() - $row['posterTime'] > $modSettings['edit_wait_time'] || $ID_MEMBER != $row['ID_MEMBER'])
{
$msgOptions['modify_time'] = time();
$msgOptions['modify_name'] = addslashes($user_info['name']);
}
modifyPost($msgOptions, $topicOptions, $posterOptions);
}
The same results are returned when the line containing
$modifiedTime = 0;
is commented out. Could this have anything to do with a new version of SMF? I notice that his hack is a bit old. Is there a newer way of doing this?
Thanks!
Quote from: ssnickerer on May 01, 2007, 10:57:08 PM
I have the following code in Post.php, and it is not working as everyone has said they would:
// This is an already existing message. Edit it.
if (!empty($_REQUEST['msg']))
{
// Administrator edits should not be logged!
if ($user_info['is_admin'])
$modifiedTime = 0;
// Have admins allowed people to hide their screwups?
if (time() - $row['posterTime'] > $modSettings['edit_wait_time'] || $ID_MEMBER != $row['ID_MEMBER'])
{
$msgOptions['modify_time'] = time();
$msgOptions['modify_name'] = addslashes($user_info['name']);
}
modifyPost($msgOptions, $topicOptions, $posterOptions);
}
The same results are returned when the line containing
$modifiedTime = 0;
is commented out. Could this have anything to do with a new version of SMF? I notice that his hack is a bit old. Is there a newer way of doing this?
Thanks!
Change $modifiedTime to $msgOptions['modify_time']
Still doesn't work. The code now stands as:
// Administrator edits should not be logged!
if ($user_info['is_admin'])
$msgOptions['modify_time'] = 0;
// Have admins allowed people to hide their screwups?
if (time() - $row['posterTime'] > $modSettings['edit_wait_time'] || $ID_MEMBER != $row['ID_MEMBER'])
{
$msgOptions['modify_time'] = time();
$msgOptions['modify_name'] = addslashes($user_info['name']);
}
modifyPost($msgOptions, $topicOptions, $posterOptions);
}
Quote from: ssnickerer on May 02, 2007, 06:19:41 PM
Still doesn't work. The code now stands as:
// Administrator edits should not be logged!
if ($user_info['is_admin'])
$msgOptions['modify_time'] = 0;
// Have admins allowed people to hide their screwups?
if (time() - $row['posterTime'] > $modSettings['edit_wait_time'] || $ID_MEMBER != $row['ID_MEMBER'])
{
$msgOptions['modify_time'] = time();
$msgOptions['modify_name'] = addslashes($user_info['name']);
}
modifyPost($msgOptions, $topicOptions, $posterOptions);
}
Add else before that second if statement...
elseif (time() - $row['posterTime'] > $modSettings['edit_wait_time'] || $ID_MEMBER != $row['ID_MEMBER'])
Quote from: mab on March 09, 2005, 05:24:59 PM
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 ?
is this the only modification I need to make? I read through everything but I'm a bit slow =P
Quote from: Matt @ ARTcom on May 02, 2007, 06:44:40 PM
Quote from: ssnickerer on May 02, 2007, 06:19:41 PM
Still doesn't work. The code now stands as:
// Administrator edits should not be logged!
if ($user_info['is_admin'])
$msgOptions['modify_time'] = 0;
// Have admins allowed people to hide their screwups?
if (time() - $row['posterTime'] > $modSettings['edit_wait_time'] || $ID_MEMBER != $row['ID_MEMBER'])
{
$msgOptions['modify_time'] = time();
$msgOptions['modify_name'] = addslashes($user_info['name']);
}
modifyPost($msgOptions, $topicOptions, $posterOptions);
}
Add else before that second if statement...
elseif (time() - $row['posterTime'] > $modSettings['edit_wait_time'] || $ID_MEMBER != $row['ID_MEMBER'])
This still doesn't work, unfortunately. =\
Does anyone have any more ideas? The code currently stands as follows:
// This is an already existing message. Edit it.
if (!empty($_REQUEST['msg']))
{
// Administrator edits should not be logged!
if ($user_info['is_admin'])
$msgOptions['modify_time'] = 0;
elseif (time() - $row['posterTime'] > $modSettings['edit_wait_time'] || $ID_MEMBER != $row['ID_MEMBER'])
// Have admins allowed people to hide their screwups?
if (time() - $row['posterTime'] > $modSettings['edit_wait_time'] || $ID_MEMBER != $row['ID_MEMBER'])
{
$msgOptions['modify_time'] = time();
$msgOptions['modify_name'] = addslashes($user_info['name']);
}
modifyPost($msgOptions, $topicOptions, $posterOptions);
}
I'd like this as a feature too. If anyone technical can please have a look at what's needed I'd be greatful.
Quote from: ssnickerer on May 06, 2007, 04:03:10 PM
Quote from: Matt @ ARTcom on May 02, 2007, 06:44:40 PM
Quote from: ssnickerer on May 02, 2007, 06:19:41 PM
Still doesn't work. The code now stands as:
// Administrator edits should not be logged!
if ($user_info['is_admin'])
$msgOptions['modify_time'] = 0;
// Have admins allowed people to hide their screwups?
if (time() - $row['posterTime'] > $modSettings['edit_wait_time'] || $ID_MEMBER != $row['ID_MEMBER'])
{
$msgOptions['modify_time'] = time();
$msgOptions['modify_name'] = addslashes($user_info['name']);
}
modifyPost($msgOptions, $topicOptions, $posterOptions);
}
Add else before that second if statement...
elseif (time() - $row['posterTime'] > $modSettings['edit_wait_time'] || $ID_MEMBER != $row['ID_MEMBER'])
This still doesn't work, unfortunately. =\
Does anyone have any more ideas? The code currently stands as follows:
// This is an already existing message. Edit it.
if (!empty($_REQUEST['msg']))
{
// Administrator edits should not be logged!
if ($user_info['is_admin'])
$msgOptions['modify_time'] = 0;
elseif (time() - $row['posterTime'] > $modSettings['edit_wait_time'] || $ID_MEMBER != $row['ID_MEMBER'])
// Have admins allowed people to hide their screwups?
if (time() - $row['posterTime'] > $modSettings['edit_wait_time'] || $ID_MEMBER != $row['ID_MEMBER'])
{
$msgOptions['modify_time'] = time();
$msgOptions['modify_name'] = addslashes($user_info['name']);
}
modifyPost($msgOptions, $topicOptions, $posterOptions);
}
I think you misunderstood what I meant. You added the entire line of code that I had in my previous post. Most of that line of code was already there.... right be.... nevermind.... use this block of code....
// This is an already existing message. Edit it.
if (!empty($_REQUEST['msg']))
{
// Administrator edits should not be logged!
if ($user_info['is_admin'])
$msgOptions['modify_time'] = 0;
// Have admins allowed people to hide their screwups?
elseif (time() - $row['posterTime'] > $modSettings['edit_wait_time'] || $ID_MEMBER != $row['ID_MEMBER'])
{
$msgOptions['modify_time'] = time();
$msgOptions['modify_name'] = addslashes($user_info['name']);
}
modifyPost($msgOptions, $topicOptions, $posterOptions);
}
Go to your Sources directory...find Post.php...in it find // Have admins allowed people to hide their screwups?
above that add if (!$user_info['is_admin'])
On my 1.1.2 forum I've added this to post.php and it works!
Well done everyone for this...
EDIT... OH no it doesn't work! It fails to show if a standard user edits their posts as well as the Admin.
HoHum... maybe someone can find a fix?
How about this:
if ($user_info['is_admin']) {
$msgOptions['modify_time'] = 0;
$msgOptions['modify_name'] = '';
}
All these fixed do not work with 1.1.2 :(
do not work for me too :(
1.1RC3 but it dont works. I add if (!$user_info['is_admin']) but nothing........
HELP!
Ok, there are two spots to change to make this work properly. I've just tested these changes on a fresh 1.1.3 install and they work just fine.... If User A makes a post, Admin can change it without the edited by showing up. If User A edits his post, the edited by will show. If Admin then goes and edits the post AFTER User A, it will still show that User A edited his post. The edited by will not be changed.
Around line 1564 in Sources/Post.php:
if (time() - $row['posterTime'] > $modSettings['edit_wait_time'] || $ID_MEMBER != $row['ID_MEMBER'])
{
$msgOptions['modify_time'] = time();
$msgOptions['modify_name'] = addslashes($user_info['name']);
}
if (!$user_info['is_admin'] && (time() - $row['posterTime'] > $modSettings['edit_wait_time'] || $ID_MEMBER != $row['ID_MEMBER']))
{
$msgOptions['modify_time'] = time();
$msgOptions['modify_name'] = addslashes($user_info['name']);
}
And around line 2235
if (time() - $row['posterTime'] > $modSettings['edit_wait_time'] || $ID_MEMBER != $row['ID_MEMBER'])
{
$msgOptions['modify_time'] = time();
$msgOptions['modify_name'] = addslashes($user_info['name']);
}
if (!$user_info['is_admin'] && (time() - $row['posterTime'] > $modSettings['edit_wait_time'] || $ID_MEMBER != $row['ID_MEMBER']))
{
$msgOptions['modify_time'] = time();
$msgOptions['modify_name'] = addslashes($user_info['name']);
}
That takes care of regular modify of a message, and quick modify, repsectively.
ok nice...it works....
thanks
so des this work with 1.1.2 Matt @ ARTcom?
I quess it works with 1.1.2
I don't see why it shouldn't.
Works 100% on SMF 1.1.2
Quote from: pirat3 on July 31, 2007, 05:56:02 PM
Works 100% on SMF 1.1.2
You should upgrade to 1.1.3 :P
Quote from: [Unknown] on September 19, 2004, 03:45:10 PM
Quote from: tenera on September 19, 2004, 02:37:53 PM
What happens is, any message you edit after you add the code, will not have an 'edit line', but a message that has already been edited will still have its 'edit line'. Also, on a previously edited post, the edit date will no longer change.
Ah. I thought that was implied. I didn't realize it might be expected to be retroactive. Thanks for clearing it up.
QuoteIf you want the edit line to be gone from all of your posts, you will have to go into your database and set modifiedTime to 0, and modifiedName to NULL. Then the edit line will no longer appear on any of your posts. There is probably a relativily quick to do this, but I couldn't outline one for you. If you're relatively knowleagable of mySQL, you could probably write a script to go through all posts with posterName = yourname, and reset the values for modifiedName and modifiedTime.
UPDATE smf_messages
SET modifiedTime = 0, modifiedName = NULL
WHERE modifiedName = 'admin';
Where 'admin' is your username.
-[Unknown]
Is it ok to set modifiedName to be a NULL value? When I execute SQL queries, I search the modifiedName field for empty strings not NULL values.
Quote from: sawz on May 05, 2006, 02:58:35 PM
Quote from: mab on March 09, 2005, 05:24:59 PM
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 ?
this worked for me :)
This worked for me. Great Stuff, but does anyone know to make it apply to both admins and global moderators? I don't know php.
Yeah, I would like to know that too. Also for my own made User Group.
Someone?
didn't work for me.
The package you are trying to download or install is either corrupt or not compatible with this version of SMF.
i m using smf 1.1.4 and dilber mc theme
Quote from: SlammedDime on June 28, 2007, 05:12:24 PM
Ok, there are two spots to change to make this work properly. I've just tested these changes on a fresh 1.1.3 install and they work just fine.... If User A makes a post, Admin can change it without the edited by showing up. If User A edits his post, the edited by will show. If Admin then goes and edits the post AFTER User A, it will still show that User A edited his post. The edited by will not be changed.
Around line 1564 in Sources/Post.php:
if (time() - $row['posterTime'] > $modSettings['edit_wait_time'] || $ID_MEMBER != $row['ID_MEMBER'])
{
$msgOptions['modify_time'] = time();
$msgOptions['modify_name'] = addslashes($user_info['name']);
}
if (!$user_info['is_admin'] && (time() - $row['posterTime'] > $modSettings['edit_wait_time'] || $ID_MEMBER != $row['ID_MEMBER']))
{
$msgOptions['modify_time'] = time();
$msgOptions['modify_name'] = addslashes($user_info['name']);
}
And around line 2235
if (time() - $row['posterTime'] > $modSettings['edit_wait_time'] || $ID_MEMBER != $row['ID_MEMBER'])
{
$msgOptions['modify_time'] = time();
$msgOptions['modify_name'] = addslashes($user_info['name']);
}
if (!$user_info['is_admin'] && (time() - $row['posterTime'] > $modSettings['edit_wait_time'] || $ID_MEMBER != $row['ID_MEMBER']))
{
$msgOptions['modify_time'] = time();
$msgOptions['modify_name'] = addslashes($user_info['name']);
}
That takes care of regular modify of a message, and quick modify, repsectively.
Thanks, SlammedDime!! I chose to only change the quick reply part, so that I could choose whether or not to have the Edits show up. I hope a feature in the advanced posting options will come out soon.
EDIT: Uh oh. Okay, lots of problems with the Quick Reply mod....
So after an Admin submits an edit, the "Loading" fails to go away on the page. For regular users, Quick Reply can't even start up - it just gets stuck at "Loading."
Any errors in your error log?
So I guess I take that back. Something's wrong. The "Loading" lingers after editing even when I replace Post.php with the default, unedited version. Seems like it's theme-independent, too. I think I've messed something up.
It seems that the following error results when a normal user tries to use quick edit:
Database Error: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ')
LIMIT 1' at line 8
File: /home/infin35/public_html/forums/Sources/Post.php
Line: 2038
EDIT: OKAY! Apparently the problem isn't in the mod! Same problem when I replace with original version of Post.php! Crap, I must have broken something. That's not good. =\
I think installing the mod gives me problems. But I think the "Loading" lingering after editing is a bug to begin with, because that's what just happened when I did a fresh install of SMF 1.1.4. (Though it may be due to server problems too, maybe?)
I'm just going to give up on this. Not worth the trouble for me. Hopefully they'll integrate this feature into the actual forum software in 2.0.
Thats a bug in 1.1.3... should have been fixed in 1.1.4.
Quote from: SlammedDime on October 10, 2007, 04:31:35 PM
Thats a bug in 1.1.3... should have been fixed in 1.1.4.
Are you sure about that? My tests were (are) on fresh, brand new 1.1.4 boards, installed with new databases and everything. =\
This mod (http://www.simplemachines.org/community/index.php?topic=199784.new) seems like a better alternative, idea-wise, until the functionality is actually built into the SMF core. But I haven't been able to get it to work yet, unfortunately. Anyone else with luck?
I combined the admins and one user as:
// Administrator edits should not be logged!
if (!$user_info['is_admin'])
if (!$user_info['username'] == 'user1')
I'm not a programmer so I don't know if there's a better way but it worked.
Can everyone that is having an issue post their current issue?
Wow.
I was looking for a way to hide post edits per usergroup. ie: designate which user groups edits will not show, and which will show.
Example, we have two levels of administrators, and also Global moderators. If I wanted to hide edits done by all three usergroups, but leave edits made by regular users, what would I have to do?
Quote from: SlammedDime on June 28, 2007, 05:12:24 PM
Ok, there are two spots to change to make this work properly. I've just tested these changes on a fresh 1.1.3 install and they work just fine.... If User A makes a post, Admin can change it without the edited by showing up. If User A edits his post, the edited by will show. If Admin then goes and edits the post AFTER User A, it will still show that User A edited his post. The edited by will not be changed.
Around line 1564 in Sources/Post.php:
if (time() - $row['posterTime'] > $modSettings['edit_wait_time'] || $ID_MEMBER != $row['ID_MEMBER'])
{
$msgOptions['modify_time'] = time();
$msgOptions['modify_name'] = addslashes($user_info['name']);
}
if (!$user_info['is_admin'] && (time() - $row['posterTime'] > $modSettings['edit_wait_time'] || $ID_MEMBER != $row['ID_MEMBER']))
{
$msgOptions['modify_time'] = time();
$msgOptions['modify_name'] = addslashes($user_info['name']);
}
And around line 2235
if (time() - $row['posterTime'] > $modSettings['edit_wait_time'] || $ID_MEMBER != $row['ID_MEMBER'])
{
$msgOptions['modify_time'] = time();
$msgOptions['modify_name'] = addslashes($user_info['name']);
}
if (!$user_info['is_admin'] && (time() - $row['posterTime'] > $modSettings['edit_wait_time'] || $ID_MEMBER != $row['ID_MEMBER']))
{
$msgOptions['modify_time'] = time();
$msgOptions['modify_name'] = addslashes($user_info['name']);
}
That takes care of regular modify of a message, and quick modify, repsectively.
Thank SlammedDime. I uses this code and it is working fine on SMF 1.1.4. No error in my error log too :)
All you have to do to make this work in 2.0 Beta 3.1 is to replace this line:
if (time() - $row['poster_time'] > $modSettings['edit_wait_time'] || $user_info['id'] != $row['id_member'])
With this:
if (!$user_info['is_admin'] && (time() - $row['poster_time'] > $modSettings['edit_wait_time'] || $user_info['id'] != $row['id_member']))
That line is in sources/posts.php twice so replace both.
Can some one tell me what i should do in total so that admin can see edited date and time but members should not see
using smf 1.1.5
Actually went throuh but couldnt find any thing exactly
SlammedDime's doesn't work for me in 1.1.7
Can anybody tell me what went wrong?
Quote from: SlammedDime on June 28, 2007, 05:12:24 PM
Ok, there are two spots to change to make this work properly. I've just tested these changes on a fresh 1.1.3 install and they work just fine.... If User A makes a post, Admin can change it without the edited by showing up. If User A edits his post, the edited by will show. If Admin then goes and edits the post AFTER User A, it will still show that User A edited his post. The edited by will not be changed.
Around line 1564 in Sources/Post.php:
if (time() - $row['posterTime'] > $modSettings['edit_wait_time'] || $ID_MEMBER != $row['ID_MEMBER'])
{
$msgOptions['modify_time'] = time();
$msgOptions['modify_name'] = addslashes($user_info['name']);
}
if (!$user_info['is_admin'] && (time() - $row['posterTime'] > $modSettings['edit_wait_time'] || $ID_MEMBER != $row['ID_MEMBER']))
{
$msgOptions['modify_time'] = time();
$msgOptions['modify_name'] = addslashes($user_info['name']);
}
And around line 2235
if (time() - $row['posterTime'] > $modSettings['edit_wait_time'] || $ID_MEMBER != $row['ID_MEMBER'])
{
$msgOptions['modify_time'] = time();
$msgOptions['modify_name'] = addslashes($user_info['name']);
}
if (!$user_info['is_admin'] && (time() - $row['posterTime'] > $modSettings['edit_wait_time'] || $ID_MEMBER != $row['ID_MEMBER']))
{
$msgOptions['modify_time'] = time();
$msgOptions['modify_name'] = addslashes($user_info['name']);
}
That takes care of regular modify of a message, and quick modify, repsectively.
Will this work in 1.1.7 ??
I don't know why TheDisturbedOne had problems, but it should work just fine.
gonna try in 1.1.7 and report back
OK, works for on 1.1.7 without errors
This also Works tested on another forum i have
http://custom.simplemachines.org/mods/index.php?mod=982
Does not give the option when you quick edit... but thats liveable ...
Puts a link to remove edit, so you can remove edits from you Globals/Mods where you see fit ..
Quote from: SlammedDime on January 19, 2009, 09:53:39 PM
I don't know why TheDisturbedOne had problems, but it should work just fine.
It works, I don't remember what happened, it was a while ago :)
we tried all changings, but now only admin can see the edit :(
what if the updater is a moderator. what code is needed?
It doesn't work with SMF 2.0 RC2. Is there any chance to modify it to work with that version?