Цель - чтобы измененные топики (если они последние) попадали в список новых сообщений. Если вы, например, через 10-15 минут что-то измените.
Если не хотите, чтобы время обновлялось - снимите птичку (через 3 часа она по умолчанию не ставится).
Для топиков с одним единственным постом эта опция отключена.
Версия phpBB: 2.0.11
Код: Выделить всё
##############################################################
## MOD Title: Update last post time on edit
## MOD Author: Meithar < N/A > (N/A) N/A
## MOD Description: Add option to update post time when you edit last post
##
## MOD Version: 1.0.0
##
## Installation Level: Easy
## Installation Time: 2 Minutes
##
## Files To Edit: posting.php
## includes/functions_post.php
## templates/subSilver/posting_body.tpl
## includes/constants.php
## language/lang_english/lang_main.php
##
## Included Files: none
##
##############################################################
## 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:
##
##############################################################
## MOD History:
##
## 2004-12-26 - Version 1.0.0
## - first version
##
##############################################################
## Before Adding This MOD To Your Forum, You Should Back Up All Files Related To This MOD
##############################################################
#
#-----[ OPEN ]------------------------------------------
#
posting.php
#
#-----[ FIND ]------------------------------------------
#
$sql = "SELECT f.*, t.topic_id, t.topic_status, t.topic_type, t.topic_first_post_id, t.topic_last_post_id, t.topic_vote, p.post_id, p.poster_id" . $select_sql . "
#
#-----[ IN-LINE FIND ]------------------------------------------
#
, p.poster_id
#
#-----[ IN-LINE AFTER, ADD ]------------------------------------------
#
, p.post_time
#
#-----[ FIND ]------------------------------------------
#
$attach_sig = ( $submit || $refresh ) ? ( ( !empty($HTTP_POST_VARS['attach_sig']) ) ? TRUE : 0 ) : ( ( $userdata['user_id'] == ANONYMOUS ) ? 0 : $userdata['user_attachsig'] );
#
#-----[ AFTER, ADD ]------------------------------------------
#
$update_post_time = ( empty($HTTP_POST_VARS['update_post_time']) ) ? FALSE : TRUE;
#
#-----[ FIND ]------------------------------------------
#
submit_post($mode, $post_data, $return_message, $return_meta, $forum_id, $topic_id, $post_id, $poll_id, $topic_type, $bbcode_on, $html_on, $smilies_on, $attach_sig, $bbcode_uid, str_replace("\'", "''", $username), str_replace("\'", "''", $subject), str_replace("\'", "''", $message), str_replace("\'", "''", $poll_title), $poll_options, $poll_length);
#
#-----[ IN-LINE FIND ]------------------------------------------
#
, $poll_length
#
#-----[ IN-LINE AFTER, ADD ]------------------------------------------
#
, $update_post_time
#
#-----[ FIND ]------------------------------------------
#
//
// Output the data to the template
//
#
#-----[ BEFORE, ADD ]------------------------------------------
#
$set_update_post_time_checkbox = FALSE;
if ($mode == 'editpost' && $post_data['last_post'] && !$post_data['first_post'])
{
$template->assign_block_vars('switch_update_post_time', array());
if ( $post_data['poster_post'] )
{
if ( $post_info['post_time'] + UPD_LAST_POST_HOUR_ACTIVE > time() )
{
$set_update_post_time_checkbox = TRUE;
}
}
}
#
#-----[ FIND ]------------------------------------------
#
'L_DELETE_POST' => $lang['Delete_post'],
#
#-----[ AFTER, ADD ]------------------------------------------
#
'L_UPDATE_POST_TIME' => $lang['Update_post_time'],
#
#-----[ FIND ]------------------------------------------
#
'S_HTML_CHECKED' => ( !$html_on ) ? 'checked="checked"' : '',
#
#-----[ BEFORE, ADD ]------------------------------------------
#
'S_UPDATE_POST_TIME' => ( $set_update_post_time_checkbox ) ? 'checked="checked"' : '',
#
#-----[ OPEN ]------------------------------------------
#
includes/functions_post.php
#
#-----[ FIND ]------------------------------------------
#
function submit_post($mode, &$post_data, &$message, &$meta, &$forum_id, &$topic_id, &$post_id, &$poll_id, &$topic_type, &$bbcode_on, &$html_on, &$smilies_on, &$attach_sig, &$bbcode_uid, &$post_username, &$post_subject, &$post_message, &$poll_title, &$poll_options, &$poll_length)
#
#-----[ IN-LINE FIND ]------------------------------------------
#
, &$poll_length
#
#-----[ IN-LINE AFTER, ADD ]------------------------------------------
#
, $update_post_time
#
#-----[ 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 " : "";
#
#-----[ AFTER, ADD ]------------------------------------------
#
$edited_sql .= ($update_post_time && $post_data['last_post'] && $mode == 'editpost' && !$post_data['first_post']) ? ", post_time = $current_time " : '';
#
#-----[ OPEN ]------------------------------------------
#
templates/subSilver/posting_body.tpl
#
#-----[ FIND ]------------------------------------------
#
<!-- BEGIN switch_html_checkbox -->
#
#-----[ BEFORE, ADD ]------------------------------------------
#
<!-- BEGIN switch_update_post_time -->
<tr>
<td><input type="checkbox" name="update_post_time" {S_UPDATE_POST_TIME} /></td>
<td><span class="gen">{L_UPDATE_POST_TIME}</span></td>
</tr>
<!-- END switch_update_post_time -->
#
#-----[ OPEN ]------------------------------------------
#
includes/constants.php
#
#-----[ FIND ]------------------------------------------
#
if ( !defined('IN_PHPBB') )
{
die("Hacking attempt");
}
#
#-----[ AFTER, ADD ]------------------------------------------
#
define('UPD_LAST_POST_HOUR_ACTIVE', 3600*3);
#
#-----[ OPEN ]------------------------------------------
#
language/lang_english/lang_main.php
#
#-----[ FIND ]------------------------------------------
#
// -------------------------------------------------
#
#-----[ AFTER, ADD ]------------------------------------------
#
$lang['Update_post_time'] = 'Update post time';
#
#-----[ SAVE/CLOSE ALL FILES ]------------------------------------------
#
# EoM