Line 500 | Line 500 |
---|
{ $postcounts[$num_posts][] = $poster_id; }
|
{ $postcounts[$num_posts][] = $poster_id; }
|
| $postcount_change = 0;
|
// Update users postcounts foreach ($postcounts as $num_posts => $poster_ids) { if (in_array($visibility, array(ITEM_REAPPROVE, ITEM_DELETED))) {
|
// Update users postcounts foreach ($postcounts as $num_posts => $poster_ids) { if (in_array($visibility, array(ITEM_REAPPROVE, ITEM_DELETED))) {
|
| $postcount_change -= $num_posts;
|
$sql = 'UPDATE ' . $this->users_table . ' SET user_posts = 0 WHERE ' . $this->db->sql_in_set('user_id', $poster_ids) . '
| $sql = 'UPDATE ' . $this->users_table . ' SET user_posts = 0 WHERE ' . $this->db->sql_in_set('user_id', $poster_ids) . '
|
Line 520 | Line 524 |
---|
} else {
|
} else {
|
| $postcount_change += $num_posts;
|
$sql = 'UPDATE ' . $this->users_table . ' SET user_posts = user_posts + ' . $num_posts . ' WHERE ' . $this->db->sql_in_set('user_id', $poster_ids); $this->db->sql_query($sql); }
|
$sql = 'UPDATE ' . $this->users_table . ' SET user_posts = user_posts + ' . $num_posts . ' WHERE ' . $this->db->sql_in_set('user_id', $poster_ids); $this->db->sql_query($sql); }
|
| }
if ($postcount_change != 0) { $this->config->increment('num_posts', $postcount_change, false);
|
}
$update_topic_postcount = true;
| }
$update_topic_postcount = true;
|
Line 818 | Line 829 |
---|
* Add post to topic and forum statistics * * @param $data array Contains information from the topics table about given topic
|
* Add post to topic and forum statistics * * @param $data array Contains information from the topics table about given topic
|
* @param &$sql_data array Populated with the SQL changes, may be empty at call time
| * @param $sql_data array Populated with the SQL changes, may be empty at call time (by reference)
|
* @return null */ public function add_post_to_statistic($data, &$sql_data)
| * @return null */ public function add_post_to_statistic($data, &$sql_data)
|
Line 839 | Line 850 |
---|
* Remove post from topic and forum statistics * * @param $data array Contains information from the topics table about given topic
|
* Remove post from topic and forum statistics * * @param $data array Contains information from the topics table about given topic
|
* @param &$sql_data array Populated with the SQL changes, may be empty at call time
| * @param $sql_data array Populated with the SQL changes, may be empty at call time (by reference)
|
* @return null */ public function remove_post_from_statistic($data, &$sql_data)
| * @return null */ public function remove_post_from_statistic($data, &$sql_data)
|
Line 872 | Line 883 |
---|
* Remove topic from forum statistics * * @param $data array Post and topic data
|
* Remove topic from forum statistics * * @param $data array Post and topic data
|
* @param &$sql_data array Populated with the SQL changes, may be empty at call time
| * @param $sql_data array Populated with the SQL changes, may be empty at call time (by reference)
|
* @return null */ public function remove_topic_from_statistic($data, &$sql_data)
| * @return null */ public function remove_topic_from_statistic($data, &$sql_data)
|