]> git.mxchange.org Git - mailer.git/commitdiff
Generic lock/unlock added, surfbar only needs dynamic payment model
authorRoland Häder <roland@mxchange.org>
Fri, 12 Sep 2008 02:36:40 +0000 (02:36 +0000)
committerRoland Häder <roland@mxchange.org>
Fri, 12 Sep 2008 02:36:40 +0000 (02:36 +0000)
16 files changed:
.gitattributes
inc/databases.php
inc/functions.php
inc/language/surfbar_de.php
inc/modules/admin/admin-inc.php
inc/modules/admin/what-list_surfbar_urls.php
templates/de/emails/admin/admin_lock_confirmed_surfbar_urls.tpl [new file with mode: 0644]
templates/de/emails/admin/admin_lock_locked_surfbar_urls.tpl [new file with mode: 0644]
templates/de/emails/member/member_lock_confirmed_surfbar_urls.tpl [new file with mode: 0644]
templates/de/emails/member/member_lock_locked_surfbar_urls.tpl [new file with mode: 0644]
templates/de/html/admin/admin_del_surfbar_urls.tpl
templates/de/html/admin/admin_del_surfbar_urls_row.tpl
templates/de/html/admin/admin_list_surfbar_urls.tpl
templates/de/html/admin/admin_list_surfbar_urls_row.tpl
templates/de/html/admin/admin_lock_surfbar_urls.tpl [new file with mode: 0644]
templates/de/html/admin/admin_lock_surfbar_urls_row.tpl [new file with mode: 0644]

index e29c0e11d59715ace53316b66c6463994073c391..c58bab216ccbabf9aac69884324be52831353023 100644 (file)
@@ -595,6 +595,8 @@ templates/de/emails/admin/admin_edit_surfbar_urls.tpl -text
 templates/de/emails/admin/admin_holiday_deactivated.tpl -text
 templates/de/emails/admin/admin_holiday_request.tpl -text
 templates/de/emails/admin/admin_holiday_unlock.tpl -text
+templates/de/emails/admin/admin_lock_confirmed_surfbar_urls.tpl -text
+templates/de/emails/admin/admin_lock_locked_surfbar_urls.tpl -text
 templates/de/emails/admin/admin_mydata_notify.tpl -text
 templates/de/emails/admin/admin_new_ext.tpl -text
 templates/de/emails/admin/admin_newsletter_request.tpl -text
@@ -667,6 +669,8 @@ templates/de/emails/member/member_holiday_activated.tpl -text
 templates/de/emails/member/member_holiday_removed.tpl -text
 templates/de/emails/member/member_holiday_request.tpl -text
 templates/de/emails/member/member_holiday_unlock.tpl -text
+templates/de/emails/member/member_lock_confirmed_surfbar_urls.tpl -text
+templates/de/emails/member/member_lock_locked_surfbar_urls.tpl -text
 templates/de/emails/member/member_mydata_notify.tpl -text
 templates/de/emails/member/member_newsletter_done.tpl -text
 templates/de/emails/member/member_newsletter_request.tpl -text
@@ -960,6 +964,8 @@ templates/de/html/admin/admin_list_user_sort_form.tpl -text
 templates/de/html/admin/admin_list_wernis_main.tpl -text
 templates/de/html/admin/admin_list_wernis_row.tpl -text
 templates/de/html/admin/admin_lock_sponsor.tpl -text
+templates/de/html/admin/admin_lock_surfbar_urls.tpl -text
+templates/de/html/admin/admin_lock_surfbar_urls_row.tpl -text
 templates/de/html/admin/admin_lock_user.tpl -text
 templates/de/html/admin/admin_login_form.tpl -text
 templates/de/html/admin/admin_login_msg.tpl -text
index 3bdc5b46c9962a9a4a21b44e6d3321bee6475a7d..5c25e944ac0d56d8d54cd7c7a205ec07045279f7 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', "303");
+define('CURR_SVN_REVISION', "304");
 
 // Take a prime number which is long (if you know a longer one please try it out!)
 define('_PRIME', 591623);
index de2c08a4a07deeb568e4db45614a6c7dfda0a9a3..6484f86506c605f8010c22e206c570b431cd0c14 100644 (file)
@@ -860,6 +860,7 @@ function LOAD_EMAIL_TEMPLATE($template, $content="", $UID="0") {
        } // END - if
 
        // Now does the final template exists?
+       $newContent = "";
        if (FILE_READABLE($file)) {
                // The local file does exists so we load it. :)
                $tmpl_file = @implode("", @file($file));
@@ -887,6 +888,12 @@ function LOAD_EMAIL_TEMPLATE($template, $content="", $UID="0") {
                $newContent = NO_TEMPLATE_SUPPLIED;
        }
 
+       // Is there some content?
+       if (empty($newContent)) {
+               // Compiling failed
+               $newContent = "Compiler error for template {$template}!";
+       } // END - if
+
        // Return compiled content
        return COMPILE_CODE($newContent);
 }
index f7044edd66feba6a68cf0d1e403bd1d9bb691d8b..9ba208a397215fc8ee4d2590e461c737b2cb0e91 100644 (file)
@@ -70,6 +70,7 @@ define('ADMIN_SURFBAR_EDIT_URL_NOW', "URL jetzt &auml;ndern");
 define('ADMIN_SURFBAR_DEL_URL', "URL l&ouml;schen");
 define('ADMIN_SURFBAR_DEL_URL_NOW', "URLs jetzt entfernen");
 define('ADMIN_SURFBAR_UNLOCK_URL', "URL ent-/sperren");
