X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=inc%2Flibs%2Ftask_functions.php;h=b7c91c62ca47248a999178a92b7957fa8c1f2a08;hb=3aaf4f50aea21809ec25dd2c9d93567fd48a61db;hp=6497d3c91706ef7c64c83bc8719754d8a4d5d1b5;hpb=963e55ca1ea79e255f235e359cde9f7862191dc5;p=mailer.git diff --git a/inc/libs/task_functions.php b/inc/libs/task_functions.php index 6497d3c917..b7c91c62ca 100644 --- a/inc/libs/task_functions.php +++ b/inc/libs/task_functions.php @@ -81,7 +81,7 @@ function OUTPUT_ADVANCED_OVERVIEW (&$result_main) SQL_FREERESULT($result); if ($value > 0) { - define('__CONFIRMED_VALUE', "".$value.""); + define('__CONFIRMED_VALUE', "".$value.""); } else { define('__CONFIRMED_VALUE', "0"); } @@ -103,7 +103,7 @@ function OUTPUT_ADVANCED_OVERVIEW (&$result_main) SQL_FREERESULT($result); if ($value > 0) { - define('__LOCKED_VALUE', "".$value.""); + define('__LOCKED_VALUE', "".$value.""); } else { define('__LOCKED_VALUE', "0"); } @@ -255,7 +255,7 @@ function OUTPUT_ADVANCED_OVERVIEW (&$result_main) // Sent bonus mails // if (GET_EXT_VERSION("bonus") >= "0.1.8") { - $result = SQL_QUERY("SELECT id FROM "._MYSQL_PREFIX."_bonus WHERE data_type='SEND'", __FILE__, __LINE__); + $result = SQL_QUERY("SELECT id FROM "._MYSQL_PREFIX."_bonus WHERE data_type='SEND' AND is_notify='N'", __FILE__, __LINE__); $value = SQL_NUMROWS($result); SQL_FREERESULT($result); @@ -272,23 +272,22 @@ function OUTPUT_ADVANCED_OVERVIEW (&$result_main) if (EXT_IS_ACTIVE("autopurge")) { // Start finding them... - $since = (time() - $_CONFIG['ap_in_since']); - $EXCLUDE_LIST = " AND d.userid != c.def_refid"; + $since = $_CONFIG['ap_inactive_since']; + $EXCLUDE_LIST = ""; + if ($_CONFIG['def_refid'] > 0) { + $EXCLUDE_LIST = " AND d.userid != ".$_CONFIG['def_refid'].""; + } // END - if // Check for more extensions - if (EXT_IS_ACTIVE("beg")) $EXCLUDE_LIST .= " AND d.userid != c.beg_uid"; - if (EXT_IS_ACTIVE("bonus")) $EXCLUDE_LIST .= " AND d.userid != c.bonus_uid"; - if (EXT_IS_ACTIVE("doubler")) $EXCLUDE_LIST .= " AND d.userid != c.doubler_uid"; - - // Check for new holiday system - if (GET_EXT_VERSION("holiday") >= "0.1.3") { - $EXCLUDE_LIST .= " AND d.holiday_active = 'N'"; - } + if (EXT_IS_ACTIVE("beg")) $EXCLUDE_LIST .= " AND d.userid != ".$_CONFIG['beg_uid'].""; + if (EXT_IS_ACTIVE("bonus")) $EXCLUDE_LIST .= " AND d.userid != ".$_CONFIG['bonus_uid'].""; + if (EXT_IS_ACTIVE("doubler")) $EXCLUDE_LIST .= " AND d.userid != ".$_CONFIG['doubler_uid'].""; + if (GET_EXT_VERSION("holiday") >= "0.1.3") $EXCLUDE_LIST .= " AND d.holiday_active='N'"; // Check for all accounts $SQLs[] = "SELECT DISTINCT d.userid, d.email, d.last_online -FROM "._MYSQL_PREFIX."_user_data AS d, "._MYSQL_PREFIX."_config AS c -WHERE d.status='CONFIRMED' AND d.joined < ".$since." AND d.last_online < ".$since." AND d.ap_notified < ".$since." +FROM "._MYSQL_PREFIX."_user_data AS d +WHERE d.status='CONFIRMED' AND d.joined < (UNIX_TIMESTAMP() - ".$since.") AND d.last_online < (UNIX_TIMESTAMP() - ".$since.") AND d.ap_notified < (UNIX_TIMESTAMP() - ".$since.") ".$EXCLUDE_LIST." ORDER BY d.userid"; $WHATs[] = "list_autopurge"; @@ -297,11 +296,11 @@ ORDER BY d.userid"; } if (GET_EXT_VERSION("sql_patches") >= "0.3.4") { - // Check for accounts without referral + // Check for accounts without referal $SQLs[] = "SELECT userid FROM "._MYSQL_PREFIX."_user_data WHERE refid='0' ORDER BY userid"; $DESCRs[] = TASK_ADMIN_LIST_ACCOUNT_NOREF; $TITLEs[] = TASK_ADMIN_LIST_ACCOUNT_NOREF_TITLE; - $WHATs[] = "list_norefs"; + $WHATs[] = "list_user&mode=norefs"; } if (EXT_IS_ACTIVE("payout")) { @@ -340,6 +339,14 @@ ORDER BY d.userid"; $TITLEs[] = TASK_ADMIN_LIST_HOLIDAYS_TITLE; } + if (GET_EXT_VERSION("bonus") >= "0.8.7") { + // List all notifications + $SQLs[] = "SELECT id FROM "._MYSQL_PREFIX."_bonus WHERE is_notify='Y' ORDER BY timestamp DESC"; + $WHATs[] = "list_notifications"; + $DESCRs[] = TASK_ADMIN_LIST_NOTIFICATIONS; + $TITLEs[] = TASK_ADMIN_LIST_NOTIFICATIONS_TITLE; + } // END - if + if (GET_EXT_VERSION("bonus") >= "0.2.3") { // Active rallye if (GET_EXT_VERSION("bonus") >= "0.6.9") { @@ -357,15 +364,15 @@ ORDER BY d.userid"; } // Autopurge installed? - $LAST = ""; $ONLINE = ""; - if ((EXT_IS_ACTIVE("autopurge")) && ($_CONFIG['ap_inactive'] == "Y") && ($_CONFIG['ap_in_since'] > 0)) { + $LAST = ""; + if ((EXT_IS_ACTIVE("autopurge")) && ($_CONFIG['autopurge_inactive'] == "Y") && ($_CONFIG['ap_inactive_since'] > 0)) { // Use last online timestamp to keep inactive members away from here - $LAST = " AND last_online >= "; - $ONLINE = bigintval(time() - $_CONFIG['ap_in_since']); + $LAST = sprintf(" AND last_online >= (UNIX_TIMESTAMP() - %s)", $_CONFIG['ap_inactive_since']); } - $SQLs[] = "SELECT ".$USE." AS active_bonus FROM "._MYSQL_PREFIX."_user_data -WHERE status='CONFIRMED' AND ".$USE.">0".$LAST."".$ONLINE." + $SQLs[] = "SELECT ".$USE." AS active_bonus +FROM "._MYSQL_PREFIX."_user_data +WHERE status='CONFIRMED' AND ".$USE.">0".$LAST." ORDER BY active_bonus DESC, userid"; $WHATs[] = "list_bonus"; $DESCRs[] = TASK_ADMIN_LIST_BONUS; @@ -376,15 +383,14 @@ ORDER BY active_bonus DESC, userid"; // Begging rallye // Autopurge installed? - $LAST = ""; $ONLINE = ""; - if ((EXT_IS_ACTIVE("autopurge")) && ($_CONFIG['ap_inactive'] == "Y") && ($_CONFIG['ap_in_since'] > 0)) { + $LAST = ""; + if ((EXT_IS_ACTIVE("autopurge")) && ($_CONFIG['autopurge_inactive'] == "Y") && ($_CONFIG['ap_inactive_since'] > 0)) { // Use last online timestamp to keep inactive members away from here - $LAST = " AND last_online >= "; - $ONLINE = bigintval(time() - $_CONFIG['ap_in_since']); + $LAST = sprintf(" AND last_online >= (UNIX_TIMESTAMP() - %s)", $_CONFIG['ap_inactive_since']); } $SQLs[] = "SELECT userid FROM "._MYSQL_PREFIX."_user_data -WHERE status='CONFIRMED' AND beg_points>0".$LAST."".$ONLINE." +WHERE status='CONFIRMED' AND beg_points>0".$LAST." ORDER BY beg_points DESC, userid"; $WHATs[] = "list_beg"; $DESCRs[] = TASK_ADMIN_LIST_BEG; @@ -404,7 +410,7 @@ ORDER BY beg_points DESC, userid"; } // - // All referral banner + // All referal banner // $SQLs[] = "SELECT id FROM "._MYSQL_PREFIX."_refbanner ORDER BY id"; $WHATs[] = "refbanner"; @@ -412,7 +418,7 @@ ORDER BY beg_points DESC, userid"; $TITLEs[] = TASK_ADMIN_LIST_REFBANNER_ALL_TITLE; // - // All activated referral banner + // All activated referal banner // $SQLs[] = "SELECT id FROM "._MYSQL_PREFIX."_refbanner WHERE visible='Y' ORDER BY id"; $WHATs[] = "refbanner"; @@ -559,7 +565,11 @@ function TASK_CREATE_EXTRA_ROWS($SQLs, $WHATs, $DESCRs, $TITLEs){ foreach ($SQLs as $key => $sql) { // Run SQL command, get line numbers and free memory $result = SQL_QUERY($sql, __FILE__, __LINE__); + + // Get rows $value = SQL_NUMROWS($result); + + // Free result SQL_FREERESULT($result); $content = array( @@ -581,7 +591,7 @@ function TASK_CREATE_EXTRA_ROWS($SQLs, $WHATs, $DESCRs, $TITLEs){ // And insert the final string into extras template $OUT .= LOAD_TEMPLATE("admin_overview_task_rows", true, $content); - } + } // END - if // Return output return LOAD_TEMPLATE("admin_overview_task_extras", true, $OUT);