]> git.mxchange.org Git - mailer.git/commitdiff
Extension ext-nickname continued:
authorRoland Häder <roland@mxchange.org>
Tue, 9 Oct 2012 20:55:48 +0000 (20:55 +0000)
committerRoland Häder <roland@mxchange.org>
Tue, 9 Oct 2012 20:55:48 +0000 (20:55 +0000)
- Listing of member's nickname history and deletion basicly finished
- Some other improvements
- TODOs.txt updated

12 files changed:
.gitattributes
DOCS/TODOs.txt
inc/expression-functions.php
inc/language/de.php
inc/language/nickname_de.php
inc/modules/admin/admin-inc.php
inc/modules/admin/what-list_nickname.php
inc/mysql-manager.php
templates/de/html/admin/admin_list_nickname_history.tpl [new file with mode: 0644]
templates/de/html/admin/admin_list_nickname_history_row.tpl [new file with mode: 0644]
templates/xml/admin/admin_delete_do_nickname_history.xml [new file with mode: 0644]
templates/xml/admin/admin_list_nickname_history.xml

index 94f1970bd28e9c849a972b8d6a47f77c8c8b7331..0f4f5c578015ebf691e8009a402222a255fbc437 100644 (file)
@@ -1502,6 +1502,8 @@ templates/de/html/admin/admin_list_network_vcheck_params.tpl svneol=native#text/
 templates/de/html/admin/admin_list_network_vcheck_params_row.tpl svneol=native#text/plain
 templates/de/html/admin/admin_list_networks.tpl svneol=native#text/plain
 templates/de/html/admin/admin_list_networks_row.tpl svneol=native#text/plain
 templates/de/html/admin/admin_list_network_vcheck_params_row.tpl svneol=native#text/plain
 templates/de/html/admin/admin_list_networks.tpl svneol=native#text/plain
 templates/de/html/admin/admin_list_networks_row.tpl svneol=native#text/plain
+templates/de/html/admin/admin_list_nickname_history.tpl svneol=native#text/plain
+templates/de/html/admin/admin_list_nickname_history_row.tpl svneol=native#text/plain
 templates/de/html/admin/admin_list_notify_emails.tpl svneol=native#text/plain
 templates/de/html/admin/admin_list_notify_emails_row.tpl svneol=native#text/plain
 templates/de/html/admin/admin_list_online.tpl svneol=native#text/plain
 templates/de/html/admin/admin_list_notify_emails.tpl svneol=native#text/plain
 templates/de/html/admin/admin_list_notify_emails_row.tpl svneol=native#text/plain
 templates/de/html/admin/admin_list_online.tpl svneol=native#text/plain
index a93a44a6a74991f22d7baf2f140b98a321193f86..cea6b771cb3b30a67e77daaa8b6df959d737b37b 100644 (file)
 ./inc/modules/order.php:78:            // @TODO Unused: 2,4
 ./inc/mysql-manager.php:1437:          // @TODO Rewrite these lines to a filter
 ./inc/mysql-manager.php:1461:  // @TODO Rewrite this to a filter
 ./inc/modules/order.php:78:            // @TODO Unused: 2,4
 ./inc/mysql-manager.php:1437:          // @TODO Rewrite these lines to a filter
 ./inc/mysql-manager.php:1461:  // @TODO Rewrite this to a filter
-./inc/mysql-manager.php:1717:                  // @TODO Rewrite this to a filter
-./inc/mysql-manager.php:1916:                          // @TODO If we can rewrite the EL sub-system to support more than one parameter, this call_user_func_array() can be avoided
-./inc/mysql-manager.php:2029:                  // @TODO Used generic 'userid' here
+./inc/mysql-manager.php:1767:                  // @TODO Rewrite this to a filter
+./inc/mysql-manager.php:1966:                          // @TODO If we can rewrite the EL sub-system to support more than one parameter, this call_user_func_array() can be avoided
+./inc/mysql-manager.php:2079:                  // @TODO Used generic 'userid' here
 ./inc/mysql-manager.php:398:   // @TODO Try to rewrite this to one or more functions
 ./inc/mysql-manager.php:44:// @TODO Can we cache this?
 ./inc/purge/purge-inact.php:55:        // @TODO Rewrite these if() blocks to a filter
 ./inc/mysql-manager.php:398:   // @TODO Try to rewrite this to one or more functions
 ./inc/mysql-manager.php:44:// @TODO Can we cache this?
 ./inc/purge/purge-inact.php:55:        // @TODO Rewrite these if() blocks to a filter
