Mail templates for undelete in surfbar added
authorRoland Häder <roland@mxchange.org>
Thu, 27 Nov 2008 18:54:55 +0000 (18:54 +0000)
committerRoland Häder <roland@mxchange.org>
Thu, 27 Nov 2008 18:54:55 +0000 (18:54 +0000)
.gitattributes
inc/databases.php
inc/functions.php
inc/libs/surfbar_functions.php
inc/modules/admin/admin-inc.php
inc/mysql-manager.php
templates/de/emails/admin/admin_undelete_active_surfbar_urls.tpl [new file with mode: 0644]
templates/de/emails/member/member_undelete_active_surfbar_urls.tpl [new file with mode: 0644]

index d182a81d8651ea971791df70e87917056b85dd68..853b4870b9a10e9cf2601cb35fc93f3351e350cf 100644 (file)
@@ -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
index daceef46029f5c79d5e2bb4d9c36ed828f0f1210..4d01b2b34d89490703f4b1cb335f945d37427f63 100644 (file)
@@ -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);
index 70694e75c449baf8e4f3ef561bacd470588d5019..5a8a571579e5ef02b22f28984299b914590ac1cb 100644 (file)
@@ -1284,6 +1284,9 @@ function bigintval($num, $castValue = true) {
        // Has the whole value changed?
        if ("".$ret."" != "".$num."") {
                // Log the values
+               print("<pre>");
+               debug_print_backtrace();
+               die("</pre>");
                DEBUG_LOG(__FUNCTION__, __LINE__, " num={$num},ret={$ret}");
        } // END - if
 
index 2af19cbbb5d65f1779bdfae32f846e40a7be1766..7bef4431ce29075100aa8b753775dce5469ed24e 100644 (file)
@@ -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) {
index b05d960fdb23b8be770afed119aa3ce9f64b52b8..355d5ef93860ae1aad34aabbd63faa45f3c278b2 100644 (file)
@@ -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",
index 02eeb4f87c6a07152a723363ad7dd903672be6c9..158977bd0f260c604c04d9b0e1aefca6bad34394 100644 (file)
@@ -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 (file)
index 0000000..fdb7b67
--- /dev/null
@@ -0,0 +1,26 @@
+{--HELLO_ADMIN--},
+
+Es wurde eine zuvor gel&ouml;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 (file)
index 0000000..870ba79
--- /dev/null
@@ -0,0 +1,21 @@
+Hallo Mitglied,
+
+wir haben soeben Ihre zuvor gel&ouml;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!})