 
   2) Как вычислить время первого поста (в смысле из склееных)? Вычитать всё из верхней даты?
 2) Как вычислить время первого поста (в смысле из склееных)? Вычитать всё из верхней даты? 
Модератор: Лора Палмер
Белый С. писал(а):Вычитать всё из верхней даты
Код: Выделить всё
$last_message = addslashes($last_message);Код: Выделить всё
$last_message = undo_htmlspecialchars(addslashes($last_message));Код: Выделить всё
#
#-----[ OPEN ]------------------------------------------
#
posting.php
#
#-----[ FIND ]------------------------------------------
#
	
	if ( !empty($last_message) )
	{
		$message = ( $last_message != $message ) ? $last_message . $separator . $message : $message;
		$sql = "UPDATE " . POSTS_TABLE . " SET post_time = " . $current_time . " WHERE post_id = " . $post_id;
		if ( !($result = $db->sql_query($sql)) )
		{
			message_die(GENERAL_ERROR, 'Could not update last post time', '', __LINE__, __FILE__, $sql);
		}
	}
#
#-----[ REPLACE WITH ]------------------------------------------
#
	
	if ( !empty($last_message) )
	{
		$message = ( $last_message != $message ) ? $last_message . $separator . $message : $message;
		$added = 1;
	}
#
#-----[ 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 ]------------------------------------------
# 
, $added
# 
#-----[ OPEN ]------------------------------------------
#  
includes/function_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 ]------------------------------------------
# 
, &$added
# 
#-----[ FIND ]------------------------------------------
#  
	if ($mode == 'editpost')
# 
#-----[ BEFORE, ADD ]------------------------------------------
# 
	if ( $added && $mode == 'editpost' )
	{
		$sql = "UPDATE " . POSTS_TABLE . " SET post_time = " . $current_time . " WHERE post_id = " . $post_id;
		if ( !($result = $db->sql_query($sql)) )
		{
			message_die(GENERAL_ERROR, 'Could not update last post time', '', __LINE__, __FILE__, $sql);
		}
	}
#
#-----[ SAVE/CLOSE ALL FILES ]------------------------------------------
#
# EoMесть. изменения перенесены вГость писал(а):А в нём нету последних изменений, связанных с изменением даты последнего сообщения..
Код: Выделить всё
includes/function_post.php 
 
До такого оригинального решения надо было додуматьсяthe date/time of last message updates to date/time of
added message. the next "added after" will count from
this time.
 
 

Код: Выделить всё
## MOD Author:      Xpert < pcxpert@mail.ru > 
##   2004-03-03 - Version 1.0.0 
##      - Initial ReleaseКод: Выделить всё
## MOD Author: Mercuree < mercuree@moldova.cc > ( Igor )
##   2004-01-13 - Version 1.0.0
##      - Initial Releaseучитывая, что мой мод выпущен раньше, _Я_ должен просить тебя об этом ) но не надо, спасибо )Xpert писал(а):Считаю, необходимо дать ссылочку на меня и мой сайт. Иначе это чистый плагиат
Код: Выделить всё
$separator = ' \n\n[size=9]'; // just cosmetics to differ this text from posted message