+define('ADMIN_SURFBAR_LOCK_URL_NOW', "URL jetzt ent-/sperren");
 define('ADMIN_SURFBAR_CONFIRM_URL', "URL(s) freigeben");
 define('ADMIN_SURFBAR_UNLOCK_DONE', "Freischaltung ausgew&auml;hlter URL(s) vollst&auml;ndig. :-)");
 define('ADMIN_SURFBAR_UNLOCK_FAILED', "Freischaltung fehlgeschlagen. Bitte nachschauen, welche URLs nicht freigegeben wurden.");
@@ -78,9 +79,10 @@ define('ADMIN_SURFBAR_URL_NOT_ADDED', "URL wurde wegen Fehler nicht hinzugef&uum
 define('ADMIN_SURFBAR_ADD_URL', "URL hinzuf&uuml;gen");
 
 // Admin titles
-define('ADMIN_SURFBAR_LIST_URLS_TITLE', "URLs in Surfbar aufisten");
-define('ADMIN_SURFBAR_DELETE_URLS_TITLE', "URLs aus Surfbar entfernen");
-define('ADMIN_SURFBAR_EDIT_URLS_TITLE', "URLs editieren");
+define('ADMIN_SURFBAR_LIST_URLS_TITLE', "Surfbar - URLs aufisten");
+define('ADMIN_SURFBAR_DELETE_URLS_TITLE', "Surfbar - URLs entfernen");
+define('ADMIN_SURFBAR_EDIT_URLS_TITLE', "Surfbar - URLs editieren");
+define('ADMIN_SURFBAR_LOCK_URLS_TITLE', "Surfbar - URLs sperren/entsperren");
 
 // General member text
 define('MEMBER_SURFBAR_URL_ADDED', "URL hinzugef&uuml;gt und wartet auf Freischaltung.");
@@ -94,8 +96,10 @@ define('ADMIN_SURFBAR_NOTIFY_URL_REG_SUBJECT', "Mitglied hat URL in Surfbar gebu
 define('ADMIN_SURFBAR_NOTIFY_URL_CONFIRMED_SUBJECT', "URL in Surfbar freigegeben");
 
 // Auto-generated admin subject lines
-define('ADMIN_DEL_SURFBAR_URLS_SUBJECT', "URL aus Surfbar entfernt");
-define('ADMIN_EDIT_SURFBAR_URLS_SUBJECT', "URL in Surfbar ge&auml;ndert");
+define('ADMIN_DEL_SURFBAR_URLS_SUBJECT', "[Surfbar:] - URL entfernt");
+define('ADMIN_EDIT_SURFBAR_URLS_SUBJECT', "[Surfbar:] - URL ge&auml;ndert");
+define('ADMIN_CONFIRMED_SURFBAR_URLS_SUBJECT', "[Surfbar:] Freigabe einer URL");
+define('ADMIN_LOCKED_SURFBAR_URLS_SUBJECT', "[Surfbar:] Sperrung einer URL");
 
 // Subject lines for members
 define('MEMBER_SURFBAR_NOTIFY_URL_UNLOCK_SUBJECT', "Ihre URL wurde in die Surfbar aufgenommen");
@@ -105,6 +109,8 @@ define('MEMBER_SURFBAR_NOTIFY_URL_CONFIRMED_SUBJECT', "Ihre URL wurde f&uuml;r d
 // Auto-generated member subject lines
 define('MEMBER_DEL_SURFBAR_URLS_SUBJECT', "Ihre URL wurde aus der Surfbar entfernt");
 define('MEMBER_EDIT_SURFBAR_URLS_SUBJECT', "&Auml;nderung Ihrer URL in der Surfbar");
+define('MEMBER_LOCKED_SURFBAR_URLS_SUBJECT', "Sperrung Ihrer URL in Surfbar, bitte AGBs beachten!");
+define('MEMBER_CONFIRMED_SURFBAR_URLS_SUBJECT', "Freigabe Ihrer URL in Surfbar");
 
 // URL status
 define('SURFBAR_URL_STATUS_CONFIRMED', "Freigegeben");
index 078d9027d8fdddb6b14cd1019fbe6bc08d949eb4..e5800717542af3b059bd36bd067b66ea704afb78 100644 (file)
@@ -500,9 +500,9 @@ function ADD_MEMBER_SELECTION_BOX ($def="0", $add_all=false, $return=false, $non
         elseif ($none) $OUT = "      <OPTION value=\"0\">".SELECT_NONE."</OPTION>\n";
        while (list($id, $sname, $fname) = SQL_FETCHROW($result))
        {
-               $OUT .= "      <OPTION value=\"".$id."\"";
+               $OUT .= "      <OPTION value=\"".bigintval($id)."\"";
                if ($def == $id) $OUT .= " selected=\"selected\"";
-               $OUT .= ">".$sname." ".$fname." (".$id.")</OPTION>\n";
+               $OUT .= ">".$sname." ".$fname." (".bigintval($id).")</OPTION>\n";
        }
 
        // Free memory
@@ -765,6 +765,45 @@ function ADMIN_CHANGE_ACTIVATION_STATUS ($IDs, $table, $row, $idRow = "id") {
                LOAD_TEMPLATE("admin_settings_saved", false, ADMIN_NOTHING_SELECTED_CHANGE);
        }
 }
+// Send mails for del/edit/lock build modes
+function ADMIN_SEND_BUILD_MAILS ($mode, $table, $content, $id, $subjectPart="") {
+       // Default subject is the subject part
+       $subject = $subjectPart;
+
+       // Is the subject part not set?
+       if (empty($subjectPart)) {
+               // Then use it from the mode
+               $subject = strtoupper($mode);
+       } // END - if
+
+       // Is the raw userid set?
+       if ($_POST['uid_raw'][$id] > 0) {
+               // Generate subject
+               $eval = "\$subjectLine = MEMBER_".$subject."_".strtoupper($table)."_SUBJECT;";
+               eval($eval);
+
+               // Load email template
+               if (!empty($subjectPart)) {
+                       $mail = LOAD_EMAIL_TEMPLATE("member_".$mode."_".strtolower($subjectPart)."_".$table, $content);
+               } else {
+                       $mail = LOAD_EMAIL_TEMPLATE("member_".$mode."_".$table, $content);
+               }
+
+               // Send email out
+               SEND_EMAIL($_POST['uid_raw'][$id], $subjectLine, $mail);
+       } // END - if
+
+       // Generate subject
+       $eval = "\$subjectLine = ADMIN_".$subject."_".strtoupper($table)."_SUBJECT;";
+       eval($eval);
+
+       // Send admin notification out
+       if (!empty($subjectPart)) {
+               SEND_ADMIN_NOTIFICATION($subjectLine, "admin_".$mode."_".strtolower($subjectPart)."_".$table, $content, $_POST['uid_raw'][$id]);
+       } else {
+               SEND_ADMIN_NOTIFICATION($subjectLine, "admin_".$mode."_".$table, $content, $_POST['uid_raw'][$id]);
+       }
+}
 // Build a special template list
 function ADMIN_BUILD_LIST ($listType, $IDs, $table, $columns, $filterFunctions, $extraValues, $idColumn, $userIdColumn) {
        global $_CONFIG;
@@ -775,44 +814,41 @@ function ADMIN_BUILD_LIST ($listType, $IDs, $table, $columns, $filterFunctions,
                // Secure ID number
                $id = bigintval($id);
 
-               // Will always be 1 ;-)
-               if ($selected == 1) {
-                       // Get result from a given column array and table name
-                       $result = SQL_RESULT_FROM_ARRAY($table, $columns, $idColumn, $id);
-
-                       // Is there one entry?
-                       if (SQL_NUMROWS($result) == 1) {
-                               // Load all data
-                               $content = SQL_FETCHARRAY($result);
-
-                               // Filter all data
-                               foreach ($content as $key => $value) {
-                                       // Search index
-                                       $idx = array_search($key, $columns, true);
-
-                                       // Do we have a userid?
-                                       if ($key == "userid") {
-                                               // Add it again as raw id
-                                               $content['uid'] = bigintval($value);
-                                       } // END - if
+               // Get result from a given column array and table name
+               $result = SQL_RESULT_FROM_ARRAY($table, $columns, $idColumn, $id);
 
-                                       // Handle the call in external function
-                                       $content[$key] = HANDLE_EXTRA_VALUES($filterFunctions[$idx], $value, $extraValues[$idx]);
-                               } // END - foreach
+               // Is there one entry?
+               if (SQL_NUMROWS($result) == 1) {
+                       // Load all data
+                       $content = SQL_FETCHARRAY($result);
+
+                       // Filter all data
+                       foreach ($content as $key => $value) {
+                               // Search index
+                               $idx = array_search($key, $columns, true);
+
+                               // Do we have a userid?
+                               if ($key == "userid") {
+                                       // Add it again as raw id
+                                       $content['uid'] = bigintval($value);
+                               } // END - if
 
-                               // Add color switching
-                               $content['sw'] = $SW;
+                               // Handle the call in external function
+                               $content[$key] = HANDLE_EXTRA_VALUES($filterFunctions[$idx], $value, $extraValues[$idx]);
+                       } // END - foreach
 
-                               // Then list it
-                               $OUT .= LOAD_TEMPLATE("admin_".$listType."_".$table."_row", true, $content);
+                       // Add color switching
+                       $content['sw'] = $SW;
 
-                               // Switch color
-                               $SW = 3 - $SW;
-                       } // END - if
+                       // Then list it
+                       $OUT .= LOAD_TEMPLATE("admin_".$listType."_".$table."_row", true, $content);
 
-                       // Free the result
-                       SQL_FREERESULT($result);
+                       // Switch color
+                       $SW = 3 - $SW;
                } // END - if
+
+               // Free the result
+               SQL_FREERESULT($result);
        } // END - foreach
 
        // Load master template
@@ -829,7 +865,7 @@ function ADMIN_DELETE_ENTRIES_CONFIRM ($IDs, $table, $columns=array(), $filterFu
                        $idList = "";
                        foreach ($IDs as $id => $sel) {
                                // Is there a userid?
-                               if (isset($_POST['uid'][$id])) {
+                               if (isset($_POST['uid_raw'][$id])) {
                                        // Load all data from that id
                                        $result = SQL_QUERY_ESC("SELECT * FROM "._MYSQL_PREFIX."_%s WHERE %s=%s LIMIT 1",
                                                array($table, $idColumn, $id), __FILE__, __LINE__);
@@ -840,25 +876,8 @@ function ADMIN_DELETE_ENTRIES_CONFIRM ($IDs, $table, $columns=array(), $filterFu
                                        // Free the result
                                        SQL_FREERESULT($result);
 
-                                       // Do we have a *real* userid?
-                                       if ($_POST['uid'][$id] > 0) {
-                                               // Generate subject
-                                               $eval = "\$subject = MEMBER_DEL_".strtoupper($table)."_SUBJECT;";
-                                               eval($eval);
-
-                                               // Load email template
-                                               $mail = LOAD_EMAIL_TEMPLATE("member_del_".$table, $content);
-
-                                               // Send email out
-                                               SEND_EMAIL($_POST['uid'][$id], $subject, $mail);
-                                       } // END - if
-
-                                       // Generate subject
-                                       $eval = "\$subject = ADMIN_DEL_".strtoupper($table)."_SUBJECT;";
-                                       eval($eval);
-
-                                       // Send admin notification out
-                                       SEND_ADMIN_NOTIFICATION($subject, "admin_del_".$table, $content, $_POST['uid'][$id]);
+                                       // Send "build mails" out
+                                       ADMIN_SEND_BUILD_MAILS("del", $table, $content, $id);
                                } // END - if
 
                                // Add id number
@@ -930,7 +949,7 @@ function ADMIN_EDIT_ENTRIES_CONFIRM ($IDs, $table, $columns=array(), $filterFunc
                                                $content['frametester'] = FRAMETESTER($content[$key]);
                                        } // END - if
                                }
-                               $SQL = substr($SQL, 0, -1) . " WHERE ".$idColumn."=".$id." LIMIT 1";
+                               $SQL = substr($SQL, 0, -1) . " WHERE ".$idColumn."=".bigintval($id)." LIMIT 1";
 
                                // Run this query
                                SQL_QUERY($SQL, __FILE__, __LINE__);
@@ -949,25 +968,8 @@ function ADMIN_EDIT_ENTRIES_CONFIRM ($IDs, $table, $columns=array(), $filterFunc
                                // Free the result
                                SQL_FREERESULT($result);
 
-                               // Is a raw user id set?
-                               if ((isset($_POST['uid_raw'][$id])) && ($_POST['uid_raw'][$id] > 0)) {
-                                       // Generate subject
-                                       $eval = "\$subject = MEMBER_EDIT_".strtoupper($table)."_SUBJECT;";
-                                       eval($eval);
-
-                                       // Load email template
-                                       $mail = LOAD_EMAIL_TEMPLATE("member_edit_".$table, $content);
-
-                                       // Send email out
-                                       SEND_EMAIL($_POST['uid_raw'][$id], $subject, $mail);
-                               } // END  - if
-
-                               // Generate subject
-                               $eval = "\$subject = ADMIN_EDIT_".strtoupper($table)."_SUBJECT;";
-                               eval($eval);
-
-                               // Send admin notification out
-                               SEND_ADMIN_NOTIFICATION($subject, "admin_edit_".$table, $content, $_POST['uid_raw'][$id]);
+                               // Send "build mails" out
+                               ADMIN_SEND_BUILD_MAILS("edit", $table, $content, $id);
                        } // END - foreach
 
                        // Was this fine?
@@ -984,13 +986,90 @@ function ADMIN_EDIT_ENTRIES_CONFIRM ($IDs, $table, $columns=array(), $filterFunc
                }
        } // END - if
 }
+// Un-/lock rows by given ID numbers
+function ADMIN_LOCK_ENTRIES_CONFIRM ($IDs, $table, $columns=array(), $filterFunctions=array(), $extraValues=array(), $statusArray=array(), $lockNow=false, $idColumn="id", $userIdColumn="userid") {
+       // All valid entries? (We hope so here!)
+       if ((is_array($IDs)) && (count($IDs) > 0) && (count($columns) == count($filterFunctions)) && (count($columns) == count($extraValues)) && ((!$lockNow) || (count($statusArray) == 1))) {
+               // Shall we un-/lock here or list for locking?
+               if ($lockNow) {
+                       // Un-/lock entries
+                       foreach ($IDs as $id => $sel) {
+                               // Construct SQL query
+                               $SQL = "UPDATE "._MYSQL_PREFIX."_".$table." SET";
+
+                               // Load data of entry
+                               $result = SQL_QUERY_ESC("SELECT * FROM "._MYSQL_PREFIX."_%s WHERE %s=%s LIMIT 1",
+                                       array($table, $idColumn, $id), __FILE__, __LINE__);
+
+                               // Fetch the data
+                               $content = SQL_FETCHARRAY($result);
+
+                               // Free the result
+                               SQL_FREERESULT($result);
+
+                               // Add all status entries (e.g. status column last_updated or so)
+                               $newStatus = "UNKNOWN";
+                               $oldStatus = "UNKNOWN";
+                               $statusColumn = "unknown";
+                               foreach ($statusArray as $column => $statusInfo) {
+                                       // Does the entry exist?
+                                       if ((isset($content[$column])) && (isset($statusInfo[$content[$column]]))) {
+                                               // Add these entries for update
+                                               $SQL .= sprintf(" %s='%s',", SQL_ESCAPE($column), SQL_ESCAPE($statusInfo[$content[$column]]));
+
+                                               // Remember status
+                                               if ($statusColumn == "unknown") {
+                                                       // Always (!!!) change status column first!
+                                                       $oldStatus = $content[$column];
+                                                       $newStatus = $statusInfo[$oldStatus];
+                                                       $statusColumn = $column;
+                                               } // END - if
+                                       } elseif (isset($content[$column])) {
+                                               // Unfinished!
+                                               die("UNFINISHED: {$column}[".gettype($statusInfo)."] = {$content[$column]}");
+                                       }
+                               } // END - foreach
+
+                               // 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'))) {
+                                               // Are there brackets () at the end?
+                                               if (substr($entries[$id], -2, 2) == "()") {
+                                                       // Direct SQL command found
+                                                       $SQL .= sprintf(" %s=%s,", SQL_ESCAPE($key), SQL_ESCAPE($entries[$id]));
+                                               } else {
+                                                       // Add regular entry
+                                                       $SQL .= sprintf(" %s='%s',", SQL_ESCAPE($key), SQL_ESCAPE($entries[$id]));
+                                               }
+                                       } // END - if
+                               } // END - if
+
+                               // Finish SQL statement
+                               $SQL = substr($SQL, 0, -1) . " WHERE ".$idColumn."=".bigintval($id)." AND ".$statusColumn."='".$oldStatus."' LIMIT 1";
+
+                               // Run the SQL
+                               SQL_QUERY($SQL, __FILE__, __LINE__);
+
+                               // Do we have an URL?
+                               if (isset($content['url'])) {
+                                       // Then add a framekiller test as well
+                                       $content['frametester'] = FRAMETESTER($content['url']);
+                               } // END - if
+
+                               // Send "build mails" out
+                               ADMIN_SEND_BUILD_MAILS("lock", $table, $content, $id, $statusInfo[$content[$column]]);
+                       } // END - if
+               } else {
+                       // List for editing
+                       ADMIN_BUILD_LIST("lock", $IDs, $table, $columns, $filterFunctions, $extraValues, $idColumn, $userIdColumn);
+               }
+       } // END - if
+}
 // Checks proxy settins by fetching check-updates3.php from www.mxchange.org
 function ADMIN_TEST_PROXY_SETTINGS ($settingsArray) {
        global $_CONFIG;
 
-       // By default they are invalid
-       $valid = false;
-
        // Set temporary the new settings
        $_CONFIG = array_merge($_CONFIG, $settingsArray);
 
index 3b8f7b7afc8f5626d740e83cc4eeb876be704146..2bf0cf53b3ce17ada976966fcd30d6440105de52 100644 (file)
@@ -45,7 +45,7 @@ $show = true;
 
 // Edit or delete button hit?
 if (isset($_POST['edit'])) {
-       // Delete entries (with confirmation)
+       // Show entries for editing
        ADMIN_EDIT_ENTRIES_CONFIRM(
                $_POST['id'],
                "surfbar_urls",
@@ -55,7 +55,7 @@ if (isset($_POST['edit'])) {
        );
        $show = false;
 } elseif (isset($_POST['do_edit'])) {
-       // Delete entries (with confirmation)
+       // Change data of entries
        ADMIN_EDIT_ENTRIES_CONFIRM(
                $_POST['id'],
                "surfbar_urls",
@@ -65,12 +65,39 @@ if (isset($_POST['edit'])) {
                true
        );
 } elseif (isset($_POST['delete'])) {
-       // Delete entries (with confirmation)
-       ADMIN_DELETE_ENTRIES_CONFIRM($_POST['id'], "surfbar_urls", array("id", "userid", "url", "registered"), array("bigintval", "ADMIN_USER_PROFILE_LINK", "FRAMETESTER", "MAKE_DATETIME"), array("", "", "", "2"));
+       // Show entries for deletion
+       ADMIN_DELETE_ENTRIES_CONFIRM(
+               $_POST['id'],
+               "surfbar_urls",
+               array("id", "userid", "url", "registered"),
+               array("bigintval", "ADMIN_USER_PROFILE_LINK", "FRAMETESTER", "MAKE_DATETIME"),
+               array("", "", "", "2")
+       );
        $show = false;
-} elseif (isset($_POST['remove'])) {
-       // Delete entries (with confirmation)
+} elseif (isset($_POST['do_delete'])) {
+       // Remove entries from database
        ADMIN_DELETE_ENTRIES_CONFIRM($_POST['id'], "surfbar_urls", array(), array(), array(), true);
+} elseif (isset($_POST['lock'])) {
+       // Un-/lock selected URLs. This does not work for pending URLs
+       ADMIN_LOCK_ENTRIES_CONFIRM(
+               $_POST['id'],
+               "surfbar_urls",
+               array("id", "userid", "url", "registered", "status"),
+               array("bigintval", "ADMIN_USER_PROFILE_LINK", "FRAMETESTER", "MAKE_DATETIME", "SURFBAR_TRANSLATE_STATUS"),
+               array("", "", "", "2", "")
+       );
+       $show = false;
+} elseif (isset($_POST['do_lock'])) {
+       // Un-/lock selected URLs. This does not work for pending URLs
+       ADMIN_LOCK_ENTRIES_CONFIRM(
+               $_POST['id'],
+               "surfbar_urls",
+               array(),
+               array(),
+               array(),
+               array("status" => array("CONFIRMED" => "LOCKED", "LOCKED" => "CONFIRMED")),
+               true
+       );
 }
 
 // Show entries?
diff --git a/templates/de/emails/admin/admin_lock_confirmed_surfbar_urls.tpl b/templates/de/emails/admin/admin_lock_confirmed_surfbar_urls.tpl
new file mode 100644 (file)
index 0000000..492b03a
--- /dev/null
@@ -0,0 +1,30 @@
+{--HELLO_ADMIN--},
+
+Es wurde eine URL in der Surfbar freigegeben.
+
+Hier sind alle dazu:
+------------------------------------------
+URL: $content[url]
+------------------------------------------
+Framekiller-Test:
+$content[frametester]
+------------------------------------------
+User-ID: $content[userid]
+------------------------------------------
+Kosten/Aufruf: $content[costs] {!POINTS!}
+------------------------------------------
+Verg&uuml;tung/Aufruf: $content[reward] {!POINTS!}
+------------------------------------------
+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/admin/admin_lock_locked_surfbar_urls.tpl b/templates/de/emails/admin/admin_lock_locked_surfbar_urls.tpl
new file mode 100644 (file)
index 0000000..c1db519
--- /dev/null
@@ -0,0 +1,30 @@
+{--HELLO_ADMIN--},
+
+Es wurde eine URL in der Surfbar gesperrt.
+
+Hier sind alle dazu:
+------------------------------------------
+URL: $content[url]
+------------------------------------------
+Framekiller-Test:
+$content[frametester]
+------------------------------------------
+User-ID: $content[userid]
+------------------------------------------
+Kosten/Aufruf: $content[costs] {!POINTS!}
+------------------------------------------
+Verg&uuml;tung/Aufruf: $content[reward] {!POINTS!}
+------------------------------------------
+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_lock_confirmed_surfbar_urls.tpl b/templates/de/emails/member/member_lock_confirmed_surfbar_urls.tpl
new file mode 100644 (file)
index 0000000..40dd9a7
--- /dev/null
@@ -0,0 +1,19 @@
+Hallo Mitglied,
+
+wir haben soeben Ihre URL in der Surfbar wieder freigegeben.
+
+Hier sind alle Daten dazu:
+------------------------------------------
+Gebuchte URL: $content[url]
+------------------------------------------
+Angemeldet: $content[registered]
+------------------------------------------
+Ihre User-ID: $content[userid]
+------------------------------------------
+ID in der Surfbar: $content[id]
+------------------------------------------
+
+Mit freundlichem Gruss,
+  Ihr {!MAIN_TITLE!} Team
+
+{!URL!} ({!WEBMASTER!})
diff --git a/templates/de/emails/member/member_lock_locked_surfbar_urls.tpl b/templates/de/emails/member/member_lock_locked_surfbar_urls.tpl
new file mode 100644 (file)
index 0000000..b66ef33
--- /dev/null
@@ -0,0 +1,21 @@
+Hallo Mitglied,
+
+wir haben soeben Ihre URL in der Surfbar sperren m&uuml;ssen. Bitte halten Sie unsere AGBs ein!
+
+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!} ({!WEBMASTER!})
index 69889a4040a1194b2e3357b01bb6402d760afeea..a8c5dbb481e3b14d1aef674716b362ef9d4473b4 100644 (file)
@@ -1,21 +1,21 @@
-<FORM action="{!URL!}/modules.php?module=admin&amp;what=list_surfbar_urls" method="POST">
-<TABLE border="0" cellspacing="0" cellpadding="0" class="admin_table dashed">
-<TR>
-       <TD align="center" colspan="3" class="admin_title" height="30">
-               <STRONG>{--ADMIN_SURFBAR_DELETE_URLS_TITLE--}</STRONG>
-       </TD>
-</TR>
-<TR>
-       <TD class="admin_title bottom2 right2" align="center"><STRONG>{--_UID--}</STRONG></TD>
-       <TD class="admin_title bottom2 right2" align="center"><STRONG>{--ADMIN_TEST_URL--}</STRONG></TD>
-       <TD class="admin_title bottom2" align="center"><STRONG>{--ADMIN_SURFBAR_REGISTERED--}</STRONG></TD>
-</TR>
+<form action="{!URL!}/modules.php?module=admin&amp;what=list_surfbar_urls" method="POST">
+<table border="0" cellspacing="0" cellpadding="0" class="admin_table dashed">
+<tr>
+       <td align="center" colspan="3" class="admin_title" height="30">
+               <strong>{--ADMIN_SURFBAR_DELETE_URLS_TITLE--}</strong>
+       </td>
+</tr>
+<tr>
+       <td class="admin_title bottom2 right2" align="center"><strong>{--_UID--}</strong></td>
+       <td class="admin_title bottom2 right2" align="center"><strong>{--ADMIN_TEST_URL--}</strong></td>
+       <td class="admin_title bottom2" align="center"><strong>{--ADMIN_SURFBAR_REGISTERED--}</strong></td>
+</tr>
 $content
-<TR>
-       <TD class="admin_footer" colspan="3">
-               <INPUT type="reset" class="admin_reset" value="{--UNDO_SELECTIONS--}">&nbsp;*
-               <INPUT type="submit" name="remove" class="admin_delete" value="{--ADMIN_SURFBAR_DEL_URL_NOW--}">
-       </TD>
-</TR>
-</TABLE>
-</FORM>
+<tr>
+       <td class="admin_footer" colspan="3">
+               <input type="reset" class="admin_reset" value="{--UNDO_SELECTIONS--}">&nbsp;*
+               <input type="submit" name="do_delete" class="admin_delete" value="{--ADMIN_SURFBAR_DEL_URL_NOW--}">
+       </td>
+</tr>
+</table>
+</form>
index c9b466f8abe8f68651b64a17318bf5019a105e1d..0d5ddbec772c27b129e98359ab8d90632986d1bf 100644 (file)
@@ -1,7 +1,7 @@
 <TR>
        <TD align="center" class="bottom2 right2 switch_sw$content[sw]">
                <INPUT type="hidden" name="id[$content[id]]" value="1" />
-               <INPUT type="hidden" name="uid[$content[id]]" value="$content[uid]" />
+               <INPUT type="hidden" name="uid_raw[$content[id]]" value="$content[uid]" />
                $content[userid]
        </TD>
        <TD align="center" class="bottom2 right2 switch_sw$content[sw]">
index 81058d7a7d33be62bec1ba98695df2770794ffc3..71fb5748d58bb310ea12ebffea20ef0249a45b48 100644 (file)
@@ -1,30 +1,30 @@
-<FORM action="{!URL!}/modules.php?module=admin&amp;what=list_surfbar_urls" method="POST">
-<TABLE border="0" cellspacing="0" cellpadding="0" class="admin_table dashed">
-<TR>
-       <TD align="center" colspan="10" class="admin_title" height="30">
-               <STRONG>{--ADMIN_SURFBAR_LIST_URLS_TITLE--}</STRONG>
-       </TD>
-</TR>
-<TR>
-       <TD class="admin_title bottom2 right2" align="center"><STRONG>{--ID_SELECT--}</STRONG></TD>
-       <TD class="admin_title bottom2 right2" align="center"><STRONG>{--_UID--}</STRONG></TD>
-       <TD class="admin_title bottom2 right2" align="center"><STRONG>{--ADMIN_TEST_URL--}</STRONG></TD>
-       <TD class="admin_title bottom2 right2" align="center"><STRONG>{--ADMIN_SURFBAR_REWARD--}</STRONG></TD>
-       <TD class="admin_title bottom2 right2" align="center"><STRONG>{--ADMIN_SURFBAR_COSTS--}</STRONG></TD>
-       <TD class="admin_title bottom2 right2" align="center"><STRONG>{--ADMIN_SURFBAR_VIEWS_TOTAL--}</STRONG></TD>
-       <TD class="admin_title bottom2 right2" align="center"><STRONG>{--ADMIN_SURFBAR_STATUS--}</STRONG></TD>
-       <TD class="admin_title bottom2 right2" align="center"><STRONG>{--ADMIN_SURFBAR_REGISTERED--}</STRONG></TD>
-       <TD class="admin_title bottom2 right2" align="center"><STRONG>{--ADMIN_SURFBAR_LAST_LOCKED--}</STRONG></TD>
-       <TD class="admin_title bottom2" align="center"><STRONG>{--ADMIN_SURFBAR_LOCK_REASON--}</STRONG></TD>
-</TR>
+<form action="{!URL!}/modules.php?module=admin&amp;what=list_surfbar_urls" method="POST">
+<table border="0" cellspacing="0" cellpadding="0" class="admin_table dashed">
+<tr>
+       <td align="center" colspan="10" class="admin_title" height="30">
+               <strong>{--ADMIN_SURFBAR_LIST_URLS_TITLE--}</strong>
+       </td>
+</tr>
+<tr>
+       <td class="admin_title bottom2 right2" align="center"><strong>{--ID_SELECT--}</strong></td>
+       <td class="admin_title bottom2 right2" align="center"><strong>{--_UID--}</strong></td>
+       <td class="admin_title bottom2 right2" align="center"><strong>{--ADMIN_TEST_URL--}</strong></td>
+       <td class="admin_title bottom2 right2" align="center"><strong>{--ADMIN_SURFBAR_REWARD--}</strong></td>
+       <td class="admin_title bottom2 right2" align="center"><strong>{--ADMIN_SURFBAR_COSTS--}</strong></td>
+       <td class="admin_title bottom2 right2" align="center"><strong>{--ADMIN_SURFBAR_VIEWS_TOTAL--}</strong></td>
+       <td class="admin_title bottom2 right2" align="center"><strong>{--ADMIN_SURFBAR_STATUS--}</strong></td>
+       <td class="admin_title bottom2 right2" align="center"><strong>{--ADMIN_SURFBAR_REGISTERED--}</strong></td>
+       <td class="admin_title bottom2 right2" align="center"><strong>{--ADMIN_SURFBAR_LAST_LOCKED--}</strong></td>
+       <td class="admin_title bottom2" align="center"><strong>{--ADMIN_SURFBAR_LOCK_REASON--}</strong></td>
+</tr>
 $content
-<TR>
-       <TD class="admin_footer" colspan="10">
-               <INPUT type="reset" class="admin_reset" value="{--UNDO_SELECTIONS--}">&nbsp;*
-               <INPUT type="submit" name="edit" class="admin_submit" value="{--ADMIN_SURFBAR_EDIT_URL--}">&nbsp;*
-               <INPUT type="submit" name="lock" class="admin_submit" value="{--ADMIN_SURFBAR_UNLOCK_URL--}">&nbsp;*
-               <INPUT type="submit" name="delete" class="admin_delete" value="{--ADMIN_SURFBAR_DEL_URL--}">
-       </TD>
-</TR>
-</TABLE>
-</FORM>
+<tr>
+       <td class="admin_footer" colspan="10">
+               <input type="reset" class="admin_reset" value="{--UNDO_SELECTIONS--}">&nbsp;*
+               <input type="submit" name="edit" class="admin_submit" value="{--ADMIN_SURFBAR_EDIT_URL--}">&nbsp;*
+               <input type="submit" name="lock" class="admin_submit" value="{--ADMIN_SURFBAR_UNLOCK_URL--}">&nbsp;*
+               <input type="submit" name="delete" class="admin_delete" value="{--ADMIN_SURFBAR_DEL_URL--}">
+       </td>
+</tr>
+</table>
+</form>
index 4ef9670913e5a53e97cfdd3ec69a1d6ff324f053..28937a767b2425e3766355576852ef77b3116421 100644 (file)
@@ -1,32 +1,32 @@
-<TR>
-       <TD align="center" class="bottom2 right2 switch_sw$content[sw]">
-               <INPUT type="checkbox" name="id[$content[id]]" value="1" class="admin_normal" />
-       </TD>
-       <TD align="center" class="bottom2 right2 switch_sw$content[sw]">
+<tr>
+       <td align="center" class="bottom2 right2 switch_sw$content[sw]">
+               <input type="checkbox" name="id[$content[id]]" value="1" class="admin_normal" />
+       </td>
+       <td align="center" class="bottom2 right2 switch_sw$content[sw]">
                $content[userid]
-       </TD>
-       <TD align="center" class="bottom2 right2 switch_sw$content[sw]">
+       </td>
+       <td align="center" class="bottom2 right2 switch_sw$content[sw]">
                <a href="$content[url]" target="_blank" title="{--ADMIN_TEST_URL--}">{--ADMIN_TEST_URL--}</a>
-       </TD>
-       <TD align="center" class="bottom2 right2 switch_sw$content[sw]">
+       </td>
+       <td align="center" class="bottom2 right2 switch_sw$content[sw]">
                $content[reward] {!POINTS!}
-       </TD>
-       <TD align="center" class="bottom2 right2 switch_sw$content[sw]">
+       </td>
+       <td align="center" class="bottom2 right2 switch_sw$content[sw]">
                $content[costs] {!POINTS!}
-       </TD>
-       <TD align="center" class="bottom2 right2 switch_sw$content[sw]">
+       </td>
+       <td align="center" class="bottom2 right2 switch_sw$content[sw]">
                <a href="{!URL!}/modules.php?module=admin&amp;what=surfbar_stats&amp;url_id=$content[id]">$content[views_total]</a>
-       </TD>
-       <TD align="center" class="bottom2 right2 switch_sw$content[sw]">
+       </td>
+       <td align="center" class="bottom2 right2 switch_sw$content[sw]">
                $content[status]
-       </TD>
-       <TD align="center" class="bottom2 right2 switch_sw$content[sw]">
+       </td>
+       <td align="center" class="bottom2 right2 switch_sw$content[sw]">
                $content[registered]
-       </TD>
-       <TD align="center" class="bottom2 right2 switch_sw$content[sw]">
+       </td>
+       <td align="center" class="bottom2 right2 switch_sw$content[sw]">
                $content[last_locked]
-       </TD>
-       <TD align="center" class="bottom2 switch_sw$content[sw]">
+       </td>
+       <td align="center" class="bottom2 switch_sw$content[sw]">
                $content[lock_reason]
-       </TD>
-</TR>
+       </td>
+</tr>
diff --git a/templates/de/html/admin/admin_lock_surfbar_urls.tpl b/templates/de/html/admin/admin_lock_surfbar_urls.tpl
new file mode 100644 (file)
index 0000000..5018801
--- /dev/null
@@ -0,0 +1,23 @@
+<form action="{!URL!}/modules.php?module=admin&amp;what=list_surfbar_urls" method="POST">
+<table border="0" cellspacing="0" cellpadding="0" class="admin_table dashed">
+<tr>
+       <td align="center" colspan="5" class="admin_title" height="30">
+               <strong>{--ADMIN_SURFBAR_LOCK_URLS_TITLE--}</strong>
+       </td>
+</tr>
+<tr>
+       <td class="admin_title bottom2 right2" align="center"><strong>{--_UID--}</strong></td>
+       <td class="admin_title bottom2 right2" align="center"><strong>{--ADMIN_TEST_URL--}</strong></td>
+       <td class="admin_title bottom2 right2" align="center"><strong>{--ADMIN_SURFBAR_STATUS--}</strong></td>
+       <td class="admin_title bottom2 right2" align="center"><strong>{--ADMIN_SURFBAR_REGISTERED--}</strong></td>
+       <td class="admin_title bottom2" align="center"><strong>{--ADMIN_SURFBAR_LOCK_REASON--}</strong></td>
+</tr>
+$content
+<tr>
+       <td class="admin_footer" colspan="5">
+               <input type="reset" class="admin_reset" value="{--UNDO_SELECTIONS--}" />&nbsp;*
+               <input type="submit" name="do_lock" class="admin_lock" value="{--ADMIN_SURFBAR_LOCK_URL_NOW--}" />
+       </td>
+</tr>
+</table>
+</form>
diff --git a/templates/de/html/admin/admin_lock_surfbar_urls_row.tpl b/templates/de/html/admin/admin_lock_surfbar_urls_row.tpl
new file mode 100644 (file)
index 0000000..f79fcbb
--- /dev/null
@@ -0,0 +1,21 @@
+<tr>
+       <td align="center" class="bottom2 right2 switch_sw$content[sw]">
+               <input type="hidden" name="id[$content[id]]" value="1" />
+               <input type="hidden" name="uid_raw[$content[id]]" value="$content[uid]" />
+               <input type="hidden" name="last_locked[$content[id]]" value="NOW()" />
+               $content[userid]
+       </td>
+       <td align="center" class="bottom2 right2 switch_sw$content[sw]">
+               <a href="$content[url]" target="_blank" title="{--ADMIN_TEST_URL--}">{--ADMIN_TEST_URL--}</a>
+       </td>
+       <td align="center" class="bottom2 right2 switch_sw$content[sw]">
+               $content[status]
+       </td>
+       <td align="center" class="bottom2 right2 switch_sw$content[sw]">
+               $content[registered]
+       </td>
+       <td align="center" class="bottom2 switch_sw$content[sw]" style="padding:2px">
+               Bitte angeben:<br />
+               <textarea name="lock_reason[$content[id]]" rows="2" cols="15"></textarea>
+       </td>
+</tr>