diff -ubBr --exclude=uploads --exclude=images --exclude=images_pcf --exclude=config.php --exclude=languages --exclude=settings.php Upload/editpost.php forum/editpost.php
--- Upload/editpost.php	2006-07-28 04:29:52.000000000 +0200
+++ forum/editpost.php	2006-06-30 09:58:55.000000000 +0200
@@ -335,6 +353,9 @@

 	$db->update_query(TABLE_PREFIX."posts", $newpost, "pid=$pid");

+	updatethreadcount($tid);	// KK:
+	updateforumcount($fid);		// KK:
+
 	$plugins->run_hooks("editpost_do_editpost_end");

 	redirect($url, $redirect);
diff -ubBr --exclude=uploads --exclude=images --exclude=images_pcf --exclude=config.php --exclude=languages --exclude=settings.php Upload/inc/functions.php forum/inc/functions.php
--- Upload/inc/functions.php	2006-07-28 04:29:52.000000000 +0200
+++ forum/inc/functions.php	2006-08-20 12:02:19.000000000 +0200
@@ -902,7 +945,7 @@
 	}
 	$query = $db->query("SELECT MAX(lastpost) AS lastpost FROM ".TABLE_PREFIX."threads WHERE fid IN (0$childforums) AND visible='1' AND closed NOT LIKE 'moved|%'");
 	$lastpost = $db->fetch_array($query);
-	if($lastpost['lastpost'] != $flastpost)
+//	if($lastpost['lastpost'] != $flastpost)	//KK: zakomentowane - z jakis powodow przy moderation.php -> "merge" daty last postow byly takie same, ale lastposttid byl stary... nie uaktualniony
 	{ // Lastpost has changed, lets update
 		$query = $db->query("SELECT lastpost, lastposter, tid FROM ".TABLE_PREFIX."threads WHERE lastpost='".$lastpost['lastpost']."' AND visible='1' AND closed NOT LIKE 'moved|%'");
 		$lp = $db->fetch_array($query);
@@ -949,6 +992,14 @@
 	}
 	$query = $db->query("SELECT u.uid, u.username, p.username AS postusername, p.dateline FROM ".TABLE_PREFIX."posts p LEFT JOIN ".TABLE_PREFIX."users u ON (u.uid=p.uid) WHERE p.tid='$tid' AND p.visible='1' ORDER BY p.dateline DESC LIMIT 1");
 	$lastpost = $db->fetch_array($query);
+	// KK:
+	$query = $db->query("SELECT u.uid, u.username, p.username AS postusername, p.edittime as dateline FROM ".TABLE_PREFIX."posts p LEFT JOIN ".TABLE_PREFIX."users u ON (u.uid=p.uid) WHERE p.tid='$tid' AND p.visible='1' ORDER BY p.edittime DESC LIMIT 1");
+	$lastpost_edited = $db->fetch_array($query);
+	if ($lastpost['dateline'] < $lastpost_edited['dateline'])
+	{
+	  $lastpost = $lastpost_edited ;
+	}
+	// KK^

 	$query = $db->query("SELECT u.uid, u.username, p.username AS postusername, p.dateline FROM ".TABLE_PREFIX."posts p LEFT JOIN ".TABLE_PREFIX."users u ON (u.uid=p.uid) WHERE p.tid='$tid' AND p.visible='1' ORDER BY p.dateline ASC LIMIT 0,1");
 	$firstpost = $db->fetch_array($query);

