Simple Machines Community Forum

Customizing SMF => Modifications and Packages => Topic started by: rsw686 on October 10, 2007, 08:37:48 PM

Title: Remove Post Modified (Last Edit) Time
Post by: rsw686 on October 10, 2007, 08:37:48 PM
Link to Mod (http://custom.simplemachines.org/mods/index.php?mod=982)

This mod allows an administrator to remove the last edit time from a post. It places a "remove this line" link next to the last edit time.
Title: Re: Remove Post Modified (Last Edit) Time
Post by: Nikwin on October 11, 2007, 11:51:36 PM
Thank you, rsw686!

Good mod!
Title: Re: Remove Post Modified (Last Edit) Time
Post by: ssnickerer on October 12, 2007, 01:09:08 PM
Thanks for the mod, it is a more practical approach for the feature than what I've seen so far. But I don't think I'm getting it to work, unfortunately. I'm on 1.1.4. No link is showing up. This applies to both previously-edited posts and also posts made after the installation of the mod through the SMF admin interface.
Title: Re: Remove Post Modified (Last Edit) Time
Post by: rsw686 on October 12, 2007, 01:17:31 PM
If your not using the default theme you need to copy/paste the code into your theme's Display.template.php file.

Find

if ($settings['show_modify'] && !empty($message['modified']['name']))
echo '
« <i>', $txt[211], ': ', $message['modified']['time'], ' ', $txt[525], ' ', $message['modified']['name'], '</i> »';


Add After

// Allow admin to remove last edit time
if($context['user']['is_admin'] && !empty($message['modified']['name']))
echo '
<a href="', $scripturl, '?action=removemodified;msg=', $message['id'], ';topic=', $context['current_topic'], '.', $context['start'], ';sesc=', $context['session_id'], '">', $txt['remove_modified'], '</a>';
Title: Re: Remove Post Modified (Last Edit) Time
Post by: Nikwin on October 12, 2007, 01:20:56 PM
You have also to edit the $languagedir/Modifications.your-language.php.
Title: Re: Remove Post Modified (Last Edit) Time
Post by: kamili34 on October 12, 2007, 05:36:46 PM
Thanks

But this mod only delet person who modyfie post right ?

Title: Re: Remove Post Modified (Last Edit) Time
Post by: rsw686 on October 12, 2007, 05:44:00 PM
Quote from: kamili34 on October 12, 2007, 05:36:46 PM
Thanks

But this mod only delet person who modyfie post right ?


All the mod does is remove the last edit line of text from the bottom of a specific post. For that post it sets the values for modifiedName and modifiedTime to null and 0. It looks to the viewer like the post was never modified.
Title: Re: Remove Post Modified (Last Edit) Time
Post by: ssnickerer on October 13, 2007, 01:07:56 AM
Quote from: Nikwin on October 12, 2007, 01:20:56 PM
You have also to edit the $languagedir/Modifications.your-language.php.

I have added the following line:

$txt['remove_modified'] = 'Post modification tag has been removed.';

I've also made the addition to Display.template.php in my theme. I still don't see a link next to the modified post tag.
Title: Re: Remove Post Modified (Last Edit) Time
Post by: Nikwin on October 13, 2007, 01:41:07 AM
Hi,

do you only have a Modifications.english.php?
If your theme has a language folder, copy the Modifications.english.php into it.

Please excuse my bad english! ;)
Title: Re: Remove Post Modified (Last Edit) Time
Post by: rsw686 on October 13, 2007, 09:54:58 AM
The "Remove this line" link will only show up if you are an administrator.
Title: Re: Remove Post Modified (Last Edit) Time
Post by: Stargater59 on October 13, 2007, 12:39:11 PM
Nice mod! I've been wanting this. :D
Title: Re: Remove Post Modified (Last Edit) Time
Post by: kat on October 13, 2007, 03:33:50 PM
Package manager gave me a (https://www.simplemachines.org/community/proxy.php?request=http%3A%2F%2Fwww.smilies.our-local.co.uk%2Findex_files%2Fc001.gif&hash=50b384e7f9000a128c33a78e3d3cf91200fd977a)

Manual mod was dead easy, though.

Thanks, RSW!
Title: Re: Remove Post Modified (Last Edit) Time
Post by: mynd on October 14, 2007, 08:51:44 AM
Hello there all,

I just installed this today and I don't have a link to do anything either.  I am running version 1.1.4, it is a fairly new installation, and I am using the default template.

http://www.myndpollution.com/forums

What should I do to get this to work?  Suggestions or advice welcome.  Thanks!
Title: Re: Remove Post Modified (Last Edit) Time
Post by: ssnickerer on October 14, 2007, 02:37:29 PM
Yes, rsw868, I am an admin. I've added the lines in Modifications.english-utf8.php and Display.template.php . Not functioning. Does anyone know what's going on?
Title: Re: Remove Post Modified (Last Edit) Time
Post by: ssnickerer on October 17, 2007, 06:27:46 AM
sorry - bump.

Can anyone offer anymore troubleshooting? :-\
Title: Re: Remove Post Modified (Last Edit) Time
Post by: rsw686 on October 17, 2007, 09:08:36 AM
Refer to this thread and let me know if you need more assistance.

http://www.simplemachines.org/community/index.php?topic=200338
Title: Re: Remove Post Modified (Last Edit) Time
Post by: James Z. on October 19, 2007, 07:23:21 AM
works great - BUT, unfortunately does not work on global announcements (http://custom.simplemachines.org/mods/index.php?mod=419)

any way to fix that?
Title: Re: Remove Post Modified (Last Edit) Time
Post by: rsw686 on October 19, 2007, 10:37:27 AM
Quote from: James Z. on October 19, 2007, 07:23:21 AM
works great - BUT, unfortunately does not work on global announcements (http://custom.simplemachines.org/mods/index.php?mod=419)

any way to fix that?


You would have to apply the modifications from Display.template.php to the Global Announcements Display.template.php section. You would also need to copy/paste the database edit function in RemoveModified.php so that it updates the global announcements table.

Basically a rewrite for the global announcements mod. This would probably best be made as another mod to be installed after the Global Announcements and Remove Post Modified Time mods.
Title: Re: Remove Post Modified (Last Edit) Time
Post by: radix2005 on October 19, 2007, 09:05:59 PM
Works like a charm. . . ;D
Title: Re: Remove Post Modified (Last Edit) Time
Post by: James Z. on October 20, 2007, 05:11:35 PM
Quote from: rsw686 on October 19, 2007, 10:37:27 AM
Quote from: James Z. on October 19, 2007, 07:23:21 AM
works great - BUT, unfortunately does not work on global announcements (http://custom.simplemachines.org/mods/index.php?mod=419)

any way to fix that?


You would have to apply the modifications from Display.template.php to the Global Announcements Display.template.php section. You would also need to copy/paste the database edit function in RemoveModified.php so that it updates the global announcements table.

Basically a rewrite for the global announcements mod. This would probably best be made as another mod to be installed after the Global Announcements and Remove Post Modified Time mods.

can anyone here do that for me? :\
Title: Re: Remove Post Modified (Last Edit) Time
Post by: sasawawa on October 23, 2007, 09:13:43 PM
After installed, there is one line code at my homepage:

$txt['remove_modified'] = 'Remove this line';

And i didn't see i can remove the last edit within threads.
Title: Re: Remove Post Modified (Last Edit) Time
Post by: Aileen on November 27, 2007, 12:17:20 PM
I already appreciate this mod. great mod!
Title: Re: Remove Post Modified (Last Edit) Time
Post by: Hoochie Coochie Man on December 04, 2007, 07:31:32 AM
Thank you..
and this is Turkish Language..

Modifications.turkish.php
$txt['remove_modified'] = 'Son Düzenlenme Tarihini Sil!';
Title: Re: Remove Post Modified (Last Edit) Time
Post by: S3NTYN3L on January 06, 2008, 05:55:33 AM
How about making it so it works for global moderators as well as admins?
Title: Re: Remove Post Modified (Last Edit) Time
Post by: Buph on January 18, 2008, 07:11:00 PM
Hello, i can't download it. Anybody can fix the link? Thanks
Title: Re: Remove Post Modified (Last Edit) Time
Post by: S3NTYN3L on January 19, 2008, 05:59:35 AM
Quote from: Buph on January 18, 2008, 07:11:00 PM
Hello, i can't download it. Anybody can fix the link? Thanks

Here ya go...
Title: Re: Remove Post Modified (Last Edit) Time
Post by: Buph on January 19, 2008, 11:00:45 AM
Thank you S3NTYN3L!!
Title: Re: Remove Post Modified (Last Edit) Time
Post by: Hoochie Coochie Man on January 24, 2008, 04:01:25 AM
Quote from: S3NTYN3L on January 06, 2008, 05:55:33 AM
How about making it so it works for global moderators as well as admins?
Yes, How can we?
Title: Re: Remove Post Modified (Last Edit) Time
Post by: rsw686 on February 09, 2008, 10:40:45 AM
Sorry I missed your reply for the last week. SMF never sent out the reply notification. Anyway you can modify Display.template.php.

Find
         // Allow admin to remove last edit time
         if($context['user']['is_admin'])

Replace with
         // Allow admin to remove last edit time
         if($context['user']['is_admin'] || in_array(2, $GLOBALS['user_info']['groups'])
Title: Re: Remove Post Modified (Last Edit) Time
Post by: Jose7up on February 14, 2008, 03:56:09 AM
Quote from: rsw686 on February 09, 2008, 10:40:45 AM
Sorry I missed your reply for the last week. SMF never sent out the reply notification. Anyway you can modify Display.template.php.

Find
         // Allow admin to remove last edit time
         if($context['user']['is_admin'])

Replace with
         // Allow admin to remove last edit time
         if($context['user']['is_admin'] || in_array(2, $GLOBALS['user_info']['groups'])

Nice mod, thanks!!

But this line: if($context['user']['is_admin'] || in_array(2, $GLOBALS['user_info']['groups']) don't work for me.

if($context['user']['is_admin'] || array(2, $GLOBALS['user_info']['groups'])  it's works, i see the link but don't delete line for problems of permissions.

Sorry for my english.
Title: Re: Remove Post Modified (Last Edit) Time
Post by: Eliana Tamerin on February 26, 2008, 09:51:43 AM
I would also like to see a permission generated for this. Or at least a working hack for allowing certain groups to access it. Gives me a template error with no explanation.
Title: Re: Remove Post Modified (Last Edit) Time
Post by: Hoochie Coochie Man on February 26, 2008, 10:08:00 AM
Quote from: rsw686 on February 09, 2008, 10:40:45 AM
Sorry I missed your reply for the last week. SMF never sent out the reply notification. Anyway you can modify Display.template.php.

Find
         // Allow admin to remove last edit time
         if($context['user']['is_admin'])

Replace with
         // Allow admin to remove last edit time
         if($context['user']['is_admin'] || in_array(2, $GLOBALS['user_info']['groups'])

Thank you very much @rsw686
Title: Re: Remove Post Modified (Last Edit) Time
Post by: 4b11l on March 07, 2008, 02:00:13 AM
Quote from: rsw686 on February 09, 2008, 10:40:45 AM
Sorry I missed your reply for the last week. SMF never sent out the reply notification. Anyway you can modify Display.template.php.

Find
         // Allow admin to remove last edit time
         if($context['user']['is_admin'])

Replace with
         // Allow admin to remove last edit time
         if($context['user']['is_admin'] || in_array(2, $GLOBALS['user_info']['groups'])

Hello, that is not working for me. It gives me an error.
Title: Re: Remove Post Modified (Last Edit) Time
Post by: 4b11l on March 08, 2008, 05:09:27 PM
Any help or update?
Title: Re: Remove Post Modified (Last Edit) Time
Post by: CmptrWz on March 08, 2008, 05:10:45 PM
Where they put

if($context['user']['is_admin'] || in_array(2, $GLOBALS['user_info']['groups'])

You need

if($context['user']['is_admin'] || in_array(2, $GLOBALS['user_info']['groups']))

note the extra ) in the second one.
Title: Re: Remove Post Modified (Last Edit) Time
Post by: 4b11l on March 08, 2008, 06:26:41 PM
Ah I see, thanks for the CmptyWz. It wasn't shown to have the extra ) in the previous posts. Thanks.

Well, now there seems to be another problem. Now, instead of having the "Remove this line" only when the post has been modified, it shows up in every single post now whether it has been modified or not.
Title: Re: Remove Post Modified (Last Edit) Time
Post by: 4b11l on March 15, 2008, 06:24:42 PM
Still no solution to this pesky problem; I'm not great when it comes to editing so I've tried basically everything.. this is how my code looks after every attempt.


if($context['user']['is_admin'] && !empty($message['modified']['name']) || in_array(2, $GLOBALS['user_info']['groups'] && !empty($message['modified']['name'])))


This makes the code work correctly for ADMIN where the "Remove this line" only appears on modified posts. However, it is not working or showing anything at all for GLOBAL MOD.

Then, if I change the code to:


if($context['user']['is_admin'] && !empty($message['modified']['name']) || in_array(2, $GLOBALS['user_info']['groups']))


It works for both ADMIN and GLOBAL MOD, however the "Remove this line" is showing up on every single post for the GLOBAL MOD; ADMIN is working fine like it should.

I am completely lost here; I really want to make this code work.. >:(
Title: Re: Remove Post Modified (Last Edit) Time
Post by: bodyan on March 20, 2008, 03:37:19 PM
Big thanks to rsw686 for great and simple mod. Wanna ask how modified to SMF 2.0? I modify this in RemoveModified.php:
<?php
if (!defined('SMF'))
die('Hacking attempt...');

function 
RemoveModified()
{
global $smcFunc$db_prefix$topic$sourcedir;

// Make sure they aren't being lead around by someone. (:@)
checkSession('get');

// Are we allowed in here?
isAllowedTo('admin_forum');

$_REQUEST['msg'] = (int) $_REQUEST['msg'];

$smcFunc['db_query']("
UPDATE 
{$db_prefix}messages
SET modified_time = 0, modified_name = NULL, id_msg_modified = 
$_REQUEST[msg]
WHERE id_topic = 
$topic
AND id_msg = 
$_REQUEST[msg]
                                                "
);

redirectexit('topic=' $topic '.' $_REQUEST['start']);
}
?>


but have a problem in 21 line. Where my mistake can you help?
Title: Re: Remove Post Modified (Last Edit) Time
Post by: rsw686 on March 20, 2008, 03:54:22 PM
I actually packaged up a 2.0 version yesterday for my site. Here's the link.

http://wgnrs.dynalias.com/smf2/removemodified_1.0.zip

I'll probably submit this to the SMF package site later. I just haven't had the time.
Title: Re: Remove Post Modified (Last Edit) Time
Post by: 4b11l on March 22, 2008, 01:23:32 AM
Such a great mod and no support; sad.
Title: Re: Remove Post Modified (Last Edit) Time
Post by: yuva on March 22, 2008, 01:29:03 AM
can you make this for SMF 2.0 Beta 3
Title: Re: Remove Post Modified (Last Edit) Time
Post by: Eliana Tamerin on March 22, 2008, 03:12:18 AM
Quote from: rsw686 on March 20, 2008, 03:54:22 PM
I actually packaged up a 2.0 version yesterday for my site. Here's the link.

http://wgnrs.dynalias.com/smf2/removemodified_1.0.zip

I'll probably submit this to the SMF package site later. I just haven't had the time.

Did you miss this?

Quote from: 4b11l on March 22, 2008, 01:23:32 AM
Such a great mod and no support; sad.

No support? What are you talking about. rsw686 has been giving support in this thread. If he hasn't replied with a solution to the problem of the "Remove Edit" line showing up on every page, he probably hasn't found one yet. He may very well be very busy trying to update his own site, themes and mods to 2.0 at the moment. Give him some time.

If anything else, just come back in a few days and remind him if he hasn't found a solution. Instead of whining about it, just politely remind him. Giving remarks like that can make the problem worse. Who wants to deal with a begrudged user over a polite one?
Title: Re: Remove Post Modified (Last Edit) Time
Post by: rsw686 on March 22, 2008, 07:47:24 AM
Quote from: 4b11l on March 22, 2008, 01:23:32 AM
Such a great mod and no support; sad.

What do you need support on? This mod only does one thing and does it well. If your trying to allow other groups to remove the modified time the code was given earlier in the thread.
Title: Re: Remove Post Modified (Last Edit) Time
Post by: Eliana Tamerin on March 22, 2008, 10:03:50 AM
The issue he has is, when he adds that code, the message for removing the last edit time shows up on every post, edited or not.
Title: Re: Remove Post Modified (Last Edit) Time
Post by: rsw686 on March 22, 2008, 11:52:32 AM
Quote from: 4b11l on March 15, 2008, 06:24:42 PM
Still no solution to this pesky problem; I'm not great when it comes to editing so I've tried basically everything.. this is how my code looks after every attempt.

if($context['user']['is_admin'] && !empty($message['modified']['name']) || in_array(2, $GLOBALS['user_info']['groups'] && !empty($message['modified']['name'])))

Honestly this is as easy as reading through the line and thinking about what will happen. The && means both have to be true. The || means either has to be true. The () group sections together.

Notice you don't have the admin and empty modified name grouped. So the || isn't doing what you intended.

Combine that with the fact you are using the old mod and that is why just add the || global moderator at the end won't work.

Version 1.1 available on the SMF mods site has this line

if($context['user']['is_admin'])

So then adding the || in_array(2, $GLOBALS['user_info']['groups']) will work.
Title: Re: Remove Post Modified (Last Edit) Time
Post by: Eliana Tamerin on March 22, 2008, 12:18:33 PM
Just remember that not everybody is a coder or understands coding syntax. The symbols mean nothing unless you've seen them before and know what they're for.

Oh, and rsw686, I sent you a PM regarding one of your other mods which isn't currently up on the SMF mod site. Might you have a look?
Title: Re: Remove Post Modified (Last Edit) Time
Post by: rsw686 on March 22, 2008, 12:56:55 PM
Quote from: Eliana Tamerin on March 22, 2008, 12:18:33 PM
Just remember that not everybody is a coder or understands coding syntax. The symbols mean nothing unless you've seen them before and know what they're for.

Oh, and rsw686, I sent you a PM regarding one of your other mods which isn't currently up on the SMF mod site. Might you have a look?

PM sent. Sorry I forgot about that as I've been busy updating 15-20 mods for my SMF 2.0 site.

I know that most don't understand coding syntax. However if you want to make simple changes understanding the basic && and || operator for if statements is a must.
Title: Re: Remove Post Modified (Last Edit) Time
Post by: 4b11l on March 23, 2008, 02:09:24 AM
I have no problems with patience. I've been patient for almost a month hoping that I would atleast get a "a can't find a solution or anything yet" or "I'm still working on it" if that was the case. As you can see I had no real experience with coding so obviously my coding is wrong or isn't working.

I know some people don't like getting PM about mods or anything so I waited for replies. Trust me if I was whining you'd notice it. I don't see a reason why you are throwing a fit. The reason I blurted that out was because rsw was able to reply to another user support, yet failed or overlooked my problem; could've atleast acknowledged my problem and let me know.

Rsw, thanks for the actual reply; that code is the exact one given to me by CpmtrWiz and as you can see it was showing "Remove this line" on every single post. Which is the actual problem I'm inquiring about; I don't see a newer version and yes I'm using 1.1
Title: Re: Remove Post Modified (Last Edit) Time
Post by: Eliana Tamerin on March 23, 2008, 02:30:48 AM
I'm not throwing a fit. I was explaining why he might not have responded to you in a very polite manner and advising you to check back in a few days.

Anyways, try using this code:

if(($context['user']['is_admin'] && !empty($message['modified']['name'])) || (in_array(2, $GLOBALS['user_info']['groups'] && !empty($message['modified']['name'])))
Title: Re: Remove Post Modified (Last Edit) Time
Post by: 4b11l on March 23, 2008, 03:39:41 AM
Your missing another ")" at the end and no it doesn't work. That does not show/work for global moderators. :/ Only works for Admin.
Title: Re: Remove Post Modified (Last Edit) Time
Post by: cripwalk on April 01, 2008, 01:45:55 PM
Quote from: rsw686 on March 22, 2008, 11:52:32 AM

Honestly this is as easy as reading through the line and thinking about what will happen. The && means both have to be true. The || means either has to be true. The () group sections together.

Notice you don't have the admin and empty modified name grouped. So the || isn't doing what you intended.

Combine that with the fact you are using the old mod and that is why just add the || global moderator at the end won't work.

Version 1.1 available on the SMF mods site has this line

if($context['user']['is_admin'])

So then adding the || in_array(2, $GLOBALS['user_info']['groups']) will work.

Do you have any suggestions on how to get the permission sorted out for Global Moderators?  I changed the line of code that you posted and it does show "Remove this line" for Global Moderators now.  However when they click on it they receive the error: "You are not allowed to administrate this forum."

Any help would be appreciated and thanks for such a great mod!

Title: Re: Remove Post Modified (Last Edit) Time
Post by: rsw686 on April 01, 2008, 01:48:21 PM
Yeah you need to change the check in Sources\RemoveModified.php If you look through the other code I'm sure you could find the syntax for it. It is just a one line change. Otherwise I will look for it later when I get home.
Title: Re: Remove Post Modified (Last Edit) Time
Post by: shacon on April 01, 2008, 05:09:37 PM
Here is what I did to remove the last edit timerstamp for admins and moderators.  It only shows for regular members.

Open  Post.php

Around line 1730 +/-

Find:
if (time() - $row['poster_time'] > $modSettings['edit_wait_time'] || $user_info['id'] != $row['id_member'])

Replace with:
if (!allowedTo('moderate_forum') && (time() - $row['poster_time'] > $modSettings['edit_wait_time'] || $user_info['id'] != $row['id_member']))

Now Moderators and administrators will be exempt from the edit time.

Hope this is what you are looking for.

-shacon  :)
Title: Re: Remove Post Modified (Last Edit) Time
Post by: cripwalk on April 01, 2008, 09:49:28 PM
Quote from: rsw686 on April 01, 2008, 01:48:21 PM
Yeah you need to change the check in Sources\RemoveModified.php If you look through the other code I'm sure you could find the syntax for it. It is just a one line change. Otherwise I will look for it later when I get home.

Thanks.  I looked in that file but I'm not sure what to change.  If its not too much trouble could you show me what I need to change. Thanks again for your help!
Title: Re: Remove Post Modified (Last Edit) Time
Post by: cripwalk on April 01, 2008, 09:50:59 PM
Quote from: shacon on April 01, 2008, 05:09:37 PM
Here is what I did to remove the last edit timerstamp for admins and moderators.  It only shows for regular members.

Open  Post.php

Around line 1730 +/-

Find:
if (time() - $row['poster_time'] > $modSettings['edit_wait_time'] || $user_info['id'] != $row['id_member'])

Replace with:
if (!allowedTo('moderate_forum') && (time() - $row['poster_time'] > $modSettings['edit_wait_time'] || $user_info['id'] != $row['id_member']))

Now Moderators and administrators will be exempt from the edit time.

Hope this is what you are looking for.

-shacon  :)

Cool, so this is a global setting not related to this mod? 
Title: Re: Remove Post Modified (Last Edit) Time
Post by: rsw686 on April 01, 2008, 10:08:42 PM
Quote from: cripwalk on April 01, 2008, 09:49:28 PM
Thanks.  I looked in that file but I'm not sure what to change.  If its not too much trouble could you show me what I need to change. Thanks again for your help!

It should be as simple as changing the line below in Sources\RemoveModified.php

   isAllowedTo('admin_forum');

to

   isAllowedTo(array('admin_forum', 'moderate_forum'));
Title: Re: Remove Post Modified (Last Edit) Time
Post by: cripwalk on April 02, 2008, 11:57:57 AM
Thank you very much.  That worked perfectly.  Thanks again for such a great mod and support.
Title: Re: Remove Post Modified (Last Edit) Time
Post by: S3NTYN3L on April 02, 2008, 05:05:33 PM
Quote from: rsw686 on April 01, 2008, 10:08:42 PM
Quote from: cripwalk on April 01, 2008, 09:49:28 PM
Thanks.  I looked in that file but I'm not sure what to change.  If its not too much trouble could you show me what I need to change. Thanks again for your help!

It should be as simple as changing the line below in Sources\RemoveModified.php

   isAllowedTo('admin_forum');

to

   isAllowedTo(array('admin_forum', 'moderate_forum'));


I did this and my moderators still get the "You are not allowed to administrate this forum." error...


Just to recap, Here's what I've changed in the codes:

In Display.Template:

Find
         // Allow admin to remove last edit time
         if($context['user']['is_admin'])

Replace with
         // Allow admin to remove last edit time
         if($context['user']['is_admin'] || in_array(2, $GLOBALS['user_info']['groups']))


And then in RemoveModified:

Find
     isAllowedTo('admin_forum');

Replace with

     isAllowedTo(array('admin_forum', 'moderate_forum'));



What am I missing?
Title: Re: Remove Post Modified (Last Edit) Time
Post by: rsw686 on April 02, 2008, 05:08:45 PM
I didn't test it. Just thought it would work. I can look into it more. I just don't have much time to be adding feature requests.
Title: Re: Remove Post Modified (Last Edit) Time
Post by: S3NTYN3L on April 23, 2008, 06:43:00 PM
Any luck with this, rsw686?
Title: Re: Remove Post Modified (Last Edit) Time
Post by: Matthew Schenker on May 15, 2008, 06:44:56 PM
Good Afternoon,
I just installed this on my site, running 1.1.4 and it works great!  I am also using a custom theme (Silent Wave) and I didn't have to change the Display.template.php file at all -- when I looked at it, the changes were already there.
Matthew
Title: Re: Remove Post Modified (Last Edit) Time
Post by: allymcbeal on July 01, 2008, 04:58:48 AM
I try to modify, my files Display.template.php is like this:

if ($settings['show_modify'] && !empty($message['modified']['name']))
         echo '
                           &#171; <i>', $txt[211], ': ', $message['modified']['time'], '
', $txt[525], ' ', $message['modified']['name'], '</i> &#187;'



The code you say to modify must be :

if ($settings['show_modify'] && !empty($message['modified']['name']))
echo '
« <i>', $txt[211], ': ', $message['modified']['time'], ' ', $txt[525],
' ', $message['modified']['name'], '</i> »';


I have this string :
&#187;'

I delete it?
Title: Re: Remove Post Modified (Last Edit) Time
Post by: rsw686 on July 01, 2008, 07:40:54 AM
You have the html character codes for «. You can either replace those with the « or vice versa.
Title: Re: Remove Post Modified (Last Edit) Time
Post by: allymcbeal on July 01, 2008, 08:56:51 AM
Ok, thanks, now I have understand.
Thank you. :)
Title: Re: Remove Post Modified (Last Edit) Time
Post by: Kimmie on August 24, 2008, 03:43:29 AM
I also have the reason for edit mod installed and it adds code to the same line in the default display file. Normally I can do these edits myself but this one is tricky because of where the code is for the other mod. I was wondering if someone could possibly take a look at the file for me and make the edit??? :)


TIA
Title: Re: Remove Post Modified (Last Edit) Time
Post by: MultiformeIngegno on September 26, 2008, 11:44:45 AM
Please get this MOD compatible with SMF 2.0 Beta 4!! 8)
Title: Re: Remove Post Modified (Last Edit) Time
Post by: DonaldDasher on October 24, 2008, 08:36:36 AM
This mod doesn't seem to be working with SMF 1.1.6. I've installed it but... nothing.
Title: Re: Remove Post Modified (Last Edit) Time
Post by: Kolya on November 18, 2008, 12:18:21 PM
Quote from: lorenzone92 on September 26, 2008, 11:44:45 AM
Please get this MOD compatible with SMF 2.0 Beta 4!! 8)

Seconded.  :)
Title: Re: Remove Post Modified (Last Edit) Time
Post by: pinoypetfinder on November 18, 2008, 07:03:13 PM
yeah and to 1.1.7 too, please! :D thanks in advance :)
Title: Re: Remove Post Modified (Last Edit) Time
Post by: Kolya on November 20, 2008, 10:46:53 AM
Worked on 1.1.7 for me, although I installed at 1.1.6 I think.
Title: Please make it compatible with SMF 2.0 Beta 4
Post by: Geko on December 24, 2008, 02:40:38 PM
Quote from: lorenzone92 on September 26, 2008, 11:44:45 AM
Please get this MOD compatible with SMF 2.0 Beta 4!! 8)

Yes, please!  O:)
Title: Re: Remove Post Modified (Last Edit) Time
Post by: neil h on January 13, 2009, 05:36:02 AM
Great mod!

many thanks,

neil
Title: Re: Remove Post Modified (Last Edit) Time
Post by: aw06 on January 20, 2009, 07:12:58 AM
Great Mod ?

Doesnt work for quick edit thou
Title: Re: Remove Post Modified (Last Edit) Time
Post by: DirtRider on February 24, 2009, 11:22:19 AM
Will it be updated to RC1
Title: Re: Remove Post Modified (Last Edit) Time
Post by: Geko on April 25, 2009, 02:09:36 PM
Quote from: lorenzone92 on September 26, 2008, 11:44:45 AM
Please get this MOD compatible with SMF 2.0 Beta 4!! 8)

Yes... please...
Title: Re: Remove Post Modified (Last Edit) Time
Post by: Smog on June 23, 2009, 07:28:10 AM
2.0 RC1-1 compatibility wouldn't be bad too, regrettably I have to assume that mod development is ceased.
A pity because this is a useful mod.
Title: Re: Remove Post Modified (Last Edit) Time
Post by: Kolya on June 26, 2009, 02:21:34 AM
I got this mod to work on SMF 2.0 RC1-1. Follow the instructions below on your own risk. I'm not the creator of this mod. I merely changed it a bit to make it work with my SMF version.
I plan to make this mod work for moderators as well, shouldn't be too hard. If anyone's interested I'll post the code for that later on.
Oh yeah...I'm sure the code in display.template.php can be simplified...


SAVE this as RemoveModified.php to the Sources dir

<?php
if (!defined('SMF'))
die('Hacking attempt...');

function 
RemoveModified()
{
global $smcFunc$topic$sourcedir;

// Make sure they aren't being lead around by someone. (:@)
checkSession('get');

// Are we allowed in here?
isAllowedTo('admin_forum');

$smcFunc['db_query']('''
UPDATE {db_prefix}messages
SET modified_time = 0, modified_name = NULL, id_msg_modified = {int:msg}
WHERE id_topic = {int:topic}
AND id_msg = {int:msg}'
,
array(
'msg' => (int) $_REQUEST['msg'],
'topic' => $topic,
)
);

redirectexit('topic=' $topic '.' $_REQUEST['start']);
}
?>




index.php
FIND
'reminder' => array('Reminder.php', 'RemindMe'),
ADD BELOW
'removemodified' => array('RemoveModified.php', 'RemoveModified'),

Display.Template.php
FIND

// Show "« Last Edit: Time by Person »" if this post was edited.
if ($settings['show_modify'] && !empty($message['modified']['name']))
echo '
« <em>', $txt['last_edit'], ': ', $message['modified']['time'], ' ', $txt['by'], ' ', $message['modified']['name'], '</em> »';

ADD BELOW

// Allow admin to remove last edit time
if($context['user']['is_admin'] && $settings['show_modify'] && !empty($message['modified']['name']))
echo '
<a href="', $scripturl, '?action=removemodified;msg=', $message['id'], ';topic=', $context['current_topic'], '.', $context['start'], ';sesc=', $context['session_id'], '">Clean up!</a>';

Title: Re: Remove Post Modified (Last Edit) Time
Post by: Kolya on June 26, 2009, 03:21:22 AM
So I made it work for moderators and simplified the code a bit...


SAVE this as RemoveModified.php to the Sources dir

<?php
if (!defined('SMF'))
die('Hacking attempt...');

function 
RemoveModified()
{
global $smcFunc$topic$sourcedir;

// Make sure they aren't being lead around by someone. (:@)
checkSession('get');

// Are we allowed in here?
isAllowedTo('moderate_forum');

$smcFunc['db_query']('''
UPDATE {db_prefix}messages
SET modified_time = 0, modified_name = NULL, id_msg_modified = {int:msg}
WHERE id_topic = {int:topic}
AND id_msg = {int:msg}'
,
array(
'msg' => (int) $_REQUEST['msg'],
'topic' => $topic,
)
);

redirectexit('topic=' $topic '.' $_REQUEST['start']);
}
?>




index.php
FIND
'reminder' => array('Reminder.php', 'RemindMe'),
ADD BELOW
'removemodified' => array('RemoveModified.php', 'RemoveModified'),

Display.Template.php
FIND

// Show "« Last Edit: Time by Person »" if this post was edited.
if ($settings['show_modify'] && !empty($message['modified']['name']))
echo '
« <em>', $txt['last_edit'], ': ', $message['modified']['time'], ' ', $txt['by'], ' ', $message['modified']['name'], '</em> »';

REPLACE

// Show "« Last Edit: Time by Person »" if this post was edited.
if ($settings['show_modify'] && !empty($message['modified']['name']))
{ echo '
&#171; <em>', $txt['last_edit'], ': ', $message['modified']['time'], ' ', $txt['by'], ' ', $message['modified']['name'], '</em> &#187;';
// Allow admin to remove last edit time
if($context['can_moderate_forum'])
{ echo '
<a href="', $scripturl, '?action=removemodified;msg=', $message['id'], ';topic=', $context['current_topic'], '.', $context['start'], ';sesc=', $context['session_id'], '">Clean up!</a>';
}
}
Title: Re: Remove Post Modified (Last Edit) Time
Post by: kai920 on July 28, 2009, 09:59:14 AM
Quote from: Smog on June 23, 2009, 07:28:10 AM
2.0 RC1-1 compatibility wouldn't be bad too, regrettably I have to assume that mod development is ceased.
A pity because this is a useful mod.

Any chance this can be updated to work with 2.0 RC1.2? I've been manually renaming columns with phpMyAdmin...
Title: Re: Remove Post Modified (Last Edit) Time
Post by: MarcusJ on November 12, 2009, 06:13:23 PM
This mod is one of my all time favorites.  Any chance it will get an update?
Title: Re: Remove Post Modified (Last Edit) Time
Post by: 4b11l on December 03, 2009, 11:33:57 PM
Mod works fine on 2.0 rc2. You have to manually find the code string. It looks a little different that's why it wont install automatically.

Find:
if ($settings['show_modify'] && !empty($message['modified']['name']))
echo '
« <em>', $txt['last_edit'], ': ', $message['modified']['time'], ' ', $txt['by'], ' ', $message['modified']['name'], '</em> »';]]></search>


Replace:
if ($settings['show_modify'] && !empty($message['modified']['name']))
{
echo '
« <em>', $txt['last_edit'], ': ', $message['modified']['time'], ' ', $txt['by'], ' ', $message['modified']['name'], '</em> »';
       
        // Remove Last Modified
        if($context['user']['is_admin'])
            echo '
                 <a href="', $scripturl, '?action=removemodified;msg=', $message['id'], ';topic=', $context['current_topic'], '.', $context['start'], ';sesc=', $context['session_id'], '">', $txt['remove_modified'], '</a>';
        }
Title: Re: Remove Post Modified (Last Edit) Time
Post by: kai920 on December 16, 2009, 12:20:07 AM
Thanks 4b11l, that worked.
Title: Re: Remove Post Modified (Last Edit) Time
Post by: ChaosEnergy on December 27, 2009, 04:41:14 PM
i tried to find those parts in 1.2 version area 2b3
but i cant find them

so how do i get it run in smf2 rc2
Title: Re: Remove Post Modified (Last Edit) Time
Post by: MarcusJ on March 20, 2010, 09:10:54 PM
Is there a chance this mod will get updated for RC3?
Title: Re: Remove Post Modified (Last Edit) Time
Post by: 7s-1k on March 23, 2010, 07:56:04 PM
Quote from: MarcusJ on March 20, 2010, 09:10:54 PM
Is there a chance this mod will get updated for RC3?

I agree :)
Title: Re: Remove Post Modified (Last Edit) Time
Post by: nikan on March 25, 2010, 03:21:49 PM
For 2.0 RC3 edit the file Display.template.php

