$scriptpath = DataAccess::fetch("SELECT scriptpath FROM $newsoptions WHERE 1");
if(!$scriptpath['0']['scriptpath']){
$scriptpath = str_replace(basename($_SERVER['REQUEST_URI']),"",$_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI']);
$scriptpath= "http://" . $scriptpath;
DataAccess::put("UPDATE $newsoptions SET scriptpath = ? WHERE 1",$scriptpath);
}
$scriptpath = DataAccess::fetch("SELECT scriptpath FROM $newsoptions WHERE 1");
if($scriptpath['0']['scriptpath']){
$scriptpath = str_replace(basename($_SERVER['REQUEST_URI']),"",$_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI']);
$scriptpath= "http://" . $scriptpath;
DataAccess::put("UPDATE $newsoptions SET scriptpath = ? WHERE 1",$scriptpath);
}