Skip to content
This repository has been archived by the owner on Feb 9, 2023. It is now read-only.

Commit

Permalink
Browse files Browse the repository at this point in the history
Пересчет баллов пользователя
  • Loading branch information
devkont committed Apr 27, 2017
1 parent 3a91596 commit af04dab
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion plugins/userpoints/userpoints.folio.delete.done.php
Expand Up @@ -16,6 +16,9 @@
*/
defined('COT_CODE') or die('Wrong URL.');

global $db_userpoints;
global $db_userpoints, $db_users;

$db->delete($db_userpoints, "item_type IN ('portfolioaddtocat', 'portfoliodeltocat') AND item_itemid=".$id);

$uuserpoints = $db->query("SELECT SUM(item_point) as summ FROM $db_userpoints WHERE item_userid=" . (int)$ritem['item_userid'])->fetchColumn();
$db->update($db_users, array('user_userpoints' => $uuserpoints), "user_id=" . (int)$ritem['item_userid']);

1 comment on commit af04dab

@eukraina
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

За исключением хвоста в flance_userpoints для уже не существующего юзера за логин + 1usp все остальное работает как надо, и при удалении фолио и при удалении всего юзера.

Please sign in to comment.