I just deleted an alt user who went on a liking rampage... I don't want his username, which was offensive, appearing under every post. Is there a way to rebuild the like caches?
$contentTypes = array( 'profile_post', 'post' ); echo "Rebuilding like totals for users . . . "; // REBUILD LIKE TOTALS FOR USERS $db->query(" UPDATE xf_user AS u SET u.like_count = ( SELECT COUNT(*) FROM xf_liked_content AS lc INNER JOIN xf_user_authenticate AS ua ON (ua.user_id = lc.like_user_id) WHERE lc.content_user_id = u.user_id AND lc.content_type IN (" . $db->quote($contentTypes) . ") ) ");
select u.username, count(like_id) as like_count from xf_liked_content l inner join xf_user u on (u.user_id = l.content_user_id) inner join xf_post p on (p.post_id = l.content_id) where (content_type = "post" OR content_type = "profile_post") group by content_user_id order by like_count desc
An exception occurred: Mysqli statement execute error : Lock wait timeout exceeded; try restarting transaction in /home/xxx/public_html/library/Zend/Db/Statement/Mysqli.php on line 214 Zend_Db_Statement_Mysqli->_execute() in Zend/Db/Statement.php at line 297 Zend_Db_Statement->execute() in Zend/Db/Adapter/Abstract.php at line 479 Zend_Db_Adapter_Abstract->query() in /home/xxx/public_html/rebuildlikes.php at line 39