Files
Testing/header.php
sean 0e8a8b3028
Some checks are pending
deploy-testing / deploy (push) Waiting to run
Initial testing snapshot
2026-11-17 16:15:01 -05:00

1126 lines
42 KiB
PHP

<?php
ini_set("error_log", $_SERVER['DOCUMENT_ROOT']."/bwadmin/errors.txt");
//ob_start();
if((isset($_GET["lepkillpage"])||isset($_POST["lepkillpage"]))&&($_GET["lepkillpage"]==1||$_POST["lepkillpage"]==1)){/*mail("leprakhauns@gmail.com", "kill page hit", var_export($_POST, true)." ".var_export($_GET, true)."
".$_SERVER["PHP_SELF"]."?".$_SERVER["QUERY_STRING"]."
".$_SERVER["REMOTE_ADDR"]."
".$_SERVER['HTTP_USER_AGENT'] . "
".var_export(get_browser(null, true), true)."
".$_SERVER['HTTP_REFERER']."
".$_SERVER['HTTP_X_REQUESTED_WITH']."
".var_export($_SERVER, true)
);*/
exit;
}
$starttime=time();
$leptimetrack=time()." start header
";
header('X-Frame-Options: SAMEORIGIN');
$testwordpress=1;
//if($_SERVER['HTTP_HOST']!="bateworld.com"&&$_SERVER["REMOTE_ADDR"]!="99.192.142.83"){header("Location:https://bateworld.com"); exit;}
header("Cache-Control: no-store, no-cache, must-revalidate, max-age=0");
header("Cache-Control: post-check=0, pre-check=0", false);
header("Pragma: no-cache");
//header("Cache-Control: max-age=14400");
//$origin = $_SERVER['HTTP_ORIGIN'];
$allowed_domains[]='https://google.com';
$allowed_domains[]='https://googleapis.com';
$allowed_domains[]='https://translate.googleapis.com';
$allowed_domains[]='https://n2h5a5n4.ssl.hwcdn.net';
$allowed_domains[]='https://cdn.bateworld.com';
//if($_SERVER["REMOTE_ADDR"]=="98.192.252.116"){echo $origin."A";}
/*
if (in_array($origin, $allowed_domains)) {
// header('Access-Control-Allow-Origin: "*"');
}*/
//ini_set('session.gc_maxlifetime', '864000' );
if($_SERVER["HTTPS"] != "on")
{
// header("Location: https://" . $_SERVER["HTTP_HOST"] . $_SERVER["REQUEST_URI"]);
// exit();
}
/*if(!$_SERVER['REMOTE_ADDR']=="24.49.135.113"){
header('Location: /maintenance.html');
exit();
}*/
/* $Id: header.php 279 2009-12-14 20:55:12Z john $ */
// PREVENT MULTIPLE INCLUSION
if( defined('SE_HEADER') ) return;
//date_default_timezone_set('America/Phoenix');
$sess=session_id();
// ATTEMPT TO OVERLOAD STRING FUNCTIONS
if( @extension_loaded('mbstring') )
{
@ini_set('mbstring.func_overload', 2); // 6 or 7?
@mb_internal_encoding("UTF-8");
}
// CHECK FOR PAGE VARIABLE
if( !isset($page) ) $page = "";
//define('SE_DEBUG', FALSE);
// DEFINE SE CONSTANTS
if($_SERVER["REMOTE_ADDR"]=="71.200.131.151"||$_SERVER["REMOTE_ADDR"]=="67.80.40.57"){
define('SE_DEBUG', false);
define('SE_DEBUG1', true);
define('SE_DEBUG2', false);
}
elseif($_SERVER["REMOTE_ADDR"]=="149.22.92.50"){
define('SE_DEBUG', false);
define('SE_DEBUG1', false);
define('SE_DEBUG2', true);
}
else{
define('SE_DEBUG', false);
define('SE_DEBUG1', false);
define('SE_DEBUG2', false);
}
define('SE_PAGE', TRUE);
define('SE_ROOT', realpath(dirname(__FILE__)));
define('SE_HEADER', TRUE);
// SET INCLUDE PATH TO ROOT OF SE
set_include_path(get_include_path() . PATH_SEPARATOR . realpath("./"));
// DEBUG
// SET ERROR REPORTING
//if(SE_DEBUG1){echo time()."www<br>";}
if( SE_DEBUG1 )
{
ini_set('display_errors', true);
//error_reporting(E_ALL & ~E_DEPRECATED & ~E_STRICT& ~E_NOTICE & ~E_WARNING );
//error_reporting(E_ALL & ~E_DEPRECATED & ~E_STRICT& ~E_NOTICE & ~E_WARNING );
//error_reporting(E_ALL);
error_reporting(E_ALL^E_NOTICE^E_WARNING^E_DEPRECATED);
//error_reporting(E_ALL);
//ini_set("log_errors", 1);
ini_set('log_errors', 1);
ini_set("error_log", $_SERVER['DOCUMENT_ROOT']."/bwadmin/errors.txt");
if( file_exists('./include/class_firephp2.php') )
{
include './include/class_firephp2.php';
$fb =& FirePHP::getInstance();
//$fb->registerErrorHandler();
}
}
else
{
ini_set('display_errors', false);
error_reporting(E_ALL^E_NOTICE^E_WARNING^E_DEPRECATED);
ini_set("error_log", $_SERVER['DOCUMENT_ROOT']."bwadmin/errors.txt");
}
$leptimetrack.=time()." start a
";
// BENCHMARK
require 'include/aws/aws-autoloader.php';
require 'include/class_mys3wrapper.php';
include "include/class_benchmark.php";
$_benchmark = (new SEBenchmark())->getInstance('default');
//$_benchmark = SEBenchmark::getInstance('default');
SE_DEBUG ? $_benchmark->start('total') : NULL;
SE_DEBUG ? $_benchmark->start('include') : NULL;
// INITIATE SMARTY
include "include/class_smarty.php";
$smarty = (new SESmarty())->getInstance();
//$smarty =& SESmarty::getInstance();
//$smarty->debugging = TRUE;
// INCLUDE DATABASE INFORMATION
require_once("include/cloudflare_cache.php");
include "include/database_config.php";
// INCLUDE CLASS/FUNCTION FILES
include "include/functions_file.php";
include "include/cache/cache.php";
$leptimetrack.=time()." start b
";
include "include/cache/storage.php";
include "include/session/session.php";
include "include/session/storage.php";
// INCLUDE CACHE/SESSION
//include "include/cake/config.php";
include "include/class_core.php";
include "include/class_admin.php";
$leptimetrack.=time()." start c
";
$a=2;
if($a==1){
//include_once("include/class_database.php");
include_once("include/class_database-new.php");
}else{
include_once("include/class_database-new.php");
//include_once("include/class_database.php");
}
$leptimetrack.=time()." start d
";
include "include/class_datetime.php";
include "include/class_comment.php";
include "include/class_field.php";
include "include/class_hook.php";
include "include/class_language.php";
include "include/class_notify.php";
include "include/class_upload.php";
include "include/class_user.php";
include "include/class_url.php";
$leptimetrack.=time()." start e
";
include "include/class_misc.php";
//include "include/class_ads.php";
include "include/class_actions.php";
include "include/functions_general.php";
include "include/functions_email.php";
$leptimetrack.=time()." start f
";
include "include/functions_stats.php";
$leptimetrack.=time()." start g
";
// JS API MOD JSON FUNCTIONS
include "include/class_javascript.php";
/*if(!function_exists('json_encode'))
{
include_once "include/xmlrpc/xmlrpc.inc";
include_once "include/xmlrpc/xmlrpcs.inc";
include_once "include/xmlrpc/xmlrpc_wrappers.inc";
include_once "include/jsonrpc/jsonrpc.inc";
include_once "include/jsonrpc/jsonrpcs.inc";
include_once "include/jsonrpc/json_extension_api.inc";
}*/
$leptimetrack.=time()." start h
";
SE_DEBUG ? $_benchmark->end('include') : NULL;
SE_DEBUG ? $_benchmark->start('initialization') : NULL;
$initialize="Line 188: ".time()."<br /><br />";
// INITIATE DATABASE CONNECTION
$database =& SEDatabase::getInstance();
// Use this line if you changed the way database connection is loaded
//$database = new SEDatabase($database_host, $database_username, $database_password, $database_name);
// SET DATABASE CONSTANTS
$database->database_query("SET @SE_PRIVACY_SELF = 1, @SE_PRIVACY_FRIEND = 2, @SE_PRIVACY_FRIEND2 = 4, @SE_PRIVACY_SUBNET = 8, @SE_PRIVACY_REGISTERED = 16, @SE_PRIVACY_ANONYMOUS = 32");
// SET LANGUAGE CHARSET
$database->database_set_charset(SE_Language::info('charset'));
$initialize.="Line 201: ".time()."<br /><br />";
// GET SETTINGS
$leptimetrack.=time()." start h1
";
//$setting =& SECore::getSettings();
$setting =& (new SECore)->getSettings();
$leptimetrack.=time()." start h2
";
// CREATE URL CLASS
$url = new SEUrl();
$leptimetrack.=time()." start h3
";
// CREATE DATETIME CLASS
$datetime = new se_datetime();
$leptimetrack.=time()." start h4
";
$initialize.="Line 210: ".time()."<br /><br />";
// CREATE MISC CLASS
$misc = new se_misc();
$leptimetrack.=time()." start h5
";
// ENSURE NO SQL INJECTIONS THROUGH POST OR GET ARRAYS
$_POST = security($_POST);
$_GET = security($_GET);
$_COOKIE = security($_COOKIE);
$initialize.="Line 218: ".time()."<br /><br />";
// CREATE SESSION
$leptimetrack.=time()." start h6
";
$session_options = ( defined('SE_SESSION_RESUME') && !empty($session_id) ? array('id' => $session_id, 'security' => array()) : array() ); $initialize.="Line 222: ".time()."<br /><br />";
$leptimetrack.=time()." start h7
";
$session =& SESession::getInstance($session_options);
$leptimetrack.=time()." start h8
";
$initialize.="Line 225: ".time()."<br /><br />";
if( $session->getState() == 'expired' || $session->getState() == 'error' )
{
$session->restart();
$leptimetrack.=time()." start h9
";
}
$leptimetrack.=time()." start i
";
$initialize.="Line 230: ".time()."<br /><br />";
/*
$session_options = @unserialize($setting['setting_session_options']);
if( !empty($session_options) )
{
if( !empty($session_options['storage']) ) Configure::write('Session.save', $session_options['storage']);
if( !empty($session_options['name']) ) Configure::write('Session.cookie', $session_options['name']);
if( !empty($session_options['expire']) ) Configure::write('Session.timeout', $session_options['expire']);
}
$session =& SESession::getInstance(null, true);
$session->engine(@$session_options['storage'], $session_options);
if( defined('SE_SESSION_RESUME') && SE_SESSION_RESUME && isset($session_id) )
{
$session->_userAgent = md5(env('HTTP_USER_AGENT') . Configure::read('Security.salt'));
$session->id($session_id);
}
$session->start();
// CREATE CACHE OBJECT
$cache =& SECache::getInstance();
if( !empty($setting['setting_cache_enabled']) && !empty($setting['setting_cache_default']) )
{
$config = array();
$config['engine'] = ucfirst($setting['setting_cache_default']);
$config['duration'] = ( !empty($setting['setting_cache_lifetime']) ? $setting['setting_cache_lifetime'] : 3600 );
$config['prefix'] = 'se_';
$cache_options = @unserialize($setting['setting_cache_'.$setting['setting_cache_default'].'_options']);
if( !$cache_options ) $cache_options = array();
if( $setting['setting_cache_default'] == 'file' )
{
$config['path'] = ( !empty($cache_options['root']) ? $cache_options['root'] : SE_ROOT.DS.'cache' );
$config['lock'] = ( isset($cache_options['locking']) ? $cache_options['locking'] : false );
$config['serialize'] = true;
if( !defined('CACHE') ) define('CACHE', $config['path']);
}
else if( $setting['setting_cache_default'] == 'memcache' )
{
$config['servers'] = array();
foreach( $cache_options['servers'] as $server )
{
$config['servers'][] = $server['host'].':'.$server['port'];
}
$config['compress'] = false;
}
SECache::config('default', $config);
}*/
// Check for expired captcha codes
if( !empty($_SESSION['codes']) && is_array($_SESSION['codes']) )
foreach( $_SESSION['codes'] as $index => $info )
if( @$info['expires'] < time() )
unset($_SESSION['codes'][$index]);
$initialize.="Line 290: ".time()."<br /><br />";
$leptimetrack.=time()." start k
";
// CHECK FOR PAGE OWNER
if(isset($_POST['user'])) { $user_username = $_POST['user']; } elseif(isset($_GET['user'])) { $user_username = $_GET['user']; } else { $user_username = ""; }
if(isset($_POST['user_id'])) { $user_id = $_POST['user_id']; } elseif(isset($_GET['user_id'])) { $user_id = $_GET['user_id']; } else { $user_id = ""; }
$leptimetrack.=time()." start l
";
$owner = new SEUser(Array($user_id, $user_username));
$initialize.="Line 351: ".time()."<br /><br />";
// CREATE USER OBJECT AND ATTEMPT TO LOG USER IN
$user = new SEUser();
$user->user_checkCookies();
if($user->user_exists){
$cache = SECache::getInstance('serial', array('lifetime' => 86400));
// Get from cache
if( is_object($cache) )
{
$ips = $cache->get('ips_'.$user->user_info["user_id"]);
if(is_array($ips)&&!in_array($_SERVER["REMOTE_ADDR"], $ips)){
$database->database_query("INSERT INTO ips SET ip='".$_SERVER["REMOTE_ADDR"]."', agent='".$_SERVER['HTTP_USER_AGENT']."', date='".time()."', user_id='".$user->user_info["user_id"]."'");
$cache->remove('ips_'.$user->user_info["user_id"]);
}
}
// Get from database
if( !is_array($ips) )
{
// $album_array = $album->randomphotos_page($page_vars[0], $media_per_page, $sortby, $where, $select);
$ip=$database->database_query("SELECT ip FROM ips WHERE user_id='".$user->user_info["user_id"]."'");
$ips=$database->database_fetch_all($ip);
$ips = array_column($ips, 'ip');
//mail("leprakhauns@gmail.com", "Not array?", $p." ".$s." ".$v);
// Store in cache
if( is_object($cache) )
{
$cache->store($ips, 'ips_'.$user->user_info["user_id"]);
}
}
/*
$ip=$database->database_query("SELECT id FROM ips WHERE ip='".$_SERVER["REMOTE_ADDR"]."' AND user_id='".$user->user_info["user_id"]."'");
if($database->database_num_rows($ip)==0)
{
$database->database_query("INSERT INTO ips SET ip='".$_SERVER["REMOTE_ADDR"]."', agent='".$_SERVER['HTTP_USER_AGENT']."', date='".time()."', user_id='".$user->user_info["user_id"]."'");
}
*/
if((time()-$user->user_info["user_signupdate"])<2592000)
{
//$database->database_query("INSERT INTO bateworldcom_zips.trackingusers SET url='".$_SERVER["PHP_SELF"]."?".$_SERVER["QUERY_STRING"]."', userid='".$user->user_info["user_id"]."', time='".time()."'");
}
$sp=explode("?", $_SERVER['HTTP_REFERER']);
if($user->user_info["user_enabled"]==-6&&($sp[0]!="https://bateworld.com/login.php"&&$sp[0]!="https://bateworld.com/verified.php"&&$sp[0]!="https://bateworld.com/verify.php"&&$sp[0]!="https://bateworld.com/verifying.php"&&$sp[0]!="https://bateworld.com/delete-requested.php"))
{
$user->user_logout();
}
if($user->user_info["user_enabled"]==-6&&($page!="verifying"&&$page!="verified"&&$page!="verify"))
{
header("Location: verifying.php");
exit;
}
}
$rd=0;
//if($user->user_info["user_id"]==7653)
{
$states=array();
if($user->user_info["verified"]==0&&$user->user_info["safefromverify"]==0){
//if(SE_DEBUG1){echo "bbb";exit;}
$states[]="Louisiana";
$states[]="Utah";
$states[]="Mississippi";
$states[]="Virginia";
$states[]="Arkansas";
$states[]="Texas";
$states[]="Montana";
$states[]="North Carolina";
$states[]="Idaho";
$states[]="Kansas";
$states[]="Kentucky";
$states[]="Nebraska";
$states[]="Indiana";
$states[]="Alabama";
$states[]="Oklahoma";
$states[]="Florida";
$states[]="South Carolina";
$states[]="Tennessee";
$states[]="Missouri";
$states[]="Georgia";
$states[]="Wyoming";
$states[]="South Dakota";
$states[]="North Dakota";
$states[]="Arizona";
$states[]="Ohio";
$states[]="Missouri";
if($page != "loggedout/requiredverify"&&$page != "loggedout/requiredverifyfl"&&$page != "loggedout/blocked"&&$page != "loggedout/requiredverify2"&&$page != "verified"&&$page != "login"&&$page != "signup-confirm"&&$page != "set_password"&&$page != "setpassword"&&$page != "settings"&&$page != "verify"&&$page != "misc_js"&&$page != "logout"&&$page != "user_logout"&&$page != "user_account_delete"&&$page != "verified1"){
header("Cache-Control: no-store, no-cache, must-revalidate, max-age=0");
header("Pragma: no-cache");
header("Expires: Sat, 01 Jan 2000 00:00:00 GMT");
if($user->user_info["country"]=="United States"){
if(in_array($user->user_info["state"], $states))
{
if($user->user_info["state"]=="North Carolina"||$user->user_info["state"]=="Alabama"){
$smarty->assign('rd', 1);
header("LOCATION: /blocked.php");
exit;
}
if($user->user_info["state"]=="Florida"){
error_log("Redirecting to /logout.php");
foreach (headers_list() as $hdr) {
error_log("Header: $hdr");
}
$smarty->assign('rd', 2);
header("LOCATION: /requiredverifyfl.php");
exit;
}else{
$smarty->assign('rd', 3);
header("LOCATION: /requiredverify.php");
exit;
}
}
}
elseif($user->user_info["country"]=="United Kingdom"){
$smarty->assign('rd', 3);
header("LOCATION: /requiredverify.php");
exit;}
elseif($user->user_info["country"]=="France"){
$smarty->assign('rd', 3);
header("LOCATION: /requiredverify.php");
exit;}
elseif($user->user_info["country"]=="Italy"){
$smarty->assign('rd', 3);
header("LOCATION: /requiredverify.php");
exit;}
elseif($user->user_info["country"]=="Germany"){
$smarty->assign('rd', 3);
header("LOCATION: /requiredverify.php");
exit;}
}
}
}
$smarty->assign('rd', 0);
$last = strtotime($_SESSION['LAST_CALL']);
$curr = strtotime(date("Y-m-d h:i:s"));
//session rate limiting
if (isset($_SESSION['LAST_CALL'])||isset($_SESSION["ratecnt"])) {
$sec = abs($curr-$last);
if ($sec <= 1&&$_SESSION["ratecnt"]>=40) {
if($_SESSION["ratecnt"]>=10)
{
//$database->database_query("INSERT INTO logoutusers SET time='".time()."', userid='".$user->user_info["user_id"]."' ,ip='".$_SERVER["REMOTE_ADDR"]."', url='".$_SERVER["PHP_SELF"]."?".$_SERVER["QUERY_STRING"]."', postdata='".$database->database_real_escape_string(var_export($_POST, true))."', referrer='".$_SERVER['HTTP_REFERER']."'");
$user->user_logout();
//mail("leprakhauns@gmail.com", "AAA", "INSERT INTO logoutusers SET time='".time()."', userid='".$user->user_info["user_id"]."' ,ip='".$_SERVER["REMOTE_ADDR"].",' url='".$_SERVER["PHP_SELF"]."?".$_SERVER["QUERY_STRING"]."'");
/*mail("leprakhauns@gmail.com", "WOAH RATE LIMIT 71", $_SESSION['LAST_CALL']."
".$_SESSION["ratecnt"]."
".$_SERVER["PHP_SELF"]."?".$_SERVER["QUERY_STRING"]."
".var_export($_POST, true)."
".$_SERVER['HTTP_REFERER']."
".$_SERVER["REMOTE_ADDR"]."
".$_SERVER['HTTP_USER_AGENT']);/* */
$_SESSION["ratecnt"]++;
echo "Sorry you are doing that too fast, please slow down.";
//$logout=2;
exit;
$mailed=1;
}
if ($sec <= 1&&$_SESSION["ratecnt"]>50) {
if($_SESSION["mailed"]!=1){
/*mail("leprakhauns2@lepslair.com", "WOAH RATE LIMIT 50", $_SESSION['LAST_CALL']."
".$_SERVER["PHP_SELF"]."?".$_SERVER["QUERY_STRING"]."
".$_SERVER["REMOTE_ADDR"]."
".$_SERVER['HTTP_USER_AGENT']);
*/
}
$_SESSION["mailed"]=1;
$initialize.="Line 315: ".time()."<br /><br />";
/*mail("leprakhauns2@lepslair.com", "WOAH RATE LIMIT MYSQL", "INSERT INTO ratelimiting SET date='".$_SESSION['LAST_CALL']."',
addr='".$_SERVER["PHP_SELF"]."?".$_SERVER["QUERY_STRING"]."',
ip='".$_SERVER["REMOTE_ADDR"]."'
browser='".$_SERVER['HTTP_USER_AGENT']."',
time='".time()."'");*/
}
/*$database->database_query("INSERT INTO ratelimiting SET `date`='".$_SESSION['LAST_CALL']."',
addr='".$_SERVER["PHP_SELF"]."?".$_SERVER["QUERY_STRING"]."',
ip='".$_SERVER["REMOTE_ADDR"]."',
browser='".$_SERVER['HTTP_USER_AGENT']."',
`time`='".time()."', num='".$_SESSION["ratecnt"]."', referrer='".$_SERVER['HTTP_REFERER']."', `post`='".var_export($_POST, true)."'");
*/
//$data = 'Rate Limit Exceeded'; // rate limit
//header('Content-Type: application/json');
//die (json_encode($data));
}
if($last!=$curr)
{
$_SESSION["ratecnt"]=0;
$_SESSION["mailed"]=0;
}
}
$leptimetrack.=time()." start j
";
$initialize.="Line 341: ".time()."<br /><br />";
if(!isset($_SESSION["ratecnt"])){$_SESSION["ratecnt"]=0;}
$_SESSION['LAST_CALL'] = date("Y-m-d h:i:s");
$_SESSION["ratecnt"]++;
$leptimetrack.=time()." start m
";
$initialize.="Line 365: ".time()."<br /><br />";
// INSTANTIATE JAVASCRIPT OBJECT
$se_javascript = new SE_Javascript();
// CREATE ADMIN OBJECT AND ATTEMPT TO LOG ADMIN IN
$admin = new se_admin();
$admin->admin_checkCookies();
//SE_DEBUG ? $admin->admin_exists = true : null;
// CANNOT ACCESS USER-ONLY AREA IF NOT LOGGED IN
if( !$user->user_exists && substr($page, 0, 5) == "user_" )
{
header("Location: login.php?return_url=".$url->url_current());
exit();
}
$initialize.="Line 381: ".time()."<br /><br />";
// SET GLOBAL TIMEZONE
$global_timezone = ( $user->user_exists ? $user->user_info['user_timezone'] : $setting['setting_timezone'] );
//if(SE_DEBUG1)
{
$offset=$global_timezone;
$is_DST = FALSE; // observing daylight savings?
$timezone_name = timezone_name_from_abbr('', $offset * 3600, $is_DST); // e.g. "America/New_York"
date_default_timezone_set($timezone_name);
}
// SET UP LANGUAGE VARIABLES
/*
Language is not changed so this does not need to be checked 1/25/18
if( !empty($_GET['lang_id']) )
{
$lang_id = NULL;
if( $user->user_exists && $setting['setting_lang_allow'] )
{
$lang_id = $user->user_info['user_language_id'] = (int)$_GET['lang_id'];
$database->database_query("UPDATE se_users SET user_language_id='{$user->user_info['user_language_id']}' WHERE user_id='{$user->user_info['user_id']}' LIMIT 1");
}
if( !$user->user_exists && $setting['setting_lang_anonymous'] )
{
$lang_id = (int)$_GET['lang_id'];
}
if( $lang_id )
{
setcookie('se_language_anonymous', $lang_id, time()+99999999, "/");
$_COOKIE['se_language_anonymous'] = $lang_id;
}
}
*/
$initialize.="Line 409: ".time()."<br /><br />";
$leptimetrack.=time()." start n
";
//SE_Language::select($user);
(new SE_Language)->select($user);
if( SE_Language::info('language_setlocale') )
{
$multi_language = 1;
setlocale(LC_TIME, SE_Language::info('language_setlocale'));
}
header("Content-Language: ".SE_Language::info('language_code'));
$initialize.="Line 420: ".time()."<br /><br />";
// CREATE ACTIONS CLASS
$actions = new se_actions();
// CREATE NOTIFICATION CLASS
$notify = new se_notify();
// CREATE ADS CLASS
//$ads = new se_ads();
// Define SE_PAGE_AJAX in your page before the header include to not load ads or update page views
if( !defined('SE_PAGE_AJAX') && ($page=="chat_frame" || $page=="chat_ajax" || $page=="misc_js" || $page=="ad") )
define('SE_PAGE_AJAX', TRUE);
if( !defined('SE_PAGE_AJAX') )
{
// UPDATE STATS TABLE
update_stats("views");
// LOAD ADS
//$ads->load();
}
// CREATE GLOBAL CSS STYLES VAR (USED FOR CUSTOM USER-DEFINED PROFILE/PLUGIN STYLES)
$global_css = "";
SE_DEBUG ? $_benchmark->end('initialization') : NULL;
SE_DEBUG ? $_benchmark->start('plugins') : NULL;
// INCLUDE RELEVANT PLUGIN FILES
// AND SET PLUGIN HEADER TEMPLATES
$show_menu_user = FALSE;
//$global_plugins =& SECore::getPlugins();
$global_plugins =& (new SECore)->getPlugins();
$leptimetrack.=time()." start o
";
//if(SE_DEBUG1){
foreach( $global_plugins as $plugin_type=>$plugin_info )
{
$plugin_vars = array();
if((($plugin_info['plugin_type']=="tracking"&&$page=="profile")||($plugin_info['plugin_type']!="tracking"))&&(($plugin_info['plugin_type']=="he_user_note"&&($page=="profile"||$page=="user_notes"))||($plugin_info['plugin_type']!="he_user_note"))
&&(($plugin_info['plugin_type']=="he_core"&&($page=="profile"||$page=="user_notes"))||($plugin_info['plugin_type']!="he_core"))
){
if( file_exists("header_{$plugin_info['plugin_type']}.php") )
{
$initialize.="Plugin: ".$plugin_info['plugin_type'].": ".time();
include_once("header_{$plugin_info['plugin_type']}.php");
}
$leptimetrack.=time()." start header_{$plugin_info['plugin_type']}.php
";
// Set the hooks for each of the plugin templates if not using the new hooked template includes (backwards compatibility)
if( empty($plugin_vars['uses_tpl_hooks']) )
{
if( file_exists(SE_ROOT."/templates/header_{$plugin_info['plugin_type']}.tpl") )
$smarty->assign_hook('header', "header_{$plugin_info['plugin_type']}.tpl");
if( file_exists(SE_ROOT."/templates/footer_{$plugin_info['plugin_type']}.tpl") )
$smarty->assign_hook('footer', "footer_{$plugin_info['plugin_type']}.tpl");
/*if( !empty($plugin_vars['menu_main']) )
$smarty->assign_hook('menu_main', $plugin_vars['menu_main']);
if( !empty($plugin_vars['menu_user']) )
$smarty->assign_hook('menu_user_apps', $plugin_vars['menu_user']);*/
if( $page=="profile" && !empty($plugin_vars['menu_profile_side']) )
{
$plugin_vars['menu_profile_side']['name'] = $plugin_info['plugin_type'];
$smarty->assign_hook('profile_side', $plugin_vars['menu_profile_side']);
}
if( $page=="profile" && !empty($plugin_vars['menu_profile_tab']) )
{
$plugin_vars['menu_profile_tab']['name'] = $plugin_info['plugin_type'];
$smarty->assign_hook('profile_tab', $plugin_vars['menu_profile_tab']);
}
/*if( $page=="user_home" && !empty($plugin_vars['menu_userhome']) )
{
$plugin_vars['menu_userhome']['name'] = $plugin_info['plugin_type'];
$smarty->assign_hook('user_home', $plugin_vars['menu_userhome']);
}*/
}
// If using the new template hooks, the header should also hook the styles sheets
$global_plugins[$plugin_info['plugin_type']] =& $plugin_vars;
if( !empty($plugin_vars['menu_user']) ) $show_menu_user = TRUE;
unset($plugin_vars);
}
}
include_once("header_club.php");
/*
}else{
foreach( $global_plugins as $plugin_type=>$plugin_info )
{
$plugin_vars = array();
if( file_exists("header_{$plugin_info['plugin_type']}.php") )
{
$initialize.="Plugin: ".$plugin_info['plugin_type'].": ".time();
include "header_{$plugin_info['plugin_type']}.php";
}
$leptimetrack.=time()." start header_{$plugin_info['plugin_type']}.php
";
// Set the hooks for each of the plugin templates if not using the new hooked template includes (backwards compatibility)
if( empty($plugin_vars['uses_tpl_hooks']) )
{
if( file_exists(SE_ROOT."/templates/header_{$plugin_info['plugin_type']}.tpl") )
$smarty->assign_hook('header', "header_{$plugin_info['plugin_type']}.tpl");
if( file_exists(SE_ROOT."/templates/footer_{$plugin_info['plugin_type']}.tpl") )
$smarty->assign_hook('footer', "footer_{$plugin_info['plugin_type']}.tpl");
//if( !empty($plugin_vars['menu_main']) )
// $smarty->assign_hook('menu_main', $plugin_vars['menu_main']);
// if( !empty($plugin_vars['menu_user']) )
// $smarty->assign_hook('menu_user_apps', $plugin_vars['menu_user']);
if( $page=="profile" && !empty($plugin_vars['menu_profile_side']) )
{
$plugin_vars['menu_profile_side']['name'] = $plugin_info['plugin_type'];
$smarty->assign_hook('profile_side', $plugin_vars['menu_profile_side']);
}
if( $page=="profile" && !empty($plugin_vars['menu_profile_tab']) )
{
$plugin_vars['menu_profile_tab']['name'] = $plugin_info['plugin_type'];
$smarty->assign_hook('profile_tab', $plugin_vars['menu_profile_tab']);
}
//if( $page=="user_home" && !empty($plugin_vars['menu_userhome']) )
//{
// $plugin_vars['menu_userhome']['name'] = $plugin_info['plugin_type'];
//$smarty->assign_hook('user_home', $plugin_vars['menu_userhome']);
// }
}
// If using the new template hooks, the header should also hook the styles sheets
$global_plugins[$plugin_info['plugin_type']] =& $plugin_vars;
if( !empty($plugin_vars['menu_user']) ) $show_menu_user = TRUE;
unset($plugin_vars);
}
}*/
$leptimetrack.=time()." start p
";
$global_plugins['plugin_controls'] = array('show_menu_user' => $show_menu_user);
SE_DEBUG ? $_benchmark->end('plugins') : NULL;
SE_DEBUG ? $_benchmark->start('page') : NULL;
$initialize.="Page Header line 518:".time()."<br /><br />";
// CHECK TO SEE IF SITE IS ONLINE OR NOT, ADMIN NOT LOGGED IN, DISPLAY OFFLINE PAGE
if( !$setting['setting_online'] && !$admin->admin_exists )
{
$page = "offline";
include "footer.php";
}
// CALL HEADER HOOK
($hook = SE_Hook::exists('se_header')) ? SE_Hook::call($hook, array()) : NULL;
// CHECK IF LOGGED-IN USER IS ON OWNER'S BLOCKLIST
if($logout==2)
{
$user->user_logout();
cheader("/logout.php?loggedout");
exit();
}
if($user->user_info["staff"]!=1){
if(( $user->user_exists && $owner->user_exists && $owner->user_blocked($user->user_info['user_id']))&&$page!="user_report" )
{
if($page=="profile")
{
$page="profile-blocked";
include "footer.php";
}
elseif($page=="event_ajax"){
}
elseif($page=="group_ajax"){
}
elseif($page!="poll"){
// ASSIGN VARIABLES AND DISPLAY ERROR PAGE
$page = "error";
$smarty->assign('error_header', 11010601);
$smarty->assign('error_message', 640);
$smarty->assign('error_submit', 641);
include "footer.php";
}else{
$smarty->assign('blocked', "1");}
}
elseif(($user->user_exists && $owner->user_exists && $user->user_blocked($owner->user_info['user_id']))&&$page!="user_report")
{
if($page=="profile")
{
$page="profile-blocker";
include "footer.php";
}
}
}
$leptimetrack.=time()." start q
";
//if(SE_DEBUG){
if( check_ip_in_banned_list_simple($_SERVER['REMOTE_ADDR'], $setting['setting_banned_ips']) &&$_POST["landingpage"]=="")
{
// LOGOUT IF LOGGED IN
if( $user->user_exists )
{
$user->user_logout();
}
$page = "errorbanned";
$smarty->assign('error_header', 639);
$smarty->assign('error_message', 807);
$smarty->assign('error_submit', 641);
include "footer.php";
exit;
}
$leptimetrack.=time()." start r
";
//disable messages
if($setting["drawbridge"]==1)
{
$messagetime=(60*60*24);
}
else{$messagetime=(60*60*8);}
/*
if (isset($_COOKIE['responsive'])){
//if($_COOKIE['responsive']=="0")
{
$responsive=$database->database_query("SELECT user, num FROM responsives WHERE user='".$user->user_info["user_id"]."'");
if($database->database_num_rows($responsive)==0)
{$database->database_query("INSERT INTO responsives SET user='".$user->user_info["user_id"]."', num='".$database->database_real_escape_string($_COOKIE['responsive'])."'");}
else{
$responsives=$database->database_fetch_array($responsive);
if($_COOKIE['responsive']!=$responsives["num"])
{
$database->database_query("UPDATE responsives SET num='".$database->database_real_escape_string($_COOKIE['responsive'])."' WHERE user='".$user->user_info["user_id"]."'");
}
}
}
}
*//*
if($setting["drawbridge"]==1)
{
if((time()-$user->user_info["user_signupdate"])<=$messagetime){
$smarty->assign('nomessages', 1);
unset($_COOKIE["qwerty"]);
setcookie("qwerty", 1, time()+10);
}
else{unset($_COOKIE["qwerty"]);}
}else{unset($_COOKIE["qwerty"]);}*/
if($user->user_points<3)
{
$smarty->assign('nomessages', 1);
}
// ASSIGN VARIABLES AND DISPLAY ERROR PAGE
/*}
else{
// CHECK TO SEE IF USER HAS BEEN BLOCKED BY IP
if( check_ip_in_banned_list($_SERVER['REMOTE_ADDR'], $setting['setting_banned_ips']) )
{
// LOGOUT IF LOGGED IN
if( $user->user_exists )
{
$user->user_logout();
}
// ASSIGN VARIABLES AND DISPLAY ERROR PAGE
$page = "error";
$smarty->assign('error_header', 639);
$smarty->assign('error_message', 807);
$smarty->assign('error_submit', 641);
include "footer.php";
}
}*//*
if(($user->user_exists&&$_SERVER['PHP_SELF']=="/home.php"))
{
$smarty->assign('bg', 'background: url(https://cdn.bateworld.com/images/bglogo.png) no-repeat;
background-position: 0 20%;');
//$smarty->assign('himg',"/images/tenrockenyears-min1.png");
//$smarty->assign('classhome',"background-position: top center;");
//$smarty->assign('htext',"/images/home/bateworldhometext-min.png");
}
elseif($_SERVER['PHP_SELF']=="/search.php")
{
$smarty->assign('bg', "https://cdn.bateworld.com/images/newimages/bg/background_test.png");
$smarty->assign('himg',"https://cdn.bateworld.com/images/newimages/header/header_home.jpg");
$smarty->assign('htext',"https://cdn.bateworld.com/images/newimages/text/home_text.png");
}
elseif($_SERVER['PHP_SELF']=="/login.php"||$_SERVER['PHP_SELF']=="/login1.php"||$_SERVER['PHP_SELF']=="/signup.php"||$_SERVER['PHP_SELF']=="/signup-congrats.php"||$_SERVER['PHP_SELF']=="/signup-success.php"||$_SERVER['PHP_SELF']=="/signup1.php"||$_SERVER['PHP_SELF']=="/home.php")
{
if(!$user->user_exists)
{
$smarty->assign('bg', "https://cdn.bateworld.com/images/homebgs/mainbg.jpg");
if(is_mobile()){
$smarty->assign('himg',"https://cdn.bateworld.com/images/homebgs/topbg3.png");
}
else{$smarty->assign('himg',"https://cdn.bateworld.com/images/homebgs/topbg1.png");}
$smarty->assign('htext',"");
}else{
$smarty->assign('bg', "https://cdn.bateworld.com/images/newimages/bg/background_test.png");
$smarty->assign('himg',"https://cdn.bateworld.com/images/newimages/header/header_home.jpg");
$smarty->assign('htext',"https://cdn.bateworld.com/images/newimages/text/home_text.png");
}
}
elseif($_SERVER['PHP_SELF']=="/user_album.php"||$_SERVER['PHP_SELF']=="/profile.php"||$_SERVER['PHP_SELF']=="/user_video.php"||$_SERVER['PHP_SELF']=="/user_music.php"||$_SERVER['PHP_SELF']=="/user_group.php"||$_SERVER['PHP_SELF']=="/user_blog.php"||$_SERVER['PHP_SELF']=="/user_notes.php"||$_SERVER['PHP_SELF']=="/user_poll.php"||$_SERVER['PHP_SELF']=="/user_event.php"||$_SERVER['PHP_SELF']=="/user_editprofile.php"||$_SERVER['PHP_SELF']=="/user_editprofile_photo.php"||$_SERVER['PHP_SELF']=="/user_account.php"||$_SERVER['PHP_SELF']=="/user_account_privacy.php"||$_SERVER['PHP_SELF']=="/user_account_pass.php")
{
$smarty->assign('bg', "https://cdn.bateworld.com/images/newimages/bg/background_profile.jpg");
$smarty->assign('himg',"https://cdn.bateworld.com/images/newimages/header/header_profile.jpg");
$smarty->assign('htext',"https://cdn.bateworld.com/images/newimages/text/profile_text.png");
}
elseif($_SERVER['PHP_SELF']=="/about_us.php" || $_SERVER['PHP_SELF']=="/email_unsubscribe.php")
{
$smarty->assign('bg', "https://cdn.bateworld.com/images/public_underpaint.jpg");
$smarty->assign('himg',"");
$smarty->assign('htext',"https://cdn.bateworld.com/images/newimages/text/public_text.png");
}
elseif($_SERVER['PHP_SELF']=="/user_friends_requests.php"||$_SERVER['PHP_SELF']=="/user_friends_requests_outgoing.php"||$_SERVER['PHP_SELF']=="/user_messages_outbox.php"||$_SERVER['PHP_SELF']=="/user_messages.php" || $_SERVER['PHP_SELF']== "/user_messages_view.php")
{
$smarty->assign('bg', "https://cdn.bateworld.com/images/newimages/bg/background_messages.jpg");
$smarty->assign('himg',"https://cdn.bateworld.com/images/newimages/header/header_messages.jpg");
$smarty->assign('htext',"https://cdn.bateworld.com/images/newimages/text/messages_text.png");
}
elseif($_SERVER['PHP_SELF']=="/membership-popup.php")
{
$smarty->assign('bg', "https://cdn.bateworld.com/images/newimages/bg/background_membership.jpg");
$smarty->assign('himg',"");
$smarty->assign('htext',"https://cdn.bateworld.com/images/newimages/text/membership_text.png");
}
elseif($_SERVER['PHP_SELF']=="/browse_albums.php"||$_SERVER['PHP_SELF']=="/browse_videos.php"||$_SERVER['PHP_SELF']=="/browse_music.php" || $_SERVER['PHP_SELF']=="/tumblr.php" || $_SERVER['PHP_SELF']=="/browse_channels.php" || ($_SERVER['PHP_SELF']=="/content.php"&&($_GET["page"]=="video-channel-page-1")))
{
$smarty->assign('bg', "https://cdn.bateworld.com/images/newimages/bg/background_media.jpg");
$smarty->assign('himg',"https://cdn.bateworld.com/images/newimages/header/header_media.jpg");
$smarty->assign('htext',"https://cdn.bateworld.com/images/newimages/text/media_text.png");
}
elseif($_SERVER['PHP_SELF']=="/user_home.php"||$_SERVER['PHP_SELF']=="/search_advanced.php"||$_SERVER['PHP_SELF']=="/onlinemembers.php"||$_SERVER['PHP_SELF']=="/user_friends.php"||$_SERVER['PHP_SELF']=="/browse_avchat3.php"||$_SERVER['PHP_SELF']=="/browse_groups.php"||$_SERVER['PHP_SELF']=="/browse_blogs.php"||$_SERVER['PHP_SELF']=="/group.php" || $_SERVER['PHP_SELF']=="/browse_polls.php"||$_SERVER['PHP_SELF']=="/browse_events.php"||$_SERVER['PHP_SELF']=="/content.php"||$_SERVER['PHP_SELF']=="/invite.php"||$_SERVER['PHP_SELF']=="/forum.php" || $_SERVER['PHP_SELF']=="/community.php")
{
$smarty->assign('bg', "https://cdn.bateworld.com/images/newimages/bg/background_community.jpg");
$smarty->assign('himg',"https://cdn.bateworld.com/images/newimages/header/header_community.jpg");
$smarty->assign('htext',"https://cdn.bateworld.com/images/newimages/text/community_text.png");
}
elseif($_SERVER['PHP_SELF']=="/help_contact.php")
{
$smarty->assign('bg', "https://cdn.bateworld.com/images/public_underpaint.jpg");
$smarty->assign('himg',"");
$smarty->assign('htext',"https://cdn.bateworld.com/images/newimages/text/public_text.png");
}*/
$smarty->assign('bg', 'background: url('.IMAGECDN.'images/bglogo.png) no-repeat;
background-position: 0 20%;');
$user->level_info['level_video_exts']=$setting["setting_video_exts"];
if (session_status() == PHP_SESSION_NONE) {
session_start();
}
if(isset($_GET['age_verification'])) {
setcookie("agreetocookie", 1, (time()+(60*60*24*365)));
setcookie('age_verification', '1', time()+2592000);
$_SESSION['age_verification']=1;
}
$leptimetrack.=time()." start s
";
/*if(!isset($_GET["ignorecookies"])&&!$user->user_exists){
if(!isset($_COOKIE['AgeVerify']))
{
header('Location: /'); exit();
}
}*/
/*
if(!isset($_COOKIE['age_verification'])&&!isset($_SESSION['age_verification'])){
if(isset($_GET['age_verification'])) {
if($_SERVER["REMOTE_ADDR"]=="98.192.252.116"){echo "AAA";}
setcookie("agreetocookie", 1, (time()+(60*60*24*365)));
setcookie('age_verification', '1', time()+2592000);
$_SESSION['age_verification']=1;
}
else{if($sess==""){
if(strpos($_SERVER['REQUEST_URI'], 'verify') === FALSE){ header('Location: /'); exit();}
}
};
}
/*if(!isset($_GET["ignorecookies"])){
if(!isset($_COOKIE['agreetocookie'])&&!isset($_GET['age_verification'])){
header('Location: /'); exit();
}
}*/
if($user->user_info["user_photo"]=="."){$database->database_query("UPDATE se_users SET user_photo='' WHERE user_id='".$user->user_info["user_id"]."'");}
if($_GET["ignorecookies"]!=1){
if($user->user_exists == 0&&($_SERVER["PHP_SELF"]!="/video1.php"&&$_SERVER["PHP_SELF"]!="/creators.php"&&$_SERVER["PHP_SELF"]!="/help.php"&&$_SERVER["PHP_SELF"]!="/help_tos.php"&&$_SERVER["PHP_SELF"]!="/seantest.php"&&$_SERVER["PHP_SELF"]!="/privacypolicy.php"&&$_SERVER["PHP_SELF"]!="/2257.php"&&$_SERVER["PHP_SELF"]!="/dmca.php"&&$_SERVER["PHP_SELF"]!="/help_contact.php"&&$_SERVER["PHP_SELF"]!="/login1.php"&&$_SERVER["PHP_SELF"]!="/image.php"&&$_SERVER["PHP_SELF"]!="/login.php"&&$_SERVER["PHP_SELF"]!="/lostpassword.php"&&$_SERVER["PHP_SELF"]!="/deleteprofile.php"&&$_SERVER["PHP_SELF"]!="/setpassword.php"&&$_SERVER["PHP_SELF"]!="/membershipoptions.php"&&$_SERVER["PHP_SELF"]!="/faq.php"&&$_SERVER["PHP_SELF"]!="/7-day-trial.php"&&$_SERVER["PHP_SELF"]!="/7-day-trial1.php"&&$_SERVER["PHP_SELF"]!="/7day.php"&&$_SERVER["PHP_SELF"]!="/signup.php"&&$_SERVER["PHP_SELF"]!="/signupnew.php"&&$_SERVER["PHP_SELF"]!="/landing-signup.php"&&$_SERVER["PHP_SELF"]!="/signup-landing.php"&&$_SERVER['PHP_SELF']!="/signup-success.php"&&$_SERVER["PHP_SELF"]!="/signup-congrats.php"&&$_SERVER["PHP_SELF"]!="/signup_verify.php"&&$_SERVER["PHP_SELF"]!="/signup-confirm.php"&&$_SERVER["PHP_SELF"]!="/signup-confirm1.php"&&$_SERVER['PHP_SELF']!="/signup1.php"&&$_SERVER["PHP_SELF"]!="/index.php"&&$_SERVER["PHP_SELF"]!="/imobile.php"&&$_SERVER["PHP_SELF"]!="/membership-popup.php"&&$_SERVER["PHP_SELF"]!="/lostpass.php"&&$_SERVER["PHP_SELF"]!="/lostpass1.php"&&$_SERVER["PHP_SELF"]!="/logout.php"&&$_SERVER["PHP_SELF"]!="/logout2.php"&&$_SERVER["PHP_SELF"]!="/logout1.php"&&$_SERVER["PHP_SELF"]!="/signup-congrats.php"&&$_SERVER["PHP_SELF"]!="/signup-congrats1.php"&&$_SERVER["PHP_SELF"]!="/lostpass_reset.php"&&$_SERVER["PHP_SELF"]!="/lostusername.php"&&$_SERVER["PHP_SELF"]!="arrowchat/external.php"&&$_SERVER["PHP_SELF"]!="/mysqltest.php"&&$_SERVER["PHP_SELF"]!="/expire_users-segpay.php"&&$_SERVER["PHP_SELF"]!="/verified1.php"&&$page!="verified"&&$_SERVER["PHP_SELF"]!="/delete-requested.php"&&$_SERVER["PHP_SELF"]!="/delete-confirmed.php"&&$page!="deleted-requested"&&$page!="delete-confirmed"))
{
// if($_SERVER["REMOTE_ADDR"]=="98.211.64.187"){echo $_SERVER["PHP_SELF"];}
header("HTTP/1.1 301 Moved Permanently");
//header("Location: login.php");
header("Location: login.php?return_url=".$url->url_current());
exit;
}
}
$initialize.="Page Header line 702:".time()."<br /><br />";
if($user->user_info["user_id"]!=$_SESSION["__default"]["user_id"]){
$_SESSION["__default"]["user_id"]=$user->user_info["user_id"];
}
if($_GET["loginasuser"]==1){
if($user->user_info["user_id"]!=$_COOKIE["user_id"]){
unset($_COOKIE["user_id"]);
setcookie("user_id", $user->user_info["user_id"]);
header("Location:". $_SERVER["PHP_SELF"]."?".$_SERVER["QUERY_STRING"]);
exit;
}
}
if($user->user_info["user_id"]!=$_COOKIE["user_id"]){
unset($_COOKIE["user_id"]);
//setcookie("user_id", $user->user_info["user_id"]);
$cookie_lifetime = ( $persistent ? time() + (60 * 60 * 24 * 30 * 6) : 0 );
//if(SE_DEBUG){echo $cookie_lifetime;exit;}
$host = "bateworld.com";
setcookie("user_id", $row["user_id"], $cookie_lifetime, '/', $host);
}
//echo $_COOKIE["user_id"]."a<br>b".$user->user_info["user_id"];
//if(SE_DEBUG1){
if($user->user_info["user_id"]!=$_COOKIE["user_id"]){
unset($_COOKIE["user_id"]);
$cookie_lifetime = ( $persistent ? time() + (60 * 60 * 24 * 30 * 6) : 0 );
//if(SE_DEBUG){echo $cookie_lifetime;exit;}
$host = "bateworld.com";
setcookie("user_id", $row["user_id"], $cookie_lifetime, '/');
//mail("leprakhauns@gmail.com", "EEE", $user->user_info["user_id"]." ".$_COOKIE["user_id"]);
//echo "AAA";
//$user->user_logout();
}
//}
$leptimetrack.=time()." start t
";
$smarty->assign('imagecdn', IMAGECDN);
$smarty->assign('imagecdn1', IMAGECDN1);
$smarty->assign('unixtime', time());
$smarty->assign('fullurl', "https://".$_SERVER["HTTP_HOST"].$_SERVER["REQUEST_URI"]);
$leptimetrack.=time()." end header<br>";
if((($user->user_info["user_pdp_evc"]==1&&$user->user_info["date_confirmed"]<(time()-(60*60*24*30*6))))||$_GET["appop"]==1){$smarty->assign('appop', 1);}
elseif((($user->user_info["user_pdp_evc"]==3&&$user->user_info["date_confirmed"]<(time()-(60*60*24*30*6))))||$_GET["appop"]==1){$smarty->assign('appop', 1);}
elseif((($user->user_info["user_pdp_evc"]==5&&$user->user_info["date_confirmed"]<(time()-(60*60*24*30*6))))||$_GET["appop"]==1){$smarty->assign('appop', 1);}
elseif(((($user->user_info["user_pdp_evc"]!=1&&$user->user_info["user_pdp_evc"]!=5&&$user->user_info["user_pdp_evc"]!=3)&&$user->user_info["date_confirmed"]<(time()-(60*60*24*30*6))))||$_GET["appop"]==2){
$smarty->assign('appop', 2);}
$smarty->assign('timerand', time());