X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=inc%2Fmodules%2Fadmin%2Fwhat-list_user.php;h=f3cbe2fd446095e7560c7cf168d99f888e46a05b;hb=9a1b4c97e62a0360dc721e599fa19068ae23c773;hp=0c861764522ffd981c4a34001ed85d600346c553;hpb=03e4bc225c635dafb42c5078d1b75cc7351c3443;p=mailer.git diff --git a/inc/modules/admin/what-list_user.php b/inc/modules/admin/what-list_user.php index 0c86176452..f3cbe2fd44 100644 --- a/inc/modules/admin/what-list_user.php +++ b/inc/modules/admin/what-list_user.php @@ -17,7 +17,7 @@ * -------------------------------------------------------------------- * * Copyright (c) 2003 - 2009 by Roland Haeder * * Copyright (c) 2009 - 2011 by Mailer Developer Team * - * For more information visit: http://www.mxchange.org * + * For more information visit: 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 * @@ -45,7 +45,6 @@ addYouAreHereLink('admin', __FILE__); // Init variables $MORE = ''; -$colspan = 4; // Add lock reason? if (isExtensionInstalledAndNewer('user', '0.3.5')) { @@ -63,20 +62,20 @@ if (isExtensionActive('country')) { } // Init unset data -if (!isGetRequestParameterSet('letter')) { setGetRequestParameter('letter', ''); } -if (!isGetRequestParameterSet('sortby')) { setGetRequestParameter('sortby', 'userid'); } -if (!isGetRequestParameterSet('page')) { setGetRequestParameter('page' , 1); } +if (!isGetRequestElementSet('letter')) { setGetRequestElement('letter', ''); } +if (!isGetRequestElementSet('sortby')) { setGetRequestElement('sortby', 'userid'); } +if (!isGetRequestElementSet('page')) { setGetRequestElement('page' , 1); } // Set base URL $base = '[ 0) { // Then use it - $content['birthday'] = generateDateTime($stamp, '3'); + $content['birthday'] = generateDateTime($stamp, '2'); } else { // Zero or below so set zero! - $content['birthday'] = generateDateTime(0, '3'); + $content['birthday'] = generateDateTime(0, '2'); } // Prepare data for template $content['email_link'] = generateEmailLink($content['email'], 'user_data'); - $content['last_online'] = generateDateTime($content['last_online'], '0'); - $content['joined'] = generateDateTime($content['joined'], '0'); - $content['last_update'] = generateDateTime($content['last_update'], '0'); - $content['last_profile_sent'] = generateDateTime($content['last_profile_sent'], '0'); + $content['last_online'] = generateDateTime($content['last_online'], '2'); + $content['joined'] = generateDateTime($content['joined'], '2'); + $content['last_update'] = generateDateTime($content['last_update'], '2'); + $content['last_profile_sent'] = generateDateTime($content['last_profile_sent'], '2'); $content['total_points'] = getTotalPoints($content['userid']); $content['locked_points'] = countSumTotalData($content['userid'], 'user_points', 'locked_points') + countSumTotalData($content['userid'], 'user_points', 'locked_order_points'); @@ -131,7 +130,7 @@ LIMIT 1", // Add more data $content['own_points'] = $data['points']; - $content['lock_timestamp'] = generateDateTime($content['lock_timestamp'], 2); + $content['lock_timestamp'] = generateDateTime($content['lock_timestamp'], '2'); // Link to email_details if some are sent if ($content['emails_sent'] > 0) { @@ -167,24 +166,24 @@ LIMIT 1", SQL_FREERESULT($result_user); } else { $whereStatement = ''; - if (isGetRequestParameterSet('letter')) { + if (isGetRequestElementSet('letter')) { // List only persons w - $whereStatement = " WHERE `family` LIKE '".getRequestParameter('letter') . "%%'"; + $whereStatement = " WHERE `family` LIKE '".getRequestElement('letter') . "%%'"; } // END - if // Parse the status or mode parameter - if (isGetRequestParameterSet('status')) { + if (isGetRequestElementSet('status')) { // Is a WHERE statement already there? if (!empty($whereStatement)) { // Then append the status column - $whereStatement .= sprintf(" AND `status`='%s'", SQL_ESCAPE(secureString(strtoupper(getRequestParameter('status'))))); + $whereStatement .= sprintf(" AND `status`='%s'", SQL_ESCAPE(secureString(strtoupper(getRequestElement('status'))))); } else { // Start a new one - $whereStatement = sprintf(" WHERE `status`='%s'", SQL_ESCAPE(secureString(strtoupper(getRequestParameter('status'))))); + $whereStatement = sprintf(" WHERE `status`='%s'", SQL_ESCAPE(secureString(strtoupper(getRequestElement('status'))))); } - } elseif (isGetRequestParameterSet('mode')) { + } elseif (isGetRequestElementSet('mode')) { // Choose what we need to list - switch (getRequestParameter('mode')) { + switch (getRequestElement('mode')) { case 'norefs': // Users w/o refs if (!empty($whereStatement)) { // Add AND statement @@ -206,14 +205,14 @@ LIMIT 1", break; default: // Invalid list mode - debug_report_bug(__FILE__, __LINE__, sprintf("Invalid list mode %s detected.", getRequestParameter('mode'))); + debug_report_bug(__FILE__, __LINE__, sprintf("Invalid list mode %s detected.", getRequestElement('mode'))); break; } // END - switch } // END - if // Generate master query string - $sql = sprintf("SELECT `userid`, `email`, `emails_sent`, `mails_confirmed`, `emails_received`" . $MORE . " FROM `{?_MYSQL_PREFIX?}_user_data`" . $whereStatement . " ORDER BY `%s` ASC", - getRequestParameter('sortby') + $sql = sprintf("SELECT `userid`,`email`,`emails_sent`,`mails_confirmed`,`emails_received`" . $MORE . " FROM `{?_MYSQL_PREFIX?}_user_data`" . $whereStatement . " ORDER BY `%s` ASC", + getRequestElement('sortby') ); // Prepare SQL and run it @@ -228,27 +227,21 @@ LIMIT 1", // Activate the extension please! $numPages = round(SQL_NUMROWS($result_master) / getConfig('user_limit') + 0.5); - if (!isGetRequestParameterSet('page')) setGetRequestParameter('page' , 1); - if (!isGetRequestParameterSet('offset')) setGetRequestParameter('offset', getConfig('user_limit')); + if (!isGetRequestElementSet('page')) setGetRequestElement('page' , 1); + if (!isGetRequestElementSet('offset')) setGetRequestElement('offset', getConfig('user_limit')); // Add limitation to SQL string and run him again - $sql .= ' LIMIT ' . (getRequestParameter('offset') * getRequestParameter('page') - getRequestParameter('offset')) . ', ' . getRequestParameter('offset'); + $sql .= ' LIMIT ' . (getRequestElement('offset') * getRequestElement('page') - getRequestElement('offset')) . ', ' . getRequestElement('offset'); $result = SQL_QUERY($sql, __FILE__, __LINE__); // 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(getRequestElement('letter'), getRequestElement('sortby')); + $templateContent['num_pages'] = $numPages; // Column with nickname when nickname extension is present // @TODO Rewrite this into a filter @@ -283,7 +276,7 @@ LIMIT 1", // Transfer data to array $content['email'] = '[' . $content['email'] . ']'; - $content['lock_timestamp'] = generateDateTime($content['lock_timestamp'], 2); + $content['lock_timestamp'] = generateDateTime($content['lock_timestamp'], '2'); $content['refs'] = countSumTotalData($content['userid'], 'user_refs', 'id', 'userid', true); $content['own_points'] = countSumTotalData($content['userid'], 'user_points', 'points') + countSumTotalData($content['userid'], 'user_points', 'order_points'); $content['locked_points'] = countSumTotalData($content['userid'], 'user_points', 'locked_points') + countSumTotalData($content['userid'], 'user_points', 'locked_order_points');