How can I show last modified time in any condition ?
Posted July 26th 2015, 6:41am
Hi, last modified time option is working only if someone replied to that topic or you text a reason for the modification. I want to show last modified time even if there is no reason for modifying that topic. Can that be done ?! How ? Thank you.
φ
Posts: 22
Joined: May 2nd 2015, 4:29pm
Likes Given: 4
How can I show last modified time in any condition ?
Posted July 27th 2015, 5:12pm
I'm not sure what you mean here. Are you talking about the "last post" column in viewforum, or something else?
φ
Posts: 1600
Joined: March 12th 2009, 11:00pm
Location: Uncertain due to momentum
Likes Given: 26
Likes Received: 357
How can I show last modified time in any condition ?
Posted August 9th 2015, 2:56am
No, about the option you have at the bottom of a post after you modify a post as an admin or as a user but after someone replied at that post.
It's something like: last modified by xxx at 09.08.2015 , Reason: blablabla.
φ
Posts: 22
Joined: May 2nd 2015, 4:29pm
Likes Given: 4
How can I show last modified time in any condition ?
Posted August 9th 2015, 11:09am
Go to includes/functions_posting.php and change this line:

if ($data['post_edit_reason'] || (!$auth->acl_get('m_edit', $data['forum_id']) && ($post_mode == 'edit' || $post_mode == 'edit_first_post')))

to this:

if ($data['post_edit_reason'] || (!$auth->acl_get('m_edit', $data['forum_id']) && $post_mode == 'edit'))

That should add an edit time to every edited post.
φ
Posts: 1600
Joined: March 12th 2009, 11:00pm
Location: Uncertain due to momentum
Likes Given: 26
Likes Received: 357
How can I show last modified time in any condition ?
Posted August 9th 2015, 11:17pm
Thank you!, tried it but it`s not working :(
φ
Posts: 22
Joined: May 2nd 2015, 4:29pm
Likes Given: 4
How can I show last modified time in any condition ?
Posted August 10th 2015, 12:30am
What do you mean by it's "not working"?

I intentionally left in the check for moderators. If you truly want the edit time to show for all edits, then use the following line in place of the one I provided above:

if ($post_mode == 'edit')

This will leave a record of all edits, including those by moderators and administrators. It is not something I would ever do on a board, but if you do not trust one of your moderators, this is a way to insure they do not edit posts.
φ
Posts: 1600
Joined: March 12th 2009, 11:00pm
Location: Uncertain due to momentum
Likes Given: 26
Likes Received: 357
How can I show last modified time in any condition ?
Posted August 10th 2015, 2:06am
Thank you again for the quick reply but I can`t see any change :( .
I`m talking about something like this:

Image

But with your code if I edit a topic,nothing happen. Hmmm.. Can the problem be from jquery database mod ? I have no idea.
φ
Posts: 22
Joined: May 2nd 2015, 4:29pm
Likes Given: 4
How can I show last modified time in any condition ?
Posted August 10th 2015, 9:59am
Just in case you have a MOD that is conflicting with the one-line edit, let's take the nuclear option. :) Find this entire block of code:

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

One line in the above code will have been changed if you applied either of the modifications I suggested in my previous posts. Additional lines may have been changed by MODs. Replace the entire block with the following code:

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

if ($data['post_edit_reason']) {
$data['post_edit_reason'] = truncate_string($data['post_edit_reason'], 255, 255, false);
$sql_data[POSTS_TABLE]['sql']['post_edit_reason'] = $data['post_edit_reason'];
}

This will force all edits to be logged.
φ
Posts: 1600
Joined: March 12th 2009, 11:00pm
Location: Uncertain due to momentum
Likes Given: 26
Likes Received: 357
How can I show last modified time in any condition ?
Posted August 17th 2015, 6:21am
Thank you!!!. It`s working like a charm but only if I edit the message as usual. If I use quick edit from "jquery database", it doesn`t show my last modified time. Strange. :|
φ
Posts: 22
Joined: May 2nd 2015, 4:29pm
Likes Given: 4

Who is online

Users browsing this forum: No registered users and 0 guests