News:

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

Main Menu

Hide Mod Edit

Started by Dr. Jones, September 27, 2007, 05:55:31 PM

Previous topic - Next topic

Lex-BY

Well, it doesn't work anyway (SMF 1.1.5).
I tried to install it manually. I've changed < replace > tag to < add > in install pacage (because replace tag causes errors after uninstall - it undesirebly adds modified code to the beginning of php file - before < ? php) and tried to install again. I even modified display.template.php as it was suggested above.
No result.
The worst is that idea of this mod is really good. It is necessary, I think.
So, let's hope that mod's author will make a newer version, which will work correctly in SMF 1.5.5, or SMF team will make the same feature in SMF 2 release.

cloudy.de


ProtoMan.EXE

I have successfully installed this mod, but can you make it admin-only ? Or maybe founder-only if the former is not possible ? Because I don't want my mods to screw up some topics :D

Necto

This works for me in 1.1.6

Find
// Have admins allowed people to hide their screwups?
if ((time() - $row['posterTime'] > $modSettings['edit_wait_time'] || $ID_MEMBER != $row['ID_MEMBER'])
&& (!in_array('moderate_board',$user_info['permissions']) && !$user_info['is_admin']))
{
$msgOptions['modify_time'] = time();
$msgOptions['modify_name'] = addslashes($user_info['name']);
}

modifyPost($msgOptions, $topicOptions, $posterOptions);

}


Replace with
// Have admins allowed people to hide their screwups?
if ((time() - $row['posterTime'] > $modSettings['edit_wait_time'] || $ID_MEMBER != $row['ID_MEMBER'])
&& (!in_array('moderate_board',$user_info['permissions']) && !$user_info['is_admin']))
{
$msgOptions['modify_time'] = time();
$msgOptions['modify_name'] = addslashes($user_info['name']);
}

modifyPost($msgOptions, $topicOptions, $posterOptions);

}


;)

pinoypetfinder

do i have to add that on post.php manually? i have installed the 'reason for editing' mod too, if i replace that part, it will disable my reason for editing mod right?

Asshandler

Quote from: Necto on October 06, 2008, 09:24:13 AM
This works for me in 1.1.6

Find
// Have admins allowed people to hide their screwups?
if ((time() - $row['posterTime'] > $modSettings['edit_wait_time'] || $ID_MEMBER != $row['ID_MEMBER'])
&& (!in_array('moderate_board',$user_info['permissions']) && !$user_info['is_admin']))
{
$msgOptions['modify_time'] = time();
$msgOptions['modify_name'] = addslashes($user_info['name']);
}

modifyPost($msgOptions, $topicOptions, $posterOptions);

}


Replace with
// Have admins allowed people to hide their screwups?
if ((time() - $row['posterTime'] > $modSettings['edit_wait_time'] || $ID_MEMBER != $row['ID_MEMBER'])
&& (!in_array('moderate_board',$user_info['permissions']) && !$user_info['is_admin']))
{
$msgOptions['modify_time'] = time();
$msgOptions['modify_name'] = addslashes($user_info['name']);
}

modifyPost($msgOptions, $topicOptions, $posterOptions);

}


;)

Aren't those two pieces of code identical? 
The only thing necessary for the triumph of evil is for good men to do nothing.

pinoypetfinder


Father Luke

Quote from: pinoypetfinder on November 19, 2008, 09:38:11 PM
any news with 1.1.7 ?

I did it manually for 1.1.7 and it worked fine.


// Have admins allowed people to hide their screwups?
if ((time() - $row['posterTime'] > $modSettings['edit_wait_time'] || $ID_MEMBER != $row['ID_MEMBER'])
    && (!in_array('moderate_board',$user_info['permissions']) && !$user_info['is_admin']))
{
$msgOptions['modify_time'] = time();
$msgOptions['modify_name'] = addslashes($user_info['name']);
}



replaces:

// 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']);
}


in Post.php

and

// Show "« Last Edit: Time by Person »" if this post was edited.
      if ($settings['show_modify'] && !empty($message['modified']['name']) && $message['member']['group']['id'] != 1)
         echo '
                           &#171; <i>', $txt[211], ': ', $message['modified']['time'], ' ', $txt[525], ' ', $message['modified']['name'], '</i> &#187;';


replaces:

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



in display.template.php


- -
Okay,
Father Luke

