News:

Want to get involved in developing SMF? Why not lend a hand on our GitHub!

Main Menu

Remove Post Modified (Last Edit) Time

Started by rsw686, October 10, 2007, 08:37:48 PM

Previous topic - Next topic

sasawawa

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.

Aileen

#21
I already appreciate this mod. great mod!

Hoochie Coochie Man

Thank you..
and this is Turkish Language..

Modifications.turkish.php
$txt['remove_modified'] = 'Son Düzenlenme Tarihini Sil!';
İnadına SMF 1.1.X

S3NTYN3L

How about making it so it works for global moderators as well as admins?

Buph

Hello, i can't download it. Anybody can fix the link? Thanks

S3NTYN3L

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

Buph


Hoochie Coochie Man

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?
İnadına SMF 1.1.X

rsw686

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'])
The Reptile File
Everything reptile for anyone reptile friendly

Aquaria Talk
Community for freshwater and saltwater aquariums enthusiasts

Jose7up

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.

Eliana Tamerin

#30
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.
Do NOT PM me for support.

SimplePortal 2.3.6 is OUT!
SimplePortal Project Manager
Download | Docs
SimplePortal: Power of Simplicity!

Hoochie Coochie Man

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
İnadına SMF 1.1.X

4b11l

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.

4b11l


CmptrWz

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.

4b11l

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.

4b11l

#36
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.. >:(

bodyan

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?

rsw686

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.
The Reptile File
Everything reptile for anyone reptile friendly

Aquaria Talk
Community for freshwater and saltwater aquariums enthusiasts

4b11l


Advertisement: