News:

SMF 2.1.4 has been released! Take it for a spin! Read more.

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

Hesperus-Lux

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.
The cistern contains; the fountain overflows.

NGame.nl

Yeah, I would like to know that too. Also for my own made User Group.


BHClanGaming.com™

Take the holeshot or someone else will!


asdas2

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
www.chillparadise.com

for all desi people .... get everything u ever wanted.... log in to view hidden stuff.

ssnickerer

#85
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:
Code (Find) Select
if (time() - $row['posterTime'] > $modSettings['edit_wait_time'] || $ID_MEMBER != $row['ID_MEMBER'])
{
$msgOptions['modify_time'] = time();
$msgOptions['modify_name'] = addslashes($user_info['name']);
}

Code (Replace) Select
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
Code (Find) Select
if (time() - $row['posterTime'] > $modSettings['edit_wait_time'] || $ID_MEMBER != $row['ID_MEMBER'])
{
$msgOptions['modify_time'] = time();
$msgOptions['modify_name'] = addslashes($user_info['name']);
}

Code (Replace) Select
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."

SlammedDime

SlammedDime
Former Lead Customizer
BitBucket Projects
GeekStorage.com Hosting
                      My Mods
SimpleSEF
Ajax Quick Reply
Sitemap
more...
                     

ssnickerer

#87
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. =\

ssnickerer

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.

SlammedDime

Thats a bug in 1.1.3... should have been fixed in 1.1.4.
SlammedDime
Former Lead Customizer
BitBucket Projects
GeekStorage.com Hosting
                      My Mods
SimpleSEF
Ajax Quick Reply
Sitemap
more...
                     

ssnickerer

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. =\

ssnickerer

This mod 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?

lanlord

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.

Fiery

Can everyone that is having an issue post their current issue?

Trinny

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?

Vinspire

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:
Code (Find) Select
if (time() - $row['posterTime'] > $modSettings['edit_wait_time'] || $ID_MEMBER != $row['ID_MEMBER'])
{
$msgOptions['modify_time'] = time();
$msgOptions['modify_name'] = addslashes($user_info['name']);
}

Code (Replace) Select
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
Code (Find) Select
if (time() - $row['posterTime'] > $modSettings['edit_wait_time'] || $ID_MEMBER != $row['ID_MEMBER'])
{
$msgOptions['modify_time'] = time();
$msgOptions['modify_name'] = addslashes($user_info['name']);
}

Code (Replace) Select
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 :)

lanlord

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.


assam_siddibapa

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

TheDisturbedOne

SlammedDime's doesn't work for me in 1.1.7
Can anybody tell me what went wrong?

aw06

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:
Code (Find) Select
if (time() - $row['posterTime'] > $modSettings['edit_wait_time'] || $ID_MEMBER != $row['ID_MEMBER'])
{
$msgOptions['modify_time'] = time();
$msgOptions['modify_name'] = addslashes($user_info['name']);
}

Code (Replace) Select
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
Code (Find) Select
if (time() - $row['posterTime'] > $modSettings['edit_wait_time'] || $ID_MEMBER != $row['ID_MEMBER'])
{
$msgOptions['modify_time'] = time();
$msgOptions['modify_name'] = addslashes($user_info['name']);
}

Code (Replace) Select
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 ??
:: ShopinJA.com Powered by SMF 1.1.19 | Ig-Oh Theme by Koni | 70 Rock Solid Error Free Mods | Many Custom Edits & Tweaks ::
- Host Unlimited Websites - Free Website Builder & Templates - Unlimited Disk Space & Bandwidth

Advertisement: