News:

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

Main Menu

Remove Post Modified (Last Edit) Time

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

Previous topic - Next topic

yuva


Eliana Tamerin

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

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

rsw686

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

Aquaria Talk
Community for freshwater and saltwater aquariums enthusiasts

Eliana Tamerin

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

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

rsw686

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

Aquaria Talk
Community for freshwater and saltwater aquariums enthusiasts

Eliana Tamerin

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

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

rsw686

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

Aquaria Talk
Community for freshwater and saltwater aquariums enthusiasts

4b11l

#47
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

Eliana Tamerin

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'])))
Do NOT PM me for support.

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

4b11l

Your missing another ")" at the end and no it doesn't work. That does not show/work for global moderators. :/ Only works for Admin.

cripwalk

#50
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!


rsw686

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

Aquaria Talk
Community for freshwater and saltwater aquariums enthusiasts

shacon

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  :)
we make a living by what we get...we make a life by what we give

cripwalk

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!

cripwalk

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? 

rsw686

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

Aquaria Talk
Community for freshwater and saltwater aquariums enthusiasts

cripwalk

Thank you very much.  That worked perfectly.  Thanks again for such a great mod and support.

S3NTYN3L

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?

rsw686

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

Aquaria Talk
Community for freshwater and saltwater aquariums enthusiasts

S3NTYN3L


Advertisement: