I don't know why you want to change posts count !
Maybe you can recalculate it from all posted messages, but change it may add integrity errors.
I am working on another mod (Guest Management), managing posts count, and merging messages from some users (from guest to registered).
http://www.phpbb.com/phpBB/viewtopic.php?t=36159
mr_mo wrote: 1) Changing post counts does NOT cause errors.
mr_mo wrote: 2) Do you have to make a shameless plug and prove your point by posting a link to YOUR mod in my post?
bourmad wrote: I prefer a query like :
update phpbb_users set post_count = (select count(user_id) from phpbb_posts where user_id = %user_id%)
I think it's more coherent.
Code: Select all
$sql = "UPDATE " . USERS_TABLE . "
SET " . $username_sql . $passwd_sql . "user_email = '" . str_replace("\'", "''", $email) . "', user_icq = '" . str_replace("\'", "''", $icq) . "', user_website = '" . str_replace("\'", "''", $website) . "', user_occ = '" . str_replace("\'", "''", $occupation) . "', user_from = '" . str_replace("\'", "''", $location) . "', user_interests = '" . str_replace("\'", "''", $interests) . "', user_sig = '" . str_replace("\'", "''", $signature) . "', user_viewemail = $viewemail, user_aim = '" . str_replace("\'", "''", $aim) . "', user_yim = '" . str_replace("\'", "''", $yim) . "', user_msnm = '" . str_replace("\'", "''", $msn) . "', user_attachsig = $attachsig, user_sig_bbcode_uid = '$signature_bbcode_uid', user_allowsmile = $allowsmilies, user_allowhtml = $allowhtml, user_allowavatar = $user_allowavatar, user_allowbbcode = $allowbbcode, user_allow_viewonline = $allowviewonline, user_notify = $notifyreply, user_allow_pm = $user_allowpm, user_notify_pm = $notifypm, user_popup_pm = $popuppm, user_lang = '" . str_replace("\'", "''", $user_lang) . "', user_style = $user_style, user_timezone = $user_timezone, user_dateformat = '" . str_replace("\'", "''", $user_dateformat) . "', user_active = $user_status, user_rank = $user_rank" . $avatar_sql . "
WHERE user_id = $user_id";
if( $result = $db->sql_query($sql) )
I don't say you may have ERRORS, but you may have differences between 2 values, first calculated (posts table), and second one static (users table).
I only want to share my ideas with you, and discuss on how to improve phpBB forums together with good ideas.
But, never mind...
and goog continuation with your "useless" mod !