Может кому пригодится. Внёс небольшое изменение: при закрытии создаётся новая тема. При этом в старой ставится ссылка на новую тему, а в новой на старую. Редирект зразу ведет в новую тему
open: posting.php
find
if ($mode == 'edit')
{
$data['topic_replies_real'] = $post_data['topic_replies_real'];
$data['topic_replies'] = $post_data['topic_replies'];
}
after-add
// idiotnesia wuz here
if ($mode == 'reply')
{
$data['topic_replies_real'] = $post_data['topic_replies_real'];
}
open: includes/functions_posting.php
find
// Send Notifications
if ($mode != 'edit' && $mode != 'delete' && $post_approval)
{
user_notification($mode, $subject, $data['topic_title'], $data['forum_name'], $data['forum_id'], $data['topic_id'], $data['post_id']);
}
before-add
$newURL = '1';
// idiotnesia wuz here
// autoforum.su wuz here
if ($mode == 'reply' && $data['topic_replies_real'] >= 99)
{
$db->sql_query('UPDATE ' . TOPICS_TABLE . ' SET topic_status = ' . ITEM_LOCKED . ' WHERE topic_id = ' . (int) $data['topic_id']
);
// note that multibyte support is enabled here
$my_subject_q = $data['topic_title']; // = utf8_normalize_nfc(request_var($data['topic_title'], '', true));
$my_text_q = '[URL=http://autoforum.su/viewtopic.php?f='.$data['forum_id'].'&t='.$data['topic_id'].']\xd0\x92\xd1\x81\xd0\x
b5 \xd0\xbd\xd0\xb0\xd1\x87\xd0\xb0\xd0\xbb\xd0\xbe\xd1\x81\xd1\x8c \xd1\x82\xd1\x83\xd1\x82[/URL]<br />'.$data['message'];
//$my_text_q = utf8_normalize_nfc(request_var($my_text_q, '', true));
// variables to hold the parameters for submit_post
$poll_q = $uid_q = $bitfield_q = $options_q = '';
generate_text_for_storage($my_subject_q, $uid_q, $bitfield_q, $options_q, false, false, false);
generate_text_for_storage($my_text_q, $uid_q, $bitfield_q, $options_q, true, true, true);
$data_new = array(
'forum_id' => $data['forum_id'],
'icon_id' => false,
'enable_bbcode' => true,
'enable_smilies' => true,
'enable_urls' => true,
'enable_sig' => true,
'message' => $my_text_q,
'message_md5' => md5($my_text_q),
'bbcode_bitfield' => $bitfield_q,
'bbcode_uid' => $uid_q,
'post_edit_locked' => 0,
'topic_title' => $my_subject_q,
'notify_set' => false,
'notify' => false,
'post_time' => 0,
'forum_name' => '',
'enable_indexing' => true,
);
submit_post('post', $my_subject_q, '', POST_NORMAL, $poll_q, $data_new);
$db->sql_query('UPDATE ' . POSTS_TABLE . ' SET post_text = CONCAT(post_text, "<br /><a href=\"./viewtopic.php?f='.
$data['forum_id'].'&t='.$data_new['topic_id'].'\" class=\"topictitle\">\xd0\xad\xd1\x82\xd0\xbe\xd1\x82 \xd1\x82\xd0\xbe\xd0\xbf\xd0\xb
8\xd0\xba \xd0\xb7\xd0\xb0\xd0\xba\xd1\x80\xd1\x8b\xd1\x82. \xd0\x9f\xd1\x80\xd0\xbe\xd0\xb4\xd0\xbe\xd0\xbb\xd0\xb6\xd0\xb5\xd0\xbd\xd0\xb
8\xd0\xb5 \xd0\xb2 \xd0\xbd\xd0\xbe\xd0\xb2\xd0\xbe\xd0\xbc \xd1\x82\xd0\xbe\xd0\xbf\xd0\xb8\xd0\xba\xd0\xb5</a>") WHERE post_id = ' . (in
t) $data['post_id']);
$newURL = "{$phpbb_root_path}viewtopic.$phpEx";
$newURL = append_sid($newURL, 'f=' . $data['forum_id'] . '&t='.$data_new['topic_id']).'#'.$data_new['topic_id']
;
}
find
$url = (!$params) ? "{$phpbb_root_path}viewforum.$phpEx" : "{$phpbb_root_path}viewtopic.$phpEx";
$url = append_sid($url, 'f=' . $data['forum_id'] . $params) . $add_anchor;
repace
// autoforum.su wuz here
if($newURL == '1'){
$url = (!$params) ? "{$phpbb_root_path}viewforum.$phpEx" : "{$phpbb_root_path}viewtopic.$phpEx";
$url = append_sid($url, 'f=' . $data['forum_id'] . $params) . $add_anchor;
}else
$url = $newURL;