Find:
if ($settings['show_modify'] && !empty($message['modified']['name']))
echo '
&#171; <em>', $txt['last_edit'], ': ', $message['modified']['time'], ' ', $txt['by'], ' ', $message['modified']['name'], '</em> &#187;';


Replace:
if ($settings['show_modify'] && !empty($message['modified']['name']))
echo '
&#171; <em>', $txt['last_edit'], ': ', $message['modified']['time'], ' ', $txt['by'], ' ', $message['modified']['name'], '</em> &#187;';

// Allow admin to remove last edit time
if ($settings['show_modify'] && !empty($message['modified']['name']) && ($context['user']['is_admin']))
echo '
<a href="', $scripturl, '?action=removemodified;msg=', $message['id'], ';topic=', $context['current_topic'], '.', $context['start'], ';sesc=', $context['session_id'], '">', $txt['remove_modified'], '</a>';
Title: Re: Remove Post Modified (Last Edit) Time
Post by: aw06 on March 25, 2010, 04:29:46 PM
What version of 2.0 Should we emulate ?
Title: Re: Remove Post Modified (Last Edit) Time
Post by: CapadY on April 25, 2010, 02:23:49 PM
This MOD will run in SMF2 RC3 without any problem. (latest version of the MOD)
Title: Re: Remove Post Modified (Last Edit) Time
Post by: Sabre™ on May 01, 2010, 07:43:12 PM
I'm afraid you are wrong buddy :)
The attached package will though.

