From acf8ab4b3e330097ad47bd28bc701cf6ccce63fb Mon Sep 17 00:00:00 2001 From: quix0r Date: Thu, 14 Jul 2011 18:53:55 +0000 Subject: [PATCH] Handled unconfirmed mails, renamed array index --- DOCS/TODOs.txt | 8 ++-- inc/language/de.php | 6 ++- inc/modules/member/what-unconfirmed.php | 38 ++++++++++++++----- .../html/member/member_mail_bonus_deleted.tpl | 2 +- .../de/html/member/member_mail_bonus_new.tpl | 2 +- .../html/member/member_mail_bonus_queue.tpl | 2 +- .../de/html/member/member_mail_bonus_send.tpl | 2 +- .../html/member/member_mail_normal_active.tpl | 2 +- .../html/member/member_mail_normal_admin.tpl | 2 +- .../member/member_mail_normal_deleted.tpl | 2 +- .../de/html/member/member_mail_normal_new.tpl | 2 +- .../html/member/member_mail_normal_send.tpl | 2 +- .../html/member/member_mail_normal_temp.tpl | 2 +- 13 files changed, 46 insertions(+), 26 deletions(-) diff --git a/DOCS/TODOs.txt b/DOCS/TODOs.txt index 9d532c7521..755bab4c48 100644 --- a/DOCS/TODOs.txt +++ b/DOCS/TODOs.txt @@ -54,8 +54,8 @@ ./inc/functions.php:2232: // @TODO Rename column data_type to e.g. mail_status ./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); -./inc/language/de.php:1065: // @TODO Rewrite these two constants -./inc/language/de.php:1081: // @TODO Rewrite these three constants +./inc/language/de.php:1067: // @TODO Rewrite these two constants +./inc/language/de.php:1083: // @TODO Rewrite these three constants ./inc/language/de.php:757:// @TODO Are these constants longer used? ./inc/language-functions.php:255: // @TODO These are all valid languages, again hard-coded ./inc/language-functions.php:44:// @TODO Rewrite all language constants to this function. @@ -165,8 +165,8 @@ ./inc/modules/member/what-rallyes.php:89: // @TODO Reactivate this: $content['admin'] = '' . $content['login'] . ''; ./inc/modules/member/what-reflinks.php:52:// @TODO Move this into a filter ./inc/modules/member/what-transfer.php:128: // @TODO Rewrite this to a filter -./inc/modules/member/what-unconfirmed.php:144: // @TODO Try to rewrite this to $content = SQL_FETCHARRAY() -./inc/modules/member/what-unconfirmed.php:209: // @TODO This 'userid' cannot be saved because of encapsulated EL code +./inc/modules/member/what-unconfirmed.php:162: // @TODO Try to rewrite this to $content = SQL_FETCHARRAY() +./inc/modules/member/what-unconfirmed.php:227: // @TODO This 'userid' cannot be saved because of encapsulated EL code ./inc/modules/order.php:74: // @TODO Unused: 2,4 ./inc/monthly/monthly_bonus.php:64: // @TODO Rewrite this to a filter ./inc/mysql-manager.php:1249: // @TODO Try to rewrite this to $content = SQL_FETCHARRAY() diff --git a/inc/language/de.php b/inc/language/de.php index 57b479d7f1..7e169ee047 100644 --- a/inc/language/de.php +++ b/inc/language/de.php @@ -439,7 +439,7 @@ addMessages(array( 'MEMBER_NO_MAILS_TO_CONFIRM' => "Keine Mails übrig zum Bestätigen.", 'MEMBER_SID' => "Mail-Id", 'CONFIRM_LINK' => "Bestätigungslink", - 'CONFIRM_LINK2' => "Best.link", + 'CONFIRM_LINK2' => "Bestätigen", 'MAIL_ALREADY_CONFIRMED' => "Mail bereits vergütet oder Link ist nicht mehr gültig.", 'MAIL_STATS_404' => "Konnte Daten aus der Statistik-Tabelle nicht laden.", 'USER_404' => "Mitgliedsdaten nicht gefunden! Sind Sie noch angemeldet?", @@ -1057,10 +1057,12 @@ addMessages(array( 'MEMBER_RANDOM_REFID_CONFIRMED' => "Anzahl Mails bestätigt, damit Ihr Account per Zufall selektiert wird", 'MEMBER_YOUR_REFID_IS' => "Sie wurden geworben von", - 'MEMBER_MAIL_BONUS_CONFIRMED_ON' => "Sie haben diese Bonusmail %s bestätigt.", + 'MEMBER_MAIL_BONUS_CONFIRMED_ON' => "Sie haben diese Bonusmail am|um %s bestätigt.", 'MEMBER_MAIL_BONUS_CONFIRMED_UNKNOWN' => "Es konnte nicht festgestellt werden, wann Sie die Bonus-Mail %s bestätigt hatten.", + 'MEMBER_MAIL_BONUS_NEVER_CONFIRMED' => "Sie haben diese Bonusmail %s noch nicht bestätigt.", 'MEMBER_MAIL_NORMAL_CONFIRMED_ON' => "Sie haben diese Klick-Mail %s bestätigt.", 'MEMBER_MAIL_NORMAL_CONFIRMED_UNKNOWN' => "Es konnte nicht festgestellt werden, wann Sie die Klick-Mail %s bestätigt hatten.", + 'MEMBER_MAIL_NORMAL_NEVER_CONFIRMED' => "Sie haben diese Klick-Mail %s noch nicht bestätigt.", // @TODO Rewrite these two constants 'MEMBER_MAIL_NORMAL_DETAILS_TITLE' => "Details zur Klick-Mail %s:", diff --git a/inc/modules/member/what-unconfirmed.php b/inc/modules/member/what-unconfirmed.php index b49e1031e2..af971c9247 100644 --- a/inc/modules/member/what-unconfirmed.php +++ b/inc/modules/member/what-unconfirmed.php @@ -67,14 +67,23 @@ LIMIT 1", $content = SQL_FETCHARRAY($result_data); // Translate some data - $content['timestamp'] = generateDateTime($content['timestamp'], 2); - $content['userid'] = getMemberId(); - $content['user_status'] = '{%message,MEMBER_MAIL_BONUS_CONFIRMED_UNKNOWN=' . $content['id'] . '%}'; + $content['timestamp'] = generateDateTime($content['timestamp'], '2'); + $content['userid'] = getMemberId(); + $content['user_mail_status'] = '{%message,MEMBER_MAIL_BONUS_CONFIRMED_UNKNOWN=' . $content['id'] . '%}'; // Is ext-user active? if (isExtensionActive('user')) { - // Get timestamp from insert - $content['user_status'] = '{%message,MEMBER_MAIL_BONUS_CONFIRMED_ON=' . generateDateTime(getEpocheTimeFromUserStats('bonusid', $content['id']), '2') . '%}'; + // Default is never confirmed + $content['user_mail_status'] = '{%message,MEMBER_MAIL_BONUS_NEVER_CONFIRMED=' . $content['id'] . '%}'; + + // Get the timestamp from the mail + $confirmedStamp = getEpocheTimeFromUserStats('bonusid', $content['id']); + + // Have confirmed it? + if ($confirmedStamp > 0) { + // Get timestamp from insert + $content['user_mail_status'] = '{%message,MEMBER_MAIL_BONUS_CONFIRMED_ON=' . generateDateTime($confirmedStamp, '2') . '%}'; + } // END - if } // END - if // Display it depending on mail (data) type @@ -106,14 +115,23 @@ LIMIT 1", $content = SQL_FETCHARRAY($result_data); // Translate some data - $content['timestamp'] = generateDateTime($content['timestamp'], '2'); - $content['userid'] = getMemberId(); - $content['user_status'] = '{%message,MEMBER_MAIL_NORMAL_CONFIRMED_UNKNOWN=' . $content['id'] . '%}'; + $content['timestamp'] = generateDateTime($content['timestamp'], '2'); + $content['userid'] = getMemberId(); + $content['user_mail_status'] = '{%message,MEMBER_MAIL_NORMAL_CONFIRMED_UNKNOWN=' . $content['id'] . '%}'; // Is ext-user active? if (isExtensionActive('user')) { - // Get timestamp from insert - $content['user_status'] = '{%message,MEMBER_MAIL_NORMAL_CONFIRMED_ON=' . generateDateTime(getEpocheTimeFromUserStats('mailid', $content['id']), '2') . '%}'; + // Default is never confirmed + $content['user_mail_status'] = '{%message,MEMBER_MAIL_NORMAL_NEVER_CONFIRMED=' . $content['id'] . '%}'; + + // Get the timestamp from the mail + $confirmedStamp = getEpocheTimeFromUserStats('mailid', $content['id']); + + // Have confirmed it? + if ($confirmedStamp > 0) { + // Get timestamp from insert + $content['user_mail_status'] = '{%message,MEMBER_MAIL_NORMAL_CONFIRMED_ON=' . generateDateTime($confirmedStamp, '2') . '%}'; + } // END - if } // END - if // Display it depending on mail (data) type diff --git a/templates/de/html/member/member_mail_bonus_deleted.tpl b/templates/de/html/member/member_mail_bonus_deleted.tpl index 304189033c..cdb2ed8268 100644 --- a/templates/de/html/member/member_mail_bonus_deleted.tpl +++ b/templates/de/html/member/member_mail_bonus_deleted.tpl @@ -58,7 +58,7 @@ - $content[user_status] + $content[user_mail_status] diff --git a/templates/de/html/member/member_mail_bonus_new.tpl b/templates/de/html/member/member_mail_bonus_new.tpl index 73b24057a4..b04b6ed99a 100644 --- a/templates/de/html/member/member_mail_bonus_new.tpl +++ b/templates/de/html/member/member_mail_bonus_new.tpl @@ -58,7 +58,7 @@ - $content[user_status] + $content[user_mail_status] diff --git a/templates/de/html/member/member_mail_bonus_queue.tpl b/templates/de/html/member/member_mail_bonus_queue.tpl index 45105f0cdb..649019f7c7 100644 --- a/templates/de/html/member/member_mail_bonus_queue.tpl +++ b/templates/de/html/member/member_mail_bonus_queue.tpl @@ -58,7 +58,7 @@ - $content[user_status] + $content[user_mail_status] diff --git a/templates/de/html/member/member_mail_bonus_send.tpl b/templates/de/html/member/member_mail_bonus_send.tpl index c230f69dc0..d0c361e7ed 100644 --- a/templates/de/html/member/member_mail_bonus_send.tpl +++ b/templates/de/html/member/member_mail_bonus_send.tpl @@ -60,7 +60,7 @@ - $content[user_status] + $content[user_mail_status] diff --git a/templates/de/html/member/member_mail_normal_active.tpl b/templates/de/html/member/member_mail_normal_active.tpl index e9a1d76729..e220da1ae3 100644 --- a/templates/de/html/member/member_mail_normal_active.tpl +++ b/templates/de/html/member/member_mail_normal_active.tpl @@ -52,7 +52,7 @@ - $content[user_status] + $content[user_mail_status] diff --git a/templates/de/html/member/member_mail_normal_admin.tpl b/templates/de/html/member/member_mail_normal_admin.tpl index 8f1dcb711a..39106dd2b8 100644 --- a/templates/de/html/member/member_mail_normal_admin.tpl +++ b/templates/de/html/member/member_mail_normal_admin.tpl @@ -52,7 +52,7 @@ - $content[user_status] + $content[user_mail_status] diff --git a/templates/de/html/member/member_mail_normal_deleted.tpl b/templates/de/html/member/member_mail_normal_deleted.tpl index bb3ed41be9..6a7937a071 100644 --- a/templates/de/html/member/member_mail_normal_deleted.tpl +++ b/templates/de/html/member/member_mail_normal_deleted.tpl @@ -52,7 +52,7 @@ - $content[user_status] + $content[user_mail_status] diff --git a/templates/de/html/member/member_mail_normal_new.tpl b/templates/de/html/member/member_mail_normal_new.tpl index 6615768709..3e8c523f74 100644 --- a/templates/de/html/member/member_mail_normal_new.tpl +++ b/templates/de/html/member/member_mail_normal_new.tpl @@ -52,7 +52,7 @@ - $content[user_status] + $content[user_mail_status] diff --git a/templates/de/html/member/member_mail_normal_send.tpl b/templates/de/html/member/member_mail_normal_send.tpl index 4c07de5d69..0a7480bc8d 100644 --- a/templates/de/html/member/member_mail_normal_send.tpl +++ b/templates/de/html/member/member_mail_normal_send.tpl @@ -54,7 +54,7 @@ - $content[user_status] + $content[user_mail_status] diff --git a/templates/de/html/member/member_mail_normal_temp.tpl b/templates/de/html/member/member_mail_normal_temp.tpl index 26e73c935e..51dda1c7a1 100644 --- a/templates/de/html/member/member_mail_normal_temp.tpl +++ b/templates/de/html/member/member_mail_normal_temp.tpl @@ -52,7 +52,7 @@ - $content[user_status] + $content[user_mail_status] -- 2.39.5