From: Roland Häder Date: Mon, 27 Jun 2011 15:52:10 +0000 (+0000) Subject: Renamed functions to make it more clear, ext-coupon continued: X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=03486c08011d4c233e2455c8e5335ecc0818333f;p=mailer.git Renamed functions to make it more clear, ext-coupon continued: - Extension ext-coupon continued: non-functional script added, template added - Renamed all someFooTimestamp() functions to someFooEpocheTime() to make it clear that the Uni* epoche time meant and not TIMESTAMP from MySQL - TODOs.txt updated --- diff --git a/.gitattributes b/.gitattributes index 527b1834db..4e793f2cf1 100644 --- a/.gitattributes +++ b/.gitattributes @@ -544,6 +544,7 @@ inc/modules/admin/what-repair_gmnu.php svneol=native#text/plain inc/modules/admin/what-repair_lang.php svneol=native#text/plain inc/modules/admin/what-repair_mmnu.php svneol=native#text/plain inc/modules/admin/what-send_bonus.php svneol=native#text/plain +inc/modules/admin/what-send_coupon.php svneol=native#text/plain inc/modules/admin/what-send_newsletter.php svneol=native#text/plain inc/modules/admin/what-stats_mods.php svneol=native#text/plain inc/modules/admin/what-sub_points.php svneol=native#text/plain @@ -1317,6 +1318,7 @@ templates/de/html/admin/admin_reset_password_form.tpl svneol=native#text/plain templates/de/html/admin/admin_reset_password_send_link.tpl svneol=native#text/plain templates/de/html/admin/admin_send_bonus_form.tpl svneol=native#text/plain templates/de/html/admin/admin_send_bonus_select.tpl svneol=native#text/plain +templates/de/html/admin/admin_send_coupon.tpl svneol=native#text/plain templates/de/html/admin/admin_send_reset_link.tpl svneol=native#text/plain templates/de/html/admin/admin_send_yoomedia.tpl svneol=native#text/plain templates/de/html/admin/admin_settings_saved.tpl svneol=native#text/plain diff --git a/DOCS/TODOs.txt b/DOCS/TODOs.txt index c1c290fe52..27afa7a1e4 100644 --- a/DOCS/TODOs.txt +++ b/DOCS/TODOs.txt @@ -47,13 +47,13 @@ ./inc/extensions-functions.php:567: // @TODO Extension is loaded, what next? ./inc/filter/bonus_filter.php:55: // @TODO This query isn't right, it will only update if the user was for a longer time away! ./inc/filter/cache_filter.php:78: // @TODO This should be rewritten not to load the cache file for just checking if it is there for save removal. -./inc/functions.php:1217: // @TODO Move this SQL code into a function, let's say 'getTimestampFromPoolId($id) ? -./inc/functions.php:1305: // @TODO Are these convertions still required? -./inc/functions.php:1323:// @TODO Rewrite this function to use readFromFile() and writeToFile() +./inc/functions.php:1219: // @TODO Move this SQL code into a function, let's say 'getTimestampFromPoolId($id) ? +./inc/functions.php:1307: // @TODO Are these convertions still required? +./inc/functions.php:1325:// @TODO Rewrite this function to use readFromFile() and writeToFile() ./inc/functions.php:163:// @TODO Rewrite this to an extension 'smtp' -./inc/functions.php:1905: // @TODO Find a way to cache this -./inc/functions.php:2006: // @TODO This is still very static, rewrite it somehow -./inc/functions.php:2186: // @TODO Rename column data_type to e.g. mail_status +./inc/functions.php:1907: // @TODO Find a way to cache this +./inc/functions.php:2008: // @TODO This is still very static, rewrite it somehow +./inc/functions.php:2188: // @TODO Rename column data_type to e.g. mail_status ./inc/functions.php:92: // @TODO Extension 'msg' does not exist ./inc/gen_sql_patches.php:95:// @TODO Rewrite this to a filter ./inc/install-functions.php:57: // @TODO DEACTIVATED: changeDataInLocalConfigurationFile('OUTPUT-MODE', "setConfigEntry('OUTPUT_MODE', '", "');", postRequestParameter('omode'), 0); @@ -113,7 +113,7 @@ ./inc/modules/admin/overview-inc.php:426: // @TODO Try to move this in includes ./inc/modules/admin/overview-inc.php:43:// @TODO This function does also check for uncompleted tasks ./inc/modules/admin/what-add_guestnl_cat.php:47: // @TODO Check if category does already exist -./inc/modules/admin/what-add_surfbar_url.php:55: // @TODO Find all convertSelectionsToTimestamp() calls and rewrite postRequestParameter() calls to $postData +./inc/modules/admin/what-add_surfbar_url.php:55: // @TODO Find all convertSelectionsToEpocheTime() calls and rewrite postRequestParameter() calls to $postData ./inc/modules/admin/what-admin_add.php:118: // @TODO This can be somehow rewritten to a function ./inc/modules/admin/what-admin_add.php:59: // @TODO Cant this be rewritten? ./inc/modules/admin/what-admin_add.php:75: // @TODO This can be somehow rewritten to a function diff --git a/inc/config-global.php b/inc/config-global.php index 8fa172f431..e4ad948336 100644 --- a/inc/config-global.php +++ b/inc/config-global.php @@ -107,6 +107,9 @@ setConfigEntry('DEBUG_TEMPLATE_CACHE', 'N'); // CFG: SALT-LENGTH setConfigEntry('salt_length', 10); +// CFG: MINIMUM-ADMIN-PASS-LENGTH +setConfigEntry('minium_admin_pass_length', 4); + // Connect to the database... loadIncludeOnce('inc/mysql-connect.php'); diff --git a/inc/extensions/ext-coupon.php b/inc/extensions/ext-coupon.php index c6b6a3e22a..ea480f402b 100644 --- a/inc/extensions/ext-coupon.php +++ b/inc/extensions/ext-coupon.php @@ -84,6 +84,9 @@ UNIQUE KEY (`coupon_code`) addConfigAddSql('coupon_default_time', 'BIGINT(20) NOT NULL DEFAULT ' . (getOneDay() * 7)); addConfigAddSql('coupon_default_points', 'FLOAT(20,5) NOT NULL DEFAULT 100.00000'); + // User data table + addExtensionSql("ALTER TABLE `{?_MYSQL_PREFIX?}_user_data` ADD `receiving_coupons` ENUM('Y','N') NOT NULL DEFAULT 'Y'"); + // Menu systems: // - Admin entries addAdminMenuSql('coupon', NULL, 'Gutscheine', 'Einrichten und Versenden von Code-Gutscheinen, sowie per API (noch in Planung). Bei Code-Gutscheinen wird ein Code pro Mitglied erzeugt, der dann an das Mitglied ausgesandt wird. Löst das Mitglied den Gutschein ein, erhält es die Gutschrift auf sein Konto gutgeschrieben. Ausgangseinstellung ist die Gutschrift auf das Werbeguthaben, was für Paidmailer von Wichtigkeit ist, dass Guthaben aus Gutscheinen nicht auszahlungsfähig ist.', 6); diff --git a/inc/filters.php b/inc/filters.php index fec9baeae0..079efbc60a 100644 --- a/inc/filters.php +++ b/inc/filters.php @@ -1073,7 +1073,7 @@ function FILTER_SET_CURRENT_DATE () { // Set current date setConfigEntry('CURRENT_DATE', generateDateTime(time(), '3')); - // Timestamp for yesterday, today ... all at 00:00 am + // Epoche time for yesterday, today ... all at 00:00 am setConfigEntry('START_YDAY', makeTime(0, 0, 0, time() - getOneDay())); setConfigEntry('START_TDAY', makeTime(0, 0, 0, time())); } diff --git a/inc/functions.php b/inc/functions.php index bc397426cf..1b9710bb80 100644 --- a/inc/functions.php +++ b/inc/functions.php @@ -717,7 +717,7 @@ function bigintval ($num, $castValue = true, $abortOnMismatch = true) { } // Creates a Uni* timestamp from given selection data and prefix -function createTimestampFromSelections ($prefix, $postData) { +function createEpocheTimeFromSelections ($prefix, $postData) { // Initial return value $ret = '0'; @@ -727,7 +727,9 @@ function createTimestampFromSelections ($prefix, $postData) { $M1 = getMonth(); // If so and if current time is before 02/29 and estimated time is after 02/29 then add 86400 seconds (one day) - if ((floor($TEST) == $TEST) && ($M1 == '02') && ($postData[$prefix . '_mo'] > '02')) $SWITCH = getOneDay(); + if ((floor($TEST) == $TEST) && ($M1 == '02') && ($postData[$prefix . '_mo'] > '02')) { + $SWITCH = getOneDay(); + } // END - if // First add years... $ret += $postData[$prefix . '_ye'] * (31536000 + $SWITCH); @@ -1458,7 +1460,7 @@ function handleExtraValues ($filterFunction, $value, $extraValue) { } // Converts timestamp selections into a timestamp -function convertSelectionsToTimestamp (&$postData, &$DATA, &$id, &$skip) { +function convertSelectionsToEpocheTime (array &$postData, array &$DATA, &$id, &$skip) { // Init test variable $skip = false; $test2 = ''; @@ -1472,7 +1474,7 @@ function convertSelectionsToTimestamp (&$postData, &$DATA, &$id, &$skip) { $test = substr($id, 0, -3); if ((isset($postData[$test.'_ye'])) && (isset($postData[$test.'_mo'])) && (isset($postData[$test.'_we'])) && (isset($postData[$test.'_da'])) && (isset($postData[$test.'_ho'])) && (isset($postData[$test.'_mi'])) && (isset($postData[$test.'_se'])) && ($test != $test2)) { // Generate timestamp - $postData[$test] = createTimestampFromSelections($test, $postData); + $postData[$test] = createEpocheTimeFromSelections($test, $postData); $DATA[] = sprintf("`%s`='%s'", $test, $postData[$test]); $GLOBALS['skip_config'][$test] = true; diff --git a/inc/language/coupon_de.php b/inc/language/coupon_de.php index f183ad4bfb..0c22a419d0 100644 --- a/inc/language/coupon_de.php +++ b/inc/language/coupon_de.php @@ -45,6 +45,13 @@ addMessages(array( 'ADMIN_CONFIG_COUPON_SETTINGS_TITLE' => "Allgemeine Einstellungen zu den Gutscheinen", 'ADMIN_CONFIG_COUPON_DEFAULT_TIME' => "Zeit, bis Gutscheine ablaufen sollen. Sie können diesen Ausgangswert beim Erstellen von neuen Gutscheinen nachträglich anpassen.", 'ADMIN_CONFIG_COUPON_DEFAULT_POINTS' => "Ausgangsvergütung in {?POINTS?}. Sie können diesen Ausgangswert beim Erstellen von neuen Gutscheinen nachträglich anpassen.", + 'ADMIN_SEND_COUPON_TITLE' => "Gutschein versenden (aktuell nur Code-Gutscheine)", + 'ADMIN_SEND_COUPON_EXPIRATION_TIME' => "Ablaufzeit (ab Versandzeitpunkt)", + 'ADMIN_SEND_COUPON_POINTS' => "Vergütung für eingelösten Gutschein", + 'ADMIN_SEND_COUPON_ENTER_DESCRIPTION' => "Kurzbeschreibung/Hinweis des Gutscheins", + 'ADMIN_SEND_COUPON' => "Gutschein versenden", + 'ADMIN_SEND_COUPON_POINTS_NOT_ENTERED' => "Bitte geben Sie eine Vergütung (in {?POINTS?}) ein.", + 'ADMIN_SEND_COUPON_DESCRIPTION_NOT_ENTERED' => "Bitte geben Sie eine kurze Beschreibung (oder einen Hinweis an Ihre Mitglieder) ein.", )); // [EOF] diff --git a/inc/language/de.php b/inc/language/de.php index a1a99a5586..734c2c3a9f 100644 --- a/inc/language/de.php +++ b/inc/language/de.php @@ -77,9 +77,9 @@ addMessages(array( 'ADMIN_NO_LOGIN' => "Sie haben keinen Loginnamen eingegeben.", 'ADMIN_NO_PASS1' => "Sie haben kein Passwort eingegeben.", 'ADMIN_NO_PASS2' => "Sie haben keine Passwortwiederholung eingegeben.", - 'ADMIN_SHORT_PASS1' => "Das Passwort ist zu kurz! Mindestens 4 Zeichen.", - 'ADMIN_SHORT_PASS2' => "Die Passwortwiederholung ist zu kurz! Mindestens 4 Zeichen.", - 'ADMIN_SHORT_PASS' => "Ihr Administratorpasswort ist zu kurz! Mindestens 4 Zeichen", + 'ADMIN_SHORT_PASS1' => "Das Passwort ist zu kurz! Mindestens {?minium_admin_pass_length?} Zeichen.", + 'ADMIN_SHORT_PASS2' => "Die Passwortwiederholung ist zu kurz! Mindestens {?minium_admin_pass_length?} Zeichen.", + 'ADMIN_SHORT_PASS' => "Ihr Administratorpasswort ist zu kurz! Mindestens {?minium_admin_pass_length?} Zeichen", 'ADMIN_PASS1_MISMATCH' => "Das Passwort stimmt nicht mit der Wiederholung überein.", 'ADMIN_PASS2_MISMATCH' => "Die Passwortwiederholung stimmt nicht mit dem Passwort überein.", 'ADMIN_LOGIN_ALREADY_REG' => "Das von Ihnen eingegebene Admin-Login existiert bereits.", @@ -92,7 +92,7 @@ addMessages(array( 'ENTER_ADMIN_PASS' => "Passwort zum Admin-Account", 'ADMIN_LOGIN_SUBMIT' => "Einloggen", 'WRONG_PASS' => "Falsches Passwort.", - 'ADMIN_ACCOUNT_404' => "Administrator-Account %s wurde nicht gefunden.", + 'ADMIN_ACCOUNT_404' => "Administrator-Account %s nicht gefunden. Bitte prüfen Sie Ihre Eingaben und versuchen Sie es erneut.", 'ADMIN_LOGIN_FAILED' => "Einloggen in den Administrator-Bereich fehlgeschlagen.", 'CANNOT_REGISTER_SESS' => "Konnte eine Sitzungsvariable nicht setzen! Vermutlich sind bei Ihnen Cookies deaktiviert.", 'SELECT_TIMEOUT' => "Gütigkeitsdauer des Auto-Logins", diff --git a/inc/libs/sponsor_functions.php b/inc/libs/sponsor_functions.php index b84281d787..6135e9108d 100644 --- a/inc/libs/sponsor_functions.php +++ b/inc/libs/sponsor_functions.php @@ -106,7 +106,7 @@ function handleSponsorRequest ($postData, $update=false, $messageArray=array(), default: // Test if there is are time selections - convertSelectionsToTimestamp($postData, $DATA, $k, $skip); + convertSelectionsToEpocheTime($postData, $DATA, $k, $skip); break; } // END - switch diff --git a/inc/libs/user_functions.php b/inc/libs/user_functions.php index 760bad363d..838c8db00f 100644 --- a/inc/libs/user_functions.php +++ b/inc/libs/user_functions.php @@ -475,7 +475,7 @@ function doNewUserPassword ($email, $userid) { } // Get timestamp for given stats type and data -function getTimestampFromUserStats ($statsType, $statsData, $userid = '0') { +function getEpocheTimeFromUserStats ($statsType, $statsData, $userid = '0') { // Default timestamp is zero $data['inserted'] = '0'; @@ -528,7 +528,7 @@ function insertUserStatsRecord ($userid, $statsType, $statsData) { } // END - if // Does it exist? - if ((!getTimestampFromUserStats($statsType, $statsData, $userid)) && (!is_array($statsData))) { + if ((!getEpocheTimeFromUserStats($statsType, $statsData, $userid)) && (!is_array($statsData))) { // Then insert it! SQL_QUERY_ESC("INSERT INTO `{?_MYSQL_PREFIX?}_user_stats_data` (`userid`,`stats_type`,`stats_data`) VALUES (%s,'%s','%s')", array( diff --git a/inc/modules/admin.php b/inc/modules/admin.php index aa379236ed..572888450f 100644 --- a/inc/modules/admin.php +++ b/inc/modules/admin.php @@ -52,7 +52,7 @@ $ret = 'init'; // Is no admin registered? if (!isAdminRegistered()) { // Admin is not registered so we have to inform the user - if ((isFormSent()) && ((!isPostRequestParameterSet('login')) || (!isPostRequestParameterSet('pass1')) || (strlen(postRequestParameter('pass1')) < 4) || (!isPostRequestParameterSet('pass2')) || (strlen(postRequestParameter('pass2')) < 4) || (postRequestParameter('pass1') != postRequestParameter('pass2')))) { + if ((isFormSent()) && ((!isPostRequestParameterSet('login')) || (!isPostRequestParameterSet('pass1')) || (strlen(postRequestParameter('pass1')) < getConfig('minium_admin_pass_length')) || (!isPostRequestParameterSet('pass2')) || (strlen(postRequestParameter('pass2')) < getConfig('minium_admin_pass_length')) || (postRequestParameter('pass1') != postRequestParameter('pass2')))) { setPostRequestParameter('ok', '***'); } // END - if @@ -147,14 +147,14 @@ if (!isAdminRegistered()) { // No password 1 entered or to short? if (!isPostRequestParameterSet('pass1')) { $pass1Message = '{--ADMIN_NO_PASS1--}'; - } elseif (strlen(postRequestParameter('pass1')) < 4) { + } elseif (strlen(postRequestParameter('pass1')) < getConfig('minium_admin_pass_length')) { $pass1Message = '{--ADMIN_SHORT_PASS1--}'; } // No password 2 entered or to short? if (!isPostRequestParameterSet('pass2')) { $pass2Message = '{--ADMIN_NO_PASS2--}'; - } elseif (strlen(postRequestParameter('pass2')) < 4) { + } elseif (strlen(postRequestParameter('pass2')) < getConfig('minium_admin_pass_length')) { $pass2Message = '{--ADMIN_SHORT_PASS2--}'; } @@ -233,7 +233,7 @@ if (!isAdminRegistered()) { } // END - if // Check if the admin has submitted data or not - if ((isFormSent()) && ((!isPostRequestParameterSet('login')) || (!isPostRequestParameterSet('password')) || (strlen(postRequestParameter('password')) < 4))) { + if ((isFormSent()) && ((!isPostRequestParameterSet('login')) || (!isPostRequestParameterSet('password')) || (strlen(postRequestParameter('password')) < getConfig('minium_admin_pass_length')))) { setPostRequestParameter('ok', '***'); } // END - if @@ -299,34 +299,34 @@ if (!isAdminRegistered()) { $loginMessage = ''; $passwdMessage = ''; - // No login entered? + // Check for login if (!isPostRequestParameterSet('login')) { + // No login entered? $loginMessage = '{--ADMIN_NO_LOGIN--}'; - } // END - if - - // An error comes back from login? - if ((!empty($ret)) && (postRequestParameter('ok') == '404')) { + } elseif ((!empty($ret)) && (postRequestParameter('ok') == '404')) { + // An error comes back from login? $loginMessage = $ret; - } // END - if + } - // No password entered? + // Check for password if (!isPostRequestParameterSet('password')) { + // No password entered? $passwdMessage = '{--ADMIN_NO_PASS--}'; - } // END - if - - // Or password too short? - if (strlen(postRequestParameter('password')) < 4) { + } elseif (strlen(postRequestParameter('password')) < getConfig('minium_admin_pass_length')) { + // Or password too short? $passwdMessage = '{--ADMIN_SHORT_PASS--}'; - } // END - if - - // An error comes back from login? - if ((!empty($ret)) && (postRequestParameter('ok') == 'password')) { + } elseif ((!empty($ret)) && (postRequestParameter('ok') == 'password')) { + // An error comes back from login? $passwdMessage = $ret; - } // END - if + } - // Load message template - $content['login_message'] = loadTemplate('admin_login_msg', true, $loginMessage); - $content['pass_message'] = loadTemplate('admin_login_msg', true, $passwdMessage); + // Load message templates if the messages have been set + if (!empty($loginMessage)) { + $content['login_message'] = loadTemplate('admin_login_msg', true, $loginMessage); + } // END - if + if (!empty($passwdMessage)) { + $content['pass_message'] = loadTemplate('admin_login_msg', true, $passwdMessage); + } // END - if } // END - if // Load login form diff --git a/inc/modules/admin/admin-inc.php b/inc/modules/admin/admin-inc.php index 4542f84670..96aaca29d9 100644 --- a/inc/modules/admin/admin-inc.php +++ b/inc/modules/admin/admin-inc.php @@ -489,7 +489,7 @@ function adminSaveSettings (&$postData, $tableName = '_config', $whereStatement // Process only formular field but not submit buttons ;) if ($id != 'ok') { // Do not save the ok value - convertSelectionsToTimestamp($postData, $tableData, $id, $skip); + convertSelectionsToEpocheTime($postData, $tableData, $id, $skip); // Shall we process this id? It muss not be empty, of course if (($skip === false) && (!empty($id)) && ((!isset($GLOBALS['skip_config'][$id]))) || ($tableName != '_config')) { diff --git a/inc/modules/admin/what-add_surfbar_url.php b/inc/modules/admin/what-add_surfbar_url.php index ba88edb47d..43d32d83b2 100644 --- a/inc/modules/admin/what-add_surfbar_url.php +++ b/inc/modules/admin/what-add_surfbar_url.php @@ -52,8 +52,8 @@ if ((isFormSent('add')) && (isPostRequestParameterSet('url'))) { $postData = postRequestArray(); // Convert the "reload selections" - // @TODO Find all convertSelectionsToTimestamp() calls and rewrite postRequestParameter() calls to $postData - convertSelectionsToTimestamp($postData, $DATA, $id, $skip); + // @TODO Find all convertSelectionsToEpocheTime() calls and rewrite postRequestParameter() calls to $postData + convertSelectionsToEpocheTime($postData, $DATA, $id, $skip); // Then add this URL if (SURFBAR_ADMIN_ADD_URL($postData['url'], $postData['limit'], $postData['reload'])) { diff --git a/inc/modules/admin/what-config_other.php b/inc/modules/admin/what-config_other.php index f013cb1ac1..84c277f5e7 100644 --- a/inc/modules/admin/what-config_other.php +++ b/inc/modules/admin/what-config_other.php @@ -52,11 +52,11 @@ if (!isExtensionActive('other')) { // Stop saving data if one input field is !isset if (isFormSent()) { // Calculate stamps and set calculated stamps - setPostRequestParameter('online_timeout' , createTimestampFromSelections('ip_timeout' , postRequestArray())); - setPostRequestParameter('url_tlock' , createTimestampFromSelections('url_tlock' , postRequestArray())); - setPostRequestParameter('profile_lock' , createTimestampFromSelections('profile_lock' , postRequestArray())); - setPostRequestParameter('profile_update' , createTimestampFromSelections('profile_update' , postRequestArray())); - setPostRequestParameter('resend_profile_update', createTimestampFromSelections('resend_profile_update', postRequestArray())); + setPostRequestParameter('online_timeout' , createEpocheTimeFromSelections('ip_timeout' , postRequestArray())); + setPostRequestParameter('url_tlock' , createEpocheTimeFromSelections('url_tlock' , postRequestArray())); + setPostRequestParameter('profile_lock' , createEpocheTimeFromSelections('profile_lock' , postRequestArray())); + setPostRequestParameter('profile_update' , createEpocheTimeFromSelections('profile_update' , postRequestArray())); + setPostRequestParameter('resend_profile_update', createEpocheTimeFromSelections('resend_profile_update', postRequestArray())); // Online-Timeout shall be > 0 or your database will crow and crow and crow... if (!isPostRequestParameterSet('online_timeout')) { unsetPostRequestParameter('ok'); } diff --git a/inc/modules/admin/what-config_register2.php b/inc/modules/admin/what-config_register2.php index 99ae08bd7d..0dc37b89fc 100644 --- a/inc/modules/admin/what-config_register2.php +++ b/inc/modules/admin/what-config_register2.php @@ -47,7 +47,7 @@ addYouAreHereLink('admin', __FILE__); if (isFormSent()) { // Calculate timestamp from selections... - setPostRequestParameter('ip_timeout', createTimestampFromSelections('ip_timeout', postRequestArray())); + setPostRequestParameter('ip_timeout', createEpocheTimeFromSelections('ip_timeout', postRequestArray())); setPostRequestParameter('least_cats', round(postRequestParameter('least_cats'))); // Save settings diff --git a/inc/modules/admin/what-edit_sponsor.php b/inc/modules/admin/what-edit_sponsor.php index d4e519a238..9df887c282 100644 --- a/inc/modules/admin/what-edit_sponsor.php +++ b/inc/modules/admin/what-edit_sponsor.php @@ -138,7 +138,7 @@ LIMIT 1", // Convert time selection $DATA = array(); $id = 'warning_interval_ye'; $skip = false; - convertSelectionsToTimestamp(postRequestArray(), $DATA, $id, $skip); + convertSelectionsToEpocheTime(postRequestArray(), $DATA, $id, $skip); // Save the sponsor handleSponsorRequest(postRequestArray()); diff --git a/inc/modules/admin/what-list_sponsor.php b/inc/modules/admin/what-list_sponsor.php index b762286c09..713c1219fd 100644 --- a/inc/modules/admin/what-list_sponsor.php +++ b/inc/modules/admin/what-list_sponsor.php @@ -74,7 +74,7 @@ WHERE $content['id'] = getRequestParameter('id'); // Contact data $content['email_link'] = generateEmailLink($content['email'], 'sponsor_data'); - // Timestamps + // Epoche times $content['sponsor_created'] = generateDateTime($content['sponsor_created'], 2); $content['last_online'] = generateDateTime($content['last_online'], 2); $content['last_change'] = generateDateTime($content['last_change'], 2); diff --git a/inc/modules/admin/what-send_bonus.php b/inc/modules/admin/what-send_bonus.php index 523f00c31b..20514fd4ac 100644 --- a/inc/modules/admin/what-send_bonus.php +++ b/inc/modules/admin/what-send_bonus.php @@ -48,19 +48,16 @@ if (!isExtensionActive('order')) { return; } // END - if -// Set empty mode to "select" -if (!isGetRequestParameterSet('mode')) setGetRequestParameter('mode', 'select'); +// 'mode' is not set by default +if (!isGetRequestParameterSet('mode')) { + // Set empty mode to "select" + setGetRequestParameter('mode', 'select'); +} // END - if if (isFormSent()) { // Deliver bonus mail addNewBonusMail(postRequestArray(), getRequestParameter('mode')); } else { - // Get all available users - $content['all'] = getRequestParameter('mode'); - - // Prepare option lines - $content['options_lines'] = getRequestParameter('mode'); - // Store send mode $content['mode'] = getRequestParameter('mode'); diff --git a/inc/modules/admin/what-send_coupon.php b/inc/modules/admin/what-send_coupon.php new file mode 100644 index 0000000000..2e4d66a2fc --- /dev/null +++ b/inc/modules/admin/what-send_coupon.php @@ -0,0 +1,67 @@ + diff --git a/inc/modules/member/what-unconfirmed.php b/inc/modules/member/what-unconfirmed.php index 2cad2b449d..65abc76504 100644 --- a/inc/modules/member/what-unconfirmed.php +++ b/inc/modules/member/what-unconfirmed.php @@ -69,7 +69,7 @@ LIMIT 1", if (isExtensionInstalled('user')) { // Get timestamp from insert $content['user_status'] = getMaskedMessage('MEMBER_MAIL_BONUS_CONFIRMED_ON', - generateDateTime(getTimestampFromUserStats('bonusid', $content['id']), 2) + generateDateTime(getEpocheTimeFromUserStats('bonusid', $content['id']), 2) ); } // END - if @@ -110,7 +110,7 @@ LIMIT 1", if (isExtensionInstalled('user')) { // Get timestamp from insert $content['user_status'] = getMaskedMessage('MEMBER_MAIL_NORMAL_CONFIRMED_ON', - generateDateTime(getTimestampFromUserStats('mailid', $content['id']), 2) + generateDateTime(getEpocheTimeFromUserStats('mailid', $content['id']), 2) ); } // END - if diff --git a/inc/wrapper-functions.php b/inc/wrapper-functions.php index 9b27b66fee..02c2e4c09d 100644 --- a/inc/wrapper-functions.php +++ b/inc/wrapper-functions.php @@ -1220,7 +1220,9 @@ function getYear ($timestamp = null) { // Is it cached? if (!isset($GLOBALS[__FUNCTION__][$timestamp])) { // null is time() - if (is_null($timestamp)) $timestamp = time(); + if (is_null($timestamp)) { + $timestamp = time(); + } // END - if // Then create it $GLOBALS[__FUNCTION__][$timestamp] = date('Y', $timestamp); diff --git a/templates/de/html/admin/admin_login_msg.tpl b/templates/de/html/admin/admin_login_msg.tpl index 8a7a59bf6b..51d09b2239 100644 --- a/templates/de/html/admin/admin_login_msg.tpl +++ b/templates/de/html/admin/admin_login_msg.tpl @@ -1,5 +1,5 @@ - + $content diff --git a/templates/de/html/admin/admin_send_bonus_form.tpl b/templates/de/html/admin/admin_send_bonus_form.tpl index c242354334..77206b71c2 100644 --- a/templates/de/html/admin/admin_send_bonus_form.tpl +++ b/templates/de/html/admin/admin_send_bonus_form.tpl @@ -7,8 +7,8 @@ diff --git a/templates/de/html/admin/admin_send_coupon.tpl b/templates/de/html/admin/admin_send_coupon.tpl new file mode 100644 index 0000000000..e077a0baa6 --- /dev/null +++ b/templates/de/html/admin/admin_send_coupon.tpl @@ -0,0 +1,36 @@ +
+
+ + + + + + + + + + + + + + + + + + + +
+ {--ADMIN_SEND_COUPON_TITLE--}: +
{--ADMIN_SEND_COUPON_EXPIRATION_TIME--}: + $content[coupon_default_time_selection] +
{--ADMIN_SEND_COUPON_POINTS--}: + + ({?POINTS?}) +
{--ADMIN_SEND_COUPON_ENTER_DESCRIPTION--}: + +
+
+