⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 hooks.inc.php

📁 简介:IceBB是一个强大
💻 PHP
字号:
<?php//******************************************************//
//           /////////                 ////   /////
//              //                    // //  //  //
//             //      /////  ////// ////   ////
//            //      //     ////   //  // //  //
//        /////////  /////  ////// /////  /////
//******************************************************//
// icebb.net // 1.0
//******************************************************//
// hooks class
// $Id: hooks.inc.php 734 2007-02-10 03:49:24Z mutantmonkey0 $
//******************************************************///** * A class that allows for "hooks" in various parts of the board that * allow for less modding * * @package		IceBB * @version		1.0 * @date		July 23, 2005 */class hooks{	/**	 * Constructor	 */	function hooks()	{		global $icebb,$db,$std;			$plugins							= array();			if(!is_array($icebb->cache['plugins']))		{			$db->query("SELECT * FROM icebb_plugins");			while($p						= $db->fetch_row())			{				$plugins[]					= $p;			}			$std->recache($plugins,'plugins');		}		else {			$plugins						= (array)$icebb->cache['plugins'];		}				foreach($plugins as $p)		{			if(!file_exists("{$icebb->path_to_icebb}plugins/{$p['filename']}.plugin.php")) continue;					$plugin_class					= "plugin_".basename($p['filename']);					include_once("{$icebb->path_to_icebb}plugins/{$p['filename']}.plugin.php");			$this->plugins[$p['filename']]	= new $plugin_class($icebb);		}	}	/**	 * Run a hook	 *	 * @param		string		$hook		The hook function name you want to run	 */	function hook($hook)	{		$args				= array();		$ret				= false;			if(func_num_args()>1)		{			$args			= func_get_args();			array_shift($args);		}			if(is_array($this->plugins))		{			foreach($this->plugins as $p)			{				if(is_callable(array($p,"hook_{$hook}")))				{					$return	= call_user_func_array(array($p,"hook_{$hook}"),$args);				}			}		}				return $return;	}		/**	 * Add a plugin (only use is for customer registration at the moment)	 *	 * @param		string		$filename	Plugin filename	 * @param		object		$inst		Plugin instance	 */	function add_plugin($filename,$inst)	{		$this->plugins[$filename]	= $inst;	}}?>

⌨️ 快捷键说明

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