memberlist.php

来自「sabreipb 2.1.6 utf-8中文版本!」· PHP 代码 · 共 528 行 · 第 1/2 页

PHP
528
字号
<?php/*+--------------------------------------------------------------------------|   Invision Power Board v2.1.5|   =============================================|   by Matthew Mecham|   (c) 2001 - 2005 Invision Power Services, Inc.|   |   =============================================|   Web: |   Time: Wed, 01 Mar 2006 19:11:27 GMT|   Release: |   Licence Info: +---------------------------------------------------------------------------|   > $Date: 2006-01-11 22:47:48 +0000 (Wed, 11 Jan 2006) $|   > $Revision: 122 $|   > $Author: bfarber $+---------------------------------------------------------------------------||   > Show all the members|   > Module written by Matt Mecham|   > Date started: 20th February 2002||	> Module Version Number: 1.0.0|   > DBA Checked: Wed 19 May 2004|   > Quality Checked: Wed 15 Sept. 2004+--------------------------------------------------------------------------*/if ( ! defined( 'IN_IPB' ) ){	print "<h1>Incorrect access</h1>You cannot access this file directly. If you have recently upgraded, make sure you upgraded all the relevant files.";	exit();}class memberlist{	# Classes	var $ipsclass;		# Others    var $output     = "";    var $page_title = "";    var $nav        = array();    var $html       = "";       var $first       = 0;    var $max_results = 10;    var $sort_key    = 'members_display_name';    var $sort_order  = 'asc';    var $filter      = 'ALL';        var $mem_titles = array();    var $mem_groups = array();        var $ucp_html   = "";    var $topic      = "";        /*-------------------------------------------------------------------------*/	// Auto-run	/*-------------------------------------------------------------------------*/    function auto_run()    {		//-----------------------------------------    	// Require the HTML and language modules    	//-----------------------------------------    			$this->ipsclass->load_language('lang_mlist');    	$this->ipsclass->load_template('skin_mlist');    	    	if ($this->ipsclass->member['g_mem_info'] != 1) 		{ 			$this->ipsclass->Error( array( 'LEVEL' => 1, 'MSG' => 'no_permission' ) );    	}    	    	//-----------------------------------------    	// Grab topics.php to parse member    	//-----------------------------------------    	    	require_once( ROOT_PATH.'sources/action_public/topics.php' );    	$this->topic = new topics();    	$this->topic->ipsclass =& $this->ipsclass;    	$this->topic->topic_init( 1 );    	    	$see_groups = array();    	    	//-----------------------------------------    	// Get the member groups, member titles stuff    	//-----------------------------------------    	    	foreach( $this->ipsclass->cache['group_cache'] as $id => $row )    	{    		if ( $row['g_hide_from_list'] )    		{    			continue;    		}    		    		$see_groups[] = $row['g_id'];    		    		$this->mem_groups[ $row['g_id'] ] = array( 'TITLE'  => $row['g_title'],    												   'ICON'   => $row['g_icon'],    											     );    	}    	    	$the_filter  = array( 'ALL' => $this->ipsclass->lang['show_all'] );    	    	foreach($this->mem_groups as $id => $data)    	{    		if ($id == $this->ipsclass->vars['guest_group'])    		{    			continue;    		}    		    		$the_filter[$id] = $data['TITLE'];    	}    	    	$group_string = implode( ",", $see_groups );    	    	//-----------------------------------------    	// Test for input     	//-----------------------------------------    	    	if (isset($this->ipsclass->input['st']))          $this->first       = intval($this->ipsclass->input['st']);    	if (isset($this->ipsclass->input['max_results'])) $this->max_results = $this->ipsclass->input['max_results'];    	if (isset($this->ipsclass->input['sort_key']))    $this->sort_key    = $this->ipsclass->input['sort_key'];    	if (isset($this->ipsclass->input['sort_order']))  $this->sort_order  = $this->ipsclass->input['sort_order'];    	if (isset($this->ipsclass->input['filter']))      $this->filter      = $this->ipsclass->input['filter'];    	    	//-----------------------------------------    	// Init some arrays    	//-----------------------------------------    	    	$the_sort_key = array( 'members_display_name'    => 'sort_by_name',    						   'posts'   => 'sort_by_posts',    						   'joined'  => 'sort_by_joined',    						 );    						     	$the_max_results = array( 10  => '10',    							  20  => '20',    							  30  => '30',    							  40  => '40',    							  50  => '50',    						    );    						        	$the_sort_order = array(  'desc' => 'descending_order',    							  'asc'  => 'ascending_order',    						   );    						       	//-----------------------------------------    	// Start the form stuff    	//-----------------------------------------    						       	$filter_html      = "<select name='filter' class='forminput'>\n";    	$sort_key_html    = "<select name='sort_key' class='forminput'>\n";    	$max_results_html = "<select name='max_results' class='forminput'>\n";    	$sort_order_html  = "<select name='sort_order' class='forminput'>\n";    	    	foreach ($the_sort_order as $k => $v)    	{			$sort_order_html .= $k == $this->sort_order ? "<option value='$k' selected>" . $this->ipsclass->lang[ $the_sort_order[ $k ] ] . "</option>\n"											            : "<option value='$k'>"          . $this->ipsclass->lang[ $the_sort_order[ $k ] ] . "</option>\n";		}     	foreach ($the_filter as $k => $v)     	{			$filter_html .= $k == $this->filter  ? "<option value='$k' selected>"         . $the_filter[ $k ] . "</option>\n"											            : "<option value='$k'>"          . $the_filter[ $k ] . "</option>\n";		}   	    	foreach ($the_sort_key as $k => $v)    	{			$sort_key_html .= $k == $this->sort_key ? "<option value='$k' selected>"     . $this->ipsclass->lang[ $the_sort_key[ $k ] ] . "</option>\n"											            : "<option value='$k'>"          . $this->ipsclass->lang[ $the_sort_key[ $k ] ] . "</option>\n";		}    	    	foreach ($the_max_results as $k => $v)    	{			$max_results_html .= $k == $this->max_results ? "<option value='$k' selected>". $the_max_results[ $k ] . "</option>\n"											            : "<option value='$k'>"          . $the_max_results[ $k ] . "</option>\n";		}				$this->ipsclass->lang['sorting_text'] = preg_replace( "/<#FILTER#>/"      , $filter_html."</select>"     , $this->ipsclass->lang['sorting_text'] );    	$this->ipsclass->lang['sorting_text'] = preg_replace( "/<#SORT_KEY#>/"    , $sort_key_html."</select>"   , $this->ipsclass->lang['sorting_text'] );    	$this->ipsclass->lang['sorting_text'] = preg_replace( "/<#SORT_ORDER#>/"  , $sort_order_html."</select>" , $this->ipsclass->lang['sorting_text'] );    	$this->ipsclass->lang['sorting_text'] = preg_replace( "/<#MAX_RESULTS#>/" , $max_results_html."</select>", $this->ipsclass->lang['sorting_text'] );    	    	$error = 0;    	    	if ( ! isset($the_sort_key[ $this->sort_key ]) )       $error = 1;    	if ( ! isset($the_sort_order[ $this->sort_order ]) )   $error = 1;    	if ( ! isset($the_filter[ $this->filter ]) )           $error = 1;    	if ( ! isset($the_max_results[ $this->max_results ]) ) $error = 1;    	    	//-----------------------------------------    	// Error?    	//-----------------------------------------    	    	if ($error == 1 )    	{    		if ( $this->ipsclass->input['b'] == 1 )     		{    			$this->ipsclass->Error( array( LEVEL=> 1, MSG =>'ml_error') );    		}    		else    		{    			$this->ipsclass->Error( array( LEVEL=> 5, MSG =>'incorrect_use') );    		}    	}    	    	//-----------------------------------------    	// Quick form?    	//-----------------------------------------    	    	$quick_jump = "";    	    	for ( $i = 65; $i <= 90; $i++ )    	{    		$letter      = strtolower(chr($i));    		$selected    = $this->ipsclass->input['quickjump'] == $letter ? ' selected="selected"' : '';    		$quick_jump .= $this->ipsclass->compiled_templates['skin_mlist']->mlist_quick_jump_entry( $letter, $selected );    	}    	    	//-----------------------------------------    	// Get custom profile information    	//-----------------------------------------				$custom_fields = "";		    	$this->topic->custom_fields->admin       = intval($this->ipsclass->member['g_access_cp']);    	$this->topic->custom_fields->supmod      = intval($this->ipsclass->member['g_is_supmod']);    	$this->topic->custom_fields->member_id   = $this->ipsclass->member['id'];    	$this->topic->custom_fields->mem_data_id = 0;    	    	$this->topic->custom_fields->init_data();    	$this->topic->custom_fields->parse_to_edit();    	    	//-----------------------------------------    	// Query..    	//-----------------------------------------    	    	$query        = array();    	$url          = array();    	$query_string = "";    	    	//-----------------------------------------    	// Quick jump rehash...    	//-----------------------------------------    	    	if ( $this->ipsclass->input['qjbutton'] and $this->ipsclass->input['quickjump'] )    	{    		$this->ipsclass->input['name_box'] = 'begins';    		$this->ipsclass->input['name']     = $this->ipsclass->input['quickjump'];    	}    	    	//-----------------------------------------    	// Member Groups...    	//-----------------------------------------    	    	if ($this->filter != 'ALL')    	{    		if ( ! preg_match( "/(^|,)".$this->filter."(,|$)/", $group_string ) )    		{    			$query[] = "m.mgroup IN($group_string)";    		}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?