Will remove when requested by the author or a staff member
Title: Re: Remove Post Modified (Last Edit) Time
Post by: akbora on May 01, 2010, 08:04:26 PM
Is it possible member group permission for this mod?
Title: Re: Remove Post Modified (Last Edit) Time
Post by: chris @ Alpine on June 02, 2010, 03:25:49 AM
Hi,

I am running 1.1.11 with default theme.  I am the admin and I have previously modified a post.  I installed the mod, but when I click on "remove this line" it displays:

Database Error
Column 'modifiedName' cannot be null
File: /home/rangate/public_html/alpineworkshops/alpineforum/Sources/RemoveModified.php
Line: 22

I have read thorough many posts here and tried various troubleshooting including changing the checkSession('get'); to checkSession('request'); (which is actually already "request") in Sources/Packages.php.

I have also tried to deinstall the mod and manually configure the mod manually by using the parsed data for 1.1.11.

What else can I do?

Thanks for your help?

Chris
Title: Re: Remove Post Modified (Last Edit) Time
Post by: ~DS~ on June 03, 2010, 04:54:15 PM
Quote from: Sabre™ on May 01, 2010, 07:43:12 PM
I'm afraid you are wrong buddy :)
The attached package will though.

Will remove when requested by the author or a staff member
Thanks Sabre, thou it make a combo with
http://custom.simplemachines.org/mods/index.php?mod=2495
and
http://custom.simplemachines.org/mods/index.php?mod=349
and
http://custom.simplemachines.org/mods/index.php?mod=1920

