| Server IP : 10.200.247.200 / Your IP : 216.73.217.19 Web Server : Apache System : Linux synergy-usa-sites 6.8.0-138-generic #138-Ubuntu SMP PREEMPT_DYNAMIC Fri Jul 31 22:41:49 UTC 2026 x86_64 User : jeremy ( 1001) PHP Version : 8.4.25 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : OFF | Sudo : ON | Pkexec : OFF Directory : /var/www/usa_sites/vx/lib/ |
Upload File : |
<?
/**
* /lib/inc.php
*
* This file must be included on the 1st line of all output files that are utilizing this framework
*
* @copyright 2016-2021 Synergy Pro Marketing
* @author Aaron Campbell <aaron@synergymentoring.com>
* @license None, All Rights Reserved
* @package Layout
* @ignore
*/
//error_reporting(E_ALL);
//ini_set("display_errors", 1);
session_start();
//Make sure they really have the monthly and are not using an old bookmark or directly going to the url for the new apps (This is set in /vx/usa/members/new.php)
//We are doing an overlay upsell page now
/*if(!empty($newest_apps_only) && empty($_SESSION['subscriptions']['2'])) {
$newest_apps_only = 0;
}*/
/**
* Set up site configuration variables.
* */
$requestUri = $_SERVER['REQUEST_URI'];
$host = $_SERVER['HTTP_HOST'];
$siteURL = explode('.', $host);
include($_SERVER['DOCUMENT_ROOT'].'/vx_/site_info.php');
$debug = false;
//=======================================================================================
$development = false;
$production = false;
if(strpos($host, "dev"))
{
$development = true;
$production = false;
}
else
{
$development = false;
$production = true;
}
//=======================================================================================
function accessProtocol($host)
{
$https = (!empty($_SERVER['HTTPS']) && $_SERVER['HTTPS'] !== 'off') ? 1 : 0;
$currentLocation = $_SERVER['REQUEST_URI'];
if(!$https)
{
header('Location: https://'.$host.$currentLocation);
}
}
if(strpos($host, 'vxbuild') !== false){}
else
{
accessProtocol($host);
}
//=======================================================================================
require_once($_SERVER['DOCUMENT_ROOT'] . "/vx/lib/access.php");
require_once($_SERVER['DOCUMENT_ROOT'] . "/vx/lib/mysql.php");
require_once($_SERVER['DOCUMENT_ROOT'] . "/vx/lib/func.php");
require_once($_SERVER['DOCUMENT_ROOT'] . "/vx/lib/ua.php");
require_once($_SERVER['DOCUMENT_ROOT'] . "/vx/lib/user.php");
require_once($_SERVER['DOCUMENT_ROOT'] . "/vx/lib/init.php");
//=======================================================================================
// SITE & SESSION DATA
// GET SITE DATA ===========================================================
$siteData = $db->query("SELECT * FROM lc2admin.site WHERE site_code = '".clean($siteCode)."'");
$siteData = $siteData[0];
$siteName = $siteData['site_name'];
$siteDomain = $siteData['site_domain'];
$sitePhone = $siteData['phone'];
$siteAddress = $siteData['mailing_address'];
$siteEmail = $siteData['refund_email'];
$siteCCDescriptor = $siteData['cc_descriptor'];
$userDB = "lc2" . $siteCode . "_lc";
$subscriptionData = $db->query("
SELECT
*
FROM {$userDB}.lc_subscriptions
WHERE
1
ORDER BY subscription_id ASC
");
$siteFee = $sitePrice = $subscriptionData[0]['default_amount'];
$monthlyFee = $subscriptionData[1]['default_amount'];
$teleseminarFee = $subscriptionData[2]['default_amount'];
//---------------------------------------------------------------------
// GET USER SESSION DATA ===================================================
$sessionData = userSession($userDB, $db);
$session = $sessionData['session'];
if(!empty($session))
{
$user = $_SESSION['user'] = (!empty($sessionData['user'])) ? $sessionData['user'] : 0;
$email = $_SESSION['email'] = (!empty($sessionData['email'])) ? $sessionData['email'] : '';
$firstName = $_SESSION['firstName'] = (!empty($sessionData['firstName'])) ? $sessionData['firstName'] : '';
$lastName = $_SESSION['lastName'] = (!empty($sessionData['lastName'])) ? $sessionData['lastName'] : '';
$sessionData['section'] = (!empty($slug)) ? $slug : '';
$greeting = (!empty($sessionData["greeting"])) ? $sessionData["greeting"] : '';
$lead = $_SESSION['lead'] = (!empty($sessionData['lead'])) ? $sessionData['lead'] : 0;
$admin = $_SESSION['admin'] = (!empty($sessionData['admin'])) ? $sessionData['admin'] : 0;
}
else
{
$greeting = "Welcome back";
}
$noTracking = $_SESSION['no_tracking'] = false;
if(!empty($_REQUEST['login_source'])) {
if($_REQUEST['login_source'] == "surf_cs_login")
{
$noTracking = $_SESSION['no_tracking'] = true;
}
}
//---------------------------------------------------------------------
//=======================================================================================
/**
* Set Up the Versioning by user, lead, and/or ipaddress
* */
ob_start();
//=======================================================================================
$viewportWidth = 1260;
if(!$phone && !$tablet)
{
$viewportWidth = 1260;
}
if(!$phone && $tablet)
{
$viewportWidth = 768;
}
else
{
$viewportWidth = 320;
}
//=======================================================================================
$states = $db->query("SELECT * FROM geo.states");
//=======================================================================================
$user = (!empty($_SESSION['user'])) ? (int) $_SESSION['user'] : 0;
$email = (!empty($_SESSION['email'])) ? $_SESSION['email'] : '';
$firstName = (!empty($_SESSION['firstName'])) ? $_SESSION['firstName'] : '';
$lastName = (!empty($_SESSION['lastName'])) ? $_SESSION['lastName'] : '';
$guest = false;
if(!empty($user) && $user > 0)
{
$guest = false;
}
else
{
$guest = true;
}
if(!empty($user) && $user > 0)
{
$userData = userData($user, $userDB, $db);
}
//=======================================================================================
if($user > 0)
{
include($_SERVER['DOCUMENT_ROOT']."/vx/usa/lib/init.php");
}
if(!$onMembers)
{
if(file_exists($_SERVER['DOCUMENT_ROOT']."/lib/versioning.php")) {
include($_SERVER['DOCUMENT_ROOT']."/lib/versioning.php");
}
if(file_exists($_SERVER['DOCUMENT_ROOT']."/lib/tracking.php")) {
include($_SERVER['DOCUMENT_ROOT']."/lib/tracking.php");
}
}
if(isset($_REQUEST['source']))
{
if(file_exists($_SERVER['DOCUMENT_ROOT']."/lib/versioning.php")) {
include($_SERVER['DOCUMENT_ROOT']."/lib/versioning.php");
}
if(file_exists($_SERVER['DOCUMENT_ROOT']."/lib/tracking.php")) {
include($_SERVER['DOCUMENT_ROOT']."/lib/tracking.php");
}
}
?>