class_display.php

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

PHP
1,145
字号
        exit;    }        /*-------------------------------------------------------------------------*/    //    // print the headers    //    /*-------------------------------------------------------------------------*/            function do_headers()    {    	if ( $this->ipsclass->vars['print_headers'] )    	{    		$this->ipsclass->vars['gb_char_set'] = $this->ipsclass->vars['gb_char_set'] ? $this->ipsclass->vars['gb_char_set'] : 'iso-8859-1';    					header("HTTP/1.0 200 OK");			header("HTTP/1.1 200 OK");			header( "Content-type: text/html;charset={$this->ipsclass->vars['gb_char_set']}" );						if ( $this->ipsclass->vars['nocache'] )			{				header("Cache-Control: no-cache, must-revalidate, max-age=0");				//header("Expires:" . gmdate("D, d M Y H:i:s") . " GMT");				header("Expires: 0");				header("Pragma: no-cache");			}        }    }        /*-------------------------------------------------------------------------*/    //    // print a pure redirect screen    //    /*-------------------------------------------------------------------------*/        function redirect_screen($text="", $url="", $override=0)    {    	//-----------------------------------------    	// Make sure global skin is loaded    	//-----------------------------------------    	    	if ( $this->ipsclass->compiled_templates['skin_global'] == "" )		{			$this->ipsclass->load_template('skin_global');		}    	    	if ($this->ipsclass->input['debug'])        {        	flush();        	exit();        }                //-----------------------------------------        // $ibforums not initialized yet?        //-----------------------------------------                if ( $override != 1 )        {			if ( $this->ipsclass->base_url )			{				$url = $this->ipsclass->base_url.$url;			}			else			{				$url = "{$this->ipsclass->vars['board_url']}/index.{$this->ipsclass->vars['php_ext']}?".$url;			}    	}    	    	//-----------------------------------------    	// Feck off first?    	//-----------------------------------------    	    	if ( $this->ipsclass->vars['ipb_remove_redirect_pages'] == 1 )    	{    		$this->ipsclass->boink_it( $url );    	}    	    	$this->ipsclass->lang['stand_by'] = stripslashes($this->ipsclass->lang['stand_by']);    	    	//-----------------------------------------        // CSS        //-----------------------------------------                $css = $this->_get_css();                //-----------------------------------------        // Fix up URLs        //-----------------------------------------                //$url = preg_replace( "#&(?!amp;)#", "&amp;" , $url );        //$url = preg_replace( '/#(?!\d)/'  , '&#035;', $url );                //-----------------------------------------        // Get template        //-----------------------------------------            	$html = $this->ipsclass->compiled_templates['skin_global']->Redirect( ucfirst($text), $url, $css);    	    	//-----------------------------------------    	// Get and parse macros    	//-----------------------------------------    	    	$this->_unpack_macros();				foreach( $this->ipsclass->skin['_macros'] as $i => $row )      	{			if ($row['macro_value'] != "")			{				$html = str_replace( "<{".$row['macro_value']."}>", $row['macro_replace'], $html );			}		}				$html = str_replace( "<% CHARSET %>" , $this->ipsclass->vars['gb_char_set'], $html );		$html = str_replace( "<#IMG_DIR#>"   , $this->ipsclass->skin['_imagedir']  , $html );				$this->_finish();            	echo ($html);    	exit;    }        /*-------------------------------------------------------------------------*/    //    // print a minimalist screen suitable for small pop up windows    //    /*-------------------------------------------------------------------------*/        function pop_up_window($title = 'Invision Power Board', $text = "" )    {    	$this->_check_debug();    	    	//-----------------------------------------        // CSS        //-----------------------------------------                $css = $this->_get_css();				//-----------------------------------------        // Get template        //-----------------------------------------            	$html = $this->ipsclass->compiled_templates['skin_global']->pop_up_window($title, $css, $text);    	            	//-----------------------------------------    	// Get and parse macros    	//-----------------------------------------    	    	$this->_unpack_macros();				foreach( $this->ipsclass->skin['_macros'] as $i => $row )      	{			if ($row['macro_value'] != "")			{				$html = str_replace( "<{".$row['macro_value']."}>", $row['macro_replace'], $html );			}		}		 		$html = str_replace( "<% CHARSET %>" , $this->ipsclass->vars['gb_char_set'], $html );		$html = str_replace( "<#IMG_DIR#>"   , $this->ipsclass->skin['_imagedir']  , $html );		$html = str_replace( "<#EMO_DIR#>"   , $this->ipsclass->skin['_emodir']    , $html );    	    	//-----------------------------------------		// Images on another server? uncomment and alter below		//-----------------------------------------				if ( $this->ipsclass->vars['ipb_img_url'] )		{			$html = preg_replace( "#img\s+?src=[\"']style_(images|avatars|emoticons)(.+?)[\"'](.+?)?".">#is", "img src=\"".$this->ipsclass->vars['ipb_img_url']."style_\\1\\2\"\\3>", $html );		}		    	$this->_finish();            	echo ($html);    	exit;    }         /*-------------------------------------------------------------------------*/	// Parse EXEC tags	/*-------------------------------------------------------------------------*/		/**	* Parses exec tags in the wrapper	* Nicked from IP.Dynamic.	*/	function _parse_exec_tags()	{		preg_match_all( "#<\!--exec\.(file|url)=(?:[\"'])?(.+?)(?:[\"'])?-->#is", $this->ipsclass->skin['_wrapper'], $match );				for ($i=0; $i < count($match[0]); $i++)		{			$method = strtolower(trim( $match[1][$i] ));			$uri    = trim( $match[2][$i] );						//-----------------------------------------			// PARSE: URL			//-----------------------------------------						if ( $method == 'url' )			{				//-----------------------------------------				// Buffer...				//-----------------------------------------								@ob_start();				include( $uri );				$data = @ob_get_contents();				@ob_end_clean();			}			//-----------------------------------------			// PARSE: LOCAL FILE			//-----------------------------------------			else			{				if ( file_exists( $uri ) )				{					//-----------------------------------------					// Buffer...					//-----------------------------------------										@ob_start();					include( $uri );					$data = @ob_get_contents();					@ob_end_clean();				}			}						$this->ipsclass->skin['_wrapper'] = str_replace( $match[0][$i], "<!--included content-->\n".$data."\n<!--/ included content-->", $this->ipsclass->skin['_wrapper'] );			unset( $data );		}	}		    /*-------------------------------------------------------------------------*/    // Show Syndication Links    /*-------------------------------------------------------------------------*/        function _get_synd_link()    {    	//-----------------------------------------    	// INIT    	//-----------------------------------------    	    	$content = "";    	    	//-----------------------------------------    	// Got any?    	//-----------------------------------------    	    	if ( ( ! is_array( $this->ipsclass->cache['rss_export'] ) OR ! count( $this->ipsclass->cache['rss_export'] ) ) AND ( ! is_array( $this->ipsclass->cache['rss_calendar'] ) OR ! count( $this->ipsclass->cache['rss_calendar'] ) ))    	{    		return;    	}    	    	//-----------------------------------------    	// Build    	//-----------------------------------------    	    	if ( is_array( $this->ipsclass->cache['rss_export'] ) and count( $this->ipsclass->cache['rss_export'] ) )    	{			foreach( $this->ipsclass->cache['rss_export'] as $id => $data )			{				$content .= $this->ipsclass->compiled_templates['skin_global']->global_footer_synd_link( $data ) . "\n";			}    	}    	    	//-----------------------------------------    	// Build    	//-----------------------------------------    	    	if ( is_array( $this->ipsclass->cache['rss_calendar'] ) and count( $this->ipsclass->cache['rss_calendar'] ) )    	{			foreach( $this->ipsclass->cache['rss_calendar'] as $id => $data )			{				$data['title'] = $this->ipsclass->lang['rss_calendar'].' '.$data['title'];				$content      .= $this->ipsclass->compiled_templates['skin_global']->global_footer_synd_link( $data ) . "\n";			}    	}    	    	//-----------------------------------------    	// Clean up content    	//-----------------------------------------    	    	$content = preg_replace( "#,(\s+)?$#s", "", $content );    	    	//-----------------------------------------    	// Return    	//-----------------------------------------    	    	return $this->ipsclass->compiled_templates['skin_global']->global_footer_synd_wrapper( $content );    }        /*-------------------------------------------------------------------------*/    // Show RSS export links    /*-------------------------------------------------------------------------*/        function _get_rss_export()    {    	//-----------------------------------------    	// INIT    	//-----------------------------------------    	    	$content = "";    	    	//-----------------------------------------    	// Got any?    	//-----------------------------------------    	    	if ( ( ! is_array( $this->ipsclass->cache['rss_export'] ) OR ! count( $this->ipsclass->cache['rss_export'] ) ) AND ( ! is_array( $this->ipsclass->cache['rss_calendar'] ) OR ! count( $this->ipsclass->cache['rss_calendar'] ) ))    	{    		return;    	}    	    	//-----------------------------------------    	// Build    	//-----------------------------------------    	    	if ( is_array( $this->ipsclass->cache['rss_export'] ) and count( $this->ipsclass->cache['rss_export'] ) )    	{			foreach( $this->ipsclass->cache['rss_export'] as $id => $data )			{				$content .= $this->ipsclass->compiled_templates['skin_global']->global_rss_link( $data ) . "\n";			}    	}    	    	//-----------------------------------------    	// Build    	//-----------------------------------------    	    	if ( is_array( $this->ipsclass->cache['rss_calendar'] ) and count( $this->ipsclass->cache['rss_calendar'] ) )    	{			foreach( $this->ipsclass->cache['rss_calendar'] as $id => $data )			{				$data['title'] = $this->ipsclass->lang['rss_calendar'].' '.$data['title'];				$content      .= $this->ipsclass->compiled_templates['skin_global']->global_rss_link( $data ) . "\n";			}    	}    	    	//-----------------------------------------    	// Return    	//-----------------------------------------    	    	return $content;    }        /*-------------------------------------------------------------------------*/    // Show lo-fi link    /*-------------------------------------------------------------------------*/        function _get_lofi_link()    {    	$link = "";    	$char = '/';    	    	if ( substr(PHP_OS, 0, 3) == 'WIN' OR strstr( php_sapi_name(), 'cgi') OR php_sapi_name() == 'apache2filter' )		{			$char = '?';		}		    	if ( $this->ipsclass->input['act'] == 'st' )    	{    		$link = $char.'t'.$this->ipsclass->input['t'].'.html';    	}    	else if ( $this->ipsclass->input['act'] == 'sf' )    	{    		$link = $char.'f'.$this->ipsclass->input['f'].'.html';    	}    	    	return $link;    }        /*-------------------------------------------------------------------------*/    // Build Languages List    /*-------------------------------------------------------------------------*/        function _build_language_list()    {    	$lang_list = "";    	    	//-----------------------------------------		// Roots		//-----------------------------------------		

⌨️ 快捷键说明

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