memberlist.php

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

PHP
528
字号
    		else    		{    			$query[] = "m.mgroup='".$this->filter."' ";    		}    	}    	    	//-----------------------------------------    	// NOT IN Member Groups...    	//-----------------------------------------    	    	if ( is_array( $this->ipsclass->cache['group_cache'] ) and count ( $this->ipsclass->cache['group_cache'] ) )    	{    		$hide_ids = array();    		    		foreach( $this->ipsclass->cache['group_cache'] as $id => $data )    		{    			if ( $data['g_hide_from_list'] )    			{    				$hide_ids[] = $data['g_id'];    			}    		}    		    		if ( count( $hide_ids ) )    		{    			$query[] = "m.mgroup NOT IN(".implode( ",", $hide_ids ).")";    		}    	}    	    	//-----------------------------------------    	// Build query    	//-----------------------------------------    	    	$dates = array( 'lastpost', 'lastvisit', 'joined' );    	    	$mapit = array( 'aim'       => 'me.aim_name',    					'yahoo'     => 'me.yahoo',    					'icq'       => 'me.icq_number',    					'msn'       => 'me.msnname',    					'posts'     => 'm.posts',    					'joined'    => 'm.joined',    					'lastpost'  => 'm.last_post',    					'lastvisit' => 'm.last_visit',    					'signature' => 'me.signature',    					'homepage'  => 'me.website',    					'name'      => 'm.name',    					'photoonly' => 'me.photo_location',    				  );    	    	//-----------------------------------------    	// Do search    	//-----------------------------------------    	    	foreach( $mapit as $in => $tbl )    	{    		$inbit = $this->ipsclass->parse_clean_value(trim(urldecode(stripslashes($this->ipsclass->input[ $in ]))));    		    		$url[] = $in.'='.$this->ipsclass->input[ $in ];    		    		//-----------------------------------------    		// Name...    		//-----------------------------------------    		    		if ( $in == 'name' and $inbit != "" )			{				if ( $this->ipsclass->input['name_box'] == 'begins' )				{					$query[] = "m.members_display_name LIKE '".$inbit."%'";				}				else				{					$query[] = "m.members_display_name LIKE '%".$inbit."%'";				}			}			else if ( $in == 'posts' and intval($inbit) > 0 )			{				$ltmt = $this->ipsclass->input[ $in .'_ltmt' ] == 'lt' ? '<' : '>';				$query[]  = $tbl. ' '.$ltmt.' '.intval($inbit);				$url[]    = $in .'_ltmt=' . $this->ipsclass->input[ $in .'_ltmt' ];			}			else if ( in_array( $in, $dates ) and $inbit )			{				list( $month, $day, $year ) = explode( '-', $this->ipsclass->input[ $in ] );								$month = intval($month);				$day   = intval($day);				$year  = intval($year);								if ( ! checkdate( $month, $day, $year ) )				{					continue;				}								$time_int = mktime( 0, 0 ,0,$month, $day, $year );								$ltmt = $this->ipsclass->input[ $in .'_ltmt' ] == 'lt' ? '<' : '>';								$query[]  = $tbl. ' '.$ltmt.' '.$time_int;				$url[]    = $in .'_ltmt=' . $this->ipsclass->input[ $in .'_ltmt' ];			}			else if ( $in == 'photoonly' )			{				if ( $this->ipsclass->input['photoonly'] == 1 )				{					$query[] = $tbl. "<> ''";				}			}			else if ( $inbit != "" )			{				$query[] = $tbl. " LIKE '%{$inbit}%'";			}	    	}    	    	//-----------------------------------------    	// Custom fields?    	//-----------------------------------------    	    	if ( count( $this->topic->custom_fields->out_fields ) )    	{    		foreach( $this->topic->custom_fields->out_fields as $id => $data )    		{    			if ( $this->ipsclass->input['field_'.$id] )    			{    				$query[] = "p.field_{$id} LIKE '{$this->ipsclass->input['field_'.$id]}%'";    				$url[]   = "field_{$id}=".$this->ipsclass->input['field_'.$id];    			}    		}    	}    	    	//-----------------------------------------    	// Finish query    	//-----------------------------------------    	    	if ( count($query) )    	{    		$query_string = implode( " AND ", $query );    	}    	    	//-----------------------------------------    	// Count...    	//-----------------------------------------    	    	$this->ipsclass->DB->cache_add_query( 'mlist_count', array( 'query' => $query_string ) );    	$this->ipsclass->DB->cache_exec_query();    	    	$max = $this->ipsclass->DB->fetch_row();				$links = $this->ipsclass->build_pagelinks(  array( 'TOTAL_POSS'  => $max['total_members'],														   'PER_PAGE'    => $this->max_results,														   'CUR_ST_VAL'  => $this->first,														   'L_SINGLE'     => "",														   'L_MULTI'      => $this->ipsclass->lang['pages'],														   'BASE_URL'     => $this->ipsclass->base_url."&amp;name_box={$this->ipsclass->input['name_box']}&amp;sort_key={$this->sort_key}&amp;sort_order={$this->sort_order}&amp;filter={$this->filter}&amp;act=members&amp;max_results={$this->max_results}&amp;".implode( '&amp;', $url )														 )												  );									   		$this->output = $this->ipsclass->compiled_templates['skin_mlist']->mlist_start();									   		$this->output .= $this->ipsclass->compiled_templates['skin_mlist']->mlist_page_header( $links, $quick_jump );  				//-----------------------------------------    	// Get custom profile information    	//-----------------------------------------    	    	$custom_fields = "";    	    	if ( count( $this->topic->custom_fields->out_fields ) )    	{			foreach( $this->topic->custom_fields->out_fields as $id => $data )			{				if ( $this->topic->custom_fields->cache_data[ $id ]['pf_type'] == 'drop' )				{					$tmp = $this->ipsclass->compiled_templates['skin_mlist']->mlist_custom_field_dropdown( 'field_'.$id, $data );				}				else				{					$tmp = $this->ipsclass->compiled_templates['skin_mlist']->mlist_custom_field_textinput( 'field_'.$id ); 				} 				 				$custom_fields .= $this->ipsclass->compiled_templates['skin_mlist']->mlist_custom_field_entry( $this->topic->custom_fields->field_names[ $id ], $tmp );			}		}				//-----------------------------------------		// START THE LISTING		//-----------------------------------------				if ( $max['total_members'] > 0 )		{			$this->ipsclass->DB->cache_add_query( 'mlist_get_members', array( 'query'   => $query_string,																			  'sort'    => $this->sort_key,																			  'order'   => $this->sort_order,																			  'limit_a' => $this->first,																			  'limit_b' => $this->max_results ) );			$this->ipsclass->DB->cache_exec_query();						while ($member = $this->ipsclass->DB->fetch_row() )			{				$member = $this->topic->parse_member( $member );								$photo_vars = $this->ipsclass->cache['group_cache'][$member['mgroup']]['g_photo_max_vars'];				$photo_dims = array( 'pwidth' => 180, 'pheight' => 180 );								if( strpos( $photo_vars, ":" ) )				{					$tmp = array();					$tmp = explode( ":", $photo_vars );					$photo_dims['pwidth'] = $tmp[1]+30;					$photo_dims['pheight'] = $tmp[2]+30;					unset( $tmp, $photo_vars );				}								$member['joined'] = $this->ipsclass->get_date( $member['joined'], 'JOINED' );								$member['group']  = $this->mem_groups[ $member['mgroup'] ]['TITLE'];								if ($member['photo_type'] and $member['photo_location'])				{					$member['camera'] = "<a href=\"javascript:PopUp('{$this->ipsclass->base_url}act=Profile&amp;CODE=showphoto&amp;MID={$member['id']}','Photo','{$photo_dims['pwidth']}','{$photo_dims['pheight']}','0','1','1','1')\"><{CAMERA}></a>";				}								$member['posts'] = $this->ipsclass->do_number_format($member['posts']);								//-----------------------------------------				// Bug fix... name-- breaks formatting				// xhmlt invalid..				//-----------------------------------------								$member['members_display_name'] = str_replace( '--', '&#45;&#45;', $member['members_display_name'] );								$this->output .= $this->ipsclass->compiled_templates['skin_mlist']->mlist_show_row($member);							}		}		else		{			$this->output .= $this->ipsclass->compiled_templates['skin_mlist']->mlist_no_results();		}				$checked = $this->ipsclass->input['photoonly'] == 1 ? 'checked="checked"' : "";				//-----------------------------------------		// Print bottom...		//-----------------------------------------				$this->output .= $this->ipsclass->compiled_templates['skin_mlist']->mlist_page_end( $checked );				$this->output .= $this->ipsclass->compiled_templates['skin_mlist']->mlist_end( $links );				if ( $custom_fields )		{			$this->output = str_replace( '<!--CUSTOM_FIELDS-->', $this->ipsclass->compiled_templates['skin_mlist']->mlist_custom_field_wrap($custom_fields), $this->output );		}    	    	//-----------------------------------------    	// Push to print handler    	//-----------------------------------------    	    	$this->ipsclass->print->add_output( $this->output );        $this->ipsclass->print->do_output( array( 'TITLE' => $this->ipsclass->lang['page_title'], 'JS' => 0, 'NAV' => array( $this->ipsclass->lang['page_title'] ) ) ); 	}	}?>

⌨️ 快捷键说明

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