okay , i solve the problem, but i was hope to find a better solution than this ... thnx :up:
PHP Code:
//update posts count
$totalposts = $db->query_first("
SELECT COUNT(*) AS posts
FROM " . TABLE_PREFIX . "post AS post
INNER JOIN " . TABLE_PREFIX . "thread AS thread ON (thread.threadid = post.threadid)
WHERE post.userid = '".$_POST['postuserid']."'
AND thread.visible = 1
AND post.visible = 1
");
$db->query_write("UPDATE " . TABLE_PREFIX . " user SET posts = '".$totalposts['posts']."' WHERE userid = '".$_POST['postuserid']."' ");