Unless there's a conflict. :P
Title: Re: Remove Post Modified (Last Edit) Time
Post by: Sabre™ on June 03, 2010, 10:44:13 PM
@ chris
See if changing null to 0 does anything.  0=zero

@ Dismal Shadow
You could even combine them all into one 'personal' package and select between each option.
Title: Re: Remove Post Modified (Last Edit) Time
Post by: ~DS~ on June 03, 2010, 10:55:17 PM
Quote from: Sabre™ on June 03, 2010, 10:44:13 PM
@ chris
See if changing null to 0 does anything.  0=zero

@ Dismal Shadow
You could even combine them all into one 'personal' package and select between each option.
I wish but I am no coder, all of them works for me as I had to manual edit most of them.
Title: Re: Remove Post Modified (Last Edit) Time
Post by: chris @ Alpine on June 03, 2010, 11:00:30 PM
I looked at the "RemoveModified.php" file and that's what it shows below (original, I haven't modified it):


<?php
if (!defined('SMF'))
   die('Hacking attempt...');

function RemoveModified()
{
   global $db_prefix, $topic, $sourcedir;

   // Make sure they aren't being lead around by someone. (:@)
   checkSession('get');

   // Are we allowed in here?
   isAllowedTo('admin_forum');

   $_REQUEST['msg'] = (int) $_REQUEST['msg'];

   db_query("
      UPDATE {$db_prefix}messages
      SET modifiedTime = 0, modifiedName = NULL, ID_MSG_MODIFIED = $_REQUEST[msg]
      WHERE ID_TOPIC = $topic
         AND ID_MSG = $_REQUEST[msg]
      LIMIT 1", __FILE__, __LINE__);

   redirectexit('topic=' . $topic . '.' . $_REQUEST['start']);
}
?>



As you can see, Line 22 is "LIMIT 1", __FILE__, __LINE__);"   so I am not sure where to insert the "0" that you suggested.


