// Merge both arrays
$content = merge_array($content, $row);
- $un = false;
+ $un = FALSE;
// Get refs by userid
$count = getReferralRallyeRefsCount($content['userid']);
bigintval($count),
$cpoints
), __FUNCTION__, __LINE__);
- $un = true;
+ $un = TRUE;
} // END - if
// Free memory
$content['refs'] = $count;
// Shall I notify this member?
- if (($content['send_notify'] == 'Y') && ($un === true)) {
+ if (($content['send_notify'] == 'Y') && ($un === TRUE)) {
// Load email template and send it to the user
$message = loadEmailTemplate('member_rallye_notify', $content, $content['userid']);
sendEmail($content['userid'], '{%message,MEMBER_RALLYE_NOTIFY_SUBJECT=' . $content['title'] . '%}', $message);
SQL_FREERESULT($result);
// Sort whole array
- array_pk_sort($content, array('cpoints', 'ref'), 0, 1, true);
+ array_pk_sort($content, array('cpoints', 'ref'), 0, 1, TRUE);
// Generate table
$OUT = '';
);
// Load row template and switch color
- $OUT .= loadTemplate($mode . '_list_rallye_row', true, $row);
+ $OUT .= loadTemplate($mode . '_list_rallye_row', TRUE, $row);
} // END - for
// Add min_prices/users
$content['min_users'] = bigintval($min_users);
// And finnally return the output
- return loadTemplate($mode . '_list_rallye', true, $content);
+ return loadTemplate($mode . '_list_rallye', TRUE, $content);
}
// Sends out a notification about the rallye
// "Walk" through all entries
foreach ($prices['userid'] as $key => $userid) {
// Check for userid
- $active = countSumTotalData($userid, 'user_data', 'userid', 'userid', true, runFilterChain('user_exclusion_sql', " AND `status`='CONFIRMED'"));
+ $active = countSumTotalData($userid, 'user_data', 'userid', 'userid', TRUE, runFilterChain('user_exclusion_sql', " AND `status`='CONFIRMED'"));
// Allow valid and active users with at least one ref
//* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'rallyeId=' . $rallyeId . ',userid=' . $userid . ',ref=' . $prices['ref'][$key] . ',cpoints=' . $prices['cpoints'][$key]);
* active = 1: account is still confirmed
* active = 0: account is deleted or locked
*/
- $active = countSumTotalData($userid, 'user_data', 'userid', 'userid', true, runFilterChain('user_exclusion_sql', " AND `status`='CONFIRMED'"));
+ $active = countSumTotalData($userid, 'user_data', 'userid', 'userid', TRUE, runFilterChain('user_exclusion_sql', " AND `status`='CONFIRMED'"));
$prices['active'][$key] = $active;
SQL_FREERESULT($result_user);
// Sort array for refs (descending)
- array_pk_sort($users, array('cpoints', 'ref'), 0, 1, true);
+ array_pk_sort($users, array('cpoints', 'ref'), 0, 1, TRUE);
// Load prices array (!)
$prices = getArrayFromReferralRallyePrices($rallye);
* active = 1: account is still confirmed
* active = 0: account is deleted or locked
*/
- $active = countSumTotalData($content['userid'][$idx], 'user_data', 'userid', 'userid', true, runFilterChain('user_exclusion_sql', " AND `status`='CONFIRMED'"));
+ $active = countSumTotalData($content['userid'][$idx], 'user_data', 'userid', 'userid', TRUE, runFilterChain('user_exclusion_sql', " AND `status`='CONFIRMED'"));
if ((empty($content['ref'][$idx])) || ($content['ref'][$idx] == '0') || ($active == '0') || ('' . round($content['cpoints'][$idx]) . '' == '0') || (empty($content['cpoints'][$idx]))) {
// Allow valid and active users with at least one ref to get points
);
// Load row template
- $OUT .= loadTemplate($mode . '_list_rallye_row', true, $row);
+ $OUT .= loadTemplate($mode . '_list_rallye_row', TRUE, $row);
} // END - for
// Prepare content
);
// Load main template and finnally return the output
- return loadTemplate($mode . '_list_rallye', true, $content);
+ return loadTemplate($mode . '_list_rallye', TRUE, $content);
}
//
// Purge whole rallye
addSql(SQL_QUERY_ESC("DELETE LOW_PRIORITY FROM `{?_MYSQL_PREFIX?}_rallye_data` WHERE `id`=%s LIMIT 1",
- array(bigintval($content['id'])), __FUNCTION__, __LINE__, false));
+ array(bigintval($content['id'])), __FUNCTION__, __LINE__, FALSE));
addSql(SQL_QUERY_ESC("DELETE LOW_PRIORITY FROM `{?_MYSQL_PREFIX?}_rallye_prices` WHERE `rallye_id`=%s LIMIT 1",
- array(bigintval($content['id'])), __FUNCTION__, __LINE__, false));
+ array(bigintval($content['id'])), __FUNCTION__, __LINE__, FALSE));
addSql(SQL_QUERY_ESC("DELETE LOW_PRIORITY FROM `{?_MYSQL_PREFIX?}_rallye_users` WHERE `rallye_id`=%s LIMIT 1",
- array(bigintval($content['id'])), __FUNCTION__, __LINE__, false));
+ array(bigintval($content['id'])), __FUNCTION__, __LINE__, FALSE));
// Add task (we ignore the task id here
createNewTask('{--ADMIN_RALLYE_PURGED_TASK--}: ' . $content['title'], '{--ADMIN_RALLYE_PURGED_TEXT--}', 'RALLYE_PURGED');
$basePath = sprintf("templates/%s/html/rallye/", getLanguage());
// Read the directory
- $templates = getArrayFromDirectory($basePath, 'rallye_', false, true, array(), '.tpl');
+ $templates = getArrayFromDirectory($basePath, 'rallye_', FALSE, TRUE, array(), '.tpl');
// And walk through
foreach ($templates as $read) {
} // END - if
} // END - foreach
- //* DEBUG: */ debugOutput('<pre>'.print_r($GLOBALS['cache_array']['refsystem'], true).'</pre>');
+ //* DEBUG: */ debugOutput('<pre>'.print_r($GLOBALS['cache_array']['refsystem'], TRUE).'</pre>');
//* DEBUG: */ doShutdown();
if ($count > 0) {
} else {
// Load current refs from database
$result_ref = SQL_QUERY_ESC("SELECT
- SUM(s.counter) AS cnt
+ SUM(s.counter) AS `cnt`
FROM
`{?_MYSQL_PREFIX?}_refsystem` AS s
LEFT JOIN
// Is there cache?
if (!isset($GLOBALS[__FUNCTION__][$rallyeId])) {
// Determine it
- $GLOBALS[__FUNCTION__][$rallyeId] = countSumTotalData($rallyeId, 'rallye_prices', 'id', 'rallye_id', true);
+ $GLOBALS[__FUNCTION__][$rallyeId] = countSumTotalData($rallyeId, 'rallye_prices', 'id', 'rallye_id', TRUE);
} // END - if
// Return it