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
./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
} // END - if
// Replace the config entry
+ //* NOISY-DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'replacer=' . $replacer);
$code = replaceExpressionCode($data, $replacer);
// Return replaced code
// 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);
// 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);
// 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);
// Member - submit buttons
'MEMBER_ACTION_EDIT_SUBMIT' => "Editieren",
'MEMBER_ACTION_DELETE_SUBMIT' => "Löschen",
+
+ // Admin - history entries - generic
+ 'ADMIN_HISTORY_VALUE' => "Historie-Eintrag",
+ 'ADMIN_HISTORY_ENTRY_ADDED' => "Eintrag hinzugefügt",
+ 'ADMIN_HISTORY_ENTRY_LAST_USED' => "Zuletzt verwendet",
+ 'ADMIN_ACTION_DELETE_HISTORY_SUBMIT' => "Alle Historie-Einträge löschen",
+ 'ADMIN_LIST_HISTORY_NOTICE' => "<strong>Vorsicht:</strong> Mit Klick auf <strong>{----}</strong> werden die Historie-Einträge sofort bereinigt, ohne zusätzliche Sicherheitsabfrage.",
));
// Description of all months
// Language definitions
addMessages(array(
+ // Admin - configuration
+ 'ADMIN_CONFIG_NICKNAME_TITLE' => "Einstellungen am Nicknamen",
+ 'ADMIN_CONFIG_NICKNAME_MIN_LENGTH' => "Minimale Länge",
+ 'ADMIN_CONFIG_NICKNAME_PATTERN' => "Pattern für isInString()-Befehl",
+ 'ADMIN_CONFIG_NICKNAME_CHARACTERS' => "Zeichenfolge fü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ührte Zeichen enthalten und sollte nicht kürzer als {?nickname_len?} Zeichen sein.",
'MEMBER_NICKNAME_ENTER_NICKNAME' => "Nickname eingeben",
'MEMBER_NICKNAME_CHANGE_SUBMIT' => "Nickname ä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ü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önnen Sie sich alternativ zur Mitglied-Id einloggen.",
'MEMBER_PLEASE_CLICK_NICKNAME_FORM' => "Hier können Sie sich nun einen einrichten...",
- 'ADMIN_CONFIG_NICKNAME_TITLE' => "Einstellungen am Nicknamen",
- 'ADMIN_CONFIG_NICKNAME_MIN_LENGTH' => "Minimale Länge",
- 'ADMIN_CONFIG_NICKNAME_PATTERN' => "Pattern für isInString()-Befehl",
- 'ADMIN_CONFIG_NICKNAME_CHARACTERS' => "Zeichenfolge für Sprachdatei",
+
+ // Guest
+ 'GUEST_ENTER_LOGIN_NICKNAME' => "Nickname o. Mitglieds-Id",
));
// [EOF]
}
// 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;
+ } elseif (!isValidUserId($userid)) {
+ // User id zero is invalid
+ return '<strong>' . convertNullToZero($userid) . '</strong>';
}
- }
- // Return link
- return '[<a href="{%url=modules.php?module=admin&what=' . $what . '&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&what=' . $what . '&userid=' . $userid . '%}" title="{--ADMIN_USER_PROFILE_TITLE--}">' . $title . '</a>]';
+ } // END - if
+
+ // Return cache
+ return $GLOBALS[__FUNCTION__][$userid][$title . '_' . $what];
}
// Check "logical-area-mode"
// 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])) {
// 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'))
} // 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);
);
// 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?
// HTML extension active?
if (isExtensionActive('html_mail')) {
- // Determine if we have HTML mode active
- $HTML = convertBooleanToYesNo($mode == 'html');
-
// 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,
bigintval($categoryId),
$target,
bigintval($receiver),
- $HTML
+ convertBooleanToYesNo($mode == 'html')
), __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,
$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
+ //* BUG: */ die($sql.'<br /><pre>'.print_r($idColumn,true).'</pre>');
$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
} // 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();
--- /dev/null
+<div align="center">
+<form accept-charset="UTF-8" action="{%url=modules.php?module=admin&what=list_nickname%}&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>
--- /dev/null
+<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>
--- /dev/null
+<?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>
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" />