require_once ("../common/includes/settings.php");
include_once "config.php";
include_once $GLOBAL_ABSOLUTE_PATH."/common/functions/func_text.php";
// added for shop mini header
include_once "../bikeshops/classes/bikeshop_review.class.php";
include_once $GLOBAL_ABSOLUTE_PATH."/bikeshops/functions/func_bikeshops.php";
isInSession()? $user = new User(getSessionUserid()) : $user = new User(0);
//SEO remove duplicates e.g. www.togoparts.com/items/view_item_char.php?iid=40779&did=0&cid=0&bid=0&ikw=&bkw=&yr=-1&rw=1
$http_host = $_SERVER['HTTP_HOST'];
$script_name = $_SERVER['SCRIPT_NAME'];
$iid = $_REQUEST['iid'];
$canonical_url = "http://".$http_host.$script_name.'?iid='.$iid;
if(count($_GET)!=1 || !isset($_REQUEST['iid'])){
//echo($canonical_url);
header("HTTP/1.1 301 Moved Permanently");
header("Location: $canonical_url");
exit;
}
//strlen($_GET["cid"]) > 0 && is_int((int) $_GET["cid"])? $cid = $_GET["cid"] : $cid = 0;
//strlen($_GET["did"]) > 0 && is_int((int) $_GET["did"])? $did = $_GET["did"] : $did = 0;
//strlen($_GET["bid"]) > 0 && is_int((int) $_GET["bid"])? $bid = $_GET["bid"] : $bid = 0;
//strlen($_GET["iid"]) > 0 && is_int((int) $_GET["iid"])? $iid = $_GET["iid"] : $iid = 0;
$iid=0;
if(isset($_REQUEST['iid']) && is_numeric($_REQUEST['iid']) && (int) $_REQUEST['iid'] > 0) {
$iid = (int) $_REQUEST['iid'];
}
else {
header("Location: $APP_ROOT_PAGE");
exit;
}
$item = new Item($iid);
$today = date("Y-m-d H:i:s");
if (!$item->getID()) {
header("Location:".$APP_ROOT_PAGE);
exit;
}
if (!isRwAdmin() && $item->getStatus() == $ITEM_STATUS_HIDDEN) {
header("Location:".$APP_ROOT_PAGE);
exit;
}
if (!hasAccess(getSessionUserid(),"vi",true)) {
header("Location:".$APP_ROOT_PAGE);
exit;
}
$distributor = new DistributorTieIn($item->getBID(), $item->getCID());
$prices = new StreetPrices($item->getID(), "date_submitted", "DESC", 0, 999);
$reviews = new Reviews($iid, $REVIEW_STATUS_APPROVED, "date_submitted", "DESC", 0, 999);
//$discipline = new Discipline($did); not used???
$category = new Category($item->getCID());
//if ($cid == 0)
$cid = $item->getCID();
$itembrand = new Brand($item->getBID());
//if ($bid == 0)
$bid = $item->getBID();
$sessionid=getSessionUserid();
/*
$thismid = (int)$_GET["mid"];
if ($thismid > 0) {
mysql_query("UPDATE bshop_markers SET views = views + 1 WHERE mid = '".$thismid."'");
}
*/
//header("Expires: ".gmdate("D, d M Y H:i:s", time() + 360)." GMT");
//header("Cache-Control: max-age=360, must-revalidate");
## Fill in the following for SEO
$WEBPAGE_TITLE = $item->getBrand()." ".$item->getName()." ".$item->getYear()." ".getCountrySelected()." Reviews | ".$category->getName()." | ". $GLOBAL_PORTAL_NAME;
$meta_description = "";
if($item->getDescription()) {
$meta_description=limit_text(str_replace("
" , " ",Global_ProcessMessage($item->getDescription())), 155);
}
$meta_keywords = $item->getBrand()." ".$item->getName().",".$item->getBrand().",".$item->getName();
$canonical_url = 'http://www.togoparts.com/items/view_item.php?iid='.$_GET["iid"];
$share_title = $item->getBrand()." ".$item->getName()." Singapore Reviews";
?>