require_once "dir.inc.php";
require_once $ROOT_DIR."config/header.inc.php";
$tplkey = "publist.detail";
$menuid = $gID4PUB;
$keyword = $_REQUEST['keyword'];
$curPage= $_REQUEST['curPage'];
$curPage = empty($curPage)?"1":$curPage;
$id = $_REQUEST['id'];
$categoryId = $menuid;
//
//////////////////////news line////////////////////////
$dao = $contentDao;
$dao->setCurrPageNo(1);
$dao->setNumberOfPage(5);
$aryList = $dao->getValidContentListPid($gPageLanguage,$gID4News);
//加载块模块
$i = 0;
$tpl->set_block("newsline","newline_row","newline_rows");
while(list($key,$content) = each($aryList)){
$tpl->set_var("STEP",$i++);
$title = is_object($content)?$content->getTitle():$gNoEnterTitle;
$alt = is_object($content)?$content->getAlt():"";
$tpl->set_var("TITLE",str_replace("'","\'",$title));
$tpl->set_var("ALT",formString($alt));
$tpl->set_var("ID",$content->getPid());
//$tpl->set_var("DATE",$news->getAddDate());
$tpl->parse("newline_rows","newline_row",true);
}
//////////////////////news line end////////////////////////
//
$currentCategory = new Category("");
$currentContent = new PublicationDao("");
$currentContent = $aryId2Content[$categoryId];
$currentContent = is_object($currentContent)?$currentContent:new PublicationDao(array());
//$tpl->set_var("categoryId",$currentContent->getVar('pid'));
//$tpl->set_var("categoryTitle",$currentContent->getTitle());
//$tpl->set_var("categoryAlt",$currentContent->getAlt());
$tpl->set_var("categoryIdKey",$_REQUEST['categoryId']);
//parse list
//$aryUkId2Content = $contentDao->getValidLangListPidKey("uk");
//$newsContent = new Content(array());
//$newsContent = $aryUkId2Content[$id];
$contentDao=new PublicationDao(array());
$newsContent = $contentDao->getObj4PidLang($id,$gPageLanguage);
//print_r($newsContent);
$title = is_object($newsContent)?$newsContent->getVar('magazineName'):$gNoEnterTitle;
$content=$newsContent;
//echo $newsContent->getVar('country');
$tpl->set_var("country",$content->getVar('country'));
//
$tpl->set_var("article",$content->getVar('article'));
$tpl->set_var("products",$content->getVar('products'));
$tpl->set_var("applications",$content->getVar('applications'));
$tpl->set_var("customer",$content->getVar('customer'));
$tpl->set_var("linkArticle",$content->getVar('linkArticle'));
$cover=$content->getVar('cover');
$getCover=$cover=='no'?'':"Cover magazine
";
$tpl->set_var("cover",$getCover);
$picUrl="../UPcoverImage/".$cover;
$tpl->set_var("picUrl",$picUrl);
//pdf Url
$pdfUrl=$content->getVar('articlepdf');
$tpl->set_var("pdfUrl","../UPcoverImage/".$pdfUrl);
//
$tpl->set_var("NewsTitle",$title);
//$tpl->set_var("TITLE_NEWS",$newsContent->getTitle());
//$tpl->set_var("TITLE_CONTENT",$newsContent->getContent());
//** add by huahua
//$currCate = $categoryDao->getObj4id($newsContent->getPid());
//if ($currCate->getStartDate() != '') $tpl->set_var("NewsDate", '['.$currCate->getStartDate().']');
//*/
//language part
$aryLangList = $contentDao->getValidLangList($id);
//* add by huahua
//parse page content
//$categorySubList = $categoryDao->getShowList($categorySubId);
////show($categorySubList);
//$categoryList = $contentDao->getValidCategory($categorySubList,$aryId2Content);
//show($categoryList);
$tpl->set_block($tplkey,"category_row","category_rows");
$tpl->set_block("category_row","news_row","news_rows");
for($i=0;$iset_var("news_rows");
$category = $categoryList[$i];
$id = $category->getId();
// show($id);
$content = $aryId2Content[$id];
$content = is_object($content)?$content:new Content(array());
$categoryId = $categoryId == 0?$id:$categoryId;
$currentCategory = $categoryId == $id?$category:$currentCategory;
$currentContent = $categoryId == $id?$content:$currentContent;
$tpl->set_var("CATEGORY_NUM", ++$cate_num); // add by huahua
if($categorySub->isCategorySubType()){
$tpl->set_var("category_display","");
$tpl->set_var("CATEGORY_ID",$id);
$tpl->set_var("CATEGORY_ALT",$content->getAlt());
$tpl->set_var("CATEGORY_TITLE",$content->getTitle());
$tpl->set_var("CATEGORY_IMG", $content->getPname()); // add by huahua
if($id == $_REQUEST['categoryId'])
$tpl->set_var("NEWSROW_SHOW","");
else
$tpl->set_var("NEWSROW_SHOW","none");
$categoryNewsList = $categoryDao->getShowList($id);
$newsList = $contentDao->getValidCategory($categoryNewsList,$aryId2Content);
for($j=0;$jgetId();
$content = $aryId2Content[$id];
$tpl->set_var("NEWS_ID",$id);
$tpl->set_var("NEWS_ALT",$content->getAlt());
$tpl->set_var("NEWS_TITLE",$content->getTitle());
$tpl->parse("news_rows","news_row",true);
}
}else{
$tpl->set_var("category_display","none");
$id = $category->getId();
$content = $aryId2Content[$id];
$tpl->set_var("NEWS_ID",$id);
$tpl->set_var("NEWS_ALT",$content->getAlt());
$tpl->set_var("NEWS_TITLE",$content->getTitle());
$tpl->parse("news_rows","news_row",true);
}
$tpl->parse("category_rows","category_row",true);
}
//*/
//////////////////////news list////////////////////////
$dao = $contentDao;
$dao->setCurrPageNo(1);
$dao->setNumberOfPage(5);
$aryList = $dao->getValidContentListPid($gPageLanguage,$gID4News);
//加载块模块
$i = 0;
$tpl->set_block("newsline","newline_row","newline_rows");
while(list($key,$content) = each($aryList)){
$tpl->set_var("STEP",$i++);
$title = is_object($content)?$content->getTitle():$gNoEnterTitle;
$alt = is_object($content)?$content->getAlt():"";
$tpl->set_var("TITLE",str_replace("'","\'",$title));
$tpl->set_var("ALT",formString($alt));
$tpl->set_var("ID",$content->getPid());
//$tpl->set_var("DATE",$news->getAddDate());
$tpl->parse("newline_rows","newline_row",true);
}
//加载newsline的页面
$tpl->parse("NEWSLINE","newsline");
//产品列表开始
$tpl->set_file("plist","pubMenu.html");
$tpl->set_block("plist","newsrow","newsrows");
$categorySubList = $categoryDao->getList(5);
$aryId2Content_p= $contentDao->getTheLangListPidKey($gCurrentLanguage);
//print_r($categorySubList);
/*
for($j=0;$jset_var("newsrows");
$categorySub = $categorySubList[$j];
// print_r($categorySub->getId());
//echo $categorySub->getId();
$content_p = $aryId2Content_p[$categorySub->getId()];
// echo $content_p;
$title = is_object($content_p)?$content_p->getTitle():$gNoEnterTitle;
$tpl->set_var("SUBid",$categorySub->getId());
$tpl->set_var("SUBTitle",$title);
$tpl->parse("newsrows","newsrow","true");
//echo "
";
//print_r($title);
}
*/
//new list
$categorySubList=array("News|99|newslist","Advertisement|92|advlist","Archive|91|archlist");
for($j=0;$jset_var("newsrows");
//$categorySub = $categorySubList[$j];
// print_r($categorySub->getId());
//echo $categorySub->getId();
// $content_p = $aryId2Content_p[$categorySub->getId()];
// echo $content_p;
// $title = is_object($content_p)?$content_p->getTitle():$gNoEnterTitle;
$array = explode("|", $categorySubList[$j]);
$title=$array[0];
$categoryID=$array[1];
$phpfile=$array[2];
$tpl->set_var('CATEGORY_ID',$categoryID);
$tpl->set_var("SUBid",$categorySub->getId());
$tpl->set_var("phpfile",$phpfile);
$tpl->set_var("SUBTitle",$title);
$tpl->parse("newsrows","newsrow","true");
//echo "
";
//print_r($title);
}
$tpl->parse("PLIST","plist");
//产品列表结束
//左边图片
$roadVisibility="
";
$parking="
";
$schoolSafety="
";
$tpl->set_var("roadVisibility",$roadVisibility);
$tpl->set_var("parking",$parking);
$tpl->set_var("schoolSafety",$schoolSafety);
//
$tpl->parse("BODY",$tplkey);
require_once $ROOT_DIR."config/bottom.inc.php";
?>