<?php
	//ini_set("display_errors", 1);
    include("site_info.php");
    $DEMO = false;
    $license="Licensehere";
    $CONST_COMPANY = "Wauhaha";          // Company Name
    $CONST_URL = "www.wauhaha.com";          // Website URL without the http://
    $SITE_ROOT = "/home/wauhaha/public_html/"; // Physical path/directory to dating software. MUST HAVE TRAILING / AT THE END OF THE PHYSICAL PATH
    $SITE_WWW_ROOT = 'http://www.wauhaha.com'; //Full website domain name including http://
	
// Database setup
    $CONST_DB_HOST = "localhost";
    $CONST_DB_NAME = "wauhaha_wauhh";
    $CONST_DB_USER = "wauhaha_admin";
    $CONST_DB_PASS = "jdt1231031whh";

// DO NOT EDIT ANYTHING BELOW THIS LINE:

	define("CONST_THUMBS_SMALL_W","150");
	define("CONST_THUMBS_SMALL_H","149");
	define("CONST_THUMBS_MEDIUM_W","210");
	define("CONST_THUMBS_MEDIUM_H","200");
	
    $CONST_VIDEOS = "Y";                              // include video profiles
    $CONST_AUDIOS = "Y";                              // include  audio profiles
    $CONST_FLIRT="Y";                                 // Include Flirting code
    $CONST_DEFAULT_LANGUAGE = 'EN';
    $CONST_CURRENCY = "USD";                          // Payments currency
    $CONST_SYMBOL = "$";                              // Payments currency symbol
    $CONST_ZIPCODES = "Y";                            // Include the zipcodes
    $CONST_THUMBS = "Y";  
	//$CONST_FREE =true;
	$CONST_FORMAT_DATE_SHORT="m-d-Y";                           // include thumnails (requires GD libraries)
    $CONST_INIT_FILE = $SITE_ROOT."/includes/init.php";
    $LIB_PATH=$SITE_ROOT."/lib";
	$CONST_IMAGE_ROOT=$SITE_WWW_ROOT."/templates/default/images";
	$CONST_ADMIN_LINK_ROOT=$SITE_WWW_ROOT."/admin";
	$CONST_LINK_ROOT=$SITE_WWW_ROOT;
	$SKIN_IMAGE_PATH=$SITE_WWW_ROOT."/templates/default/images";
	$CONST_EMOTIONS_PATH=$SITE_WWW_ROOT."/templates/default/images/smiles";
	define("__INCLUDE_CLASS_PATH",$SITE_ROOT."/lib");
    define("CONST_INCLUDE_ROOT",$SITE_ROOT."/includes");
	define("SITE_ROOT",$SITE_ROOT);
	define('FFMPEG_LIBRARY', '/usr/local/bin/ffmpeg ');
	
	include( $LIB_PATH."/class.Main.php");  
	include( $LIB_PATH."/class.DB.php");
	include( $LIB_PATH."/class.Skin.php");
	include( $LIB_PATH."/class.Language.php");
	include( $LIB_PATH."/class.Pager.php");
	include( $LIB_PATH."/class.Options.php");
	include( $LIB_PATH."/class.ItemManager.php");
	include( $LIB_PATH."/class.Microtime.php");
	include( $LIB_PATH."/class.Banner.php");
	//include( $SITE_ROOT."includes/prem_func.inc.php");
	 
	 include $CONST_INIT_FILE;
	 $option_manager = new OptionManager();
	 $CONST_SKIN = $option_manager->GetValue('skin'); 
	 $skin=new Skin;
	 $skin->init($CONST_SKIN);
	 $SKIN_IMAGE_PATH=$SITE_WWW_ROOT."/".$skin->Path."images";
	 $link=mysql_connect($CONST_DB_HOST,$CONST_DB_USER,$CONST_DB_PASS);
	 $db=mysql_select_db($CONST_DB_NAME,$link);
	 

########################
# Do not edit Below part
########################


function clearInput($value) {
 
$find = array(
    '@<script[^>]*?>.*?</script>@si',   // Strip out javascript
    '@<[\/\!]*?[^<>]*?>@si',            // Strip out HTML tags
    '@<style[^>]*?>.*?</style>@siU',    // Strip style tags properly
    '@<![\s\S]*?--[ \t\n\r]*>@'         // Strip multi-line comments
);
 
    $result = preg_replace($find, '', $value);
    return $result;
}


function form_get($value){
    global $_POST,$_GET,$_REQUEST;
    if (isset($_POST[$value])) {
        $get_value=$_POST[$value];
    }
    elseif (isset($_GET[$value])) {
        $get_value=$_GET[$value];
    }
	elseif (isset($_REQUEST[$value])) {
        $get_value=$_REQUEST[$value];
    }
    else {
        $get_value="";
    }
    $get_value = (get_magic_quotes_gpc()==0 && set_magic_quotes_runtime()==0) ? mysql_real_escape_string($get_value) : $get_value;
    return $get_value;
}


$option_manager = new OptionManager();
$free=$option_manager->GetValue('free');
if($free=='0'){ $CONST_FREE=false;}
if($free=='1'){ $CONST_FREE=true;}
$Sess_Userlevel=$_SESSION['Sess_Userlevel'];
 
 $uri = "http://".$_SERVER['HTTP_HOST'].$_SERVER['PHP_SELF'];
 $sql_query = "

        SELECT * FROM premium_func

        WHERE

                prf_uri = '".mysql_escape_string(str_replace($CONST_LINK_ROOT, '', $uri))."'

                AND prf_active = 1";

$sql_result_prf = mysql_query($sql_query, $link);

//$sql_result_prf = mysql_query($sql_query);
$Sess_Userlevel=$_SESSION['Sess_Userlevel'];
if(mysql_num_rows($sql_result_prf) > 0 && $Sess_Userlevel != 'gold' && $CONST_FREE != true)

{

        $func = mysql_fetch_object($sql_result_prf);

        if($func->prf_app == 0)

        {

                include_once('prem_message.php');

                prem_page(PREMIUM_FUNC_ERROR_PAGE1,PREMIUM_FUNC_ERROR_PAGE2,GENERAL_USER_ERROR);
				
				
        }

        else

        {

                ?>

                <html>

                <head>

                        <script language="javascript">

                                function showError()

                                {
									
                                        window.alert('<?=str_replace("'", "\'", PREMIUM_FUNC_ERROR_MSG)?>');

                                        <?php if($func->prf_app == 1) { ?>

                                        window.close();

                                        <?php } else { 
										if(mysql_escape_string(str_replace($CONST_LINK_ROOT, '', $uri))=='/messenger/index.php' or mysql_escape_string(str_replace($CONST_LINK_ROOT, '', $uri))=='/avchat/index.php'){?>
										 window.close();
										<? }
										?>
										window.location='home.php?area=home';	
                                        //window.history.back(2);

                                        <?php } ?>

                                }









                        </script>

                </head>

                <body onLoad="showError()"></body>

                </html>

                <?php

                exit;

        }

}
echo "<script> function MDM_openWindow(theURL,winName,features) {        features += ',location=yes,status=yes,resizeable=yes'; var _W=window.open(theURL,winName,features);       _W.focus();      _W.moveTo(50,30); } </script>";

	
	
	
?>