han_editor.php

来自「sabreipb 2.1.6 utf-8中文版本!」· PHP 代码 · 共 205 行

PHP
205
字号
<?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:29 GMT|   Release: |   Licence Info: +---------------------------------------------------------------------------|   > $Date: 2005-10-10 14:08:54 +0100 (Mon, 10 Oct 2005) $|   > $Revision: 23 $|   > $Author: matt $+---------------------------------------------------------------------------||   > Post Handler|   > Module written by Matt Mecham|   > Date started: Wednesday 9th March 2005 (15:23)|+--------------------------------------------------------------------------*/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 han_editor{	# Global	var $ipsclass;	var $class_editor;		# Method	var $method;		# Skin method	var $skin_function;		# Html handler	var $html;		# Pass width	var $ed_width   = '650px';		# Pass height	var $ed_height  = 250;	    /*-------------------------------------------------------------------------*/    // INIT    /*-------------------------------------------------------------------------*/        function init()    {    	//-----------------------------------------    	// INIT    	//-----------------------------------------    	    	$class = "";    	    	if ( ! $this->ipsclass->vars['posting_allow_rte'] )    	{    		$this->ipsclass->member['members_editor_choice'] = 'std';    	}    	    	if ( ! $this->method )    	{    		$this->method = $this->ipsclass->member['members_editor_choice'];    	}    	    	//-----------------------------------------    	// Fix width    	//-----------------------------------------    	    	$this->ed_width = $this->ipsclass->vars['rte_width'] ? $this->ipsclass->vars['rte_width'] : $this->ed_width;    	    	//-----------------------------------------    	// Make sure we haven't had any messin'    	//-----------------------------------------    	    	if ( intval($_POST['rte_used']) )    	{    		$this->method = 'rte';    	}    	    	//-----------------------------------------    	// Force STD editor (fast reply, etc)    	//-----------------------------------------    	    	if ( intval($_POST['std_used']) )    	{    		$this->method = 'std';    	}    	    	//-----------------------------------------    	// Sneaky Opera or Safari    	//-----------------------------------------        	if ( $this->method == 'rte' )    	{    		if ( $this->ipsclass->browser['browser'] == 'opera' AND $this->browser['version'] < 9.0 ) # Okay... this is for future compat.    		{    			$this->method = 'std';    			$this->ipsclass->force_editor_change = 1;    		}    		else if ( $this->ipsclass->browser['browser'] == 'safari' AND $this->ipsclass->browser['version'] < 1000 ) # Okay... this is for future compat.    		{    			$this->method = 'std';    			$this->ipsclass->force_editor_change = 1;    		}    		else if ( $this->ipsclass->browser['browser'] == 'konqueror' )    		{    			$this->method = 'std';    			$this->ipsclass->force_editor_change = 1;    		}    	}    	    	//$this->method = "rte";    	    	//-----------------------------------------    	// Which class    	//-----------------------------------------    	    	switch( $this->method )    	{    		case 'rte':    			$class = 'class_editor_rte.php';    			$this->skin_function = 'editor_rte';    			break;    		case 'std':    			$class = 'class_editor_std.php';    			$this->skin_function = 'editor_std';    			break;    		default:    			$class = 'class_editor_std.php';    			$this->skin_function = 'editor_std';    	}    			//-----------------------------------------		// Load classes		//-----------------------------------------				require_once( ROOT_PATH . 'sources/classes/editor/class_editor.php' );		require_once( ROOT_PATH . 'sources/classes/editor/'.$class );				$this->class_editor                   =  new class_editor_module();		$this->class_editor->ipsclass         =& $this->ipsclass;		$this->class_editor->allow_unicode    =  $this->ipsclass->allow_unicode;		$this->class_editor->get_magic_quotes =  $this->ipsclass->get_magic_quotes;				//-----------------------------------------		// Init class		//-----------------------------------------		        $this->class_editor->main_init();    }        /*-------------------------------------------------------------------------*/    // Mode: Show editor    // Takes raw text with BBCode *NOT* converted BBCode    /*-------------------------------------------------------------------------*/    	function show_editor( $text, $form_field='post_content' )  	{  		//-----------------------------------------  		// Load skin and language  		//-----------------------------------------  		  		if ( ! $this->ipsclass->compiled_templates['skin_editors'] )  		{  			$this->ipsclass->load_template( 'skin_editors' );  		}  		  		$this->ipsclass->load_language( 'lang_editors' );  		  		//-----------------------------------------  		// Pre parse...  		//-----------------------------------------  		  		$text = $this->class_editor->process_before_form( $text );  		$func = $this->skin_function;  		  		return $this->ipsclass->compiled_templates['skin_editors']->$func( $text, $form_field, $this->ed_width, $this->ed_height );  	}  	    /*-------------------------------------------------------------------------*/    // Mode: Process text    /*-------------------------------------------------------------------------*/    	function process_raw_post( $form_field )  	{  		return $this->class_editor->process_after_form( $form_field );  	}		}?>

⌨️ 快捷键说明

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