## EasyMod 0.0.10a compliant
#################################################################
## MOD Title: Show edited By MOD
## MOD Author: Shannado <
sven@shannado.nl> (Sven)
http://www.shannado.nl/forumorg
## MOD Description: This MOD shows by whom the post is edited. Only when it is not the last post
## In the HOW TO is descriped how to also show the edited by info even if it is the last post.
## MOD Version: 1.0.5
##
## Installation Level: Easy
## Installation Time: 5 - 10 minutes
## Files To Edit: viewtopic.php,
## functions_post.php
## Included Files: N/A
##############################################################
## For Security Purposes, Please Check:
http://www.phpbb.com/mods/ for the
## latest version of this MOD. Downloading this MOD from other sites could cause malicious code
## to enter into your phpBB Forum. As such, phpBB will not offer support for MOD's not offered
## in our MOD-Database, located at:
http://www.phpbb.com/mods/
##############################################################
## Author Notes:
##
## If you want that the always the edit info is displayed (even if it is the last post) then adjust the
## '$edited_sql' codeline AFTER you done the entire HOWTO in the functions_post.php
## $edited_sql = ($mode == 'editpost') ? ", post_edit_user = $usr_id, post_edit_time = $current_time, post_edit_count = post_edit_count + 1 " : ""; ##
##############################################################
## MOD History:
##
##
## ------------
## 01-01-2002 - 0.9.0 beta
## - Beta
##
## 01-01-2002 - 1.0.0 FINAL
## - FINAL
## - No changes
##
## 01-01-2002 - 1.0.1 FINAL
## - Made the HOW TO phpBB v2.0.1 compliant
##
## 01-01-2002 - 1.0.2 FINAL
## - At some users it occur that, when edited post 4 out of 10,
## then post 4 till 10 showed the message. Fixed thanks to sj26
##
## 01-01-2002 - 1.0.3 FINAL
## - Made phpBB v2.0.2 complaint and EasyMod 0.0.7 complaint
##
## 01-01-2002 - 1.0.4 FINAL
## - Made phpBB v2.0.4 complaint
##
## 05-12-2003 - 1.0.5 FINAL
## - Made phpBB v2.0.6 complaint and EasyMod 0.0.10a complaint
## - Adjusted to the new Template
#################################################################
## Before Adding This MOD To Your Forum, You Should Back Up All Files Related To This MOD
#################################################################
#
#-----[ SQL ]------------------------------------------
#
ALTER TABLE phpbb_posts ADD post_edit_user MEDIUMINT(8) DEFAULT NULL;
#
#-----[ OPEN ]------------------------------------------
#
viewtopic.php
#
#-----[ FIND ]------------------------------------------
#
//
// Editing information
//
if ( $postrow[$i]['post_edit_count'] )
{
$l_edit_time_total = ( $postrow[$i]['post_edit_count'] == 1 ) ? $lang['Edited_time_total'] : $lang['Edited_times_total'];
$l_edited_by = '<br /><br />' . sprintf($l_edit_time_total, $poster, create_date($board_config['default_dateformat'], $postrow[$i]['post_edit_time'], $board_config['board_timezone']), $postrow[$i]['post_edit_count']);
}
#
#-----[ REPLACE WITH ]------------------------------------------
#
//
// Editing information
//
$l_edited_by = '';
if ( $postrow[$i]['post_edit_count'] )
{
$editer = '';
if ( !$postrow[$i]['post_edit_user'] )
{
$editer = $poster;
}
else
{
$usr_id = $postrow[$i]['post_edit_user'];
$sql = "SELECT username
FROM " . USERS_TABLE . " u
WHERE user_id = " . $usr_id;
if ( !($result = $db->sql_query($sql)) )
{
message_die(GENERAL_ERROR, 'Tried obtaining data for a non-existent user', '', __LINE__, __FILE__, $sql);
}
$row = $db->sql_fetchrow($result);
$editer = $row['username'];
}
$l_edit_time_total = ( $postrow[$i]['post_edit_count'] == 1 ) ? $lang['Edited_time_total'] : $lang['Edited_times_total'];
$l_edited_by = '<br /><br />' . sprintf($l_edit_time_total, $editer, create_date($board_config['default_dateformat'], $postrow[$i]['post_edit_time'], $board_config['board_timezone']), $postrow[$i]['post_edit_count']);
}
#
#-----[ OPEN ]------------------------------------------
#
includes/functions_post.php
#
#-----[ FIND ]------------------------------------------
#
$edited_sql = ($mode == 'editpost' && !$post_data['last_post'] && $post_data['poster_post']) ? ", post_edit_time = $current_time, post_edit_count = post_edit_count + 1 " : "";
#
#-----[ REPLACE WITH ]------------------------------------------
#
$usr_id = $userdata['user_id'];
$edited_sql = ($mode == 'editpost' && !$post_data['last_post']) ? ", post_edit_user = $usr_id, post_edit_time = $current_time, post_edit_count = post_edit_count + 1 " : "";
#
#-----[ SAVE/CLOSE ALL FILES ]------------------------------------------
#
# EoM