session_start();
include ("includes/config.php");
include ("includes/constants.php");
// Do the log in checks
if ($_SESSION['user_id']<1) // if user_id isn't set, check the cookie
{
$user_id=$_COOKIE['user_id'];
// if cookie found, validate user, then set session variables
if ($user_id>0)
{
$result=mysql_query(" SELECT * FROM users WHERE id=\"$user_id\" ");
$num=mysql_numrows($result);
$_SESSION['user_id']=mysql_result($result,0,"id");
$_SESSION['user_firstname']=mysql_result($result,0,"firstname");
$_SESSION['user_lastname']=mysql_result($result,0,"lastname");
$_SESSION['user_email']=mysql_result($result,0,"email");
$_SESSION['admin']=mysql_result($result,0,"admin");
}
}
else
$user_id=$_SESSION['user_id'];
if ($_SESSION['user_id']>0)
$user=1;
if ($_SESSION['admin']>0)
$admin=1;
$access_level=$user+$admin;
if ($page_level>$access_level)
{
echo "";
}
$domain=$_SERVER['HTTP_HOST'];
$domain1=str_replace("www.","",$domain);
$domain="www.".$domain1;
$keyphrase=$_REQUEST['keyphrase'];
$location=$_REQUEST['location'];
$content_id=$_REQUEST['content_id'];
if (isset($keyphrase))
$_SESSION['keyphrase']=$keyphrase;
elseif (isset($_SESSION['keyphrase']) )
$keyphrase=$_SESSION['keyphrase'];
else
$keyphrase=$keyphrases[0];
$keyphraselink=$keyphrase;
$keyphrase=str_replace("_"," ",$keyphrase);
$keyphrase=ucwords($keyphrase);
if (isset($location))
$_SESSION['location']=$location;
elseif (isset($_SESSION['location']) )
$location=$_SESSION['location'];
else
$location=$locations[0];
$locationlink=$location;
$location=str_replace("_"," ",$location);
$location=ucwords($location);
$alt_tag1=ucwords($keyphrase)." ".ucwords($location);
$alt_tag2=ucwords($location)." ".ucwords($keyphrase);
$title_tag1=ucwords($location)." ".ucwords($keyphrase);
$title_tag1=ucwords($keyphrase)." ".ucwords($location);
if (!$_REQUEST['content_id'])
$content_id="1";
$result=mysql_query("SELECT * FROM cms WHERE id='$content_id' ");
$text=mysql_result($result,0,"text");
$property_id=$_REQUEST['property_id'];
if ($property_id>1)
{
$result=mysql_query(" SELECT * FROM properties WHERE property_id=$property_id ");
$property=mysql_result($result,0,"property");
$country=mysql_result($result,0,"country");
$city=mysql_result($result,0,"city");
$title=mysql_result($result,0,"title");
$description=mysql_result($result,0,"description");
$feature=mysql_result($result,0,"feature");
$description=strip_tags(substr($description,0,150));
}
?>
SunnyBay Property - Bali
if ($refresh>0)
echo "";
?>