【php开源代码栏目提醒】:网学会员鉴于大家对php开源代码十分关注,论文会员在此为大家搜集整理了“inc.common.php”一文,供大家参考学习
<?php
/*********************/
/* */
/* Version : 5.1.0 */
/* Author : RM */
/* Comment : 071223 */
/* */
/*********************/
error_reporting( 0 );
$mtime = explode( " ", microtime( ) );
set_magic_quotes_runtime( 0 );
if (
PHP_VERSION < "4.1.0" )
{
$_GET =& $HTTP_GET_VARS;
$_POST =& $HTTP_POST_VARS;
$_COOKIE =& $HTTP_COOKIE_VARS;
$_SERVER =& $HTTP_SERVER_VARS;
$_ENV =& $HTTP_ENV_VARS;
$_FILES =& $HTTP_POST_FILES;
}
if ( isset( $_REQUEST['GLOBALS'] ) || isset( $_FILES['GLOBALS'] ) )
{
exit( "Request tainting attempted." );
}
define( "IN_SUPEV", TRUE );
define( "SUPEV_ROOT", substr( dirname( __FILE__ ), 0, 0 - 3 ) );
define( "MAGIC_QUOTES_GPC", get_magic_quotes_gpc( ) );
if ( !defined( "CURSCRIPT" ) )
{
define( "CURSCRIPT", "" );
}
define( "CACHE_PATH", SUPEV_ROOT."./data/cache/" );
header( "P3P: CP=\"CURa ADMa DEVa PSAo PSDo OUR BUS UNI PUR INT DEM STA PRE COM NAV OTC NOI DSP COR\"" );
include_once( SUPEV_ROOT."./lib/func/func.global.php" );
define( "ISROBOT", getrobot( ) );
if ( defined( "NOROBOT" ) && ISROBOT )
{
exit( header( "HTTP/1.1 403 Forbidden" ) );
}
foreach ( array( "_COOKIE", "_POST", "_GET" ) as $_request )
{
foreach ( $$_request as $_key => $_value )
{
if ( $_key[0] != "_" )
{
$$_key = daddslashes( $_value );
}
}
}
if ( !MAGIC_QUOTES_GPC && $_FILES )
{
$GLOBALS['_FILES'] = daddslashes( $_FILES );
}
$refs = array( "block" => 0 );
$env = $cookie = $block = $member = $cookie = $cache = $jsenv = $settings = $auth = $seccode = $sess = array( );
$env['ctime'] = $mtime[1] + $mtime[0];
$timestamp = $jscode[1];
$jscode = "";
$site_url = getsiteurl( );
include_once( SUPEV_ROOT."./config.php" );
if ( getenv( "HTTP_CLIENT_IP" ) && strcasecmp( getenv( "HTTP_CLIENT_IP" ), "unknown" ) )
{
$onlineip = getenv( "HTTP_CLIENT_IP" );
}
else if ( getenv( "HTTP_X_FORWARDED_FOR" ) && strcasecmp( getenv( "HTTP_X_FORWARDED_FOR" ), "unknown" ) )
{
$onlineip = getenv( "HTTP_X_FORWARDED_FOR" );
}
else if ( getenv( "REMOTE_ADDR" ) && strcasecmp( getenv( "REMOTE_ADDR" ), "unknown" ) )
{
$onlineip = getenv( "REMOTE_ADDR" );
}
else if ( isset( $_SERVER['REMOTE_ADDR'] ) && $_SERVER['REMOTE_ADDR'] && strcasecmp( $_SERVER['REMOTE_ADDR'], "unknown" ) )
{
$onlineip = $_SERVER['REMOTE_ADDR'];
}
preg_match( "/[\\d\\.]{7,15}/", $onlineip, $onlineipmatches );
$onlineip = $onlineipmatches[0] ? $onlineipmatches[0] : "unknown";
unset( $onlineipmatches );
$GLOBALS['_SERVER']['HTTP_USER_AGENT'] = empty( $_SERVER['HTTP_USER_AGENT'] ) ? "" : $_SERVER['HTTP_USER_AGENT'];
include_once( SUPEV_ROOT."./lib/class/class.db.php" );
$db = new db_cls( );
$db->connect( $dbhost, $dbuser, $dbpw, $dbname );
unset( $dbhost );
unset( $dbuser );
unset( $dbpw );
unset( $dbname );
$prelength = strlen( $cookie_pre );
foreach ( $GLOBALS['_COOKIE'] as $key => $val )
{
if ( substr( $key, 0, $prelength ) == $cookie_pre )
{
$cookie[substr( $key, $prelength )] = MAGIC_QUOTES_GPC ? $val : daddslashes( $val );
}
}
include_once( SUPEV_ROOT."./lib/func/func.cache.php" );
readsyscache( "common" );
$settings =& $cache['settings'];
if ( !empty( $settings['gzipcompress'] ) && function_exists( "ob_gzhandler" ) && empty( $inajax ) )
{
$env['gzip'] = true;
ob_start( "ob_gzhandler" );
}
else
{
$env['gzip'] = false;
ob_start( );
$settings['gzipcompress'] = 0;
}
$timenow = array(
"time" => gmdate( "Y骞磎鏈坉鏃?h:m:s",time() + intval( $settings['time_zone'] ) * 3600 ),
"offset" => 0 <= $settings['time_zone'] ? $settings['time_zone'] == 0 ? "" : "+".$settings['time_zone'] : $settings['time_zone']
);
$seo_title = $settings['site_name'].( empty( $settings['seo_title'] ) ? "" : " - ".$settings['seo_title'] )." - Powered by SupeV";
include_once( SUPEV_ROOT."./inc/const.php" );
include_once( SUPEV_ROOT."./lib/func/func.tpl.php" );
js_setval( "jsenv", $jsenv );
$page = isset( $page ) ? max( 1, intval( $page ) ) : 1;
$stype = empty( $stype ) ? STYPE_VIDEO : $stype;
$settings['cronnextrun'] = !empty( $settings['cronnextrun'] ) ? $settings['cronnextrun'] : "1";
if ( !empty( $settings['cronnextrun'] ) && $settings['cronnextrun'] <= $timestamp )
{
require_once( SUPEV_ROOT."./lib/func/func.cron.php" );
runcron( );
}
include_once( SUPEV_ROOT."./inc/inc.auth.php" );
if ( !( in_array( CURSCRIPT, array( "login", "seccode", "
ajax" ) ) || $member['light_admgid'] == ADMGID ) && $settings['site_closed'] == ON )
{
clearcookies( );
show( $settings['site_reason'] ? $settings['site_rea