Post editing

Get help with installation and running phpBB 3.0.x here. Please do not post bug reports, feature requests, or MOD-related questions here.
Scam Warning
Forum rules
END OF SUPPORT: 1 January 2017 (announcement)
Locked
anothernovice
Registered User
Posts: 10
Joined: Thu Apr 21, 2011 2:16 pm

Post editing

Post by anothernovice »

For some reason when people edit posts it does not show that they edited posts, under post settings I have, Display last edited time information: checked yes

:?:

Any ideas?

User avatar
tbackoff
Former Team Member
Posts: 7022
Joined: Thu Jun 04, 2009 1:41 am
Location: cheerleading practice
Name: Tabitha Backoff

Re: Post editing

Post by tbackoff »

OPEN: /includes/functions_posting.php

FIND:

Code: Select all

        case 'edit_topic':

            // If edit reason is given always display edit info

            // If editing last post then display no edit info
            // If m_edit permission then display no edit info
            // If normal edit display edit info

            // Display edit info if edit reason given or user is editing his post, which is not the last within the topic.
            if ($data['post_edit_reason'] || (!$auth->acl_get('m_edit', $data['forum_id']) && ($post_mode == 'edit' || $post_mode == 'edit_first_post')))
            {
                $data['post_edit_reason']        = truncate_string($data['post_edit_reason'], 255, 255, false);

                $sql_data[POSTS_TABLE]['sql']    = array(
                    'post_edit_time'    => $current_time,
                    'post_edit_reason'    => $data['post_edit_reason'],
                    'post_edit_user'    => (int) $data['post_edit_user'],
                );

                $sql_data[POSTS_TABLE]['stat'][] = 'post_edit_count = post_edit_count + 1';
            }
            else if (!$data['post_edit_reason'] && $mode == 'edit' && $auth->acl_get('m_edit', $data['forum_id']))
            {
                $sql_data[POSTS_TABLE]['sql'] = array(
                    'post_edit_reason'    => '',
                );
            }

            // If the person editing this post is different to the one having posted then we will add a log entry stating the edit
            // Could be simplified by only adding to the log if the edit is not tracked - but this may confuse admins/mods
            if ($user->data['user_id'] != $poster_id)
            {
                $log_subject = ($subject) ? $subject : $data['topic_title'];
                add_log('mod', $data['forum_id'], $data['topic_id'], 'LOG_POST_EDITED', $log_subject, (!empty($username)) ? $username : $user->lang['GUEST']);
            }

            if (!isset($sql_data[POSTS_TABLE]['sql'])) 
REPLACE WITH:

Code: Select all

        case 'edit_topic':

            // If edit reason is given always display edit info

            // If editing last post then display no edit info
            // If m_edit permission then display no edit info
            // If normal edit display edit info

            // Display edit info if edit reason given or user is editing his post, which is not the last within the topic.
            $sql_data[POSTS_TABLE]['sql']    = array(
                'post_edit_time'    => $current_time,
                'post_edit_reason'    => $data['post_edit_reason'],
                'post_edit_user'    => (int) $data['post_edit_user'],
            );

            $sql_data[POSTS_TABLE]['stat'][] = 'post_edit_count = post_edit_count + 1';

            // If the person editing this post is different to the one having posted then we will add a log entry stating the edit
            // Could be simplified by only adding to the log if the edit is not tracked - but this may confuse admins/mods
            $log_subject = ($subject) ? $subject : $data['topic_title'];
            add_log('mod', $data['forum_id'], $data['topic_id'], 'LOG_POST_EDITED', $log_subject, (!empty($username)) ? $username : $user->lang['GUEST']);

            if (!isset($sql_data[POSTS_TABLE]['sql'])) 
Credit to ktuk.net.
Flying is the second best thrill to cheerleaders; being caught is the first.

anothernovice
Registered User
Posts: 10
Joined: Thu Apr 21, 2011 2:16 pm

Re: Post editing

Post by anothernovice »

that seems to have done it. Thanks, and may I ask why it didn't work with original code?

User avatar
tbackoff
Former Team Member
Posts: 7022
Joined: Thu Jun 04, 2009 1:41 am
Location: cheerleading practice
Name: Tabitha Backoff

Re: Post editing

Post by tbackoff »

phpBB will only display the last edit information if the post is not the last post in a topic.
Flying is the second best thrill to cheerleaders; being caught is the first.

User avatar
Erik Frèrejean
Former Team Member
Posts: 9899
Joined: Tue Oct 09, 2007 9:09 am
Location: The Netherlands, 3.0.x Support Forum
Name: Erik Frèrejean
Contact:

Re: Post editing

Post by Erik Frèrejean »

t_backoff wrote:phpBB will only display the last edit information if the post is not the last post in a topic.
Or if an moderator edits the post and enters an "edit reason".
Support Toolkit | Support Request Template | Knowledge Base | phpBB 3.0.x documentation
I don't give support via PM or IM! (all unsolicited pms will be trashed!)

cally6008
Registered User
Posts: 286
Joined: Wed Nov 26, 2008 10:18 pm

Re: Post editing

Post by cally6008 »

excellent, thanks

Locked

Return to “[3.0.x] Support Forum”