1
0
mirror of https://github.com/e107inc/e107.git synced 2025-01-16 20:28:28 +01:00

fixes #3269 switched v1 tables to v2

Fixed issue with null values in table (on duplicate)
This commit is contained in:
Achim Ennenbach 2018-08-09 14:52:17 +02:00
parent 604cda1f83
commit 0afb9e67bf
2 changed files with 3 additions and 2 deletions

View File

@ -796,7 +796,7 @@ class e107forum
$qry = '
INSERT INTO `#user_extended` (user_extended_id, user_plugin_forum_posts)
VALUES ('.USERID.', 1)
ON DUPLICATE KEY UPDATE user_plugin_forum_posts = user_plugin_forum_posts + 1
ON DUPLICATE KEY UPDATE user_plugin_forum_posts = IFNULL(user_plugin_forum_posts, 0) + 1
';
$result = $sql->gen($qry);
}

View File

@ -193,7 +193,8 @@ if ($action == 'top')
$text .= "</table>\n</div>";
if ($subaction == 'forum')
{
$ftotal = $sql->db_Count('user', '(*)', 'WHERE `user_forums` > 0');
//$ftotal = $sql->db_Count('user', '(*)', 'WHERE `user_forums` > 0');
$ftotal = $sql->count('user_extended', '(*)', 'WHERE `user_plugin_forum_posts` > 0');
$parms = "{$ftotal},{$view},{$from},".e_SELF.'?[FROM].top.forum.'.$view;
$text .= "<div class='nextprev'>".$tp->parseTemplate("{NEXTPREV={$parms}}").'</div>';
}