Chris
Title: Re: Remove Post Modified (Last Edit) Time
Post by: Sabre™ on June 04, 2010, 12:31:15 AM
Quote from: Dismal Shadow on June 03, 2010, 10:55:17 PM
wish but I am no coder, all of them works for me as I had to manual edit most of them.

Dude, I'm a forklift driver on a wharf and factories, so no coder here lol  But it isn't really too difficult once you stop yourself from Thinking it is ;)
Good job on getting them all to function correct mate :)

Chris, look for the word null on this line
SET modifiedTime = 0, modifiedName = NULL, ID_MSG_MODIFIED = $_REQUEST[msg]
and change it to 0.
Im not guaranteeing it will work for you, but as I understand it, some servers have issues regarding the null syntax.
Title: Re: Remove Post Modified (Last Edit) Time
Post by: chris @ Alpine on June 04, 2010, 01:30:04 AM
Quote
Chris, look for the word null on this line
SET modifiedTime = 0, modifiedName = NULL, ID_MSG_MODIFIED = $_REQUEST[msg]
and change it to 0.
Im not guaranteeing it will work for you, but as I understand it, some servers have issues regarding the null syntax.

Thank you!  It works perfectly now!  You are awesome!

Chris
Title: Re: Remove Post Modified (Last Edit) Time
Post by: Sabre™ on June 04, 2010, 01:38:35 AM
My pleasure mate :)
Title: Re: Remove Post Modified (Last Edit) Time
Post by: viperboy on June 12, 2010, 09:58:45 PM
Hey everyone, I started my own forums last week and I'm trying to get everything going and I would love to have this working. I have v1.1.11 and I tried download this from the mod site anyway and it didn't do anything. I used the creators thread on how to modify a file and make it work and it caused a database error or something. I'm sorry, I didn't save the error but I would love to have this working.

