contact_member.php

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

PHP
807
字号
<?php/*+--------------------------------------------------------------------------|   Invision Power Board v2.1.6|   =============================================|   by Matthew Mecham|   (c) 2001 - 2005 Invision Power Services, Inc.|   http://www.invisionpower.com|   =============================================|   Web: http://www.invisionboard.com|   Time: Thu, 04 May 2006 17:39:49 GMT|   Release: b415613eeb952a2741ff6d53e0266428|   Licence Info: http://www.invisionboard.com/?license+---------------------------------------------------------------------------|   > $Date: 2006-03-06 14:58:13 +0000 (Mon, 06 Mar 2006) $|   > $Revision: 161 $|   > $Author: bfarber $+---------------------------------------------------------------------------||   > ICQ / AIM / EMAIL functions|   > Module written by Matt Mecham|   > Date started: 28th February 2002||	> Module Version Number: 1.0.0|   > DBA Checked: Mon 24th May 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 contactmember{    var $output    = "";    var $base_url  = "";    var $html      = "";        var $nav       = array();    var $page_title= "";    var $email     = "";    var $forum     = "";	var $int_error  = "";	var $int_extra  = "";	    /*-------------------------------------------------------------------------*/	//	// Our constructor, load words, load skin	//	/*-------------------------------------------------------------------------*/        function auto_run()    {		// What to do?                switch($this->ipsclass->input['act'])        {        	case 'Mail':        		$this->mail_member();        		break;        	        	case 'chat':        		if ( $this->ipsclass->vars['chat_account_no'] )				{					$this->chat_display();				}				else if ( $this->ipsclass->vars['chat04_account_no'] )				{					if ( $this->ipsclass->input['CODE'] == 'update' )					{						$this->chat04_refresh();					}					else					{						$this->chat04_display();					}				}        		break;        	        	case 'report':        		if ($this->ipsclass->input['send'] != 1)        		{        			$this->report_form();        		}        		else        		{        			$this->send_report();        		}        		break;        		        	case 'boardrules':        		$this->board_rules();        		break;        	        	default:        		$this->ipsclass->Error( array( 'LEVEL' => 1, 'MSG' => 'invalid_use' ) );        		break;        }                $this->ipsclass->print->add_output("$this->output");        $this->ipsclass->print->do_output( array( 'TITLE' => $this->page_title, 'JS' => 0, NAV => $this->nav ) );        	}		/*-------------------------------------------------------------------------*/	// BOARD RULES	//	/*-------------------------------------------------------------------------*/                	function board_rules()	{		//-----------------------------------------		// Get board rule (not cached)		//-----------------------------------------				$row = $this->ipsclass->DB->simple_exec_query( array( 'select' => '*', 'from' => 'conf_settings', 'where' => "conf_key='gl_guidelines'" ) );				$this->ipsclass->load_language('lang_emails');		$this->ipsclass->load_template('skin_emails');				$row['conf_value'] = $this->ipsclass->my_nl2br(stripslashes($row['conf_value']));				$this->nav[] = $this->ipsclass->vars['gl_title'];                $this->page_title = $this->ipsclass->vars['gl_title'];                $this->output .= $this->ipsclass->compiled_templates['skin_emails']->board_rules( $this->ipsclass->vars['gl_title'], $row['conf_value'] );			}		/*-------------------------------------------------------------------------*/	// IP CHAT04: Refresh useronline	//	/*-------------------------------------------------------------------------*/        	function chat04_refresh()	{		//-----------------------------------------		// Okay: refresh every 90 seconds		//-----------------------------------------				if ( $this->ipsclass->lastclick > ( time() - 3600 ) )		{			//-----------------------------------------			// Our last click was more recent than an hour!			//-----------------------------------------						if ( ! strstr( $this->ipsclass->location, 'chat' ) )			{				//-----------------------------------------				// And we're no longer in chat				// .... put 'em back!				//-----------------------------------------								$this->ipsclass->DB->do_update( 'sessions', array( 'location' => 'chat,' ), "id='".$this->ipsclass->my_session."'" );			}		}				//-----------------------------------------		// Stop cycling after 2 hours of no activity		//-----------------------------------------				if ( $this->ipsclass->lastclick > ( time() - 7200 ) )		{			//-----------------------------------------			// Print out the 'blank' gif			//-----------------------------------------						@header( "Content-Type: text/html" );			print "<html><head><meta http-equiv='refresh' content='90; url={$this->ipsclass->base_url}act=chat&CODE=update'></head><body></body></html>";			exit();		}			}					/*-------------------------------------------------------------------------*/	// IP CHAT:	//	/*-------------------------------------------------------------------------*/                	function chat_display()	{		$this->ipsclass->load_language('lang_emails');		$this->ipsclass->load_template('skin_emails');				if ( ! $this->ipsclass->vars['chat_account_no'] )		{			$this->ipsclass->Error( array( 'LEVEL' => 1, 'MSG' => 'missing_files') );		}				if ( ! $this->ipsclass->vars['chat_server_addr'] )		{			$this->ipsclass->vars['chat_server_addr'] = 'client1.invisionchat.com';		}				$this->ipsclass->vars['chat_server_addr'] = str_replace( 'http://', '', $this->ipsclass->vars['chat_server_addr'] );				$width  = $this->ipsclass->vars['chat_width']    ? $this->ipsclass->vars['chat_width']  : 600;		$height = $this->ipsclass->vars['chat_height']   ? $this->ipsclass->vars['chat_height'] : 350;				$lang   = $this->ipsclass->vars['chat_language'] ? $this->ipsclass->vars['chat_language'] : 'en';				$user = "";		$pass = "";				if ( $this->ipsclass->member['id'] )		{			$user = $this->ipsclass->member['members_display_name'];						$converge_member = $this->ipsclass->converge->converge_load_member_by_id($this->ipsclass->member['id']);			$pass = $this->ipsclass->converge->member['converge_pass_hash'];		}				if ( $this->ipsclass->input['pop'] )		{			$html = $this->ipsclass->compiled_templates['skin_emails']->chat_pop( $this->ipsclass->vars['chat_server_addr'], $this->ipsclass->vars['chat_account_no'], $lang, $width, $height, $user, $pass );						$this->ipsclass->print->pop_up_window( "CHAT", $html );						exit();		}		else		{			$this->output .= $this->ipsclass->compiled_templates['skin_emails']->chat_inline( $this->ipsclass->vars['chat_server_addr'], $this->ipsclass->vars['chat_account_no'], $lang, $width, $height, $user, $pass);		}		        $this->nav[] = $this->ipsclass->lang['live_chat'];                $this->page_title = $this->ipsclass->lang['live_chat'];			}					/*-------------------------------------------------------------------------*/	// REPORT POST FORM:	//	/*-------------------------------------------------------------------------*/                	function report_form()	{		$this->ipsclass->load_language('lang_emails');		$this->ipsclass->load_template('skin_emails');				$pid = intval($this->ipsclass->input['p']);		$tid = intval($this->ipsclass->input['t']);		$st  = intval($this->ipsclass->input['st']);				if ( (!$pid) and (!$tid) )		{			$this->ipsclass->Error( array( 'LEVEL' => 1, 'MSG' => 'missing_files') );		}				// Do we have permission to do stuff in this forum? Lets hope so eh?!				$this->check_access($tid);				$this->output .= $this->ipsclass->compiled_templates['skin_emails']->report_form($tid, $pid, $st, $this->topic['topic_title']);		        $this->nav[] = "<a href='".$this->ipsclass->base_url."act=SF&f={$this->forum['id']}'>{$this->forum['name']}</a>";        $this->nav[] = $this->ipsclass->lang['report_title'];                $this->page_title = $this->ipsclass->lang['report_title'];			}			function send_report()	{		$this->ipsclass->load_language('lang_emails');		$this->ipsclass->load_template('skin_emails');				$pid = intval($this->ipsclass->input['p']);		$tid = intval($this->ipsclass->input['t']);		$fid = intval($this->ipsclass->input['f']);		$st  = intval($this->ipsclass->input['st']);				if ( (!$pid) and (!$tid) and (!$fid) )		{			$this->ipsclass->Error( array( 'LEVEL' => 1, 'MSG' => 'missing_files') );		}				//-----------------------------------------		// Make sure we came in via a form.		//-----------------------------------------				if ( $_POST['message'] == "" )		{			$this->ipsclass->Error( array( 'LEVEL' => 1, 'MSG' => 'complete_form') );		}				//-----------------------------------------		// Get the topic title		//-----------------------------------------				$this->ipsclass->DB->simple_construct( array( 'select' => 'title', 'from' => 'topics', 'where' => "tid=".$tid ) );		$this->ipsclass->DB->simple_exec();				$topic = $this->ipsclass->DB->fetch_row();				if ( ! $topic['title'] )		{			$this->ipsclass->Error( array( 'LEVEL' => 1, 'MSG' => 'missing_files') );		}				//-----------------------------------------		// Do we have permission to do stuff in this		// forum? Lets hope so eh?!		//-----------------------------------------				$this->check_access($tid);				$mods = array();		$fid  = $this->forum['id'];				//-----------------------------------------		// Check for mods in this forum		//-----------------------------------------				$this->ipsclass->DB->cache_add_query( 'contact_member_report_get_mods', array( 'fid' => $fid ) );		$this->ipsclass->DB->cache_exec_query();				if ( $this->ipsclass->DB->get_num_rows() )		{			while( $r = $this->ipsclass->DB->fetch_row() )			{				$mods[ $r['id'] ] = $r;			}		}		else		{			//-----------------------------------------			// No mods? Get those super moderators			//-----------------------------------------						$this->ipsclass->DB->cache_add_query( 'contact_member_report_get_supmod', array() );			$this->ipsclass->DB->cache_exec_query();						if ( $this->ipsclass->DB->get_num_rows() )			{				while( $r = $this->ipsclass->DB->fetch_row() )				{					$mods[ $r['id'] ] = $r;				}			}			else			{				//-----------------------------------------				// No supmods? Get those with control panel access				//-----------------------------------------								$this->ipsclass->DB->cache_add_query( 'contact_member_report_get_cpaccess', array() );				$this->ipsclass->DB->cache_exec_query();								while( $r = $this->ipsclass->DB->fetch_row() )				{					$mods[ $r['id'] ] = $r;				}			}		}				//-----------------------------------------    	// Get the emailer module		//-----------------------------------------				require_once( ROOT_PATH."sources/classes/class_email.php" );				$this->email           = new emailer();		$this->email->ipsclass =& $this->ipsclass;		$this->email->email_init();				require_once( ROOT_PATH.'sources/lib/func_msg.php' ); 				$this->lib = new func_msg();		$this->lib->ipsclass =& $this->ipsclass;				$this->lib->init(); 						//-----------------------------------------		// Loop and send the mail		//-----------------------------------------				$report = trim(stripslashes($this->ipsclass->input['message']));		$report = htmlspecialchars($report, ENT_QUOTES);		foreach( $mods as $idx => $data )		{			$this->email->get_template("report_post");

⌨️ 快捷键说明

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