Pisałem o tym w temacie
http://www.phpbb2.pl/forum/viewtopic.php?t=15606. Dziwię się, że nie denerwuje was ta sytuacja, bo mnie bardzo. Pisałem tam, że na jakiś forum przed wysłaniem postu użytkownik otrzymuje info, że post na który odpowiada został zmodyfikowany/usnięty. I w końcu znalazłem to na swoim forum w pliku
posting.php, kod:[php]<?php
$topic_last_post_id = intval($post_info['topic_last_post_id']);
if ( ($submit || $refresh) && in_array($mode, array('reply', 'quote', 'editpost')) )
{
// check if the last post id is still the same
if ( _read('last_post', TYPE_INT, $topic_last_post_id) != $topic_last_post_id )
{
$refresh = $preview = true;
$submit = false;
_error($mode == 'editpost' ? 'New_post_meanwhile_edit' : 'New_post_meanwhile_reply');
}
}
?>[/php]
oraz funkcje
_read() i
_error() w pliku
CH_functions.php, kod:[php]<?php
function _read($var, $type='', $dft='', $list=array(), $no_strip=false, $post_only=false)
{
global $HTTP_POST_VARS, $HTTP_GET_VARS;
// adjust with dft
$res = _type_cast($dft, $type, $list, false);
// read $_* value
if ( !empty($var) )
{
// read parm
if ( isset($HTTP_POST_VARS[$var]) || (isset($HTTP_GET_VARS[$var]) && !$post_only) )
{
$res = isset($HTTP_POST_VARS[$var]) ? $HTTP_POST_VARS[$var] : $HTTP_GET_VARS[$var];
if ( !$no_strip )
{
$res = trim(stripslashes(str_replace(array("\r\n", "\r", '\xFF'), array("\n", "\n", ' '), $res)));
}
}
}
$res = _type_cast($res, $type, $list);
return $res;
}
?>[/php]
[php]<?php
function _error($key)
{
global $user;
global $error, $error_msg;
if ( !$error )
{
$error_msg = '';
}
$error = true;
$error_msg .= (empty($error_msg) ? '' : '<br /><br />') . $user->lang($key);
}
?>[/php]
pozdrawiam
Kocioł