assign('right_advertising',$right_advertising);
$smarty->debugging=DEBUGGING;
include_once("location_arrays.inc");
$smarty->assign('group_name_nf',$_SESSION['cs']['group_name_search_nf']);
unset($_SESSION['cs']['group_name_search_nf']);
// $month = $_GET['date'];
// $year = $_GET['year'];
// $smarty->assign('month', '4');
// $smarty->assign('year', '2006');
$smarty->assign('page', 'index');
//GET THE PROPER REFERAL SITE INTO THE SESSION TO BE ABLE TO PULL HEADERS AND FOOTERS
if($_GET['ref'] >= "0"){
$_SESSION['ref']['site'] = $_GET['ref'];
}else{
$_SESSION['ref']['site'] = FALSE;
}
//GET THE STATE THE VISITOR IS LINKING FROM TO BE ABLE TO TARGET THE BANNER AD ON THE HOMEPAGE
unset($_SESSION['ip']['state']);
if(!$_SESSION['ip']['state']){
include("geoipcity.inc");
$dbpath = GLOBAL_CSCODE_ROOT."geoip/GeoIPCity.dat";
//geoip_load_shared_mem($dbpath);
//$gi = geoip_open($dbpath,GEOIP_SHARED_MEMORY);
$gi = geoip_open($dbpath,GEOIP_STANDARD);
if(DEPLOYMENT_TARGET == "DEV"){
$ip = $_SERVER['HTTP_X_FORWARDED_FOR'];
}else{
$ip = $_SERVER['REMOTE_ADDR'];
}
//echo "Visitor IP is: ".$ip."
";
//echo "... Remote Address is: ".REMOTE_ADDR;
//$record = GeoIP_record_by_addr($gi,"69.109.209.251");
$record = GeoIP_record_by_addr($gi,$ip);
$_SESSION['ip']['state'] = $record->region;
//ERASE THIS LINE WHEN READY TO GO TO PRODUCTION
//$_SESSION['ip']['state'] = "CA";
//echo "Country: ".$record->country_code . " " . $record->country_code3 . " " . $record->country_name . "\n";
//echo "State: ".$record->region . "\n";
//echo "City: ".$record->city . "\n";
//echo "Zip: ".$record->postal_code . "\n";
//echo "Latitude: ".$record->latitude . "\n";
//echo "Longitude: ".$record->longitude . "\n";
//echo $record->dma_code . "\n";
//echo $record->area_code . "\n";
geoip_close($gi);
}
if($_SESSION['ip']['state'] == 'NY' OR $_SESSION['ip']['state'] == 'NJ' OR $_SESSION['ip']['state'] == 'CT' OR $_SESSION['ip']['state'] == 'VA'){
//echo "State is: ".$_SESSION['ip']['state'];
$_SESSION['cs']['featured_group'] = new Group;
$featuredid = 64;
$_SESSION['cs']['featured_group']->load($featuredid);
//echo "Featured group is: ".$_SESSION['cs']['featured_group']->getID();
if($_SESSION['cs']['featured_group']->getID() < 1){
unset($_SESSION['cs']['featured_group']);
}else{
$descriptionsid = $_SESSION['cs']['featured_group']->getDescriptionsID();
$profileid = $_SESSION['cs']['featured_group']->getProfileID();
$_SESSION['cs']['featured_group_descriptions'] = new Group_Descriptions;
$_SESSION['cs']['featured_group_descriptions']->load($descriptionsid);
$_SESSION['cs']['featured_group_profile'] = new Group_Profile;
$_SESSION['cs']['featured_group_profile']->load($profileid);
$_SESSION['cs']['view_group'] = $_SESSION['cs']['featured_group'];
$_SESSION['cs']['view_group_profile'] = $_SESSION['cs']['featured_group_profile'];
$_SESSION['cs']['view_group_descriptions'] = $_SESSION['cs']['featured_group_descriptions'];
}
}else{
//echo "State is: ".$_SESSION['ip']['state'];
unset($_SESSION['cs']['featured_group']);
}
// $q = "2140 Taylor St, 94133";
// $filler = "http://rpc.geocoder.us/service/csv?address=" . (urlencode($q));
// $gm = fopen($filler,"r");
// $tmp = fgetcsv($gm,8000);
// fclose($gm);
// $lat = $tmp["0"];
// $lon = $tmp["1"];
// $smarty->assign('latitude', $lat);
// $smarty->assign('longitude',$lon);
// $smarty->assign('address',$q);
// $map = new GoogleMapAPI();
// $map->setAPIKey('ABQIAAAA8SNSstQmEpiagVePLiUBfhQ-atQXwr6STYYO6fC3NpqTyegLIhSQJWKvJvEFY42Ld30bUwJQhcj6LQ');
// $map->addMarkerByAddress($_POST['address'],$_POST['address'],$_POST['address']);
// $map->addMarkerByCoords($lon,$lat,$q,$html = '');
// $map->addMarkerByCoords($lon+.0025,$lat,'2',$html = '');
// $map->setWidth('250px');
// $map->setHeight('170px');
// $iconImage = @IMAGES."house_icon_25x20.gif";
// $iconShadowImage = @IMAGES."house_icon_shadow_25x20.gif";
// $map->setMarkerIcon($iconImage,$iconShadowImage,0,0,10,10);
// $_SESSION['cs']['map'] = $map;
// $_SESSION['cs']['smallmap'] = $map->getMap();
// $_SESSION['cs']['mapsidebar'] = $map->getSidebar();
// $_SESSION['cs']['mapheader'] = $map->getHeaderJS();
// $_SESSION['cs']['mapjs'] = $map->getMapJS();
// $smarty->assign($_SESSION);
SmartyValidate::connect($smarty, true);
SmartyValidate::register_validator('valid','logon_name','isValidLogon',false,false,'trim');
$smarty->assign($_SESSION);
$smarty->display('CS_wrapper1.tpl');
?>