administration.php

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

PHP
706
字号
								$this->ipsclass->update_cache( array( 'name' => 'ranks', 'array' => 1, 'deletefirst' => 1 ) );								$this->ipsclass->main_msg = 'Ranks Updated';				break;							//-----------------------------------------			// Profile Fields			//-----------------------------------------						case 'profilefields':							$this->ipsclass->cache['profilefields'] = array();								$this->ipsclass->DB->simple_construct( array( 'select' => '*', 'from' => 'pfields_data', 'order' => 'pf_position' ) );								 				$this->ipsclass->DB->simple_exec();								while ( $r = $this->ipsclass->DB->fetch_row() )				{					$this->ipsclass->cache['profilefields'][ $r['pf_id'] ] = $r;				}								$this->ipsclass->update_cache( array( 'name' => 'profilefields', 'array' => 1, 'deletefirst' => 1 ) );								$this->ipsclass->main_msg = 'Profile Fields Updated';				break;							//-----------------------------------------			// Calendar			//-----------------------------------------						case 'calendar':							require_once( ROOT_PATH.'sources/lib/func_taskmanager.php' );				$func = new func_taskmanager();				$func->ipsclass =& $this->ipsclass;								require_once( ROOT_PATH.'sources/tasks/calendarevents.php' );								$task = new task_item();				$task->register_class( $func );				$task->restrict_log = 1;				$task->run_task();								$this->ipsclass->main_msg = 'Calendar Events Updated';				break;							//-----------------------------------------			// Birthdays			//-----------------------------------------						case 'birthdays':							require_once( ROOT_PATH.'sources/lib/func_taskmanager.php' );				$func = new func_taskmanager();				$func->ipsclass =& $this->ipsclass;								require_once( ROOT_PATH.'sources/tasks/calendarevents.php' );								$task = new task_item();				$task->register_class( $func );				$task->restrict_log = 1;				$task->run_task();								$this->ipsclass->main_msg = 'Birthdays Updated';				break;							//-----------------------------------------			// Multimoderation			//-----------------------------------------						case 'multimod':							$this->ipsclass->cache['multimod'] = array();        					$this->ipsclass->DB->simple_construct( array(										 'select' => '*',										 'from'   => 'topic_mmod',										 'order'  => 'mm_title'								 )      );													$this->ipsclass->DB->simple_exec();											while ($i = $this->ipsclass->DB->fetch_row())				{					$this->ipsclass->cache['multimod'][ $i['mm_id'] ] = $i;				}								$this->ipsclass->update_cache( array( 'name' => 'multimod', 'array' => 1, 'deletefirst' => 1 ) );								$this->ipsclass->main_msg = 'Multi-Moderation Updated';				break;							//-----------------------------------------			// BBCODE			//-----------------------------------------						case 'bbcode':								require_once( ROOT_PATH.'sources/action_admin/bbcode.php' );				$this->bbcode           = new ad_bbcode();				$this->bbcode->ipsclass =& $this->ipsclass;								$this->bbcode->bbcode_rebuildcache();							$this->ipsclass->main_msg = 'BBCode Updated';				break;							//-----------------------------------------			// SETTINGS			//-----------------------------------------						case 'settings':								$this->ipsclass->cache['settings'] = array();							$this->ipsclass->DB->simple_construct( array( 'select' => '*', 'from' => 'conf_settings', 'where' => 'conf_add_cache=1' ) );				$info = $this->ipsclass->DB->simple_exec();							while ( $r = $this->ipsclass->DB->fetch_row($info) )				{					$value = $r['conf_value'] != "" ?  $r['conf_value'] : $r['conf_default'];								if ( $value == '{blank}' )					{						$value = '';					}								$this->ipsclass->cache['settings'][ $r['conf_key'] ] = $value;				}								$this->ipsclass->update_cache( array( 'name' => 'settings', 'array' => 1, 'deletefirst' => 1 ) );								$this->ipsclass->main_msg = 'Settings Updated';				break;							//-----------------------------------------			// EMOTICONS			//-----------------------------------------						case 'emoticons':								require_once( ROOT_PATH.'sources/action_admin/emoticons.php' );				$this->emoticons           = new ad_emoticons();				$this->emoticons->ipsclass =& $this->ipsclass;								$this->emoticons->emoticon_rebuildcache();							$this->ipsclass->main_msg = 'Emoticons Updated';				break;							//-----------------------------------------			// BADWORDS			//-----------------------------------------						case 'badwords':								require_once( ROOT_PATH.'sources/action_admin/banandbadword.php' );				$this->banandbadword           = new ad_banandbadword();				$this->banandbadword->ipsclass =& $this->ipsclass;								$this->banandbadword->badword_rebuildcache();								$this->ipsclass->main_msg = 'Badwords Updated';				break;						//-----------------------------------------			// LANGUAGES			//-----------------------------------------						case 'languages':							$this->ipsclass->cache['languages'] = array();						$this->ipsclass->DB->simple_construct( array( 'select' => 'ldir,lname', 'from' => 'languages' ) );				$this->ipsclass->DB->simple_exec();								while ( $r = $this->ipsclass->DB->fetch_row() )				{					$this->ipsclass->cache['languages'][] = $r;				}								$this->ipsclass->update_cache( array( 'name' => 'languages', 'array' => 1, 'deletefirst' => 1 ) );								$this->ipsclass->main_msg = 'Languages Updated';				break;						//-----------------------------------------			// BAN FILTERS			//-----------------------------------------							case 'banfilters':								require_once( ROOT_PATH.'sources/action_admin/banandbadword.php' );				$this->banandbadword           = new ad_banandbadword();				$this->banandbadword->ipsclass =& $this->ipsclass;								$this->banandbadword->ban_rebuildcache();								$this->ipsclass->main_msg = 'Banfilters Updated';				break;						//-----------------------------------------			// ATTACHMENT TYPES			//-----------------------------------------							case 'attachtypes':				$this->ipsclass->cache['attachtypes'] = array();							$this->ipsclass->DB->simple_construct( array( 'select' => 'atype_extension,atype_mimetype,atype_post,atype_photo,atype_img', 'from' => 'attachments_type', 'where' => "atype_photo=1 OR atype_post=1" ) );				$this->ipsclass->DB->simple_exec();							while ( $r = $this->ipsclass->DB->fetch_row() )				{					$this->ipsclass->cache['attachtypes'][ $r['atype_extension'] ] = $r;				}								$this->ipsclass->update_cache( array( 'name' => 'attachtypes', 'array' => 1, 'deletefirst' => 1 ) );								$this->ipsclass->main_msg = 'Attachment Types Updated';				break;							//-----------------------------------------			// Announcements			//-----------------------------------------							case 'announcements':							require_once( ROOT_PATH.'sources/action_public/announcements.php' );				$announcements = new announcements();				$announcements->ipsclass =& $this->ipsclass;				$announcements->announce_recache();								$this->ipsclass->main_msg = 'Announcements Updated';				break;							//-----------------------------------------			// BBCODE			//-----------------------------------------						case 'components':								require_once( ROOT_PATH.'sources/action_admin/components.php' );				$this->components           = new ad_components();				$this->components->ipsclass =& $this->ipsclass;								$this->components->components_rebuildcache();							$this->ipsclass->main_msg = 'Components Updated';				break;								default:				$this->ipsclass->main_msg = 'No valid cache was specified to update';				break;		}				if ( ! $dontcancel )		{			$this->cache_start();		}	}		/*-------------------------------------------------------------------------*/	// SHOW CACHE FORM	/*-------------------------------------------------------------------------*/		function cache_start()	{		//-----------------------------------------		// INIT		//-----------------------------------------				$used    = array();		$content = "";				//-----------------------------------------		// SHOW CACHES		//-----------------------------------------				$this->ipsclass->DB->simple_construct( array( 'select' => '*', 'from' => 'cache_store', 'order' => 'cs_key' ) );		$this->ipsclass->DB->simple_exec();				while ( $row = $this->ipsclass->DB->fetch_row() )		{			if ( ! in_array( $row['cs_key'], array_keys( $this->map ) ) )			{				continue;			}						$used[ $row['cs_key'] ] = $row['cs_key'];			$row['_size']           = ceil( intval( strlen( $row['cs_value'] ) ) / 1024 );			$row['_desc']           = $this->map[ $row['cs_key'] ];						$content .= $this->html->cache_row( $row );		}				if ( count( $used ) != count( $this->map ) )		{			foreach( $this->map as $k => $v )			{				if ( in_array( $k, array_keys( $used ) ) )				{					continue;				}				else				{					$row['cs_key']   = $k;					$row['cs_value'] = $v;					$row['_size']    = 0;					$row['_desc']    = $this->map[ $row['cs_key'] ];										$content .= $this->html->cache_row( $row );				}			}		}				$this->ipsclass->html .= $this->html->cache_overview( $content );				$this->ipsclass->admin->output();	}		/*-------------------------------------------------------------------------*/	// PERL	/*-------------------------------------------------------------------------*/		function perly_length_sort($a, $b)	{		if ( strlen($a['typed']) == strlen($b['typed']) )		{			return 0;		}		return ( strlen($a['typed']) > strlen($b['typed']) ) ? -1 : 1;	}		function perly_word_sort($a, $b)	{		if ( strlen($a['type']) == strlen($b['type']) )		{			return 0;		}		return ( strlen($a['type']) > strlen($b['type']) ) ? -1 : 1;	}						}?>

⌨️ 快捷键说明

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