Revision 313866323465 () - Diff

Link to this snippet: https://friendpaste.com/1vtOL5CfsYI2isiHP28F2M
Embed:
1
2
3
4
5
6
7
8
9
10
11
12
$qb = net_nemein_discussion_post_dba::new_query_builder();
$qb->add_constraint('sender', '=', $id);
$qb->add_constraint('status', '>=', NET_NEMEIN_DISCUSSION_NEW);
$good_posts = $qb->count_unchecked();
$qb = net_nemein_discussion_post_dba::new_query_builder();
$qb->add_constraint('sender', '=', $id);
$qb->add_constraint('status', '<', NET_NEMEIN_DISCUSSION_NEW);
$bad_posts = $qb->count_unchecked();
$karma = $good_posts + ($bad_posts * $this->_config->get('karma_discussion_badpost_modifier'));
return $karma;