}
// User who can receive mails
-$content['user_max_mails'] = countSumTotalData('CONFIRMED', 'user_data', 'max_mails', 'status', TRUE, " AND `max_mails` > 0");
+$content['user_max_mails'] = countSumTotalData('CONFIRMED', 'user_data', 'max_mails', 'status', TRUE, runFilterChain('user_exclusion_sql', " AND `max_mails` > 0"));
// Users who can receive mails today
-$content['user_max_rec'] = countSumTotalData('CONFIRMED', 'user_data', 'receive_mails', 'status', TRUE, " AND `receive_mails` > 0");
+$content['user_max_rec'] = countSumTotalData('CONFIRMED', 'user_data', 'receive_mails', 'status', TRUE, runFilterChain('user_exclusion_sql', " AND `receive_mails` > 0"));
// Max mails per day
-$content['max'] = countSumTotalData('CONFIRMED', 'user_data', 'max_mails', 'status', FALSE, " AND `max_mails` > 0");
+$content['max'] = countSumTotalData('CONFIRMED', 'user_data', 'max_mails', 'status', FALSE, runFilterChain('user_exclusion_sql', " AND `max_mails` > 0"));
// Max mails for this day
-$content['rec'] = countSumTotalData('CONFIRMED', 'user_data', 'receive_mails', 'status', FALSE, " AND `receive_mails` > 0");
+$content['rec'] = countSumTotalData('CONFIRMED', 'user_data', 'receive_mails', 'status', FALSE, runFilterChain('user_exclusion_sql', " AND `receive_mails` > 0"));
// Initial lots of variables
$bmails = '0';
// Total referral link clicks, total logins
$result = SQL_QUERY('SELECT
- SUM(d.ref_clicks), SUM(d.total_logins)
+ SUM(d.`ref_clicks`) AS `total_ref_clicks`,
+ SUM(d.`total_logins`) AS `total_logins`
FROM
- `{?_MYSQL_PREFIX?}_user_data` AS d', __FILE__, __LINE__);
+ `{?_MYSQL_PREFIX?}_user_data` AS `d`
+' . runFilterChain('user_exclusion_sql', ''), __FILE__, __LINE__);
list($ref, $logins) = SQL_FETCHROW($result);
SQL_FREERESULT($result);
$total = countSumTotalData('Y', 'refbanner', 'id', 'visible', TRUE);
// Total views and clicks
-$result = SQL_QUERY("SELECT SUM(`counter`) AS cnt, SUM(`clicks`) AS clx FROM `{?_MYSQL_PREFIX?}_refbanner` WHERE `visible`='Y'", __FILE__, __LINE__);
+$result = SQL_QUERY("SELECT SUM(`counter`) AS `cnt`, SUM(`clicks`) AS `clicks` FROM `{?_MYSQL_PREFIX?}_refbanner` WHERE `visible`='Y'", __FILE__, __LINE__);
list($views, $clicks) = SQL_FETCHROW($result);
SQL_FREERESULT($result);
if (isExtensionActive('holiday')) {
// Total holiday requests
$result = SQL_QUERY("SELECT
- COUNT(h.userid) AS count_holidays
+ COUNT(h.`userid`) AS `count_holidays`
FROM
- `{?_MYSQL_PREFIX?}_user_holidays` AS h
+ `{?_MYSQL_PREFIX?}_user_holidays` AS `h`
LEFT JOIN
- `{?_MYSQL_PREFIX?}_user_data` AS d
+ `{?_MYSQL_PREFIX?}_user_data` AS `d`
ON
- h.userid=d.userid
+ h.`userid`=d.`userid`
WHERE
- d.`holiday_active`='Y'",
+ d.`holiday_active`='Y'
+" . runFilterChain('user_exclusion_sql', ' '),
__FILE__, __LINE__);
list($holiday) = SQL_FETCHROW($result);
SQL_FREERESULT($result);
if (isExtensionActive('transfer')) {
// Statistics for points transfers
$result = SQL_QUERY("SELECT
- COUNT(t.id) AS cnt, SUM(t.points) AS `points`
+ COUNT(t.`id`) AS `cnt`,
+ SUM(t.`points`) AS `points`
FROM
- `{?_MYSQL_PREFIX?}_user_transfers_in` AS t
+ `{?_MYSQL_PREFIX?}_user_transfers_in` AS `t`
LEFT JOIN
- `{?_MYSQL_PREFIX?}_user_data` AS d
+ `{?_MYSQL_PREFIX?}_user_data` AS `d`
ON
- t.userid=d.userid",
+ t.`userid`=d.`userid`
+" . runFilterChain('user_exclusion_sql', ''),
__FILE__, __LINE__);
list($count_in, $points_in) = SQL_FETCHROW($result);
SQL_FREERESULT($result);
if (empty($points_in)) $points_in = '0';
$result = SQL_QUERY("SELECT
- COUNT(t.id), SUM(t.points)
+ COUNT(t.`id`) AS `cnt`, SUM(t.`points`) AS `points`
FROM
- `{?_MYSQL_PREFIX?}_user_transfers_out` AS t
+ `{?_MYSQL_PREFIX?}_user_transfers_out` AS `t`
LEFT JOIN
- `{?_MYSQL_PREFIX?}_user_data` AS d
+ `{?_MYSQL_PREFIX?}_user_data` AS `d`
ON
- t.userid=d.userid",
+ t.userid=d.userid
+" . runFilterChain('user_exclusion_sql', ''),
__FILE__, __LINE__);
list($count_out, $points_out) = SQL_FETCHROW($result);
SQL_FREERESULT($result);