From: Roland Häder Date: Thu, 27 Nov 2008 18:54:55 +0000 (+0000) Subject: Mail templates for undelete in surfbar added X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=78815656dde7ad2e609f884f5778a5f421ff8621;p=mailer.git Mail templates for undelete in surfbar added --- diff --git a/.gitattributes b/.gitattributes index d182a81d86..853b4870b9 100644 --- a/.gitattributes +++ b/.gitattributes @@ -662,6 +662,7 @@ templates/de/emails/admin/admin_surfbar_url_rejected.tpl -text templates/de/emails/admin/admin_surfbar_url_unlock.tpl -text templates/de/emails/admin/admin_transfer_ap.tpl -text templates/de/emails/admin/admin_transfer_points.tpl -text +templates/de/emails/admin/admin_undelete_active_surfbar_urls.tpl -text templates/de/emails/admin/admin_wernis_request.tpl -text templates/de/emails/admins/.htaccess -text templates/de/emails/admins/admins_mail_contct_admin.tpl -text @@ -736,6 +737,7 @@ templates/de/emails/member/member_surfbar_url_rejected.tpl -text templates/de/emails/member/member_surfbar_url_unlock.tpl -text templates/de/emails/member/member_transfer_recipient.tpl -text templates/de/emails/member/member_transfer_sender.tpl -text +templates/de/emails/member/member_undelete_active_surfbar_urls.tpl -text templates/de/emails/member/member_wernis_accepted.tpl -text templates/de/emails/member/member_wernis_rejected.tpl -text templates/de/emails/member/member_wernis_request.tpl -text diff --git a/inc/databases.php b/inc/databases.php index daceef4602..4d01b2b34d 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', "562"); +define('CURR_SVN_REVISION', "563"); // Take a prime number which is long (if you know a longer one please try it out!) define('_PRIME', 591623); diff --git a/inc/functions.php b/inc/functions.php index 70694e75c4..5a8a571579 100644 --- a/inc/functions.php +++ b/inc/functions.php @@ -1284,6 +1284,9 @@ function bigintval($num, $castValue = true) { // Has the whole value changed? if ("".$ret."" != "".$num."") { // Log the values + print("
");
+		debug_print_backtrace();
+		die("
"); DEBUG_LOG(__FUNCTION__, __LINE__, " num={$num},ret={$ret}"); } // END - if diff --git a/inc/libs/surfbar_functions.php b/inc/libs/surfbar_functions.php index 2af19cbbb5..7bef4431ce 100644 --- a/inc/libs/surfbar_functions.php +++ b/inc/libs/surfbar_functions.php @@ -241,6 +241,7 @@ function SURFBAR_MEMBER_DO_FORM ($formData, $URLs) { } else { // Log invalid request DEBUG_LOG(__FUNCTION__, __LINE__, " action={$formData['action']},id={$formData['id']},function={$functionName}"); + ADD_FATAL(sprintf("Invalid member action! action=%s,id=%s,function=%s", $formData['action'], $formData['id'], $functionName)); } // Return status @@ -259,6 +260,7 @@ function SURFBAR_VALIDATE_MEMBER_ACTION_STATUS ($action, $status) { // Fetch the new status if found if ($isValid) { + // Load new status list($SURFBAR_CACHE['new_status']) = SQL_FETCHROW($result); } // END - if @@ -273,7 +275,7 @@ function SURFBAR_VALIDATE_MEMBER_ACTION_STATUS ($action, $status) { // Member actions // ----------------------------------------------------------------------------- // -// Retreat an URL +// Retreat a booked URL function SURFBAR_MEMBER_RETREAT_ACTION ($urlData) { // Create the data array for next function call $data = array( @@ -293,6 +295,40 @@ function SURFBAR_MEMBER_BOOKNOW_ACTION ($urlData) { // Simply change the status here return SURFBAR_CHANGE_STATUS ($urlData['id'], $urlData['status'], $urlData['new_status'], $data); } +// Show edit form or do the changes +function SURFBAR_MEMBER_EDIT_ACTION ($urlData) { + // Is the "execute" flag there? + if (isset($urlData['execute'])) { + // Execute the changes + return SURFBAR_MEMBER_EXECUTE_ACTION("edit", $urlData); + } // END - if + + // Display form + return SURFBAR_MEMBER_DISPLAY_ACTION_FORM("edit", $urlData); +} +// Show delete form or do the changes +function SURFBAR_MEMBER_DELETE_ACTION ($urlData) { + // Is the "execute" flag there? + if (isset($urlData['execute'])) { + // Execute the changes + return SURFBAR_MEMBER_EXECUTE_ACTION("del", $urlData); + } // END - if + + // Display form + return SURFBAR_MEMBER_DISPLAY_ACTION_FORM("del", $urlData); +} +// Display selected "action form" +function SURFBAR_MEMBER_DISPLAY_ACTION_FORM ($action, $urlData) { + // Translate some data + $urlData['registered'] = MAKE_DATETIME($urlData['registered'], "2"); + $urlData['views_total'] = TRANSLATE_COMMA($urlData['views_total']); + + // Load the form and display it + LOAD_TEMPLATE(sprintf("member_surfbar_%s_action_form", $action), false, $urlData); + + // All fine by default ... ;-) + return true; +} // // ----------------------------------------------------------------------------- // Self-maintenance functions @@ -541,10 +577,10 @@ function SURFBAR_TRANSLATE_STATUS ($status) { // Set default translated status $statusTranslated = "!".$constantName."!"; - // Generate eval() command + // Is the constant there? if (defined($constantName)) { - $eval = "\$statusTranslated = ".$constantName.";"; - eval($eval); + // Then get it's value + $statusTranslated = constant($constantName); } // END - if // Return result @@ -1014,7 +1050,8 @@ function SURFBAR_CHANGE_STATUS ($urlId, $prevStatus, $newStatus, $data=array()) global $_CONFIG; // Get URL data for status comparison if missing - if (count($data) == 0) { + if ((!is_array($data)) || (count($data) == 0)) { + // Fetch missing URL data $data = SURFBAR_GET_URL_DATA($urlId); } // END - if @@ -1026,10 +1063,10 @@ function SURFBAR_CHANGE_STATUS ($urlId, $prevStatus, $newStatus, $data=array()) // Update the status now - // ---------------------- Commented out for debugging member actions! ----------------------- + // ---------- Comment out for debugging/developing member actions! --------- //SQL_QUERY_ESC("UPDATE "._MYSQL_PREFIX."_surfbar_urls SET status='%s' WHERE id=%s LIMIT 1", // array($newStatus, bigintval($urlId)), __FILE__, __LINE__); - // ---------------------- Commented out for debugging member actions! ----------------------- + // ---------- Comment out for debugging/developing member actions! --------- // Was that fine? if (SQL_AFFECTEDROWS() != 1) { diff --git a/inc/modules/admin/admin-inc.php b/inc/modules/admin/admin-inc.php index b05d960fdb..355d5ef938 100644 --- a/inc/modules/admin/admin-inc.php +++ b/inc/modules/admin/admin-inc.php @@ -978,8 +978,8 @@ function ADMIN_BUILD_STATUS_HANDLER ($mode, $IDs, $table, $columns, $filterFunct // Add other columns as well foreach ($_POST as $key => $entries) { - // Skip id, raw userid and 'do_lock' - if (!in_array($key, array($idColumn, 'uid_raw', 'do_lock'))) { + // Skip id, raw userid and 'do_$mode' + if (!in_array($key, array($idColumn, 'uid_raw', ('do_'.$mode)))) { // Are there brackets () at the end? if (substr($entries[$id], -2, 2) == "()") { // Direct SQL command found @@ -989,7 +989,7 @@ function ADMIN_BUILD_STATUS_HANDLER ($mode, $IDs, $table, $columns, $filterFunct $SQL .= sprintf(" %s='%s',", SQL_ESCAPE($key), SQL_ESCAPE($entries[$id])); } } // END - if - } // END - if + } // END - foreach // Finish SQL statement $SQL = substr($SQL, 0, -1) . sprintf(" WHERE %s=%s AND %s='%s' LIMIT 1", diff --git a/inc/mysql-manager.php b/inc/mysql-manager.php index 02eeb4f87c..158977bd0f 100644 --- a/inc/mysql-manager.php +++ b/inc/mysql-manager.php @@ -1874,6 +1874,9 @@ function UPDATE_CONFIG ($entries, $values, $updateMode="") { if (($values[$idx] + 0) === $values[$idx]) { // Number detected $all .= sprintf("%s=%s,", $entry, (float)$values[$idx]); + } elseif ($values[$idx] == "UNIX_TIMESTAMP()") { + // Function UNIX_TIMESTAMP() detected + $all .= sprintf("%s=%s,", $entry, $values[$idx]); } else { // String detected $all .= sprintf("%s='%s',", $entry, SQL_ESCAPE($values[$idx])); diff --git a/templates/de/emails/admin/admin_undelete_active_surfbar_urls.tpl b/templates/de/emails/admin/admin_undelete_active_surfbar_urls.tpl new file mode 100644 index 0000000000..fdb7b672c0 --- /dev/null +++ b/templates/de/emails/admin/admin_undelete_active_surfbar_urls.tpl @@ -0,0 +1,26 @@ +{--HELLO_ADMIN--}, + +Es wurde eine zuvor gelöschte URL in der Surfbar wiederhergestellt. + +Hier sind alle dazu: +------------------------------------------ +URL: $content[url] +------------------------------------------ +Framekiller-Test: +$content[frametester] +------------------------------------------ +User-ID: $content[userid] +------------------------------------------ +Sperrgrund: $content[lock_reason] +------------------------------------------ +Letzte Sperrung: $content[last_locked] +------------------------------------------ +Angemeldet: $content[registered] +------------------------------------------ +ID in der Surfbar: $content[id] +------------------------------------------ + +{--ADMIN_THANX--} + {--YOUR--} {!MAIN_TITLE!} {--SCRIPT--} + +{!URL!}/admin.php diff --git a/templates/de/emails/member/member_undelete_active_surfbar_urls.tpl b/templates/de/emails/member/member_undelete_active_surfbar_urls.tpl new file mode 100644 index 0000000000..870ba79605 --- /dev/null +++ b/templates/de/emails/member/member_undelete_active_surfbar_urls.tpl @@ -0,0 +1,21 @@ +Hallo Mitglied, + +wir haben soeben Ihre zuvor gelöschte URL in der Surfbar wiederhergestellt. + +Hier sind alle Daten dazu: +------------------------------------------ +Gebuchte URL: $content[url] +------------------------------------------ +Sperrgrund: $content[lock_reason] +------------------------------------------ +Angemeldet: $content[registered] +------------------------------------------ +Ihre User-ID: $content[userid] +------------------------------------------ +ID in der Surfbar: $content[id] +------------------------------------------ + +Mit freundlichem Gruss, + Ihr {!MAIN_TITLE!} Team + +{!URL!}/login.php ({!WEBMASTER!})