index f8e823d9bc9a6694d0321905340bfdbc22ce6dce..c8f1bfdf7698c3c1a242cf36605fc14aeb119fa2 100644 (file)
@@ -211,6 +211,7 @@ function doExpressionPipe ($data) {
        } // END - if
 
        // Replace the config entry
        } // END - if
 
        // Replace the config entry
+       //* NOISY-DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'replacer=' . $replacer);
        $code = replaceExpressionCode($data, $replacer);
 
        // Return replaced code
        $code = replaceExpressionCode($data, $replacer);
 
        // Return replaced code
@@ -332,8 +333,18 @@ function doExpressionMath ($data) {
 
 // Expression call-back for GET request
 function doExpressionGet ($data) {
 
 // Expression call-back for GET request
 function doExpressionGet ($data) {
-       // Construct the replacer
-       $replacer = '{%pipe,getRequestElement=' . $data['value'] . '%}';
+       // Construct the replacer:
+       // - GET request element
+       $replacer = '{%pipe,getRequestElement';
+
+       // Add more call-back functions?
+       if (!empty($data['callback'])) {
+               // - Okay, add them
+               $replacer .= ',' . $data['callback'];
+       } // END - if
+
+       // - Finalize replacer
+       $replacer .= '=' . $data['value'] . '%}';
 
        // Replace the code
        $code = replaceExpressionCode($data, $replacer);
 
        // Replace the code
        $code = replaceExpressionCode($data, $replacer);
@@ -344,8 +355,18 @@ function doExpressionGet ($data) {
 
 // Expression call-back for POST request
 function doExpressionPost ($data) {
 
 // Expression call-back for POST request
 function doExpressionPost ($data) {
-       // Construct the replacer
-       $replacer = '{%pipe,postRequestElement=' . $data['value'] . '%}';
+       // Construct the replacer:
+       // - POST request element
+       $replacer = '{%pipe,postRequestElement';
+
+       // Add more call-back functions?
+       if (!empty($data['callback'])) {
+               // - Okay, add them
+               $replacer .= ',' . $data['callback'];
+       } // END - if
+
+       // - Finalize replacer
+       $replacer .= '=' . $data['value'] . '%}';
 
        // Replace the code
        $code = replaceExpressionCode($data, $replacer);
 
        // Replace the code
        $code = replaceExpressionCode($data, $replacer);
@@ -356,8 +377,18 @@ function doExpressionPost ($data) {
 
 // Expression call-back for session data
 function doExpressionSession ($data) {
 
 // Expression call-back for session data
 function doExpressionSession ($data) {
-       // Construct the replacer
-       $replacer = '{%pipe,getSession=' . $data['value'] . '%}';
+       // Construct the replacer:
+       // - Session element
+       $replacer = '{%pipe,getSession';
+
+       // Add more call-back functions?
+       if (!empty($data['callback'])) {
+               // - Okay, add them
+               $replacer .= ',' . $data['callback'];
+       } // END - if
+
+       // - Finalize replacer
+       $replacer .= '=' . $data['value'] . '%}';
 
        // Debug message
        //* NOISY-DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'value=' . $data['value'] . ',replacer=' . $replacer);
 
        // Debug message
        //* NOISY-DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'value=' . $data['value'] . ',replacer=' . $replacer);
index 1dab156233e9e9aa19cc8967a67a33c75e95d7b5..310c76f79c627f99e2f8babd20416d0dd1356088 100644 (file)
@@ -1331,6 +1331,13 @@ addMessages(array(
        // Member - submit buttons
        'MEMBER_ACTION_EDIT_SUBMIT' => "Editieren",
        'MEMBER_ACTION_DELETE_SUBMIT' => "L&ouml;schen",
        // Member - submit buttons
        'MEMBER_ACTION_EDIT_SUBMIT' => "Editieren",
        'MEMBER_ACTION_DELETE_SUBMIT' => "L&ouml;schen",
+
+       // Admin - history entries - generic
+       'ADMIN_HISTORY_VALUE' => "Historie-Eintrag",
+       'ADMIN_HISTORY_ENTRY_ADDED' => "Eintrag hinzugef&uuml;gt",
+       'ADMIN_HISTORY_ENTRY_LAST_USED' => "Zuletzt verwendet",
+       'ADMIN_ACTION_DELETE_HISTORY_SUBMIT' => "Alle Historie-Eintr&auml;ge l&ouml;schen",
+       'ADMIN_LIST_HISTORY_NOTICE' => "<strong>Vorsicht:</strong> Mit Klick auf <strong>{----}</strong> werden die Historie-Eintr&auml;ge sofort bereinigt, ohne zus&auml;tzliche Sicherheitsabfrage.",
 ));
 
 // Description of all months
 ));
 
 // Description of all months
index ed02ab9ef2b0f593d4f1d0436c42b0c0dae2bcf7..c3ff2b938bf29839a56fa30eaec5bc3cf730d026 100644 (file)
@@ -42,22 +42,30 @@ if (!defined('__SECURITY')) {
 
 // Language definitions
 addMessages(array(
 
 // Language definitions
 addMessages(array(
+       // Admin - configuration
+       'ADMIN_CONFIG_NICKNAME_TITLE' => "Einstellungen am Nicknamen",
+       'ADMIN_CONFIG_NICKNAME_MIN_LENGTH' => "Minimale L&auml;nge",
+       'ADMIN_CONFIG_NICKNAME_PATTERN' => "Pattern f&uuml;r isInString()-Befehl",
+       'ADMIN_CONFIG_NICKNAME_CHARACTERS' => "Zeichenfolge f&uuml;r Sprachdatei",
+
+       // Admin - nickname history
+       'ADMIN_LIST_NICKNAME_HISTORY_TITLE' => "Alle verwendeten Nicknames des Mitgliedes <span class=\"data\">{%get,generateUserProfileLink=userid%}</span>",
+
+       // Member
        'MEMBER_NICKNAME_CHANGE_NICKNAME_TITLE' => "Einstellen Ihres Nicknames",
        'MEMBER_NICKNAME_CHANGE_NICKNAME_INTRO' => "Stellen Sie hier einen Nicknamen ein, der anstelle Ihrer Mitglied-Id angezeigt wird! Dieser darf nur unten aufgef&uuml;hrte Zeichen enthalten und sollte nicht k&uuml;rzer als {?nickname_len?} Zeichen sein.",
        'MEMBER_NICKNAME_ENTER_NICKNAME' => "Nickname eingeben",
        'MEMBER_NICKNAME_CHANGE_SUBMIT' => "Nickname &auml;ndern",
        'MEMBER_NICKNAME_ALREADY_IN_USE' => "Der von Ihnen eingegebene Nickname wird bereits verwendet.",
        'MEMBER_NICKNAME_SAVED' => "Nickname wurde gespeichert.",
        'MEMBER_NICKNAME_CHANGE_NICKNAME_TITLE' => "Einstellen Ihres Nicknames",
        'MEMBER_NICKNAME_CHANGE_NICKNAME_INTRO' => "Stellen Sie hier einen Nicknamen ein, der anstelle Ihrer Mitglied-Id angezeigt wird! Dieser darf nur unten aufgef&uuml;hrte Zeichen enthalten und sollte nicht k&uuml;rzer als {?nickname_len?} Zeichen sein.",
        'MEMBER_NICKNAME_ENTER_NICKNAME' => "Nickname eingeben",
        'MEMBER_NICKNAME_CHANGE_SUBMIT' => "Nickname &auml;ndern",
        'MEMBER_NICKNAME_ALREADY_IN_USE' => "Der von Ihnen eingegebene Nickname wird bereits verwendet.",
        'MEMBER_NICKNAME_SAVED' => "Nickname wurde gespeichert.",
-       'GUEST_ENTER_LOGIN_NICKNAME' => "Nickname o. Mitglieds-Id",
        'MEMBER_NICKNAME_ALLOWED_CHARS' => "Erlaubte Zeichen:",
        'MEMBER_NICKNAME_IS_INVALID' => "Ung&uuml;ltige Zeichen im Nicknamen gefunden oder ist zu kurz.",
        'MEMBER_NICKNAME_YOUR_REFERRAL_LINK' => "Ihr Nickname-Reflink",
        'MEMBER_NO_NICKNAME_SET' => "Sie haben noch keinen Nickname eingerichtet! Damit k&ouml;nnen Sie sich alternativ zur Mitglied-Id einloggen.",
        'MEMBER_PLEASE_CLICK_NICKNAME_FORM' => "Hier k&ouml;nnen Sie sich nun einen einrichten...",
        'MEMBER_NICKNAME_ALLOWED_CHARS' => "Erlaubte Zeichen:",
        'MEMBER_NICKNAME_IS_INVALID' => "Ung&uuml;ltige Zeichen im Nicknamen gefunden oder ist zu kurz.",
        'MEMBER_NICKNAME_YOUR_REFERRAL_LINK' => "Ihr Nickname-Reflink",
        'MEMBER_NO_NICKNAME_SET' => "Sie haben noch keinen Nickname eingerichtet! Damit k&ouml;nnen Sie sich alternativ zur Mitglied-Id einloggen.",
        'MEMBER_PLEASE_CLICK_NICKNAME_FORM' => "Hier k&ouml;nnen Sie sich nun einen einrichten...",
-       'ADMIN_CONFIG_NICKNAME_TITLE' => "Einstellungen am Nicknamen",
-       'ADMIN_CONFIG_NICKNAME_MIN_LENGTH' => "Minimale L&auml;nge",
-       'ADMIN_CONFIG_NICKNAME_PATTERN' => "Pattern f&uuml;r isInString()-Befehl",
-       'ADMIN_CONFIG_NICKNAME_CHARACTERS' => "Zeichenfolge f&uuml;r Sprachdatei",
+
+       // Guest
+       'GUEST_ENTER_LOGIN_NICKNAME' => "Nickname o. Mitglieds-Id",
 ));
 
 // [EOF]
 ));
 
 // [EOF]
index 827a66f46e81bf71a37c8f8020a0023ccc69d7fd..2e47837431641f431c3e483a6c55638377c51bde 100644 (file)
@@ -700,34 +700,47 @@ function adminAddMenuSelectionBox ($menu, $type, $name, $default = '') {
 }
 
 // Creates a user-profile link for the admin. This function can also be used for many other purposes
 }
 
 // Creates a user-profile link for the admin. This function can also be used for many other purposes
-function generateUserProfileLink ($userid, $title = '', $what = 'list_user') {
-       if (($title == '') && (isValidUserId($userid))) {
-               // Set userid as title
-               $title = $userid;
-       } elseif (!isValidUserId($userid)) {
-               // User id zero is invalid
-               return '<strong>' . convertNullToZero($userid) . '</strong>';
-       }
-
-       if (($title == '0') && ($what == 'list_refs')) {
-               // Return title again
-               return $title;
-       } elseif (!empty($title)) {
-               // Not empty, so skip next one
-       } elseif (isExtensionActive('nickname')) {
-               // Get nickname
-               $nick = getNickname($userid);
-
-               // Is it not empty, use it as title else the userid
-               if (!empty($nick)) {
-                       $title = $nick . '(' . $userid . ')';
-               } else {
+function generateUserProfileLink ($userid, $title = '', $what = '') {
+       // Is there cache?
+       if (!isset($GLOBALS[__FUNCTION__][$userid][$title . '_' . $what])) {
+               // Is title empty and valid userid?
+               if (($title == '') && (isValidUserId($userid))) {
+                       // Set userid as title
                        $title = $userid;
                        $title = $userid;
+               } elseif (!isValidUserId($userid)) {
+                       // User id zero is invalid
+                       return '<strong>' . convertNullToZero($userid) . '</strong>';
                }
                }
-       }
 
 
-       // Return link
-       return '[<a href="{%url=modules.php?module=admin&amp;what=' . $what . '&amp;userid=' . $userid . '%}" title="{--ADMIN_USER_PROFILE_TITLE--}">' . $title . '</a>]';
+               // Is what set?
+               if (empty($what)) {
+                       // Then get it
+                       $what = getWhat();
+               } // END - if
+
+               if (($title == '0') && ($what == 'list_refs')) {
+                       // Return title again
+                       return $title;
+               } elseif (!empty($title)) {
+                       // Not empty, so skip next one
+               } elseif (isExtensionActive('nickname')) {
+                       // Get nickname
+                       $nick = getNickname($userid);
+
+                       // Is it not empty, use it as title else the userid
+                       if (!empty($nick)) {
+                               $title = $nick . '(' . $userid . ')';
+                       } else {
+                               $title = $userid;
+                       }
+               }
+
+               // Set it in cache
+               $GLOBALS[__FUNCTION__][$userid][$title . '_' . $what] = '[<a href="{%url=modules.php?module=admin&amp;what=' . $what . '&amp;userid=' . $userid . '%}" title="{--ADMIN_USER_PROFILE_TITLE--}">' . $title . '</a>]';
+       } // END - if
+
+       // Return cache
+       return $GLOBALS[__FUNCTION__][$userid][$title . '_' . $what];
 }
 
 // Check "logical-area-mode"
 }
 
 // Check "logical-area-mode"
@@ -952,7 +965,7 @@ function adminDeleteEntriesConfirm ($tableName, $columns = array(), $filterFunct
        // Shall we delete here or list for deletion?
        if ($deleteNow[0] === true) {
                // Call generic function
        // Shall we delete here or list for deletion?
        if ($deleteNow[0] === true) {
                // Call generic function
-               $affected = doGenericDeleteEntriesConfirm($tableName, $columns, $filterFunctions, $extraValues, $timeColumns, $editNow, $idColumn, $userIdColumn, $rawUserId, $cacheFiles);
+               $affected = doGenericDeleteEntriesConfirm($tableName, $columns, $filterFunctions, $extraValues, $deleteNow, $idColumn, $userIdColumn, $rawUserId, $cacheFiles);
 
                // Was this fine?
                if ($affected == countPostSelection($idColumn[0])) {
 
                // Was this fine?
                if ($affected == countPostSelection($idColumn[0])) {
index 8d4cada317c575dfe222f37bf10ea585bd28ca5d..e9788a830eb69f818d1dea17ff4780d0a43b45f8 100644 (file)
@@ -45,6 +45,12 @@ addYouAreHereLink('admin', __FILE__);
 
 // Check if 'userid' is set
 if (isGetRequestElementSet('userid')) {
 
 // Check if 'userid' is set
 if (isGetRequestElementSet('userid')) {
+       // Delete entries?
+       if (isFormSent('do_delete')) {
+               // Remove entries from database
+               showEntriesByXmlCallback('admin_delete_do_nickname_history');
+       } // END - if
+
        // List all entries per user
        showEntriesByXmlCallback('admin_list_nickname_history', array(
                'userid' => bigintval(getRequestElement('userid'))
        // List all entries per user
        showEntriesByXmlCallback('admin_list_nickname_history', array(
                'userid' => bigintval(getRequestElement('userid'))
index b4b635d87b4e2f5a60261114679589cdcf80bc96..691fbd4cba6ed88da5378b0de1bdd3989ba28544 100644 (file)
@@ -1465,7 +1465,7 @@ LIMIT 1",
        } // END - if
 
        // Add reason and translate points
        } // END - if
 
        // Add reason and translate points
-       $data['text']   = $reason;
+       $data['text'] = $reason;
 
        // Now a mail to the user and that's all...
        $message = loadEmailTemplate('member_user_deleted', $data, $userid);
 
        // Now a mail to the user and that's all...
        $message = loadEmailTemplate('member_user_deleted', $data, $userid);
@@ -1523,7 +1523,14 @@ function generateCategoryOptionsList ($mode, $userid = NULL) {
        );
 
        // Get categories
        );
 
        // Get categories
-       $result = SQL_QUERY('SELECT `id`,`cat` FROM `{?_MYSQL_PREFIX?}_cats`' . $whereStatement . ' ORDER BY `sort` ASC',
+       $result = SQL_QUERY('SELECT
+       `id`,
+       `cat`
+FROM
+       `{?_MYSQL_PREFIX?}_cats`
+' . $whereStatement . '
+ORDER BY
+       `sort` ASC',
                __FUNCTION__, __LINE__);
 
        // Are there entries?
                __FUNCTION__, __LINE__);
 
        // Are there entries?
@@ -1596,13 +1603,34 @@ function addBonusMailToQueue ($subject, $text, $receiverList, $points, $seconds,
 
        // HTML extension active?
        if (isExtensionActive('html_mail')) {
 
        // HTML extension active?
        if (isExtensionActive('html_mail')) {
-               // Determine if we have HTML mode active
-               $HTML = convertBooleanToYesNo($mode == 'html');
-
                // Add HTML mail
                // Add HTML mail
-               SQL_QUERY_ESC("INSERT INTO `{?_MYSQL_PREFIX?}_bonus`
-(`subject`,`text`,`receivers`,`points`,`time`,`data_type`,`timestamp`,`url`,`cat_id`,`target_send`,`mails_sent`,`html_msg`)
-VALUES ('%s','%s','%s',%s,%s,'NEW', UNIX_TIMESTAMP(),'%s',%s,%s,%s,'%s')",
+               SQL_QUERY_ESC("INSERT INTO `{?_MYSQL_PREFIX?}_bonus` (
+       `subject`,
+       `text`,
+       `receivers`,
+       `points`,
+       `time`,
+       `data_type`,
+       `timestamp`,
+       `url`,
+       `cat_id`,
+       `target_send`,
+       `mails_sent`,
+       `html_msg`
+) VALUES (
+       '%s',
+       %s',
+       '%s',
+       %s,
+       %s,
+       'NEW',
+       UNIX_TIMESTAMP(),
+       '%s',
+       %s,
+       %s,
+       %s,
+       '%s'
+)",
                array(
                        $subject,
                        $text,
                array(
                        $subject,
                        $text,
@@ -1613,13 +1641,35 @@ VALUES ('%s','%s','%s',%s,%s,'NEW', UNIX_TIMESTAMP(),'%s',%s,%s,%s,'%s')",
                        bigintval($categoryId),
                        $target,
                        bigintval($receiver),
                        bigintval($categoryId),
                        $target,
                        bigintval($receiver),
-                       $HTML
+                       convertBooleanToYesNo($mode == 'html')
                ), __FUNCTION__, __LINE__);
        } else {
                // Add regular mail
                ), __FUNCTION__, __LINE__);
        } else {
                // Add regular mail
-               SQL_QUERY_ESC("INSERT INTO `{?_MYSQL_PREFIX?}_bonus`
-(`subject`,`text`,`receivers`,`points`,`time`,`data_type`,`timestamp`,`url`,`cat_id`,`target_send`,`mails_sent`)
-VALUES ('%s','%s','%s',%s,%s,'NEW', UNIX_TIMESTAMP(),'%s',%s,%s,%s)",
+               SQL_QUERY_ESC("INSERT INTO `{?_MYSQL_PREFIX?}_bonus` (
+       `subject`,
+       `text`,
+       `receivers`,
+       `points`,
+       `time`,
+       `data_type`,
+       `timestamp`,
+       `url`,
+       `cat_id`,
+       `target_send`,
+       `mails_sent`
+) VALUES (
+       '%s',
+       '%s',
+       '%s',
+       %s,
+       %s,
+       'NEW',
+       UNIX_TIMESTAMP(),
+       '%s',
+       %s,
+       %s,
+       %s
+)",
                array(
                        $subject,
                        $text,
                array(
                        $subject,
                        $text,
@@ -2170,14 +2220,22 @@ function doGenericDeleteEntriesConfirm ($tableName, $columns = array(), $filterF
        $sql = "DELETE LOW_PRIORITY FROM `{?_MYSQL_PREFIX?}_%s` WHERE `%s` IN (%s)";
 
        // Is a user id provided?
        $sql = "DELETE LOW_PRIORITY FROM `{?_MYSQL_PREFIX?}_%s` WHERE `%s` IN (%s)";
 
        // Is a user id provided?
+       //* BUG: */ die('<pre>'.print_r($rawUserId,true).'</pre><pre>'.print_r($userIdColumn,true).'</pre>');
        if ((isset($rawUserId[0])) && (isPostRequestElementSet($rawUserId[0])) && (isset($userIdColumn[0]))) {
                // Add user id as well
                $sql .= ' AND `' . $userIdColumn[0] . '`=' . bigintval(postRequestElement($rawUserId[0]));
        } // END - if
 
        // Delete them all
        if ((isset($rawUserId[0])) && (isPostRequestElementSet($rawUserId[0])) && (isset($userIdColumn[0]))) {
                // Add user id as well
                $sql .= ' AND `' . $userIdColumn[0] . '`=' . bigintval(postRequestElement($rawUserId[0]));
        } // END - if
 
        // Delete them all
+       //* BUG: */ die($sql.'<br /><pre>'.print_r($idColumn,true).'</pre>');
        $idList = '';
        foreach (postRequestElement($idColumn[0]) as $id => $sel) {
        $idList = '';
        foreach (postRequestElement($idColumn[0]) as $id => $sel) {
+               // Is id zero?
+               if ($id == '0') {
+                       // Then skip this
+                       continue;
+               } // END - if
+
                // Is there a userid?
                if (isPostRequestElementSet($userIdColumn[0])) {
                        // Load all data from that id
                // Is there a userid?
                if (isPostRequestElementSet($userIdColumn[0])) {
                        // Load all data from that id
@@ -2203,7 +2261,12 @@ function doGenericDeleteEntriesConfirm ($tableName, $columns = array(), $filterF
        } // END - foreach
 
        // Run the query
        } // END - foreach
 
        // Run the query
-       SQL_QUERY_ESC($sql, array($tableName[0], $idColumn[0], substr($idList, 0, -1)), __FUNCTION__, __LINE__);
+       SQL_QUERY_ESC($sql,
+               array(
+                       $tableName[0],
+                       $idColumn[0],
+                       convertNullToZero(substr($idList, 0, -1))
+               ), __FUNCTION__, __LINE__);
 
        // Return affected rows
        return SQL_AFFECTEDROWS();
 
        // Return affected rows
        return SQL_AFFECTEDROWS();
diff --git a/templates/de/html/admin/admin_list_nickname_history.tpl b/templates/de/html/admin/admin_list_nickname_history.tpl
new file mode 100644 (file)
index 0000000..ad0eff8
--- /dev/null
@@ -0,0 +1,30 @@
+<div align="center">
+<form accept-charset="UTF-8" action="{%url=modules.php?module=admin&amp;what=list_nickname%}&amp;userid={%get,bigintval=userid%}" method="post">
+<table border="0" cellspacing="0" cellpadding="0" class="table dashed" width="800">
+<tr>
+       <td align="center" colspan="5" class="table_header">
+               <strong>{--ADMIN_LIST_NICKNAME_HISTORY_TITLE--}</strong>
+       </td>
+</tr>
+<tr>
+       <td class="header_column bottom right" align="center"><strong>{--ID_SELECT--}</strong></td>
+       <td class="header_column bottom right" align="center"><strong>{--_USERID--}</strong></td>
+       <td class="header_column bottom right" align="center"><strong>{--ADMIN_HISTORY_VALUE--}</strong></td>
+       <td class="header_column bottom right" align="center"><strong>{--ADMIN_HISTORY_ENTRY_ADDED--}</strong></td>
+       <td class="header_column bottom" align="center"><strong>{--ADMIN_HISTORY_ENTRY_LAST_USED--}</strong></td>
+</tr>
+$content
+<tr>
+       <td class="table_footer" colspan="5">
+               <input type="hidden" name="history_id[0]" value="1" />
+               <input type="hidden" name="history_userid" value="{%get,bigintval=userid%}" />
+               <input type="submit" class="form_delete" name="do_delete" value="{--ADMIN_ACTION_DELETE_HISTORY_SUBMIT--}" />
+       </td>
+</tr>
+</table>
+</form>
+</div>
+
+<div class="notice">
+       {--ADMIN_LIST_HISTORY_NOTICE--}
+</div>
diff --git a/templates/de/html/admin/admin_list_nickname_history_row.tpl b/templates/de/html/admin/admin_list_nickname_history_row.tpl
new file mode 100644 (file)
index 0000000..924243c
--- /dev/null
@@ -0,0 +1,17 @@
+<tr>
+       <td align="center" class="bottom right {%template,ColorSwitch%}">
+               <strong>$content[history_id]</strong>
+       </td>
+       <td class="{%template,ColorSwitch%} bottom right" align="center">
+               {%pipe,generateUserProfileLink=$content[history_userid]%}
+       </td>
+       <td align="center" class="bottom right {%template,ColorSwitch%}">
+               $content[history_value]
+       </td>
+       <td align="center" class="bottom right {%template,ColorSwitch%}">
+               $content[history_added]
+       </td>
+       <td align="center" class="bottom {%template,ColorSwitch%}">
+               $content[history_last_used]
+       </td>
+</tr>
diff --git a/templates/xml/admin/admin_delete_do_nickname_history.xml b/templates/xml/admin/admin_delete_do_nickname_history.xml
new file mode 100644 (file)
index 0000000..3af9abc
--- /dev/null
@@ -0,0 +1,82 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!--
+This template provides meta data for doing deletions on nickname history.
+
+@author                Roland Haeder <webmaster@mxchange.org>
+@version       0.2.1-FINAL
+@copyright     (c) 2003 - 2009 by Roland Haeder
+@copyright     (c) 2009 - 2012 by Mailer Developer Team
+@license       GNU GPL 2.0 or any newer version
+@link          http://mxchange.org
+
+This program is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2 of the License, or
+(at your option) any later version.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program; if not, write to the Free Software
+Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,
+MA  02110-1301  USA
+//-->
+<admin-entry-meta-data>
+       <!--
+       Call-back function which should all following parameter handled over
+       to. This will always be type of string but we like homogene XMLs.
+       //-->
+       <callback-function type="string" value="adminDeleteEntriesConfirm" />
+       <!--
+       Name of the database table where the entries should be read/write from/to.
+       //-->
+       <database-table name="" type="string" value="history" />
+       <!--
+       The following three lists must have the same count of list entries, else an
+       error may occur.
+       //-->
+       <!--
+       And all column names to read/write, leave this list tag empty for all (*).
+       //-->
+       <database-column-list>
+       </database-column-list>
+       <!--
+       "Filter" call-back functions to call back for piping the fetched data
+       through (can be left empty, no call-back function will be called)
+       //-->
+       <callback-function-list>
+       </callback-function-list>
+       <!--
+       Extra parameters (2nd, 3rd, ...) for above call-back functions. If an array
+       is provided, we have more than two parameters to handle over to the
+       call-back function. See function handleExtraValues() for details.
+       //-->
+       <extra-parameter-list>
+       </extra-parameter-list>
+       <!--
+       Wether to 'edit/delete/change' (change) the entries (true) or just read them for displaying (false)
+       //-->
+       <enable-modify-entries name="" type="bool" value="true" />
+       <!--
+       The table column which should be taken for the ids (see first parameter).
+       This' type can again only be 'string' (remember why?).
+       //-->
+       <table-id-column name="" type="string" value="history_id" />
+       <!--
+       The table column which should be taken for user ids
+       This' type can again only be 'string' (remember why?).
+       //-->
+       <table-userid-column name="" type="string" value="history_userid" />
+       <!--
+       Raw userid column ($key) to skip which is always an invalid (?) entry
+       This' type can again only be 'string' (remember why?).
+       //-->
+       <raw-userid-column-key name="" type="string" value="history_userid" />
+       <!--
+       Cache file to delete
+       //-->
+       <cache-file name="" type="string" value="" />
+</admin-entry-meta-data>
index 01f74798af61831498e92952af5f4b97b4136cae..68deb5eb228fea9756a7e3c51ddd1400a7a4227c 100644 (file)
@@ -64,6 +64,7 @@ MA  02110-1301  USA
                        always be set), alias (again can be left empty) and SQL function
                        (can also be left empty) which shall be applied on the column.
                        //-->
                        always be set), alias (again can be left empty) and SQL function
                        (can also be left empty) which shall be applied on the column.
                        //-->
+                       <select-data-from-list-entry type="string" table="" value="history_id" alias="" function="" />
                        <select-data-from-list-entry type="string" table="" value="history_userid" alias="" function="" />
                        <select-data-from-list-entry type="string" table="" value="history_value" alias="" function="" />
                        <select-data-from-list-entry type="string" table="" value="history_added" alias="history_added" function="UNIX_TIMESTAMP" />
                        <select-data-from-list-entry type="string" table="" value="history_userid" alias="" function="" />
                        <select-data-from-list-entry type="string" table="" value="history_value" alias="" function="" />
                        <select-data-from-list-entry type="string" table="" value="history_added" alias="history_added" function="UNIX_TIMESTAMP" />