📄 10001_mysql_queries.php
字号:
<?php/*+--------------------------------------------------------------------------| Invision Power Board v2.1.5| ========================================| by Matthew Mecham| (c) 2001 - 2004 Invision Power Services| | ========================================| Web: | Time: Wed, 01 Mar 2006 19:11:35 GMT| Release: | Email: | Licence Info: +---------------------------------------------------------------------------|| > IPB UPGRADE 1.1 -> 2.0 SQL STUFF!| > Script written by Matt Mecham| > Date started: 21st April 2004| > Interesting fact: Turin Brakes are also good+--------------------------------------------------------------------------*/class upgrade_sql{ var $errors = array(); var $sqlcount = 0; var $sqlbit = array(); /*-------------------------------------------------------------------------*/ // CONSTRUCTOR /*-------------------------------------------------------------------------*/ function upgrade_sql() { global $DB, $ibforums, $std; define( 'THIS_HUMAN_VERSION', '2.0.2' ); define( 'THIS_LONG_VERSION' , '20012' ); $this->sqlbit['attach'] = "attach_file != ''"; } /*-------------------------------------------------------------------------*/ // STEP 24: RECACHE & REBUILD /*-------------------------------------------------------------------------*/ function step_24() { global $DB, $std, $ibforums; //----------------------------------- // Get ACP library //----------------------------------- require_once( ROOT_PATH.'sources/lib/admin_cache_functions.php' ); $acp = new admin_cache_functions(); $acp->ipsclass =& $this->ipsclass; //----------------------------------- // Cache skins and shit //----------------------------------- $acp->_rebuild_all_caches( array(2,3) ); //------------------------------------------------------------- // Forum cache //------------------------------------------------------------- $this->ipsclass->cache['forum_cache'] = array(); $this->ipsclass->DB->simple_construct( array( 'select' => '*', 'from' => 'forums', 'order' => 'parent_id, position' ) ); $this->ipsclass->DB->simple_exec(); while( $fr = $this->ipsclass->DB->fetch_row() ) { $perms = unserialize(stripslashes($fr['permission_array'])); $fr['read_perms'] = $perms['read_perms']; $fr['reply_perms'] = $perms['reply_perms']; $fr['start_perms'] = $perms['start_perms']; $fr['upload_perms'] = $perms['upload_perms']; $fr['show_perms'] = $perms['show_perms']; unset($fr['permission_array']); $this->ipsclass->cache['forum_cache'][ $fr['id'] ] = $fr; } $this->ipsclass->update_cache( array( 'name' => 'forum_cache', 'array' => 1, 'deletefirst' => 1 ) ); //------------------------------------------------------------- // Group Cache //------------------------------------------------------------- $this->ipsclass->cache['group_cache'] = array(); $this->ipsclass->DB->simple_construct( array( 'select' => "*", 'from' => 'groups' ) ); $this->ipsclass->DB->simple_exec(); while ( $i = $this->ipsclass->DB->fetch_row() ) { $this->ipsclass->cache['group_cache'][ $i['g_id'] ] = $i; } $this->ipsclass->update_cache( array( 'name' => 'group_cache', 'array' => 1, 'deletefirst' => 1 ) ); //------------------------------------------------------------- // Systemvars //------------------------------------------------------------- $this->ipsclass->cache['systemvars'] = array(); $result = $this->ipsclass->DB->simple_exec_query( array( 'select' => 'count(*) as cnt', 'from' => 'mail_queue' ) ); $this->ipsclass->cache['systemvars']['mail_queue'] = intval( $result['cnt'] ); $this->ipsclass->cache['systemvars']['task_next_run'] = time() + 3600; $this->ipsclass->update_cache( array( 'name' => 'systemvars', 'array' => 1, 'deletefirst' => 1 ) ); //------------------------------------------------------------- // Stats //------------------------------------------------------------- $this->ipsclass->cache['stats'] = array(); $this->ipsclass->DB->simple_construct( array( 'select' => 'count(pid) as posts', 'from' => 'posts', 'where' => "queued <> 1" ) ); $this->ipsclass->DB->simple_exec();
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -