X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=inc%2Fmodules%2Fadmin%2Fwhat-list_user.php;h=0199638d136c39047917a5c705bbfdc684290b5e;hb=a05706f3f5f5e6ae26c2114d2fd3ede01d5fe093;hp=0ab0267cdbce1fd9957d61ff5b9b875ca6d7a9cd;hpb=75ad748a68473ace540251427a74fb781b1145e9;p=mailer.git diff --git a/inc/modules/admin/what-list_user.php b/inc/modules/admin/what-list_user.php index 0ab0267cdb..0199638d13 100644 --- a/inc/modules/admin/what-list_user.php +++ b/inc/modules/admin/what-list_user.php @@ -128,34 +128,40 @@ WHERE userid=%d LIMIT 1", } else { - $WHERE = ""; + $whereStatement = ""; if (($_GET['letter'] != _ALL2) && ($_GET['letter'] != _OTHERS) && (!empty($_GET['letter']))) { // List only persons w - $WHERE = " WHERE family LIKE '".$_GET['letter']."%'"; + $whereStatement = " WHERE family LIKE '".$_GET['letter']."%'"; } if ($_GET['sortby'] == "family_name") $_GET['sortby'] = "family"; // Parse the mode parameter if (isset($_GET['mode'])) { // Is a WHERE statement already there? - if (!empty($WHERE)) { + if (!empty($whereStatement)) { // Then append the status column - $WHERE .= sprintf(" AND status='%s'", SQL_ESCAPE(strip_tags(strtoupper($_GET['mode'])))); + $whereStatement .= sprintf(" AND status='%s'", SQL_ESCAPE(strip_tags(strtoupper($_GET['mode'])))); } else { // Start a new one - $WHERE = sprintf(" WHERE status='%s'", SQL_ESCAPE(strip_tags(strtoupper($_GET['mode'])))); + $whereStatement = sprintf(" WHERE status='%s'", SQL_ESCAPE(strip_tags(strtoupper($_GET['mode'])))); } } - $SQL = "SELECT userid, sex, surname, family, email, REMOTE_ADDR, refid, status".$MORE." FROM "._MYSQL_PREFIX."_user_data".$WHERE." ORDER BY ".$_GET['sortby']; + $SQL = "SELECT userid, sex, surname, family, email, REMOTE_ADDR, refid, status".$MORE." FROM "._MYSQL_PREFIX."_user_data".$whereStatement." ORDER BY ".$_GET['sortby']; $result_master = SQL_QUERY($SQL, __FILE__, __LINE__); // Calculate page count (0.5 fixes a bug with page count) - $PAGES = round(SQL_NUMROWS($result_master) / $CONFIG['user_limit'] + 0.5); + if ($_CONFIG['user_limit'] == 0) { + $_CONFIG['user_limit'] = 100; + LOAD_TEMPLATE("admin_settings_saved", false, EXTENSION_WARNING_USER_LIMIT); + } + + // Activate the extension please! + $PAGES = round(SQL_NUMROWS($result_master) / $_CONFIG['user_limit'] + 0.5); if (empty($_GET['page'])) $_GET['page'] = "1"; - if (empty($_GET['offset'])) $_GET['offset'] = $CONFIG['user_limit']; + if (empty($_GET['offset'])) $_GET['offset'] = $_CONFIG['user_limit']; // Add limitation to SQL string and run him again $SQL .= " LIMIT ".($_GET['offset'] * $_GET['page'] - $_GET['offset']).", ".$_GET['offset']; @@ -174,17 +180,22 @@ WHERE userid=%d LIMIT 1", define('__COLSPAN1' , $colspan); define('__COLSPAN2' , ($colspan + 2)); define('__USER_CNT' , $user_count); - define('__ALPHA_SORT', alpha($_GET['sortby'], $colspan, true)); - define('__SORT_LINKS', SortLinks($_GET['letter'], $_GET['sortby'], $colspan, true)); - if ($PAGES > 1) - { - define('__PAGE_NAV', ADD_PAGENAV($PAGES, $CONFIG['user_limit'], true, $colspan, true)); + + if ((function_exists('alpha')) && (function_exists('SortLinks'))) { + define('__ALPHA_SORT', alpha($_GET['sortby'], $colspan, true)); + define('__SORT_LINKS', SortLinks($_GET['letter'], $_GET['sortby'], $colspan, true)); + } else { + define('__ALPHA_SORT', ""); + define('__SORT_LINKS', ""); } - else - { + + if ($PAGES > 1) { + define('__PAGE_NAV', ADD_PAGENAV($PAGES, $_CONFIG['user_limit'], true, $colspan, true)); + } else { // No page navigation is required define('__PAGE_NAV', ""); } + // Column with nickname when nickname extension is present if (EXT_IS_ACTIVE("nickname")) { @@ -214,7 +225,7 @@ WHERE userid=%d LIMIT 1", 'sex' => TRANSLATE_SEX($sex), 'sname' => $sname, 'fname' => $fname, - 'email' => "".stripslashes($email)."", + 'email' => "".$email."", 'addr' => $IP, 'ref' => $ref, 'status' => TRANSLATE_STATUS($status),