<?php
/**
 * @package		Ad Platform
 * @author		Uta Marian - Alexandru ( -uMarian- )
 * @license		http://codecanyon.net/licenses
 * @link		http://www.uta-marian.com
 * @version		Version 1.0
 * @download	www.persianscript.ir
 */
 
//*********** SESSION ***********//
session_start();
//*********** DATABASE DETAILS ***********//
/*
* DB_DRIVER - > DEFAULT MYSQLI, ACTUALLY THIS IS THE ONLY INSTALLED DRIVER
* DB_HOSTNAME - > YOUR MYSQL HOSTING, DEFAULT "LOCALHOST"
* DB_USERNAME - > YOUR MYSQL USERNAME
* DB_PASSWORD - > YOUR MYSQL USERNAME PASSWORD
* DB_DATABASE - > YOUR MYSQL DATABASE NAME
* DB_PREFIX - > IN THIS VERSION ISN'T ENABLED, SO DON'T CHANGE IT
*/
define('DB_DRIVER', 'mysqli');//don't change
define('DB_HOSTNAME', 'localhost');
define('DB_USERNAME', 'DB USERNAME');
define('DB_PASSWORD', 'DB PASSWORD');
define('DB_DATABASE', 'DB NAME');



//*********** HTTP ***********//
/*
* HTTP_MASTER - > YOUR DOMAIN NAME
* DOMAIN MASTER CAN BE : http://www.domain.com/
* YOU NEED TO ENTER : http://www.domain.com/ not http://www.domain.com
*/
define('NO_REPLY', 'NOREPLY@YOUR-DOMAIN.COM');
define('HTTP_DOMAIN', 'YOUR-DOMAIN.COM');
define('HTTP_MASTER', 'http://www.YOUR-DOMAIN.COM/');
define('ADMIN_DIR', 'admin');





define('HTTP_SERVER_ADMIN', HTTP_MASTER.ADMIN_DIR.'/');
define('HTTP_SERVER_WEBSITE', HTTP_MASTER);
define('HTTP_REPORT_URL', HTTP_MASTER.'ad-report');
define('HTTP_SERVER_ADMIN_LIBRARIES',HTTP_MASTER.ADMIN_DIR.'/libraries/');
define('HTTP_SERVER_ADMIN_LANGUAGE',HTTP_MASTER.ADMIN_DIR.'/language/');

define('HTTP_SERVER_SYSTEM',HTTP_MASTER.'system/');
define('HTTP_SERVER_WEBSITE_LIBRARIES',HTTP_MASTER.'system/libraries/');
define('HTTP_SERVER_WEBSITE_UPLOADS',HTTP_MASTER.'uploads/');
define('HTTP_SERVER_WEBSITE_UPLOADS_BANNER_ADS',HTTP_MASTER.'uploads/banner-ads/');
define('HTTP_SERVER_WEBSITE_LANGUAGES',HTTP_MASTER.'system/language/');


/************ DON'T CHANGE **************/
if (get_magic_quotes_gpc()) {
    $process = array(&$_GET, &$_POST, &$_COOKIE, &$_REQUEST);
    while (list($key, $val) = each($process)) {
        foreach($val as $k => $v) {
            unset($process[$key][$k]);
            if (is_array($v)) {
                $process[$key][stripslashes($k)] = $v;
                $process[] = &$process[$key][stripslashes($k)];
            } else {
                $process[$key][stripslashes($k)] = stripslashes($v);
            }
        }
    }
    unset($process);
}
error_reporting(0);
/*****************************************/


//*********** DEFINE YOUR ADMIN SESSION ***********//
define('ADMIN_SESSION','admin_login');

//*********** DEFINE YOUR USER SESSION ***********//
define('USER_SESSION','user_login');

//*********** DEFINE COPYRIGHT NAME ***********//
define('PROJECT_NAME','<span id="fl">Persian Script</span><span id="sl"> Platform</span>');
define('COPYRIGHT','&copy; Ad Platform 2014 - PS');



//*********** DEFINE CMS NAME ***********//
define('CMS_NAME','Ad Platform');

//*********** DEFINE DATE FORMAT ***********//
define('DATE_FORMAT','d.m.Y');
define('DATE_FORMAT_FULL','d.m.Y H:i:s');



//*********** LOAD DIRECTORIES
define('DIR',dirname(__FILE__));
//*********** ADMIN ***********//
define('DIR_ADMIN', DIR.'/'.ADMIN_DIR.'/');
define('DIR_ADMIN_TEMPLATE', DIR.'/'.ADMIN_DIR.'/template/');
define('DIR_ADMIN_LIBRARIES', DIR.'/'.ADMIN_DIR.'/libraries/');
define('DIR_ADMIN_LANGUAGE', DIR.'/'.ADMIN_DIR.'/language/');
//*********** ADMIN ***********//

