profile.php
来自「sabreipb 2.1.6 utf-8中文版本!」· PHP 代码 · 共 967 行 · 第 1/3 页
PHP
967 行
if ( strstr( $member['sesslocation'], 'mod:' ) ) { $module = str_replace( 'mod:', '', $member['sesslocation'] ); $filename = ROOT_PATH.'sources/components_location/'.$this->ipsclass->txt_alphanumerical_clean( $module ).'.php'; if ( file_exists( $filename ) ) { $real_loc = $member['location']; $member['location'] = $member['sesslocation']; require_once( $filename ); $toload = 'components_location_'.$module; $loader = new $toload; $loader->ipsclass =& $this->ipsclass; $tmp = $loader->parse_online_entries( array( 1 => $member ) ); if ( is_array( $tmp ) and count( $tmp ) ) { $where = "<a href='{$tmp[1]['_url']}'>{$tmp[1]['_text']}</a>"; } $member['location'] = $real_loc; } } else if ( $member['location_1_type'] == 'topic' AND $member['location_1_id'] ) { $topic = $this->ipsclass->DB->simple_exec_query( array( 'select' => '*', 'from' => 'topics', 'where' => 'tid='.$member['location_1_id'] ) ); if ( $topic['tid'] ) { if ( ! $this->ipsclass->forums->forums_quick_check_access( $member['location_2_id'] ) ) { $where = $this->ipsclass->lang['wol_topic'].': '."<a href='{$this->ipsclass->base_url}showtopic={$topic['tid']}'>{$topic['title']}</a>"; } } } else if ( $member['location_2_type'] == 'forum' AND $member['location_2_id'] ) { if ( ! $this->ipsclass->forums->forums_quick_check_access( $member['location_2_id'] ) ) { $where = $this->ipsclass->lang['wol_forum'].' '.$this->ipsclass->cache['forum_cache'][ $member['location_2_id'] ]['name']; } } else if ( strstr( strtolower($member['sesslocation']), 'usercp' ) or strstr( strtolower($member['sesslocation']), 'msg' ) ) { $where = $this->ipsclass->lang['wol_ucp']; } else if ( strstr( strtolower($member['sesslocation']), 'profile' ) ) { $where = $this->ipsclass->lang['wol_profile']; } else if ( strstr( strtolower($member['sesslocation']), 'search' ) ) { $where = $this->ipsclass->lang['wol_search']; } if ( ! $where ) { $where = $this->ipsclass->lang['wol_index']; } $info['online_extra'] = '('.$where.')'; } //----------------------------------------- // Time... //----------------------------------------- $this->ipsclass->vars['time_adjust'] = $this->ipsclass->vars['time_adjust'] == "" ? 0 : $this->ipsclass->vars['time_adjust']; if ($member['dst_in_use'] == 1) { $member['time_offset'] += 1; } $info['local_time'] = $member['time_offset'] != "" ? gmdate( $this->ipsclass->vars['clock_long'], time() + ($member['time_offset']*3600) + ($this->ipsclass->vars['time_adjust'] * 60) ) : $this->ipsclass->lang['no_info']; $info['avatar'] = $this->ipsclass->get_avatar( $member['avatar_location'] , 1, $member['avatar_size'], $member['avatar_type'] ); //----------------------------------------- // Siggy //----------------------------------------- $info['signature'] = $member['signature']; $this->parser->parse_html = intval($this->ipsclass->vars['sig_allow_html']); $this->parser->parse_nl2br = 1; //判断是否显示签名图片 if (!$this->ipsclass->vars['allow_img_sig']) { $info['signature'] = preg_replace("/<img +src=(\'|\")|\" +border=\"0\" +alt *?= *?\"IPB +Image\" +\/>/i", "", $info['signature']); } //判断是否显示签名图片 $info['signature'] = $this->parser->pre_display_parse($info['signature']); //----------------------------------------- // site //----------------------------------------- if ( $member['website'] and preg_match( "/^http:\/\/\S+$/", $member['website'] ) ) { $info['homepage'] = "<a href='{$member['website']}' target='_blank'>{$member['website']}</a>"; } else { $info['homepage'] = $this->ipsclass->lang['no_info']; } //----------------------------------------- // Birthday //----------------------------------------- if ($member['bday_month']) { $info['birthday'] = $member['bday_day']." ".$this->ipsclass->lang[ 'M_'.$member['bday_month'] ]." ".$member['bday_year']; } else { $info['birthday'] = $this->ipsclass->lang['no_info']; } //----------------------------------------- // Email //----------------------------------------- if ( ! $member['hide_email'] ) { $info['email'] = "<a href='{$this->ipsclass->base_url}act=Mail&CODE=00&MID={$member['id']}'>{$this->ipsclass->lang['email']}</a>"; } else { $info['email'] = $this->ipsclass->lang['private']; } //----------------------------------------- // Get photo and show profile: //----------------------------------------- $this->load_photo( $member['id'], $member ); if ( $this->has_photo == TRUE ) { $info['photo'] = $this->ipsclass->compiled_templates['skin_profile']->get_photo( $this->show_photo, $this->show_width, $this->show_height ); } else { $info['photo'] = ""; } $info['base_url'] = $this->ipsclass->base_url; $info['posts'] = $this->ipsclass->do_number_format($info['posts']); //----------------------------------------- // Output //----------------------------------------- $this->output .= $this->ipsclass->compiled_templates['skin_profile']->show_profile( $info, $this->ipsclass->return_md5_check() ); //----------------------------------------- // Is this our profile? //----------------------------------------- if ($member['id'] == $this->ipsclass->member['id']) { $this->output = preg_replace( "/<!--MEM OPTIONS-->/", $this->ipsclass->compiled_templates['skin_profile']->user_edit($info), $this->output ); } //----------------------------------------- // Get custom profile information //----------------------------------------- require_once( ROOT_PATH.'sources/classes/class_custom_fields.php' ); $fields = new custom_fields( $this->ipsclass->DB ); $fields->member_id = $this->ipsclass->member['id']; $fields->mem_data_id = $member['id']; $fields->cache_data = $this->ipsclass->cache['profilefields']; $fields->admin = intval($this->ipsclass->member['g_access_cp']); $fields->supmod = intval($this->ipsclass->member['g_is_supmod']); $fields->init_data(); $fields->parse_to_view(); foreach( $fields->out_fields as $id => $data ) { if ( ! $data ) { $data = $this->ipsclass->lang['no_info']; } $custom_out .= $this->ipsclass->compiled_templates['skin_profile']->custom_field( $fields->field_names[ $id ], nl2br($data) ); } if ($custom_out != "") { $this->output = str_replace( "<!--{CUSTOM.FIELDS}-->", $custom_out, $this->output ); } else { $this->output = str_replace( "<!--{CUSTOM.FIELDS}-->", $this->ipsclass->compiled_templates['skin_profile']->no_custom_information(), $this->output ); } //----------------------------------------- // Warning stuff!! //----------------------------------------- $pass = 0; $mod = 0; if ( $this->ipsclass->vars['warn_on'] and ( ! stristr( ','.$this->ipsclass->vars['warn_protected'].',', ','.$member['mgroup'].',' ) ) ) { if ($this->ipsclass->member['id']) { if ( $this->ipsclass->member['g_is_supmod'] == 1 ) { $pass = 1; $mod = 1; } if ( $pass == 0 and ( $this->ipsclass->vars['warn_show_own'] and ( $member['id'] == $this->ipsclass->member['id'] ) ) ) { $pass = 1; } if ( $pass == 1 ) { // Work out which image to show. if ( ! $this->ipsclass->vars['warn_show_rating'] ) { if ( $member['warn_level'] < 1 ) { $member['warn_img'] = '<{WARN_0}>'; } else if ( $member['warn_level'] >= $this->ipsclass->vars['warn_max'] ) { $member['warn_img'] = '<{WARN_5}>'; $member['warn_percent'] = 100; } else { $member['warn_percent'] = $member['warn_level'] ? sprintf( "%.0f", ( ($member['warn_level'] / $this->ipsclass->vars['warn_max']) * 100) ) : 0; if ( $member['warn_percent'] > 100 ) { $member['warn_percent'] = 100; } if ( $member['warn_percent'] >= 81 ) { $member['warn_img'] = '<{WARN_5}>'; } else if ( $member['warn_percent'] >= 61 ) { $member['warn_img'] = '<{WARN_4}>'; } else if ( $member['warn_percent'] >= 41 ) { $member['warn_img'] = '<{WARN_3}>'; } else if ( $member['warn_percent'] >= 21 ) { $member['warn_img'] = '<{WARN_2}>'; } else if ( $member['warn_percent'] >= 1 ) { $member['warn_img'] = '<{WARN_1}>'; } else { $member['warn_img'] = '<{WARN_0}>'; } } if ( $member['warn_percent'] < 1 ) { $member['warn_percent'] = 0; } if ( $mod == 1 ) { $this->output = str_replace( "<!--{WARN_LEVEL}-->", $this->ipsclass->compiled_templates['skin_profile']->warn_level($member['id'], $member['warn_img'], $member['warn_percent']), $this->output ); } else { $this->output = str_replace( "<!--{WARN_LEVEL}-->", $this->ipsclass->compiled_templates['skin_profile']->warn_level_no_mod($member['id'], $member['warn_img'], $member['warn_percent']), $this->output ); } } else { // Rating mode: if ( $mod == 1 ) { $this->output = str_replace( "<!--{WARN_LEVEL}-->", $this->ipsclass->compiled_templates['skin_profile']->warn_level_rating($member['id'], $member['warn_level'], $this->ipsclass->vars['warn_min'], $this->ipsclass->vars['warn_max']), $this->output ); } else { $this->output = str_replace( "<!--{WARN_LEVEL}-->", $this->ipsclass->compiled_templates['skin_profile']->warn_level_rating_no_mod($member['id'], $member['warn_level'], $this->ipsclass->vars['warn_min'], $this->ipsclass->vars['warn_max']), $this->output ); } } } } } $this->page_title = $this->ipsclass->lang['page_title']; $this->nav = array( $this->ipsclass->lang['page_title'] ); } }?>
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?