0 Membros e 1 Visitante estão a ver este tópico.
'all' => array(&$txt[303], 'MLAll', $context['listing_by'] == 'all'),
'all' => array(&$txt[303], 'MLAll', $context['listing_by'] == 'all'), 'position' => array(&$txt['mlist_search_group'], 'MLPosition', $context['listing_by'] == 'position'),
$context['can_send_pm'] = allowedTo('pm_send');
$context['can_send_pm'] = allowedTo('pm_send'); //Preload Membergoups :) and set some Standards global $db_prefix; $context['ID_GROUP'] = 0; $request = db_query(" SELECT groupName, ID_GROUP, minPosts FROM {$db_prefix}membergroups WHERE ID_GROUP != 3 ORDER BY minPosts, ID_GROUP != 1, ID_GROUP != 2, groupName", __FILE__, __LINE__); while ($row = mysql_fetch_assoc($request)) { $context['groups'][(int) $row['ID_GROUP']] = array( 'id' => $row['ID_GROUP'], 'name' => trim($row['groupName']), 'is_post_group' => $row['minPosts'] != -1, ); } mysql_free_result($request);
function printMemberListRows($request){
// Filter Memberlist by Membergroups.function MLPosition(){ global $txt, $scripturl, $db_prefix, $user_info; global $modSettings, $context, $func; //Nothing set? Hacking? $_REQUEST['position'] = !isset($_REQUEST['position']) ? 0 : (int) $_REQUEST['position']; if(empty($_REQUEST['position']) || !isset($context['groups'][$_REQUEST['position']])) $currentGroup = $context['groups'][1]; //Admins is the Standard for me ;) else $currentGroup = $context['groups'][$_REQUEST['position']]; //Set the id for later. $context['ID_GROUP'] = $currentGroup['id']; if($currentGroup['is_post_group']) { $group_sql = 'ID_POST_GROUP = '.$currentGroup['id']; $group_sql_and = 'ID_GROUP = 0'; } else { $group_sql = 'ID_GROUP = '.$currentGroup['id']; $group_sql_and = ''; } //First count the current Filter counter $request = db_query(" SELECT COUNT(*) FROM {$db_prefix}members WHERE is_activated = 1 AND $group_sql".(!empty($group_sql_and) ? " AND $group_sql_and" : ""), __FILE__, __LINE__); list ($context['num_members']) = mysql_fetch_row($request); mysql_free_result($request); // Set defaults for sort (realName) and start. (0) if (!isset($_REQUEST['sort']) || !isset($context['columns'][$_REQUEST['sort']])) $_REQUEST['sort'] = 'realName'; if (!is_numeric($_REQUEST['start'])) { if (preg_match('~^[^\'\\\\/]~' . ($context['utf8'] ? 'u' : ''), $func['strtolower']($_REQUEST['start']), $match) === 0) fatal_error('h.a.c.k.e.r?', false); $_REQUEST['start'] = $match[0]; $request = db_query(" SELECT COUNT(*) FROM {$db_prefix}members WHERE LOWER(SUBSTRING(realName, 1, 1)) < '$_REQUEST[start]' AND is_activated = 1 AND $group_sql".(!empty($group_sql_and) ? " AND $group_sql_and" : ""), __FILE__, __LINE__); list ($_REQUEST['start']) = mysql_fetch_row($request); mysql_free_result($request); } $context['letter_links'] = ''; for ($i = 97; $i < 123; $i++) $context['letter_links'] .= '<a href="' . $scripturl . '?action=mlist;sa=position;position='.$currentGroup['id'].';start=' . chr($i) . '#letter' . chr($i) . '">' . strtoupper(chr($i)) . '</a> '; // Sort out the column information. foreach ($context['columns'] as $col => $dummy) { $context['columns'][$col]['href'] = $scripturl . '?action=mlist;sa=position;position='.$currentGroup['id'].';sort=' . $col . ';start=0'; if (!isset($_REQUEST['desc']) && $col == $_REQUEST['sort']) $context['columns'][$col]['href'] .= ';desc'; $context['columns'][$col]['link'] = '<a href="' . $context['columns'][$col]['href'] . '">' . $context['columns'][$col]['label'] . '</a>'; $context['columns'][$col]['selected'] = $_REQUEST['sort'] == $col; } $context['sort_by'] = $_REQUEST['sort']; $context['sort_direction'] = !isset($_REQUEST['desc']) ? 'down' : 'up'; // Construct the page index. $context['page_index'] = constructPageIndex($scripturl . '?action=mlist;sa=position;position='.$currentGroup['id'].';sort=' . $_REQUEST['sort'] . (isset($_REQUEST['desc']) ? ';desc' : ''), $_REQUEST['start'], $context['num_members'], $modSettings['defaultMaxMembers']); // Send the data to the template. $context['start'] = $_REQUEST['start'] + 1; $context['end'] = min($_REQUEST['start'] + $modSettings['defaultMaxMembers'], $context['num_members']); $context['page_title'] = $txt[308] . ' ' . $context['start'] . ' ' . $txt[311] . ' ' . $context['end']. ' ('.$currentGroup['name'].')'; $context['linktree'][] = array( 'url' => $scripturl . '?action=mlist;sa=position;position='.$currentGroup['id'].';sort=' . $_REQUEST['sort'] . ';start=' . $_REQUEST['start'], 'name' => &$context['page_title'], 'extra_after' => ' (' . $txt[309] . ' ' . $context['num_members'] . ' ' . $txt[310] . ')' ); // List out the different sorting methods... $sort_methods = array( 'isOnline' => array( 'down' => '(ISNULL(lo.logTime)' . (!allowedTo('moderate_forum') ? ' OR NOT mem.showOnline' : '') . ') ASC, realName ASC', 'up' => '(ISNULL(lo.logTime)' . (!allowedTo('moderate_forum') ? ' OR NOT mem.showOnline' : '') . ') DESC, realName DESC' ), 'realName' => array( 'down' => 'mem.realName ASC', 'up' => 'mem.realName DESC' ), 'emailAddress' => array( 'down' => (allowedTo('moderate_forum') || empty($modSettings['allow_hideEmail'])) ? 'mem.emailAddress ASC' : 'mem.hideEmail ASC, mem.emailAddress ASC', 'up' => (allowedTo('moderate_forum') || empty($modSettings['allow_hideEmail'])) ? 'mem.emailAddress DESC' : 'mem.hideEmail DESC, mem.emailAddress DESC' ), 'websiteUrl' => array( 'down' => 'LENGTH(mem.websiteURL) > 0 DESC, ISNULL(mem.websiteURL) ASC, mem.websiteURL ASC', 'up' => 'LENGTH(mem.websiteURL) > 0 ASC, ISNULL(mem.websiteURL) DESC, mem.websiteURL DESC' ), 'ICQ' => array( 'down' => 'LENGTH(mem.ICQ) > 0 DESC, ISNULL(mem.ICQ) OR mem.ICQ = 0 ASC, mem.ICQ ASC', 'up' => 'LENGTH(mem.ICQ) > 0 ASC, ISNULL(mem.ICQ) OR mem.ICQ = 0 DESC, mem.ICQ DESC' ), 'AIM' => array( 'down' => 'LENGTH(mem.AIM) > 0 DESC, ISNULL(mem.AIM) ASC, mem.AIM ASC', 'up' => 'LENGTH(mem.AIM) > 0 ASC, ISNULL(mem.AIM) DESC, mem.AIM DESC' ), 'YIM' => array( 'down' => 'LENGTH(mem.YIM) > 0 DESC, ISNULL(mem.YIM) ASC, mem.YIM ASC', 'up' => 'LENGTH(mem.YIM) > 0 ASC, ISNULL(mem.YIM) DESC, mem.YIM DESC' ), 'MSN' => array( 'down' => 'LENGTH(mem.MSN) > 0 DESC, ISNULL(mem.MSN) ASC, mem.MSN ASC', 'up' => 'LENGTH(mem.MSN) > 0 ASC, ISNULL(mem.MSN) DESC, mem.MSN DESC' ), 'registered' => array( 'down' => 'mem.dateRegistered ASC', 'up' => 'mem.dateRegistered DESC' ), 'ID_GROUP' => array( 'down' => 'ISNULL(mg.groupName) ASC, mg.groupName ASC', 'up' => 'ISNULL(mg.groupName) DESC, mg.groupName DESC' ), 'posts' => array( 'down' => 'mem.posts DESC', 'up' => 'mem.posts ASC' ) ); $limit = $_REQUEST['start']; // Select the members from the database. $request = db_query(" SELECT mem.ID_MEMBER FROM {$db_prefix}members AS mem" . ($_REQUEST['sort'] === 'isOnline' ? " LEFT JOIN {$db_prefix}log_online AS lo ON (lo.ID_MEMBER = mem.ID_MEMBER)" : '') . ($_REQUEST['sort'] === 'ID_GROUP' ? " LEFT JOIN {$db_prefix}membergroups AS mg ON (mg.ID_GROUP = IF(mem.ID_GROUP = 0, mem.ID_POST_GROUP, mem.ID_GROUP))" : '') . " WHERE mem.is_activated = 1 AND mem.{$group_sql}".(!empty($group_sql_and) ? " AND mem.{$group_sql_and}" : "")." ORDER BY " . $sort_methods[$_REQUEST['sort']][$context['sort_direction']] . " LIMIT $limit, $modSettings[defaultMaxMembers]", __FILE__, __LINE__); printMemberListRows($request); mysql_free_result($request); // Add anchors at the start of each letter. if ($_REQUEST['sort'] == 'realName') { $last_letter = ''; foreach ($context['members'] as $i => $dummy) { $this_letter = $func['strtolower']($func['substr']($context['members'][$i]['name'], 0, 1)); if ($this_letter != $last_letter && preg_match('~[a-z]~', $this_letter) === 1) { $context['members'][$i]['sort_letter'] = htmlspecialchars($this_letter); $last_letter = $this_letter; } } }}function printMemberListRows($request){
// Display page numbers and the a-z links for sorting by name if not a result of a search. if (!isset($context['old_search'])) echo ' <table width="100%" cellpadding="0" cellspacing="0" border="0"> <tr> <td>', $txt[139], ': ', $context['page_index'], '</td> <td align="right">', $context['letter_links'] . '</td> </tr> </table>';
// Display page numbers and the a-z links for sorting by name if not a result of a search. if (!isset($context['old_search'])) { echo ' <form name="searchPosition" action="'.$scripturl.'?action=mlist;sa=position" method="post">'; echo ' <table width="100%" cellpadding="0" cellspacing="0" border="0"> <tr> <td>', $txt[139], ': ', $context['page_index'], ' <select name="position" onChange="document.searchPosition.submit();">'.($context['ID_GROUP'] != 0 ? '' : ' <option value="0"'.($context['ID_GROUP'] == 0 ? ' selected="selected"' : '').'>'.$txt['mlist_search_group'].'</option>'); foreach($context['groups'] as $group) echo ' <option value="'.$group['id'].'"'.($group['id'] == $context['ID_GROUP'] ? ' selected="selected"' : '').'>'.$group['name'].'</option>'; echo ' </select> <input type="submit" value="'.$txt['quick_mod_go'].'"> </td> <td align="right">', $context['letter_links'] . '</td> </tr> </table> </form>'; }