<?php
require_once "peardb_class.php";
class pages_class extends peardb_class
{
function View($pQuery, $pValues=false, $types=true, $pStart=0, $pEnd=0)
{
return $this->BaseView($pQuery,$pValues,$types,$pStart,$pEnd);
}
function Update($pQuery, $pValues=false, $types=true)
{
return $this->BaseUpdate($pQuery, $pValues, $types);
}
function Insert($pQuery, $pValues=false, $types=true)
{
return $this->BaseInsert($pQuery, $pValues, $types);
}
function Delete($pQuery, $pValues=false, $types=true)
{
return $this->BaseInsert($pQuery, $pValues, $types);
}
function GetRequestedPageUrlWithoutHost()
{
$lsRequest_URI = $_SERVER['REQUEST_URI'];
if(!strpos($lsRequest_URI,'.php'))
return $lsRequest_URI;
//$lsSCRIPT_NAME = $_SERVER['SCRIPT_NAME'];
$lsFile_NAME = substr($lsRequest_URI,strripos($lsRequest_URI,'/'),strlen($lsRequest_URI)-strripos($lsRequest_URI,'/'));
return $lsFile_NAME;
}
function GetSEODeails()
{
$pValues = $this->GetRequestedPageUrlWithoutHost();
//echo $pValues;
//echo 'select * from '.TABLE_PREFIX.'pages where url like \'%'.$pValues.'%\'';die;
//print_r($this->View('select * from '.TABLE_PREFIX.'pages where url like \'%?%\'', $pValues, null, $pStart=1));
return $this->View("select * from ".TABLE_PREFIX."pages where url like '%".$pValues."%'", null, null, $pStart=1);
}
function getTitleMataDescription()
{
$currentUrl=$_SERVER['REQUEST_URI'];
$currentUrl=substr($currentUrl,1);
$postion_second_q_string=strpos($currentUrl,"&");
if($postion_second_q_string!=false)
$currentUrl=substr($currentUrl,0,$postion_second_q_string);
$query="select * from ".TABLE_PREFIX."pages pp
where pp.url like '$currentUrl'";
$result= $this->View($query,null,null);
if($result==false)
{
$query="select * from ".TABLE_PREFIX."pages pp
where locate(pp.url, '$currentUrl')>0";
$result= $this->View($query,null,null);
}
return $result;
}
}
?>