Is there a .zip file I can install to make it work on 1.1.11 or the correct directions for 1.1.11? Thanks again!
Title: Re: Remove Post Modified (Last Edit) Time
Post by: viperboy on June 14, 2010, 04:48:31 PM
Bumping this thread, hoping for an answer. Thanks!
Title: Re: Remove Post Modified (Last Edit) Time
Post by: Sabre™ on June 15, 2010, 11:06:17 PM
The edits are quite simple, and [HERE] (http://custom.simplemachines.org/mods/index.php?action=parse;mod=982;attach=55618;smf_version=1.1.11) are the manual instructions for smf 1.1.11 if you'd like to double check.
Atm I'm on vacation, so I'm not at my pc to check anything. This should get you in the right direction though.
Good Luck :)
Title: Re: Remove Post Modified (Last Edit) Time
Post by: Laura CGA on December 09, 2010, 10:32:03 AM
Any idea if this will be updated for 2.0 RC4?
Title: Re: Remove Post Modified (Last Edit) Time
Post by: Tedi on June 22, 2011, 03:42:51 PM
Will there be an Update vor SMF 2.0 in the future ?
Title: Re: Remove Post Modified (Last Edit) Time
Post by: smokester on June 23, 2011, 07:51:39 PM
Quote from: Tedi on June 22, 2011, 03:42:51 PM
Will there be an Update vor SMF 2.0 in the future ?