//*********** WEBSITE ***********//
define('DIR_LANGUAGE', DIR.'/system/language/');
define('DIR_TEMPLATE', DIR.'/templates/');
define('DIR_IMAGE', DIR.'/image/');
define('DIR_DOWNLOAD', DIR.'/download/');
define('DIR_SYSTEM', DIR.'/system/');
define('DIR_DATABASE', DIR.'/system/database/');
define('DIR_LIBRARIES', DIR.'/system/libraries/');
define('DIR_PAGES', DIR.'/system/pages/');
define('DIR_PAGES_VIEW', DIR.'/system/pages/view/');
define('DIR_PAGES_CONTROLLER', DIR.'/system/pages/controller/');
define('DIR_PAGES_WIDGETS', DIR.'/system/pages/wigets/');
define('DIR_CONFIG', DIR.'/system/config/');
define('DIR_LOGS', DIR.'/system/logs/');
define('DIR_UPLOADS', DIR.'/uploads/');
define('DIR_UPLOADS_BANNER_ADS', DIR.'/uploads/banner-ads/');
//*********** WEBSITE ***********//



//*********** LOAD FILES ***********//
require_once(DIR_LIBRARIES.'template.class.php');
require_once(DIR_LIBRARIES.'prepare.class.php');
require_once(DIR_LIBRARIES.'upload.class.php');
require_once(DIR_LIBRARIES.'paypal.class.php');
require_once(DIR_DATABASE.DB_DRIVER.'.class.php');
require_once(DIR_SYSTEM.'geoIp/geolocation.php');


//*********** DEFINE COOKIES
define('COOKIE_DOMAIN', '.'.HTTP_DOMAIN);
define('COOKIE_LANGUAGE_DIR', 'AP_CLD');
define('COOKIE_LANGUAGE_FILE', 'AP_CLF');

//*********** LOAD DATABASE CLASS ***********//
$db = new database;

//*********** LOAD TEMPLATE CLASS ***********//
$view				=	new template;
$prepare			=	new	prepare;
$VISITOR_IP			=	$prepare->get_client_ip();
$geolocation		=	ip2c_geolocation($IP_ADD);

$view->prepare		=	$prepare;
$view->db			=	$db;
$view->VISITOR_IP	=	$VISITOR_IP;
$view->geolocation	=	$geolocation;


//** LOAD LANGUAGE FILE **//
if ( !empty ( $_COOKIE[COOKIE_LANGUAGE_DIR] ) and !empty ( $_COOKIE[COOKIE_LANGUAGE_FILE] ) ) {
		define('LANG_DIR', $_COOKIE[COOKIE_LANGUAGE_DIR]);
		define('LANG_FILE', $_COOKIE[COOKIE_LANGUAGE_FILE]);
require_once(DIR_LANGUAGE.LANG_DIR.'/'.LANG_FILE);
	} else {
		define('LANG_DIR', 'english');
		define('LANG_FILE', 'en.php');
require_once(DIR_LANGUAGE.LANG_DIR.'/'.LANG_FILE);
}
$view->LANG	=	$LANG;






define('WEBSITE_TEMPLATE',	'default');
define('ADMIN_TEMPLATE',	'admin');

//*********** DEFINE COOKIE ***********//
define('WBS_C0OKIE', 0);
define('WBS_MAINTENANCE', 0);


//*********** DEFINE SYSTEM VARS ***********//
define('MAX_UPLOAD_SIZE','1012000');//LIMITATION ADDED ON: /plugins/advertiser/ad.banner.php
define('CHARTS_TYPE', 'HIGHCHARTS');//HIGHCHARTS - only after you will upload the library in : /templates/default/assets/plugins/highcharts
define('NUMBER_FORMAT',	'%0.2f');//sprintf('%0.2f', $NUMBER);
define('MONEY_SYMBOL',	'$');
define('MONEY_ALIGN',	'LEFT');//LEFT or RIGHT
define('ADVERTISER',	'ON');//ON or OFF
define('PUBLISHER',		'ON');//ON or OFF

define('INCREASE_VALUE',	'0.02');//Increase suggested value with.
define('COST_MIN_CLICK',	'0.05');//Minimum allowed / click
define('WITHDRAWAL_MINIMUM',	'50');//Minimum allowed for withdrawal request.
define('GIVEN_PERCENT',	'50');//System will give 50% of click value
define('ADS_CLASS_NAME',	'adsbynetwork');//ON or OFF




//*** PAYPAL ***//
define('PAYPAL_CURRENCY',	'USD');
$DEV_PAYPAL	=	'OFF';//SET OFF IF YOU WANT TO TURN OFF SANDBOX

	if ( $DEV_PAYPAL == 'ON' ) {
		define('EMAIL_ADD', "mail@domain.com"); // For system notification.
		define('PAYPAL_EMAIL_ADD', "mail@domain.com");
		define('SANDBOX', "ON");
	} else {
		define('EMAIL_ADD', "payments@domain.com"); // For system notification.
		define('PAYPAL_EMAIL_ADD', "mail@domain.com");
		define('SANDBOX', "OFF");
	}
$view->SANDBOX	=	SANDBOX;
?>