From: Roland Häder Date: Thu, 6 Jan 2011 05:31:25 +0000 (+0000) Subject: Also reset (aka daily reset scripts) renamed. The naming 'reset' came from the time... X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=b4c80165024acf8963971a72e5c3ca970b3e646d;p=mailer.git Also reset (aka daily reset scripts) renamed. The naming 'reset' came from the time when only daily reset scripts exist --- diff --git a/.gitattributes b/.gitattributes index fe44c7ec96..c55771879b 100644 --- a/.gitattributes +++ b/.gitattributes @@ -111,6 +111,20 @@ inc/code-functions.php svneol=native#text/plain inc/config-functions.php -text svneol=unset#text/plain inc/config-global.php -text svneol=unset#text/plain inc/config-local.php.dist -text +inc/daily/.htaccess svneol=native#text/plain +inc/daily/daily_ -text +inc/daily/daily_100_bonus.php svneol=native#text/plain +inc/daily/daily_autopurge.php svneol=native#text/plain +inc/daily/daily_beg.php svneol=native#text/plain +inc/daily/daily_birthday.php svneol=native#text/plain +inc/daily/daily_bonus.php svneol=native#text/plain +inc/daily/daily_doubler.php svneol=native#text/plain +inc/daily/daily_engine.php svneol=native#text/plain +inc/daily/daily_holiday.php svneol=native#text/plain +inc/daily/daily_profile.php svneol=native#text/plain +inc/daily/daily_surfbar.php svneol=native#text/plain +inc/daily/daily_user.php svneol=native#text/plain +inc/daily/daily_yoomedia.php svneol=native#text/plain inc/databases.php -text svneol=unset#text/plain inc/db/.htaccess -text svneol=unset#text/plain inc/db/lib-mysql3.php -text svneol=unset#text/plain diff --git a/DOCS/TODOs.txt b/DOCS/TODOs.txt index 0964cc015a..434a16949a 100644 --- a/DOCS/TODOs.txt +++ b/DOCS/TODOs.txt @@ -7,6 +7,8 @@ ./inc/cache/config-local.php:124:// @TODO Rewrite the following three constants, somehow... ./inc/classes/cachesystem.class.php:501: // @TODO Add support for more types which break in last else-block ./inc/config-functions.php:136: // @TODO Make this all better... :-/ +./inc/daily/daily_beg.php:52:// @TODO This should be converted in a daily beg rallye +./inc/daily/daily_birthday.php:92: // @TODO 4 is hard-coded here, should we move it out in config? ./inc/expression-functions.php:164:// @TODO FILTER_COMPILE_CONFIG does not handle call-back functions so we handle it here again ./inc/expression-functions.php:46: // @TODO is escapeQuotes() enougth for strings with single/double quotes? ./inc/extensions/ext-html_mail.php:136: // @TODO Move these arrays into config @@ -33,7 +35,7 @@ ./inc/extensions/ext-network.php:37: * @TODO Yoo!Media: What is LayerAd compared to Layer click? * ./inc/extensions/ext-network.php:91: // @TODO network_type_handle is an internal name and needs documentation ./inc/extensions/ext-newsletter.php:218: // @TODO Move these into configuration -./inc/extensions/ext-order.php:335: // @TODO This should be moved out to inc/reset/ +./inc/extensions/ext-order.php:335: // @TODO This should be moved out to inc/daily/ ./inc/extensions/ext-rallye.php:329: // @TODO Move this code into rallye_functions.php ./inc/extensions/ext-rallye.php:92: // @TODO Fix config_rallye_prices to list_rallye_prices ./inc/extensions/ext-yoomedia.php:121: // @TODO Can this be moved into a database table? @@ -181,8 +183,6 @@ ./inc/mysql-manager.php:1977:// @TODO Fix inconsistency between last_module and getWhat() ./inc/mysql-manager.php:368: // @TODO Try to rewrite this to one or more functions ./inc/mysql-manager.php:44:// @TODO Can we cache this? -./inc/reset/reset_beg.php:52:// @TODO This should be converted in a daily beg rallye -./inc/reset/reset_birthday.php:92: // @TODO 4 is hard-coded here, should we move it out in config? ./inc/revision-functions.php:169:// @TODO This function does also set and get in 'cache_array' ./inc/template-functions.php:1043: // @TODO Deprecate this thing ./inc/template-functions.php:1054: // @TODO Deprecate this thing @@ -242,6 +242,18 @@ ./inc/loader/load_cache-revision.php:2:// @DEPRECATED ./inc/loader/load_cache-them.php:2:// @DEPRECATED ./inc/modules/admin/admin-inc.php:437:// @DEPRECATED +./inc/reset/reset_100_bonus.php:2:// @DEPRECATED +./inc/reset/reset_autopurge.php:2:// @DEPRECATED +./inc/reset/reset_beg.php:2:// @DEPRECATED +./inc/reset/reset_birthday.php:2:// @DEPRECATED +./inc/reset/reset_bonus.php:2:// @DEPRECATED +./inc/reset/reset_daily.php:2:// @DEPRECATED +./inc/reset/reset_doubler.php:2:// @DEPRECATED +./inc/reset/reset_engine.php:2:// @DEPRECATED +./inc/reset/reset_holiday.php:2:// @DEPRECATED +./inc/reset/reset_profile.php:2:// @DEPRECATED +./inc/reset/reset_surfbar.php:2:// @DEPRECATED +./inc/reset/reset_yoomedia.php:2:// @DEPRECATED ### ### template-warnings.log follows: ### ### Warning: Not parsing JavaScript templates/de/html/js/js_order_send.tpl. Warning: Not parsing JavaScript templates/de/html/js/js_cookies_disabled.tpl. diff --git a/inc/daily/.htaccess b/inc/daily/.htaccess new file mode 100644 index 0000000000..3a42882788 --- /dev/null +++ b/inc/daily/.htaccess @@ -0,0 +1 @@ +Deny from all diff --git a/inc/daily/daily_ b/inc/daily/daily_ new file mode 100644 index 0000000000..9e41885718 --- /dev/null +++ b/inc/daily/daily_ @@ -0,0 +1,56 @@ + diff --git a/inc/daily/daily_100_bonus.php b/inc/daily/daily_100_bonus.php new file mode 100644 index 0000000000..0fba064338 --- /dev/null +++ b/inc/daily/daily_100_bonus.php @@ -0,0 +1,94 @@ + 0 AND + `bonus_stats_active`='N' +ORDER BY + `userid` ASC", __FILE__, __LINE__); + +if (!SQL_HASZERONUMS($result_bonus)) { + // We found some mail orders... + while ($content = SQL_FETCHARRAY($result_bonus)) { + // Add points + SQL_QUERY_ESC("UPDATE `{?_MYSQL_PREFIX?}_user_data` SET `bonus_stats`=`bonus_stats`+{?bonus_stats?} WHERE `userid`=%s LIMIT 1", + array(bigintval($content['userid'])), __FILE__, __LINE__); + + // Translate some data + $content['timestamp'] = generateDateTime($content['timestamp_ordered'], 2); + + // Load email template and send email + $message = loadEmailTemplate('member_stats_bonus', $content, bigintval($content['userid'])); + sendEmail($content['userid'], '{--MEMBER_BONUS_STATS_SUBJECT--}', $message); + + // Update database + $result_update = SQL_QUERY_ESC("UPDATE `{?_MYSQL_PREFIX?}_user_stats` SET `bonus_stats_active`='Y' WHERE `id`=%s LIMIT 1", + array(bigintval($content['id'])), __FILE__, __LINE__); + } // END - while + + // Handle bonus points + handleBonusPoints(getConfig('bonus_stats')); +} // END - if + +// Free memory +SQL_FREERESULT($result_bonus); + +// Debug line +//* DEBUG: */ logDebugMessage(__FILE__, __LINE__, 'Daily reset ended.'); + +// [EOF] +?> diff --git a/inc/daily/daily_autopurge.php b/inc/daily/daily_autopurge.php new file mode 100644 index 0000000000..e2d13f9a22 --- /dev/null +++ b/inc/daily/daily_autopurge.php @@ -0,0 +1,66 @@ + diff --git a/inc/daily/daily_beg.php b/inc/daily/daily_beg.php new file mode 100644 index 0000000000..e5a8b080a3 --- /dev/null +++ b/inc/daily/daily_beg.php @@ -0,0 +1,58 @@ + diff --git a/inc/daily/daily_birthday.php b/inc/daily/daily_birthday.php new file mode 100644 index 0000000000..3ecad9d80f --- /dev/null +++ b/inc/daily/daily_birthday.php @@ -0,0 +1,127 @@ + 0)) { + $add = " AND `last_online` >= (UNIX_TIMESTAMP() - {?ap_inactive_since?})"; +} // END - if + +// Only confirmed members shall receive birthday mails... +$result_birthday = SQL_QUERY_ESC("SELECT `userid`, `email`, `birth_year` +FROM + `{?_MYSQL_PREFIX?}_user_data` +WHERE + `status`='CONFIRMED' AND + `birth_day`=%s AND + `birth_month`=%s AND + `birthday_sent` < (UNIX_TIMESTAMP() - ({?ONE_DAY?} * 364)) + ".$add." +ORDER BY + `userid` ASC", + array($day, $month, $value), __FILE__, __LINE__); + +if (!SQL_HASZERONUMS($result_birthday)) { + // Start sending out birthday mails + while ($content = SQL_FETCHARRAY($result_birthday)) { + // Calculate own timestamp for birthday and today + $bd = $content['birth_year'] + 12 * $month + 365 * $day; + $now = $year + 12 * $month + 365 * $day; + + // Simply subtract both values and you got the age... :) + $age = $now - $bd; + + if (getConfig('birthday_points') > 0) { + // Add more entries to the array + $content['age'] = $age; + $content['check'] = ''; + + // @TODO 4 is hard-coded here, should we move it out in config? + for ($idx = '0'; $idx < 4; $idx++) { + $content['check'] .= generateRandomCode('8', mt_rand(0, $month . $day), $content['userid'], ($age * ($idx + 1))); + } // END - for + + // Insert row into database + SQL_QUERY_ESC("INSERT INTO `{?_MYSQL_PREFIX?}_user_birthday` (`userid`, `points`, `chk_value`) VALUES (%s,{?birthday_points?},'%s' )", + array( + bigintval($content['userid']), + $content['check'] + ), __FILE__, __LINE__); + + // Load email template with confirmation link + $message = loadEmailTemplate('member_birthday_confirm', $content, bigintval($content['userid'])); + } else { + // Load default email template and fill in the age + $message = loadEmailTemplate('member_birthday', $age, $content['userid']); + } + + // Send email + sendEmail($content['email'], '{--MEMBER_HAPPY_BIRTHDAY_SUBJECT--}', $message); + + // Remember him that he has received a birthday mail + SQL_QUERY_ESC("UPDATE `{?_MYSQL_PREFIX?}_user_data` SET `birthday_sent`=UNIX_TIMESTAMP() WHERE `userid`=%s LIMIT 1", + array(bigintval($content['userid'])), __FILE__, __LINE__); + } // END - while + + // Free memory + SQL_FREERESULT($result_birthday); +} // END - if + +// Debug line +//* DEBUG: */ logDebugMessage(__FILE__, __LINE__, 'Daily reset ended.'); + +// [EOF] +?> diff --git a/inc/daily/daily_bonus.php b/inc/daily/daily_bonus.php new file mode 100644 index 0000000000..6391405698 --- /dev/null +++ b/inc/daily/daily_bonus.php @@ -0,0 +1,70 @@ + diff --git a/inc/daily/daily_doubler.php b/inc/daily/daily_doubler.php new file mode 100644 index 0000000000..6d1a40d129 --- /dev/null +++ b/inc/daily/daily_doubler.php @@ -0,0 +1,59 @@ + diff --git a/inc/daily/daily_engine.php b/inc/daily/daily_engine.php new file mode 100644 index 0000000000..a9efa4beac --- /dev/null +++ b/inc/daily/daily_engine.php @@ -0,0 +1,56 @@ + diff --git a/inc/daily/daily_holiday.php b/inc/daily/daily_holiday.php new file mode 100644 index 0000000000..4c8058d083 --- /dev/null +++ b/inc/daily/daily_holiday.php @@ -0,0 +1,129 @@ + 0 AND + `holiday_activated` < UNIX_TIMESTAMP() AND + `holiday_active`='N' +ORDER BY + `holiday_activated` ASC", +__FILE__, __LINE__); + +// Entries found? +if (!SQL_HASZERONUMS($result_main)) { + // Init SQLs + initSqls(); + + // We have found at least one useraccount so let's check it... + while ($content = SQL_FETCHARRAY($result_main)) { + // Check if his holiday can be activated + $result_holiday = SQL_QUERY_ESC("SELECT + `holiday_start`, `holiday_end` +FROM + `{?_MYSQL_PREFIX?}_user_holidays` +WHERE + `userid`=%s AND + `holiday_start` <= UNIX_TIMESTAMP() AND + `holiday_end` > UNIX_TIMESTAMP() +LIMIT 1", + array(bigintval($content['userid'])), __FILE__, __LINE__); + + // Do we have an entry? + if (SQL_NUMROWS($result_holiday) == 1) { + // Okay, this user can be send away to holiday... + $content = merge_array($content, SQL_FETCHARRAY($result_holiday)); + + // Prepare all data for the template + $content = merge_array($content, array( + 'activated' => generateDateTime($content['holiday_activated'], 1), + 'start' => generateDateTime($content['holiday_start'] , 1), + 'end' => generateDateTime($content['holiday_end'] , 1) + )); + + // Send email to user + $message = loadEmailTemplate('member_holiday_activated', $content, $content['userid']); + sendEmail($content['userid'], '{--MEMBER_HOLIDAY_ACTIVATED_SUBJECT--}', $message); + + // Update account + addSql(SQL_QUERY_ESC("UPDATE + `{?_MYSQL_PREFIX?}_user_data` +SET + `holiday_active`='Y' +WHERE + `userid`=%s +LIMIT 1", + array(bigintval($content['userid'])), __FILE__, __LINE__, false)); + } // END - if + + // Free memory + SQL_FREERESULT($result_holiday); + } // END - while + + // Run all SQLs + runFilterChain('run_sqls'); +} // END - if + +// Free memory +SQL_FREERESULT($result_main); + +// Stop currently activated holidays +stopHolidays(); + +// Debug line +//* DEBUG: */ logDebugMessage(__FILE__, __LINE__, 'Daily reset ended.'); + +// [EOF] +?> diff --git a/inc/daily/daily_profile.php b/inc/daily/daily_profile.php new file mode 100644 index 0000000000..dac81b696f --- /dev/null +++ b/inc/daily/daily_profile.php @@ -0,0 +1,114 @@ + 0) && (getResendProfileUpdate() > 0)) { + // Load personal data + $result = SQL_QUERY("SELECT + `userid`, `email`, `last_update`, `joined` +FROM + `{?_MYSQL_PREFIX?}_user_data` +WHERE + `status`='CONFIRMED' AND ( + ( + `last_update` < (UNIX_TIMESTAMP() - {?profile_update?}) AND + `last_update` > 0 AND + `last_profile_sent` < (UNIX_TIMESTAMP() - {?resend_profile_update?}) + ) OR ( + `last_update` = 0 AND + `last_profile_sent` = 0 AND + `joined` < (UNIX_TIMESTAMP() - {?profile_update?}) + ) + ) +ORDER BY + `userid` ASC", __FILE__, __LINE__); + + // Do we have some notifications to sent? + if (!SQL_HASZERONUMS($result)) { + // We need to send-out notifications... + while ($content = SQL_FETCHARRAY($result)) { + // Translate timestamp + $content['joined'] = generateDateTime($content['joined'], 0); + + if (round($content['last_update']) == '0') { + // Has never changed his accont + $content['last_update'] = '{--MEMBER_PROFILE_NEVER_CHANGED--}'; + } else { + // Has changed his account + $content['last_update'] = generateDateTime($content['last_update'], 0); + } + + // Load email template and send mail away + $message = loadEmailTemplate('member_profile', $content, bigintval($content['userid'])); + sendEmail($content['email'], '{--MEMBER_PROFILE_OUTDATED_SUBJECT--}', $message); + + // Update profile data + SQL_QUERY_ESC("UPDATE + `{?_MYSQL_PREFIX?}_user_data` +SET + `last_profile_sent`=UNIX_TIMESTAMP(), + `notified`='Y' +WHERE + `userid`=%s +LIMIT 1", + array(bigintval($content['userid'])), __FILE__, __LINE__); + } // END - while + } // END - if + + // Free result + SQL_FREERESULT($result); +} // END - if + +// Debug line +//* DEBUG: */ logDebugMessage(__FILE__, __LINE__, 'Daily reset ended.'); + +// [EOF] +?> diff --git a/inc/daily/daily_surfbar.php b/inc/daily/daily_surfbar.php new file mode 100644 index 0000000000..fd6f64c730 --- /dev/null +++ b/inc/daily/daily_surfbar.php @@ -0,0 +1,61 @@ + diff --git a/inc/daily/daily_user.php b/inc/daily/daily_user.php new file mode 100644 index 0000000000..5c5e6ac088 --- /dev/null +++ b/inc/daily/daily_user.php @@ -0,0 +1,149 @@ + diff --git a/inc/daily/daily_yoomedia.php b/inc/daily/daily_yoomedia.php new file mode 100644 index 0000000000..7a7168ba8d --- /dev/null +++ b/inc/daily/daily_yoomedia.php @@ -0,0 +1,59 @@ + diff --git a/inc/extensions/ext-bonus.php b/inc/extensions/ext-bonus.php index 6a948845a3..cea0cbce6a 100644 --- a/inc/extensions/ext-bonus.php +++ b/inc/extensions/ext-bonus.php @@ -485,7 +485,7 @@ WHERE `last_online` < ".$mark." ORDER BY `userid` ASC"); break; case '0.7.9': // SQL queries for v0.7.9 - setExtensionUpdateNotes("Dollarzeichen fehlte in inc/reset/reset_bonus.php, Zeile 39"); + setExtensionUpdateNotes("Dollarzeichen fehlte in inc/daily/daily_bonus.php, Zeile 39"); break; case '0.8.0': // SQL queries for v0.8.0 diff --git a/inc/extensions/ext-order.php b/inc/extensions/ext-order.php index dbc2f8d556..0716da86a1 100644 --- a/inc/extensions/ext-order.php +++ b/inc/extensions/ext-order.php @@ -332,7 +332,7 @@ INDEX (`pool_id`) case 'init': // Do stuff when extension is initialized // Do daily reset only when installed and extension version is at least 0.1.1 - // @TODO This should be moved out to inc/reset/ + // @TODO This should be moved out to inc/daily/ if ((isResetModeEnabled()) && (isInstalled()) && (isAdminRegistered()) && (isExtensionInstalledAndNewer('order', '0.1.1'))) { // Reset mail order values $result_ext = SQL_QUERY('UPDATE `{?_MYSQL_PREFIX?}_user_data` SET `mail_orders`=0 WHERE `mail_orders` > 0', __FILE__, __LINE__); diff --git a/inc/filters.php b/inc/filters.php index a75f8dd0c9..5f69f44285 100644 --- a/inc/filters.php +++ b/inc/filters.php @@ -557,7 +557,7 @@ function FILTER_RUN_RESET_INCLUDES () { } // END - if // Get more daily reset scripts - setIncludePool('reset', getArrayFromDirectory('inc/reset/', 'reset_')); + setIncludePool('reset', getArrayFromDirectory('inc/daily/', 'daily_')); // Update database if ((!isConfigEntrySet('DEBUG_RESET')) || (getConfig('DEBUG_RESET') != 'Y')) updateConfiguration('last_update', 'UNIX_TIMESTAMP()'); diff --git a/inc/reset/reset_ b/inc/reset/reset_ index cc983a3029..f551ef47b7 100644 --- a/inc/reset/reset_ +++ b/inc/reset/reset_ @@ -1,56 +1,3 @@ diff --git a/inc/reset/reset_100_bonus.php b/inc/reset/reset_100_bonus.php index 265388459a..f551ef47b7 100644 --- a/inc/reset/reset_100_bonus.php +++ b/inc/reset/reset_100_bonus.php @@ -1,94 +1,3 @@ 0 AND - `bonus_stats_active`='N' -ORDER BY - `userid` ASC", __FILE__, __LINE__); - -if (!SQL_HASZERONUMS($result_bonus)) { - // We found some mail orders... - while ($content = SQL_FETCHARRAY($result_bonus)) { - // Add points - SQL_QUERY_ESC("UPDATE `{?_MYSQL_PREFIX?}_user_data` SET `bonus_stats`=`bonus_stats`+{?bonus_stats?} WHERE `userid`=%s LIMIT 1", - array(bigintval($content['userid'])), __FILE__, __LINE__); - - // Translate some data - $content['timestamp'] = generateDateTime($content['timestamp_ordered'], 2); - - // Load email template and send email - $message = loadEmailTemplate('member_stats_bonus', $content, bigintval($content['userid'])); - sendEmail($content['userid'], '{--MEMBER_BONUS_STATS_SUBJECT--}', $message); - - // Update database - $result_update = SQL_QUERY_ESC("UPDATE `{?_MYSQL_PREFIX?}_user_stats` SET `bonus_stats_active`='Y' WHERE `id`=%s LIMIT 1", - array(bigintval($content['id'])), __FILE__, __LINE__); - } // END - while - - // Handle bonus points - handleBonusPoints(getConfig('bonus_stats')); -} // END - if - -// Free memory -SQL_FREERESULT($result_bonus); - -// Debug line -//* DEBUG: */ logDebugMessage(__FILE__, __LINE__, 'Daily reset ended.'); - -// [EOF] +// @DEPRECATED ?> diff --git a/inc/reset/reset_autopurge.php b/inc/reset/reset_autopurge.php index 518d3601e4..f551ef47b7 100644 --- a/inc/reset/reset_autopurge.php +++ b/inc/reset/reset_autopurge.php @@ -1,66 +1,3 @@ diff --git a/inc/reset/reset_beg.php b/inc/reset/reset_beg.php index 05c56e0708..f551ef47b7 100644 --- a/inc/reset/reset_beg.php +++ b/inc/reset/reset_beg.php @@ -1,58 +1,3 @@ diff --git a/inc/reset/reset_birthday.php b/inc/reset/reset_birthday.php index b194ef628f..f551ef47b7 100644 --- a/inc/reset/reset_birthday.php +++ b/inc/reset/reset_birthday.php @@ -1,127 +1,3 @@ 0)) { - $add = " AND `last_online` >= (UNIX_TIMESTAMP() - {?ap_inactive_since?})"; -} // END - if - -// Only confirmed members shall receive birthday mails... -$result_birthday = SQL_QUERY_ESC("SELECT `userid`, `email`, `birth_year` -FROM - `{?_MYSQL_PREFIX?}_user_data` -WHERE - `status`='CONFIRMED' AND - `birth_day`=%s AND - `birth_month`=%s AND - `birthday_sent` < (UNIX_TIMESTAMP() - ({?ONE_DAY?} * 364)) - ".$add." -ORDER BY - `userid` ASC", - array($day, $month, $value), __FILE__, __LINE__); - -if (!SQL_HASZERONUMS($result_birthday)) { - // Start sending out birthday mails - while ($content = SQL_FETCHARRAY($result_birthday)) { - // Calculate own timestamp for birthday and today - $bd = $content['birth_year'] + 12 * $month + 365 * $day; - $now = $year + 12 * $month + 365 * $day; - - // Simply subtract both values and you got the age... :) - $age = $now - $bd; - - if (getConfig('birthday_points') > 0) { - // Add more entries to the array - $content['age'] = $age; - $content['check'] = ''; - - // @TODO 4 is hard-coded here, should we move it out in config? - for ($idx = '0'; $idx < 4; $idx++) { - $content['check'] .= generateRandomCode('8', mt_rand(0, $month . $day), $content['userid'], ($age * ($idx + 1))); - } // END - for - - // Insert row into database - SQL_QUERY_ESC("INSERT INTO `{?_MYSQL_PREFIX?}_user_birthday` (`userid`, `points`, `chk_value`) VALUES (%s,{?birthday_points?},'%s' )", - array( - bigintval($content['userid']), - $content['check'] - ), __FILE__, __LINE__); - - // Load email template with confirmation link - $message = loadEmailTemplate('member_birthday_confirm', $content, bigintval($content['userid'])); - } else { - // Load default email template and fill in the age - $message = loadEmailTemplate('member_birthday', $age, $content['userid']); - } - - // Send email - sendEmail($content['email'], '{--MEMBER_HAPPY_BIRTHDAY_SUBJECT--}', $message); - - // Remember him that he has received a birthday mail - SQL_QUERY_ESC("UPDATE `{?_MYSQL_PREFIX?}_user_data` SET `birthday_sent`=UNIX_TIMESTAMP() WHERE `userid`=%s LIMIT 1", - array(bigintval($content['userid'])), __FILE__, __LINE__); - } // END - while - - // Free memory - SQL_FREERESULT($result_birthday); -} // END - if - -// Debug line -//* DEBUG: */ logDebugMessage(__FILE__, __LINE__, 'Daily reset ended.'); - -// [EOF] +// @DEPRECATED ?> diff --git a/inc/reset/reset_bonus.php b/inc/reset/reset_bonus.php index cb36ff75d5..f551ef47b7 100644 --- a/inc/reset/reset_bonus.php +++ b/inc/reset/reset_bonus.php @@ -1,70 +1,3 @@ diff --git a/inc/reset/reset_daily.php b/inc/reset/reset_daily.php index 02b19d73f9..f551ef47b7 100644 --- a/inc/reset/reset_daily.php +++ b/inc/reset/reset_daily.php @@ -1,149 +1,3 @@ diff --git a/inc/reset/reset_doubler.php b/inc/reset/reset_doubler.php index 8fc2f1028d..f551ef47b7 100644 --- a/inc/reset/reset_doubler.php +++ b/inc/reset/reset_doubler.php @@ -1,59 +1,3 @@ diff --git a/inc/reset/reset_engine.php b/inc/reset/reset_engine.php index e4a970f03f..f551ef47b7 100644 --- a/inc/reset/reset_engine.php +++ b/inc/reset/reset_engine.php @@ -1,56 +1,3 @@ diff --git a/inc/reset/reset_holiday.php b/inc/reset/reset_holiday.php index a4a9f316bc..f551ef47b7 100644 --- a/inc/reset/reset_holiday.php +++ b/inc/reset/reset_holiday.php @@ -1,129 +1,3 @@ 0 AND - `holiday_activated` < UNIX_TIMESTAMP() AND - `holiday_active`='N' -ORDER BY - `holiday_activated` ASC", -__FILE__, __LINE__); - -// Entries found? -if (!SQL_HASZERONUMS($result_main)) { - // Init SQLs - initSqls(); - - // We have found at least one useraccount so let's check it... - while ($content = SQL_FETCHARRAY($result_main)) { - // Check if his holiday can be activated - $result_holiday = SQL_QUERY_ESC("SELECT - `holiday_start`, `holiday_end` -FROM - `{?_MYSQL_PREFIX?}_user_holidays` -WHERE - `userid`=%s AND - `holiday_start` <= UNIX_TIMESTAMP() AND - `holiday_end` > UNIX_TIMESTAMP() -LIMIT 1", - array(bigintval($content['userid'])), __FILE__, __LINE__); - - // Do we have an entry? - if (SQL_NUMROWS($result_holiday) == 1) { - // Okay, this user can be send away to holiday... - $content = merge_array($content, SQL_FETCHARRAY($result_holiday)); - - // Prepare all data for the template - $content = merge_array($content, array( - 'activated' => generateDateTime($content['holiday_activated'], 1), - 'start' => generateDateTime($content['holiday_start'] , 1), - 'end' => generateDateTime($content['holiday_end'] , 1) - )); - - // Send email to user - $message = loadEmailTemplate('member_holiday_activated', $content, $content['userid']); - sendEmail($content['userid'], '{--MEMBER_HOLIDAY_ACTIVATED_SUBJECT--}', $message); - - // Update account - addSql(SQL_QUERY_ESC("UPDATE - `{?_MYSQL_PREFIX?}_user_data` -SET - `holiday_active`='Y' -WHERE - `userid`=%s -LIMIT 1", - array(bigintval($content['userid'])), __FILE__, __LINE__, false)); - } // END - if - - // Free memory - SQL_FREERESULT($result_holiday); - } // END - while - - // Run all SQLs - runFilterChain('run_sqls'); -} // END - if - -// Free memory -SQL_FREERESULT($result_main); - -// Stop currently activated holidays -stopHolidays(); - -// Debug line -//* DEBUG: */ logDebugMessage(__FILE__, __LINE__, 'Daily reset ended.'); - -// [EOF] +// @DEPRECATED ?> diff --git a/inc/reset/reset_profile.php b/inc/reset/reset_profile.php index 4b22bc2f56..f551ef47b7 100644 --- a/inc/reset/reset_profile.php +++ b/inc/reset/reset_profile.php @@ -1,114 +1,3 @@ 0) && (getResendProfileUpdate() > 0)) { - // Load personal data - $result = SQL_QUERY("SELECT - `userid`, `email`, `last_update`, `joined` -FROM - `{?_MYSQL_PREFIX?}_user_data` -WHERE - `status`='CONFIRMED' AND ( - ( - `last_update` < (UNIX_TIMESTAMP() - {?profile_update?}) AND - `last_update` > 0 AND - `last_profile_sent` < (UNIX_TIMESTAMP() - {?resend_profile_update?}) - ) OR ( - `last_update` = 0 AND - `last_profile_sent` = 0 AND - `joined` < (UNIX_TIMESTAMP() - {?profile_update?}) - ) - ) -ORDER BY - `userid` ASC", __FILE__, __LINE__); - - // Do we have some notifications to sent? - if (!SQL_HASZERONUMS($result)) { - // We need to send-out notifications... - while ($content = SQL_FETCHARRAY($result)) { - // Translate timestamp - $content['joined'] = generateDateTime($content['joined'], 0); - - if (round($content['last_update']) == '0') { - // Has never changed his accont - $content['last_update'] = '{--MEMBER_PROFILE_NEVER_CHANGED--}'; - } else { - // Has changed his account - $content['last_update'] = generateDateTime($content['last_update'], 0); - } - - // Load email template and send mail away - $message = loadEmailTemplate('member_profile', $content, bigintval($content['userid'])); - sendEmail($content['email'], '{--MEMBER_PROFILE_OUTDATED_SUBJECT--}', $message); - - // Update profile data - SQL_QUERY_ESC("UPDATE - `{?_MYSQL_PREFIX?}_user_data` -SET - `last_profile_sent`=UNIX_TIMESTAMP(), - `notified`='Y' -WHERE - `userid`=%s -LIMIT 1", - array(bigintval($content['userid'])), __FILE__, __LINE__); - } // END - while - } // END - if - - // Free result - SQL_FREERESULT($result); -} // END - if - -// Debug line -//* DEBUG: */ logDebugMessage(__FILE__, __LINE__, 'Daily reset ended.'); - -// [EOF] +// @DEPRECATED ?> diff --git a/inc/reset/reset_surfbar.php b/inc/reset/reset_surfbar.php index 758fcabe2d..f551ef47b7 100644 --- a/inc/reset/reset_surfbar.php +++ b/inc/reset/reset_surfbar.php @@ -1,61 +1,3 @@ diff --git a/inc/reset/reset_yoomedia.php b/inc/reset/reset_yoomedia.php index 8a22f74bba..f551ef47b7 100644 --- a/inc/reset/reset_yoomedia.php +++ b/inc/reset/reset_yoomedia.php @@ -1,59 +1,3 @@