class_display.php
来自「sabreipb 2.1.6 utf-8中文版本!」· PHP 代码 · 共 1,145 行 · 第 1/3 页
PHP
1,145 行
foreach( $this->ipsclass->cache['languages'] as $id => $data ) { if ( $this->ipsclass->member['language'] == $data['ldir'] ) { $selected = ' selected="selected"'; } else { $selected = ""; } $lang_list .= "\n<option value='{$data['ldir']}'{$selected}>{$data['lname']}</option>"; } return $lang_list; } /*-------------------------------------------------------------------------*/ // Build Skin List /*-------------------------------------------------------------------------*/ function _build_skin_list() { $skin_list = ""; //----------------------------------------- // Roots //----------------------------------------- foreach( $this->ipsclass->cache['skin_id_cache'] as $id => $data ) { $skin_sets[ $data['set_parent'] ]['_children'][] = $id; if ( $data['set_parent'] < 1 and $id > 1 ) { if ( $data['set_hidden'] and ! $this->ipsclass->member['g_access_cp'] ) { continue; } $star = $data['set_hidden'] ? ' *' : ''; if ( $this->ipsclass->skin['_setid'] == $id ) { $selected = ' selected="selected"'; } else { $selected = ""; } $skin_list .= "\n<option value='$id'{$selected}>{$data['set_name']}{$star}</option><!--CHILDREN:{$id}-->"; } } //----------------------------------------- // Kids... //----------------------------------------- foreach( $skin_sets as $id => $data ) { if ( is_array( $data['_children'] ) and count( $data['_children'] ) > 0 ) { $html = ""; foreach( $data['_children'] as $cid ) { if ( $this->ipsclass->cache['skin_id_cache'][ $cid ]['set_hidden'] and ! $this->ipsclass->member['g_access_cp'] ) { continue; } $star = $this->ipsclass->cache['skin_id_cache'][ $cid ]['set_hidden'] ? ' *' : ''; if ( $this->ipsclass->skin['_setid'] == $cid ) { $selected = ' selected="selected"'; } else { $selected = ""; } $html .= "\n<option value='$cid'{$selected}>---- {$this->ipsclass->cache['skin_id_cache'][ $cid ]['set_name']}{$star}</option>"; } $skin_list = str_replace( "<!--CHILDREN:{$id}-->", $html, $skin_list ); } } return $skin_list; } /*-------------------------------------------------------------------------*/ // unpack_macros /*-------------------------------------------------------------------------*/ function _unpack_macros() { if ( ! is_array( $this->ipsclass->skin['_macros'] ) OR ! count( $this->ipsclass->skin['_macros'] ) ) { $this->ipsclass->skin['_macros'] = unserialize( stripslashes($this->ipsclass->skin['_macro']) ); } if ( LEGACY_MODE ) { $this->macros =& $this->ipsclass->skin['_macros']; } } /*-------------------------------------------------------------------------*/ // show_debug /*-------------------------------------------------------------------------*/ function _show_debug() { $input = ""; $queries = ""; $sload = ""; $stats = ""; //----------------------------------------- // Form & Get & Skin //----------------------------------------- if ($this->ipsclass->vars['debug_level'] >= 2) { $stats .= "<br />\n<div class='tableborder'>\n<div class='subtitle'>FORM and GET Input</div><div class='row1' style='padding:6px'>\n"; while( list($k, $v) = each($this->ipsclass->input) ) { if ( in_array( strtolower( $k ), array( 'pass', 'password' ) ) ) { $v = '*******'; } $stats .= "<strong>$k</strong> = $v<br />\n"; } $stats .= "</div>\n</div>"; $stats .= "<br />\n<div class='tableborder'>\n<div class='subtitle'>SKIN & TASK Info</div><div class='row1' style='padding:6px'>\n"; while( list($k, $v) = each($this->ipsclass->skin) ) { if ( strlen($v) > 120 ) { $v = substr( $v, 0, 120 ). '...'; } $stats .= "<strong>$k</strong> = ".$this->ipsclass->txt_htmlspecialchars($v)."<br />\n"; } $stats .= "<b>Next task</b> = ".$this->ipsclass->get_date( $this->ipsclass->cache['systemvars']['task_next_run'], 'LONG' )."\n<br /><b>Time now</b> = ".$this->ipsclass->get_date( time(), 'LONG' ); $stats .= "<br /><b>Timestamp Now</b> = ".time(); $stats .= "</div>\n</div>"; $stats .= "<br />\n<div class='tableborder'>\n<div class='subtitle'>Loaded PHP Templates</div><div class='row1' style='padding:6px'>\n"; $stats .= "<strong>".implode(", ",array_keys($this->ipsclass->compiled_templates))."</strong><br />\n"; $stats .= "<strong>".implode(", ",array_keys($this->ipsclass->loaded_templates))."</strong><br />\n"; $stats .= "</div>\n</div>"; } //----------------------------------------- // SQL //----------------------------------------- if ($this->ipsclass->vars['debug_level'] >= 3) { $stats .= "<br />\n<div class='tableborder' style='overflow:auto'>\n<div class='subtitle'>Queries Used</div><div class='row1' style='padding:6px'>"; foreach($this->ipsclass->DB->obj['cached_queries'] as $q) { $q = htmlspecialchars($q); $q = preg_replace( "/^SELECT/i" , "<span class='red'>SELECT</span>" , $q ); $q = preg_replace( "/^UPDATE/i" , "<span class='blue'>UPDATE</span>" , $q ); $q = preg_replace( "/^DELETE/i" , "<span class='orange'>DELETE</span>", $q ); $q = preg_replace( "/^INSERT/i" , "<span class='green'>INSERT</span>" , $q ); $q = str_replace( "LEFT JOIN" , "<span class='red'>LEFT JOIN</span>" , $q ); $q = preg_replace( "/(".$this->ipsclass->vars['sql_tbl_prefix'].")(\S+?)([\s\.,]|$)/", "<span class='purple'>\\1\\2</span>\\3", $q ); $stats .= "$q<hr />\n"; } if ( count( $this->ipsclass->DB->obj['shutdown_queries'] ) ) { foreach($this->ipsclass->DB->obj['shutdown_queries'] as $q) { $q = htmlspecialchars($q); $q = preg_replace( "/^SELECT/i" , "<span class='red'>SELECT</span>" , $q ); $q = preg_replace( "/^UPDATE/i" , "<span class='blue'>UPDATE</span>" , $q ); $q = preg_replace( "/^DELETE/i" , "<span class='orange'>DELETE</span>", $q ); $q = preg_replace( "/^INSERT/i" , "<span class='green'>INSERT</span>" , $q ); $q = str_replace( "LEFT JOIN" , "<span class='red'>LEFT JOIN</span>" , $q ); $q = preg_replace( "/(".$this->ipsclass->vars['sql_tbl_prefix'].")(\S+?)([\s\.,]|$)/", "<span class='purple'>\\1\\2</span>\\3", $q ); $stats .= "<div style='background:#DEDEDE'><b>SHUTDOWN:</b> $q</div><hr />\n"; } } $stats .= "</div>\n</div>"; } if ( $stats ) { $collapsed_ids = ','.$this->ipsclass->my_getcookie('collapseprefs').','; $show['div_fo'] = 'show'; $show['div_fc'] = 'none'; if ( strstr( $collapsed_ids, ',debug,' ) ) { $show['div_fo'] = 'none'; $show['div_fc'] = 'show'; } $stats = "<div align='center' style='display:{$show['div_fc']}' id='fc_debug'> <div class='row2' style='padding:8px;vertical-align:middle'><a href='javascript:togglecategory(\"debug\", 0);'>Show Debug Information</a></div> </div> <div align='center' style='display:{$show['div_fo']}' id='fo_debug'> <div class='row2' style='padding:8px;vertical-align:middle'><a href='javascript:togglecategory(\"debug\", 1);'>Hide Debug Information</a></div> <br /> <div class='tableborder' align='left'> <div class='maintitle'>Debug Information</div> <div style='padding:5px;background:#8394B2;'>$stats</div> </div> </div>"; } return $stats; } /*-------------------------------------------------------------------------*/ // check_debug /*-------------------------------------------------------------------------*/ function _check_debug() { if ($this->ipsclass->DB->obj['debug']) { flush(); print "<html><head><title>SQL Debugger</title><body bgcolor='white'><style type='text/css'> TABLE, TD, TR, BODY { font-family: verdana,arial, sans-serif;color:black;font-size:11px }</style>"; print "<h1 align='center'>SQL Total Time: {$this->ipsclass->DB->sql_time} for {$query_cnt} queries</h1><br />".$this->ipsclass->DB->debug_html; print "<br /><div align='center'><strong>Total SQL Time: {$this->ipsclass->DB->sql_time}</div></body></html>"; exit(); } } /*-------------------------------------------------------------------------*/ // check_ips_report /*-------------------------------------------------------------------------*/ function _check_ips_report() { //----------------------------------------- // Note, this is designed to allow IPS validate boards // who've purchased copyright removal / registration. // The order number is the only thing shown and the // order number is unique to the person who paid and // is no good to anyone else. // Showing the order number poses no risk at all - // the information is useless to anyone outside of IPS. //----------------------------------------- $pass = 0; $key = trim( $_REQUEST['key'] ); $cust_number = 0; $acc_number = 0; $cust_number_tmp = '0,0'; if ( $this->ipsclass->input['ipsreport'] or $this->ipsclass->input['ipscheck'] ) { if ( $this->ipsclass->vars['ipb_copy_number'] ) { $cust_number_tmp = preg_replace( "/^(\d+?)-(\d+?)-(\d+?)-(\S+?)$/", "\\2,\\3", $this->ipsclass->vars['ipb_copy_number'] ); } else if ( $this->ipsclass->vars['ipb_reg_number'] ) { $cust_number_tmp = preg_replace( "/^(\d+?)-(\d+?)-(\d+?)-(\d+?)-(\S+?)$/", "\\2,\\4", $this->ipsclass->vars['ipb_reg_number'] ); } if ( md5($key) == '23f2554a507f6d52b8f27934d3d2a88d' ) { $latest_version = $this->ipsclass->DB->build_and_exec_query( array( 'select' => '*', 'from' => 'upgrade_history', 'order' => 'upgrade_version_id DESC', 'limit' => array(0, 1) ) ); if ( $this->ipsclass->version == 'v2.1.5' ) { $this->ipsclass->version = 'v'.$latest_version['upgrade_version_human']; } if ( $this->ipsclass->acpversion == '21011' ) { $this->ipsclass->acpversion = $latest_version['upgrade_version_id']; } list( $cust_number, $acc_number ) = explode( ',', $cust_number_tmp ); @header( "Content-type: text/xml" ); $out = '<?xml version="1.0" encoding="ISO-8859-1"?'.'>'; $out .= "\n<ipscheck>\n\t<result>1</result>\n\t<customer_id>$cust_number</customer_id>\n\t<account_id>$acc_number</account_id>\n\t" . "<version_id>{$this->ipsclass->acpversion}</version_id>\n\t<version_string>{$this->ipsclass->version}</version_string>\n\t<release_hash><![CDATA[<{%dyn.down.var.md5%}]]>></release_hash>" . "\n</ipscheck>"; print $out; exit(); } else { @header( "Content-type: text/plain" ); print "<result>0</result>\nYou do not have permission to view this page."; exit(); } } } //*-------------------------------------------------------------------------*/ // get_css /*-------------------------------------------------------------------------*/ function _get_css() { if ( $this->ipsclass->skin['_usecsscache'] and @file_exists( CACHE_PATH.'style_images/css_'. $this->ipsclass->skin['_csscacheid'] .'.css' ) ) { $css = $this->ipsclass->compiled_templates['skin_global']->css_external($this->ipsclass->skin['_csscacheid']); } else { $css = $this->ipsclass->compiled_templates['skin_global']->css_inline( str_replace( "<#IMG_DIR#>", $this->ipsclass->skin['_imagedir'], $this->ipsclass->skin['_css'] ) ); } if ( defined('LEGACY_MODE') && LEGACY_MODE == 1 ) { $css .= '<style type="text/css" media="all">table { width:100%; }'."\n".'tr, td { padding:4px }</style>'; } return $css; } /*-------------------------------------------------------------------------*/ // finish /*-------------------------------------------------------------------------*/ function _finish() { //----------------------------------------- // Do shutdown //----------------------------------------- if ( ! USE_SHUTDOWN ) { $this->ipsclass->my_deconstructor(); $this->ipsclass->DB->close_db(); } //----------------------------------------- // Start GZIP compression //----------------------------------------- if ($this->ipsclass->vars['disable_gzip'] != 1 ) { $buffer = ob_get_contents(); ob_end_clean(); @ob_start('ob_gzhandler'); print $buffer; } //----------------------------------------- // Print, plop and part //----------------------------------------- $this->do_headers(); } } // END class ?>
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?