profile.php
来自「sabreipb 2.1.6 utf-8中文版本!」· PHP 代码 · 共 967 行 · 第 1/3 页
PHP
967 行
<?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-02-01 18:16:26 +0000 (Wed, 01 Feb 2006) $| > $Revision: 132 $| > $Author: bfarber $+---------------------------------------------------------------------------|| > User Profile functions| > Module written by Matt Mecham| > Date started: 28th February 2002|| > Module Version Number: 1.0.0| > DBA Checked: Thu 20 May 2004| > Quality Checked: Wed 15 Sept. 2004+--------------------------------------------------------------------------*//*** Public Action Class: Profile** @package InvisionPowerBoard* @subpackage Public-Action* @author Matt Mecham* @copyright Invision Power Services, Inc.* @version 2.1*/if ( ! defined( 'IN_IPB' ) ){ /** * Error checking */ 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();}/*** Public Action Class: Profile** @package InvisionPowerBoard* @subpackage Public-Action* @author Matt Mecham* @version 2.1*/class profile{ var $output = ""; var $page_title = ""; var $nav = array(); var $html = ""; var $member = array(); var $m_group = array(); var $jump_html = ""; var $parser = ""; var $links = array(); var $bio = ""; var $notes = ""; var $size = "m"; var $show_photo = ""; var $show_width = ""; var $show_height = ""; var $show_name = ""; var $photo_member = ""; var $has_photo = FALSE; var $lib; function auto_run() { //----------------------------------------- // Load and config the post parser //----------------------------------------- require_once( ROOT_PATH."sources/handlers/han_parse_bbcode.php" ); $this->parser = new parse_bbcode(); $this->parser->ipsclass = $this->ipsclass; $this->parser->allow_update_caches = 1; $this->parser->bypass_badwords = intval($this->ipsclass->member['g_bypass_badwords']); //----------------------------------------- // Require the HTML and language modules //----------------------------------------- $this->ipsclass->load_language('lang_profile'); $this->ipsclass->load_template('skin_profile'); $this->ipsclass->base_url_nosess = "{$this->ipsclass->vars['board_url']}/index.{$this->ipsclass->vars['php_ext']}"; //----------------------------------------- // What to do? //----------------------------------------- switch($this->ipsclass->input['CODE']) { case '03': $this->view_profile(); break; case 'showphoto': $this->show_photo(); break; case 'showcard': $this->show_card(); break; case 'show-display-names': $this->show_display_names(); break; //----------------------------------------- default: $this->view_profile(); break; } // If we have any HTML to print, do so... $this->ipsclass->print->add_output("$this->output"); $this->ipsclass->print->do_output( array( 'TITLE' => $this->page_title, 'JS' => 1, NAV => $this->nav ) ); } /*-------------------------------------------------------------------------*/ // VIEW CONTACT CARD: /*-------------------------------------------------------------------------*/ /** * Display member display name change history * * Prints a pop-up window of the member's display name * history * * @return void * @since IPB 2.1.0.2005-7-5 */ function show_display_names() { //----------------------------------------- // INIT //----------------------------------------- $id = intval( $this->ipsclass->input['id'] ); $member = array(); $html = ""; $content = ""; //----------------------------------------- // Display name feature on? //----------------------------------------- if ( ! $this->ipsclass->vars['auth_allow_dnames'] ) { $this->ipsclass->Error( array( 'LEVEL' => 1, 'MSG' => 'no_permission' ) ); } //----------------------------------------- // Permission check //----------------------------------------- if ( $this->ipsclass->member['g_mem_info'] != 1 ) { $this->ipsclass->Error( array( 'LEVEL' => 1, 'MSG' => 'no_permission' ) ); } if ( ! $id ) { $this->ipsclass->Error( array( 'LEVEL' => 1, 'MSG' => 'incorrect_use' ) ); } //----------------------------------------- // Get member info //----------------------------------------- $this->ipsclass->DB->cache_add_query( 'generic_get_all_member', array( 'mid' => $id ) ); $this->ipsclass->DB->cache_exec_query(); $member = $this->ipsclass->DB->fetch_row(); //----------------------------------------- // Get Dname history //----------------------------------------- $this->ipsclass->DB->build_query( array( 'select' => 'd.*', 'from' => array( 'dnames_change' => 'd' ), 'where' => 'dname_member_id='.$id, 'add_join' => array( 0 => array( 'select' => 'm.members_display_name', 'from' => array( 'members' => 'm' ), 'where' => 'm.id=d.dname_member_id', 'type' => 'inner' ) ), 'order' => 'dname_date DESC' ) ); $this->ipsclass->DB->exec_query(); while( $row = $this->ipsclass->DB->fetch_row() ) { //----------------------------------------- // Format some info //----------------------------------------- $date = $this->ipsclass->get_date( $row['dname_date'], 'SHORT' ); //----------------------------------------- // Compile HTML //----------------------------------------- $content .= $this->ipsclass->compiled_templates['skin_profile']->dname_content_row( $row['dname_previous'], $row['dname_current'], $date ); } //----------------------------------------- // No changes? Add in a default row //----------------------------------------- if ( ! $content ) { $content .= $this->ipsclass->compiled_templates['skin_profile']->dname_content_row( '--', $member['members_display_name'], $this->ipsclass->get_date( $member['joined'], 'SHORT' ) ); } //----------------------------------------- // Print the pop-up window //----------------------------------------- $html = $this->ipsclass->compiled_templates['skin_profile']->dname_wrapper( $member['members_display_name'], $content ); $this->ipsclass->print->pop_up_window( $this->ipsclass->lang['dname_title'], $html ); } /*-------------------------------------------------------------------------*/ // VIEW CONTACT CARD: /*-------------------------------------------------------------------------*/ function show_card() { $info = array(); if ($this->ipsclass->member['g_mem_info'] != 1) { $this->ipsclass->Error( array( 'LEVEL' => 1, 'MSG' => 'no_permission' ) ); } //----------------------------------------- // Check input.. //----------------------------------------- $id = intval($this->ipsclass->input['MID']); if ( empty($id) ) { $this->ipsclass->Error( array( 'LEVEL' => 1, 'MSG' => 'incorrect_use' ) ); } $this->ipsclass->DB->cache_add_query( 'generic_get_all_member', array( 'mid' => $id ) ); $this->ipsclass->DB->cache_exec_query(); $member = $this->ipsclass->DB->fetch_row(); $member['website'] = $member['website'] == 'http://' ? '' : $member['website']; $info['aim_name'] = $member['aim_name'] ? $member['aim_name'] : $this->ipsclass->lang['no_info']; $info['icq_number'] = $member['icq_number'] ? $member['icq_number'] : $this->ipsclass->lang['no_info']; $info['yahoo'] = $member['yahoo'] ? $member['yahoo'] : $this->ipsclass->lang['no_info']; $info['location'] = $member['location'] ? $member['location'] : $this->ipsclass->lang['no_info']; $info['interests'] = $member['interests'] ? $member['interests'] : $this->ipsclass->lang['no_info']; $info['msn_name'] = $member['msnname'] ? $member['msnname'] : $this->ipsclass->lang['no_info']; $info['website'] = $member['website'] ? "<a href='{$member['website']}' target='_blank'>{$member['website']}</a>" : $this->ipsclass->lang['no_info']; $info['mid'] = $member['id']; $info['has_blog'] = $member['has_blog']; $info['has_gallery'] = $member['has_gallery']; if (!$member['hide_email']) { $info['email'] = "<a href='javascript:redirect_to(\"&act=Mail&CODE=00&MID={$member['id']}\",1);'>{$this->ipsclass->lang['click_here']}</a>"; } else { $info['email'] = $this->ipsclass->lang['private']; } $this->load_photo($id); if ( $this->has_photo == TRUE ) { $photo = $this->ipsclass->compiled_templates['skin_profile']->get_photo( $this->show_photo, $this->show_width, $this->show_height ); } else { $photo = "<{NO_PHOTO}>"; } if ($this->ipsclass->input['download'] == 1) { $photo = str_replace( "<{NO_PHOTO}>", $this->ipsclass->lang['no_photo_avail'], $photo ); $html = $this->ipsclass->compiled_templates['skin_profile']->show_card_download( $member['members_display_name'], $photo, $info ); $html = str_replace( "<!--CSS-->", $this->ipsclass->skin['_css'], $html ); //----------------------------------------- // Macros //----------------------------------------- $macros = unserialize(stripslashes($this->ipsclass->skin['_macro'])); if ( is_array( $macros ) ) { foreach( $macros as $i => $row )
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?