./inc/functions.php:2214: // @TODO Rename column data_type to e.g. mail_status
./inc/gen_sql_patches.php:95:// @TODO Rewrite this to a filter
./inc/install-functions.php:57: // @TODO DEACTIVATED: changeDataInLocalConfigurationFile('OUTPUT-MODE', "setConfigEntry('OUTPUT_MODE', '", "');", postRequestParameter('omode'), 0);
-./inc/language/de.php:1062: // @TODO Rewrite these two constants
-./inc/language/de.php:1078: // @TODO Rewrite these three constants
-./inc/language/de.php:754:// @TODO Are these constants longer used?
+./inc/language/de.php:1065: // @TODO Rewrite these two constants
+./inc/language/de.php:1081: // @TODO Rewrite these three constants
+./inc/language/de.php:757:// @TODO Are these constants longer used?
./inc/language-functions.php:255: // @TODO These are all valid languages, again hard-coded
./inc/language-functions.php:44:// @TODO Rewrite all language constants to this function.
./inc/language/newsletter_de.php:13: * @TODO This language file is completely out-dated, please do no *
./inc/libs/task_functions.php:247: // @TODO These can be rewritten to filter
./inc/libs/task_functions.php:51:// @TODO Move all extension-dependent queries into filters
./inc/libs/theme_functions.php:93: // @TODO Can't this be rewritten to an API function?
-./inc/libs/user_functions.php:159: // @TODO These two constants are no longer used, maybe we reactivate this code?
-./inc/libs/user_functions.php:250:// @TODO Double-check configuration entry here
-./inc/libs/user_functions.php:344: // @TODO Make this filter working: $ADDON = runFilterChain('post_login_update', $content);
-./inc/libs/user_functions.php:373: // @TODO Make this filter working: $url = runFilterChain('do_login', array('content' => $content, 'addon' => $ADDON));
+./inc/libs/user_functions.php:221:// @TODO Double-check configuration entry here
+./inc/libs/user_functions.php:315: // @TODO Make this filter working: $ADDON = runFilterChain('post_login_update', $content);
+./inc/libs/user_functions.php:344: // @TODO Make this filter working: $url = runFilterChain('do_login', array('content' => $content, 'addon' => $ADDON));
./inc/libs/yoomedia_functions.php:114: $response = YOOMEDIA_QUERY_API('out_textmail.php', true); // @TODO Ask Yoo!Media for test script
./inc/load_config.php:75: // @TODO Rewrite them to avoid this else block
./inc/loader/load-extension.php:13: * @TODO Rewrite this whole file *
./inc/modules/admin/what-list_refs.php:107: // @TODO Try to rewrite some to EL
./inc/modules/admin/what-list_unconfirmed.php:107: // @TODO "Please do not call me directly." Should be rewritten to a nice selection depending on ext-bonus
./inc/modules/admin/what-list_unconfirmed.php:84: // @TODO This constant might be unused? define('__LIST_UNCON_TITLE', '{--ADMIN_LIST_UNCONFIRMED_BONUS_LINKS--}');
-./inc/modules/admin/what-list_user.php:254: // @TODO Rewrite this into a filter
-./inc/modules/admin/what-list_user.php:297: // @TODO Rewrite this into a filter
+./inc/modules/admin/what-list_user.php:247: // @TODO Rewrite this into a filter
+./inc/modules/admin/what-list_user.php:290: // @TODO Rewrite this into a filter
./inc/modules/admin/what-logs.php:64: // @TODO Fix content-type here
./inc/modules/admin/what-logs.php:70: // @TODO Fix content-type here
./inc/modules/admin/what-mem_add.php:124: // @TODO This can be somehow rewritten to a function
./templates/de/html/admin/admin_list_chk_reg.tpl:1:<!-- @DEPRECATED //-->
./templates/de/html/admin/admin_list_country_del_row.tpl:1:<!-- @DEPRECATED //-->
./templates/de/html/admin/admin_list_country_edit_row.tpl:1:<!-- @DEPRECATED //-->
+./templates/de/html/admin/admin_list_user_sort_form.tpl:1:<!-- @DEPRECATED //-->
./templates/de/html/admin/admin_reset_pass_done.tpl:1:<!-- @DEPRECATED //-->
./templates/de/html/admin/admin_send_reset_link.tpl:1:<!-- @DEPRECATED //-->
./templates/de/html/member/member_refback_edit.tpl:1:<!-- @DEPRECATED //-->
} // END - if
// Version number
-setThisExtensionVersion('0.0.3');
+setThisExtensionVersion('0.0.4');
// Version history array (add more with , '0.0.1' and so on)
-setExtensionVersionHistory(array('0.0.0','0.0.1','0.0.2','0.0.3'));
+setExtensionVersionHistory(array('0.0.0','0.0.1','0.0.2','0.0.3', '0.0.4'));
switch (getExtensionMode()) {
case 'register': // Do stuff when installation is running
case '0.0.3': // SQL queries for v0.0.3
// Change menu-string
- addExtensionSql("UPDATE `{?_MYSQL_PREFIX?}_admin_menu` SET `title` = 'Admin-Menü editieren' WHERE `what` = 'adminedit' LIMIT 1");
+ addExtensionSql("UPDATE `{?_MYSQL_PREFIX?}_admin_menu` SET `title`='Admin-Menü editieren' WHERE `what` = 'adminedit' LIMIT 1");
setExtensionUpdateNotes("Menüpunkt 'Vom Admin editieren' in 'Admin-Menü editieren' bei bereits bestehenden Installationen umändern.");
break;
+
+ case '0.0.4': // SQL queries for v0.0.4
+ // Change menu-string
+ addExtensionSql("ALTER TABLE `{?_MYSQL_PREFIX?}_admin_menu` CHANGE `title` `title` VARCHAR(255) NOT NULL DEFAULT ''");
+ addExtensionSql("UPDATE `{?_MYSQL_PREFIX?}_admin_menu` SET `title`='{OPEN_TEMPLATE}DEFAULT_POINTS{CLOSE_TEMPLATE} gutschreiben' WHERE `what` = 'add_points' LIMIT 1");
+
+ setExtensionUpdateNotes("VARCHAR(50) ist zu kurz für Linktitel (wegen der dynamischen Anteile).");
+ break;
} // END - switch
break;
} // END - if
// Add links for selecting some users
-function alpha ($sortby, $colspan, $return=false) {
- if (!isGetRequestParameterSet('offset')) {
- setGetRequestParameter('offset', 0);
- } // END - if
- $add = '&page=' . getRequestParameter('page').'&offset=' . getRequestParameter('offset');
- foreach (array('mode','status') as $param) {
+function alpha ($sortby) {
+ $add = '';
+ foreach (array('page','offset','mode','status') as $param) {
if (isGetRequestParameterSet($param)) {
$add .= '&' . $param . '=' . getRequestParameter($param);
} // END - if
$OUT .= '<strong>' . $ltr . '</strong>';
} else {
// Output link to letter
- $OUT .= '<a href="{%url=modules.php?module=admin&what=' . getWhat();
- foreach (array('mode','status') as $param) {
- if (isGetRequestParameterSet($param)) {
- $OUT .= '&' . $param . '=' . getRequestParameter($param);
- } // END - if
- } // END - foreach
- $OUT .= '&letter=' . $ltr . '&sortby=' . $sortby . $add . '%}">' . $ltr . '</a>';
+ $OUT .= '<a href="{%url=modules.php?module=admin&what=' . getWhat() . '&letter=' . $ltr . '&sortby=' . $sortby . $add . '%}">' . $ltr . '</a>';
}
if ((($counter / getConfig('user_alpha')) == round($counter / getConfig('user_alpha'))) && ($counter > 0)) {
// Prepare content
$content = array (
- 'colspan2' => $colspan,
'alpha_selection' => $OUT
);
// Load template
$OUT = loadTemplate('admin_list_user_alpha', true, $content);
- if ($return === true) {
- // Return generated code
- return $OUT;
- } else {
- // Output generated code
- outputHtml($OUT);
- }
+
+ // Return generated code
+ return $OUT;
}
// Add links for sorting
-function addSortLinks ($letter, $sortby, $colspan, $return=false) {
+function addSortLinks ($letter, $sortby) {
$OUT = '';
if (!isGetRequestParameterSet('offset')) setGetRequestParameter('offset', 0);
if (!isGetRequestParameterSet('page')) setGetRequestParameter('page' , 0);
}
} // END - foreach
- // Add list and colspan
+ // Add output
$content['list'] = substr($OUT, 0, -1);
- $content['colspan2'] = $colspan;
// Load template
$OUT = loadTemplate('admin_list_user_sort', true, $content);
- // Should we return or output?
- if ($return === true) {
- // Return code
- return $OUT;
- } else {
- // Output code
- outputHtml($OUT);
- }
+ // Return code
+ return $OUT;
}
// Add page navigation
-function addPageNavigation ($numPages, $offset, $showForm, $colspan, $return=false) {
- // @TODO These two constants are no longer used, maybe we reactivate this code?
- //if ($showForm === true) {
- // // Load form for changing number of lines
- // define('__FORM_HEADER', loadTemplate('admin_list_user_sort_form', true));
- // define('__FORM_FOOTER', '<tr><td colspan="'.$colspan.'" class="seperator bottom"> </td></tr>');
- //} else {
- // // Empty row
- // define('__FORM_HEADER', '<tr><td colspan="' . $colspan . '" class="seperator"> </td></tr>');
- // define('__FORM_FOOTER', '<tr><td colspan="' . $colspan . '" class="seperator bottom"> </td></tr>');
- //}
-
+function addPageNavigation ($numPages) {
+ // Start with empty content
$OUT = '';
- for ($page = 1; $page <= $numPages; $page++) {
- if (($page == getRequestParameter('page')) || ((!isGetRequestParameterSet('page')) && ($page == 1))) {
- $OUT .= '<strong>-';
- } else {
- if (!isGetRequestParameterSet('letter')) setGetRequestParameter('letter', '');
- if (!isGetRequestParameterSet('sortby')) setGetRequestParameter('sortby', 'userid');
- // Base link
- $OUT .= '<a href="{%url=modules.php?module=admin&what=' . getWhat();
+ // Create only the navigation if page count > 1
+ if ($numPages > 1) {
+ // Create navigation links for every page
+ for ($page = 1; $page <= $numPages; $page++) {
+ if (($page == getRequestParameter('page')) || ((!isGetRequestParameterSet('page')) && ($page == 1))) {
+ $OUT .= '<strong>-';
+ } else {
+ if (!isGetRequestParameterSet('letter')) setGetRequestParameter('letter', '');
+ if (!isGetRequestParameterSet('sortby')) setGetRequestParameter('sortby', 'userid');
- // Add status/mode
- foreach (array('mode','status') as $param) {
- if (isGetRequestParameterSet($param)) {
- $OUT .= '&' . $param . '=' . getRequestParameter($param);
- } // END - if
- } // END - foreach
+ // Base link
+ $OUT .= '<a href="{%url=modules.php?module=admin&what=' . getWhat();
- // Letter and so on
- $OUT .= '&letter=' . getRequestParameter('letter') . '&sortby=' . getRequestParameter('sortby') . '&page=' . $page . '&offset=' . $offset . '%}">';
- }
+ // Add status/mode
+ foreach (array('mode','status') as $param) {
+ if (isGetRequestParameterSet($param)) {
+ $OUT .= '&' . $param . '=' . getRequestParameter($param);
+ } // END - if
+ } // END - foreach
+
+ // Letter and so on
+ $OUT .= '&letter=' . getRequestParameter('letter') . '&sortby=' . getRequestParameter('sortby') . '&page=' . $page . '&offset=' . getConfig('user_limit') . '%}">';
+ }
- $OUT .= $page;
+ $OUT .= $page;
- if (($page == getRequestParameter('page')) || ((!isGetRequestParameterSet('page')) && ($page == 1))) {
- $OUT .= '-</strong>';
- } else {
- $OUT .= '</a>';
- }
+ if (($page == getRequestParameter('page')) || ((!isGetRequestParameterSet('page')) && ($page == 1))) {
+ $OUT .= '-</strong>';
+ } else {
+ $OUT .= '</a>';
+ }
- if ($page < $numPages) $OUT .= '|';
- } // END - for
+ if ($page < $numPages) {
+ $OUT .= '|';
+ } // END - if
+ } // END - for
- // Remember the list and colspan
- $content['list'] = $OUT;
- $content['colspan2'] = $colspan;
+ // Add list output
+ $content['list'] = $OUT;
- // Load template
- $OUT = loadTemplate('admin_list_user_pagenav', true, $content);
- if ($return === true) {
- // Return code
- return $OUT;
- } else {
- // Output code
- outputHtml($OUT);
- }
+ // Load template
+ $OUT = loadTemplate('admin_list_user_pagenav', true, $content);
+ } // END - if
+
+ // Return code
+ return $OUT;
}
// Create email link to user's account
if (($title == '') && (isValidUserId($userid))) {
// Set userid as title
$title = $userid;
- } elseif ($userid == 0) {
+ } elseif (!isValidUserId($userid)) {
// User id zero is invalid
- return '<strong>' . $userid . '</strong>';
+ return '<strong>' . makeNullToZero($userid) . '</strong>';
}
if (($title == '0') && ($what == 'list_refs')) {
// Init variables
$MORE = '';
-$colspan = 4;
// Add lock reason?
if (isExtensionInstalledAndNewer('user', '0.3.5')) {
// Are there some entries?
if (!SQL_HASZERONUMS($result_master)) {
// We have some (new?) registrations!
- $templateContent['colspan2'] = ($colspan + 2);
$templateContent['user_count'] = getTotalConfirmedUser();
- // Sorting links
- $templateContent['alpha_sort'] = alpha(getRequestParameter('sortby'), ($colspan + 1), true);
- $templateContent['sort_links'] = addSortLinks(getRequestParameter('letter'), getRequestParameter('sortby'), ($colspan + 1), true);
- $templateContent['page_nav'] = '';
-
- if ($numPages > 1) {
- $templateContent['page_nav'] = addPageNavigation($numPages, getConfig('user_limit'), true, $colspan, true);
- } // END - if
+ // Sorting links and number of pages
+ $templateContent['sort_links'] = addSortLinks(getRequestParameter('letter'), getRequestParameter('sortby'));
+ $templateContent['num_pages'] = $numPages;
// Column with nickname when nickname extension is present
// @TODO Rewrite this into a filter
// Is it a valid resource?
if (SQL_SELECT_DB($GLOBALS['mysql']['dbase'], __FILE__, __LINE__) === true) {
- // This is required for extension 'optimize' to work
+ // Set database name (required for ext-optimize and isSqlTableCreated())
setConfigEntry('__DB_NAME', $GLOBALS['mysql']['dbase']);
// Remove MySQL array from namespace
<div align="center">
<table border="0" cellspacing="0" cellpadding="0" class="table dashed">
<tr>
- <td class="table_header bottom" colspan="$content[colspan2]" align="center">
+ <td class="table_header bottom" colspan="5" align="center">
<strong>{%template,AdminListUserTitle%}:</strong>
</td>
</tr>
- $content[alpha_sort]
+ {%pipe,getRequestParameter,alpha=sortby%}
$content[sort_links]
- $content[page_nav]
+ {%pipe,addPageNavigation=$content[num_pages]%}
$content[rows]
- $content[page_nav]
+ {%pipe,addPageNavigation=$content[num_pages]%}
</table>
</div>
<tr>
- <td colspan="$content[colspan2]" align="center">
+ <td colspan="5" align="center">
<table border="0" cellspacing="0" cellpadding="0" width="510">
<tr>
<td class="admin_alpha">
<tr>
- <td class="table_header" colspan="$content[colspan2]" align="center">
+ <td class="table_header" colspan="5" align="center">
<table border="0" cellspacing="0" cellpadding="0">
<tr>
<td class="admin_pagenav">
<tr>
- <td class="bottom" colspan="$content[colspan2]" align="center">
+ <td class="bottom" colspan="5" align="center">
<table border="0" cellspacing="0" cellpadding="0">
<tr>
<td class="admin_sortlinks">
-<tr>
- <td colspan="$content[colspan2]" align="center">
- <table border="0" cellspacing="0" cellpadding="0">
- <tr>
- <td align="center">
- <!--
- <form accept-charset="UTF-8" action="{%url=modules.php?module=admin&what=list_user%}" method="post">
- </form>
- //-->
- </td>
- </tr>
- </table>
- </td>
-</tr>
+<!-- @DEPRECATED //-->