It's only a tiny manual edit as the only real change is the <i> and <em> in the display.template. It works like a charm for me in 2.0.
Title: Re: Remove Post Modified (Last Edit) Time
Post by: Tedi on June 26, 2011, 08:54:35 AM
Yes, I've tried it by myself allready ... it works fine !

For finding the relevant files in the source folder, I simply took the "manually update" - instructions from the mods page (see the link to it on page 1 of this thread ) .
Title: Re: Remove Post Modified (Last Edit) Time
Post by: Mr. Ballin on August 17, 2011, 10:04:42 PM
i cannot get this to work can someone like help me over teamviewer?
Title: Re: Remove Post Modified (Last Edit) Time
Post by: Iomega0318 on October 16, 2011, 09:42:51 PM
For anyone wondering, install the mod and skip the error..
Open up Display.template.php and find this section of code:

      if ($settings['show_modify'] && !empty($message['modified']['name']))
         echo '
                        &#171; <em>', $txt['last_edit'], ': ', $message['modified']['time'], ' ', $txt['by'], ' ', $message['modified']['name'], '</em> &#187;';


and replace it with this:

      if ($settings['show_modify'] && !empty($message['modified']['name']))
      {
         echo '
                        &#171; <em>', $txt['last_edit'], ': ', $message['modified']['time'], ' ', $txt['by'], ' ', $message['modified']['name'], '</em> &#187;';

      // Allow admin to remove last edit time
      if($context['user']['is_admin'])
         echo '
                        <a href="', $scripturl, '?action=removemodified;msg=', $message['id'], ';topic=', $context['current_topic'], '.', $context['start'], ';sesc=', $context['session_id'], '">', $txt['remove_modified'], '</a>';
      }



That should be it.. just installed it and it works great!
Much better than the last mod I tried which broke my site..
Title: Re: Remove Post Modified (Last Edit) Time
Post by: DimTwinkle on November 28, 2011, 10:06:59 AM
Quote from: Iomega0318 on October 16, 2011, 09:42:51 PM
For anyone wondering, install the mod and skip the error..
Open up Display.template.php and find this section of code:

(Edited out code)

That should be it.. just installed it and it works great!
Much better than the last mod I tried which broke my site..

I'd just like to verify that installing the mod, ignoring the error, and making the Display.template.php changes you supplied is intended to make this mod work on 2.0.1?

This is very important to me as I upgraded from 1.1.15 and dropped PrettyURLs which means I'm correcting a lot of links within posts and I'd like to remove as much evidence of my presence and that of my other administrator as possible. I loved how I could click and remove all reference to the fact I had edited a post in 1.1.15. Thanks for sharing the code and thanks in advance for your reply.
Title: Re: Remove Post Modified (Last Edit) Time
Post by: DimTwinkle on November 28, 2011, 10:44:30 AM
It worked exactly as stated. Thanks very much.