From: Roland Häder Date: Wed, 10 Sep 2008 11:19:04 +0000 (+0000) Subject: More time() in SQL queries replace with UNIX_TIMESTAMP() X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=30ca796470b999b169640dcac82abf5dc8693334;p=mailer.git More time() in SQL queries replace with UNIX_TIMESTAMP() --- diff --git a/.gitattributes b/.gitattributes index f6de7bda74..4efde83e25 100644 --- a/.gitattributes +++ b/.gitattributes @@ -1305,7 +1305,8 @@ templates/de/html/page_body.tpl -text templates/de/html/page_footer.tpl -text templates/de/html/page_header.tpl -text templates/de/html/profile-update.tpl -text -templates/de/html/rallye_test.tpl -text +templates/de/html/rallye/.htaccess -text +templates/de/html/rallye/rallye_test.tpl -text templates/de/html/redirect_url.tpl -text templates/de/html/register_header.tpl -text templates/de/html/runtime_fatal_row.tpl -text diff --git a/inc/databases.php b/inc/databases.php index 6c874469e6..341f8e4caf 100644 --- a/inc/databases.php +++ b/inc/databases.php @@ -114,7 +114,7 @@ define('USAGE_BASE', "usage"); define('SERVER_URL', "http://www.mxchange.org"); // This current patch level -define('CURR_SVN_REVISION', "294"); +define('CURR_SVN_REVISION', "295"); // Take a prime number which is long (if you know a longer one please try it out!) define('_PRIME', 591623); diff --git a/inc/extensions/ext-rallye.php b/inc/extensions/ext-rallye.php index e1d89f8397..6f3b40a646 100644 --- a/inc/extensions/ext-rallye.php +++ b/inc/extensions/ext-rallye.php @@ -310,23 +310,21 @@ default: // Do stuff when extension is loaded // Add more data on higher versions $ADD1 = ""; $ADD2 = ""; $OR = ""; - if (GET_EXT_VERSION("rallye") >= "0.2.0") - { + if (GET_EXT_VERSION("rallye") >= "0.2.0") { $ADD1 = ", min_users, min_prices"; $ADD2 = ", d.min_users, d.min_prices"; $OR = " OR (d.min_users <= ".$TOTAL." AND d.min_users > 0)"; - } + } // END - if // Check for new started but not notified rallyes $result = SQL_QUERY("SELECT SQL_SMALL_RESULT id, title, start_time, end_time, send_notify".$ADD1." FROM "._MYSQL_PREFIX."_rallye_data -WHERE is_active='Y' AND notified='N' AND expired='N' AND start_time <= ".time()." AND end_time > ".time()." +WHERE is_active='Y' AND notified='N' AND expired='N' AND start_time <= UNIX_TIMESTAMP() AND end_time > UNIX_TIMESTAMP() LIMIT 1", __FILE__, __LINE__); - if (SQL_NUMROWS($result) == 1) - { + if (SQL_NUMROWS($result) == 1) { // Start rallye RALLYE_AUTOSTART_RALLYES($result); - } + } // END - if // Free memory SQL_FREERESULT($result); @@ -334,7 +332,7 @@ LIMIT 1", __FILE__, __LINE__); // Check for expired rallyes $result = SQL_QUERY("SELECT SQL_SMALL_RESULT d.id, d.title, d.start_time, d.end_time, d.send_notify".$ADD2." FROM "._MYSQL_PREFIX."_rallye_data AS d -WHERE d.is_active='Y' AND d.notified='Y' AND d.expired='N' AND (d.end_time <= ".time()."".$OR.") +WHERE d.is_active='Y' AND d.notified='Y' AND d.expired='N' AND (d.end_time <= UNIX_TIMESTAMP()".$OR.") LIMIT 1", __FILE__, __LINE__); if ((SQL_NUMROWS($result) == 1) && (EXT_IS_ACTIVE("autopurge"))) { diff --git a/inc/language/rallye_de.php b/inc/language/rallye_de.php index 9a8dcfb893..59b58ab416 100644 --- a/inc/language/rallye_de.php +++ b/inc/language/rallye_de.php @@ -131,7 +131,7 @@ define('RALLYE_GET_REFLINK', "Jetzt dran teilnehmen!"); define('ADMIN_TASK_IS_RALLYE_EXPIRED', "Rallye wurde beendet"); define('ADMIN_TASK_IS_RALLYE_PURGED', "Rallye wurde gelöscht"); define('RALLYE_LIST_USERS', "Alle teilnehmenden Mitglieder auflisten."); -define('RALLYE_REF_POINTS_NOTE', "Die {!POINTS!} in der Spalte Verdienst durch Refs geben den Verdienst in erster Ebene vor der Rallye an und wird sich bis Ende der allye nicht verändern."); +define('RALLYE_REF_POINTS_NOTE', "Die {!POINTS!} in der Spalte Verdienst durch Refs geben den Verdienst in erster Ebene vor der Rallye an und wird sich bis Ende der Rallye nicht verändern."); define('RALLYE_MIN_USERS', "Gesamtzahl der Mitglieder, ab der Rallye automatisch endet."); define('RALLYE_MIN_PRICES', "Mindestens zu belegende Plätze"); define('RALLYE_MIN_USERS_MINI', "Mitgliederanzahl erreicht"); diff --git a/inc/libs/holiday_functions.php b/inc/libs/holiday_functions.php index f013ebeb21..d155341c3c 100644 --- a/inc/libs/holiday_functions.php +++ b/inc/libs/holiday_functions.php @@ -43,7 +43,7 @@ function HOLIDAY_STOP_HOLIDAYS() // Let's find some expired holiday requests... $result_stop = SQL_QUERY("SELECT userid, holiday_start, holiday_end, comments FROM "._MYSQL_PREFIX."_user_holidays -WHERE holiday_end <= ".time()." +WHERE holiday_end <= UNIX_TIMESTAMP() ORDER BY userid", __FILE__, __LINE__); if (SQL_NUMROWS($result_stop) > 0) { diff --git a/inc/modules/member/what-order.php b/inc/modules/member/what-order.php index 10eaf82772..62aec111c7 100644 --- a/inc/modules/member/what-order.php +++ b/inc/modules/member/what-order.php @@ -264,7 +264,7 @@ ORDER BY d.%s %s", { // Check for his holiday status $result_holiday = SQL_QUERY_ESC("SELECT id FROM "._MYSQL_PREFIX."_user_holidays -WHERE userid=%s AND holiday_start < ".time()." AND holiday_end > ".time()." LIMIT 1", +WHERE userid=%s AND holiday_start < UNIX_TIMESTAMP() AND holiday_end > UNIX_TIMESTAMP() LIMIT 1", array(bigintval($REC)), __FILE__, __LINE__); if (SQL_NUMROWS($result_holiday) == 1) $REC = 0; // Exclude user who are in holiday @@ -497,7 +497,7 @@ array( LEFT JOIN "._MYSQL_PREFIX."_user_holidays AS h ON d.userid=h.userid WHERE d.userid=%s AND d.receive_mails > 0 AND d.status='CONFIRMED' AND d.holiday_active='Y' -AND h.holiday_start < ".time()." AND h.holiday_end > ".time()." +AND h.holiday_start < UNIX_TIMESTAMP() AND h.holiday_end > UNIX_TIMESTAMP() LIMIT 1", array(bigintval($ucat)), __FILE__, __LINE__); if (SQL_NUMROWS($result_holiday) == 1) { diff --git a/inc/reset/reset_holiday.php b/inc/reset/reset_holiday.php index 45e8b9fd48..3fc5f67995 100644 --- a/inc/reset/reset_holiday.php +++ b/inc/reset/reset_holiday.php @@ -45,14 +45,14 @@ if (($CSS == 1) || ((!isBooleanConstantAndTrue('__DAILY_RESET')) && ($_CONFIG['h // Check for holidays we need to enable and send email to user $result_main = SQL_QUERY("SELECT userid, holiday_activated FROM "._MYSQL_PREFIX."_user_data -WHERE holiday_activated > 0 AND holiday_activated < ".time()." AND holiday_active='N' +WHERE holiday_activated > 0 AND holiday_activated < UNIX_TIMESTAMP() AND holiday_active='N' ORDER BY holiday_activated", __FILE__, __LINE__); if (SQL_NUMROWS($result_main) > 0) { // We have found at least one useraccount so let's check it... while(list($uid, $activated) = SQL_FETCHROW($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 <= ".time()." AND holiday_end > ".time()." LIMIT 1", +WHERE userid=%s AND holiday_start <= UNIX_TIMESTAMP() AND holiday_end > UNIX_TIMESTAMP() LIMIT 1", array(bigintval($uid)), __FILE__, __LINE__); if (SQL_NUMROWS($result_holiday) == 1) { diff --git a/templates/de/html/rallye/.htaccess b/templates/de/html/rallye/.htaccess new file mode 100644 index 0000000000..03688ee918 --- /dev/null +++ b/templates/de/html/rallye/.htaccess @@ -0,0 +1 @@ +Deny from all diff --git a/templates/de/html/rallye/rallye_test.tpl b/templates/de/html/rallye/rallye_test.tpl new file mode 100644 index 0000000000..d04e6c4d60 --- /dev/null +++ b/templates/de/html/rallye/rallye_test.tpl @@ -0,0 +1,3 @@ +Dieses Template heisst rallye_test.tpl.de, das Sie gerne weiter verwenden können:
+
+Speichern Sie eine Textdatei ab, die rallye_?????.tpl.de heissen muss. Anstelle der ? dann den Namen! diff --git a/templates/de/html/rallye_test.tpl b/templates/de/html/rallye_test.tpl deleted file mode 100644 index d04e6c4d60..0000000000 --- a/templates/de/html/rallye_test.tpl +++ /dev/null @@ -1,3 +0,0 @@ -Dieses Template heisst rallye_test.tpl.de, das Sie gerne weiter verwenden können:
-
-Speichern Sie eine Textdatei ab, die rallye_?????.tpl.de heissen muss. Anstelle der ? dann den Namen!