Fattredd

any changes needed for 1.1.6?

forummaker

Father Luke.
I have 1.1.7. and tried what you suggested, but it didn't work for me. The code you have listed as already being in the display.template.php is different for mine. This is what I have.

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


Not sure what to change this to. What do you think? Thanks in advance.

Father Luke

@ forummaker :

That looks like it's already had the mod applied.
What about the rest?


- -
Okay,
Father Luke

Rattler

Quote from: Father Luke on December 31, 2008, 09:15:25 AM
Quote from: pinoypetfinder on November 19, 2008, 09:38:11 PM
any news with 1.1.7 ?

I did it manually for 1.1.7 and it worked fine.


// Have admins allowed people to hide their screwups?
if ((time() - $row['posterTime'] > $modSettings['edit_wait_time'] || $ID_MEMBER != $row['ID_MEMBER'])
    && (!in_array('moderate_board',$user_info['permissions']) && !$user_info['is_admin']))
{
$msgOptions['modify_time'] = time();
$msgOptions['modify_name'] = addslashes($user_info['name']);
}



replaces:

// 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']);
}


in Post.php

and

// Show "« Last Edit: Time by Person »" if this post was edited.
      if ($settings['show_modify'] && !empty($message['modified']['name']) && $message['member']['group']['id'] != 1)
         echo '
                           « <i>', $txt[211], ': ', $message['modified']['time'], ' ', $txt[525], ' ', $message['modified']['name'], '</i> »';


replaces:

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



in display.template.php


- -
Okay,
Father Luke

Worked here also, thanks!

As we show a Reason For Edit had to tweak your hints a bit in order not to lose that feature.

Kind regards,

Rattler
You can discuss with people, and sometimes it even makes sense to do so. Forget that when confronted with the cruel facts of life... (inspired by SiGnature™).

Rattler

#52
FAO Father Luke:

While your code does exactly what I want to have done, I get an error in the error log every time someone looks at a post

Error: 8: Uninitialized string offset: 0
File: ./Themes/default/Display.template.php (main sub template - eval?)
Line: 480

which in my case is

if ($settings['show_modify'] && !empty($message['modified']['name']) && $message['member']['group']['id'] != 1)

I guess this is only a notice, as nothing seems not to be working as it should in the forum overall, but it is at least annoying to have pages and pages of error log to clear every day.

Any ideas why php would be screaming "unitialized string"? Can I force a set to get rid of the error?

Kind regards,

Rattler
You can discuss with people, and sometimes it even makes sense to do so. Forget that when confronted with the cruel facts of life... (inspired by SiGnature™).

Father Luke

@Rattler:

You could go:
Configuration - -  >Features and Options - -  > uncheck Enable error logging.


- -
Okay,
Father Luke

Rattler

Quote from: Father Luke on January 30, 2009, 06:52:14 PM
@Rattler:

You could go:
Configuration - -  >Features and Options - -  > uncheck Enable error logging.
- -
Okay,
Father Luke

Indeed!  ;)

Better: I found it finally, a small typo, the "1" in the end of line does not like a space in front, the following now works w/o more errors:

// Show "&#171; Last Edit: Time by Person &#187;" if this post was edited.
if ($settings['show_modify'] && !empty($message['modified']['name']) && $message['member']['group']['id'] !=1)


:D

Kind regards,

Rattler
You can discuss with people, and sometimes it even makes sense to do so. Forget that when confronted with the cruel facts of life... (inspired by SiGnature™).

Father Luke

@ Rattler:

Good work. 

- -
Okay,
Father Luke

Rattler

Quote from: Father Luke on January 30, 2009, 07:45:47 PM
@ Rattler:
Good work.

Father Luke

Well. turns out it only solved it for admins/mds looking at a post.

For guests and other non-staff members the error perisists...  ::)

Any more ideas?

Rattler
You can discuss with people, and sometimes it even makes sense to do so. Forget that when confronted with the cruel facts of life... (inspired by SiGnature™).

PHPLearner

That worked but Did Not Hide The Edits Of Regular users, Any Idea?, Thanks!

Kob Ob Ob


     How can  hide only admin edit.Thank,

MilanRS

Quote from: Kob Ob Ob on July 05, 2009, 12:57:57 PM
     How can  hide only admin edit.Thank,

Same here.
Please.

Advertisement: