require_once "dir.inc.php";
require_once $ROOT_DIR."config/header.inc.php";
//if($_REQUEST['categoryId'] == "$indexId"){
// goUrl("../");
// exit;
//}
$tplkey = "list1";
//** add by huahua TO contactus
/*edit by runbao
if (isset($_REQUEST['contactus']) or isset($_REQUEST['aboutus'])) {
$tpl->set_var('NOTE_CONTACTUS_B', '');
} else {
$tpl->set_var('NOTE_CONTACTUS_E', '');
}
/**/
//** add by huahua TO back(link)
/*edit by bjwrb
if (!isset($_REQUEST['newsid3'])) {
$tpl->set_var('NOTE_BACK_B', '');
}
/**/
//page content
$categoryId = 0;
//替换菜单的链接id
$tpl->set_var("categoryIdKey",$_REQUEST['categoryId']);
$tpl->set_var("tdHight","10");
$tpl->set_var("divHight","313");
$tpl->set_var("bgImage","n_1_21");
$tpl->set_var("divTabHight","335");
if($_REQUEST['categoryId']==29||$_REQUEST['categoryId']==158)
{
$tpl->set_var("bannerHide","none");
$tpl->set_var("tdHight","0");
$tpl->set_var("divHight","410");
$tpl->set_var("divTabHight","435");
$tpl->set_var("bgImage1","newn_1_21");
$tpl->set_var("bgImage","");
}
$tpl->set_var("gs",$_REQUEST['Extension']);
if(empty($_REQUEST['app'])){
$tpl->set_var("app","none");
}
$categoryId = empty($_REQUEST['categoryId'])?$categoryId:$_REQUEST['categoryId'];
//图片判断
$roadVisibility="
";
$parking="
";
$schoolSafety="
";
switch ($categoryId) {
case 140:
$tpl->set_var("parking",$parking);
$tpl->set_var("schoolSafety",$schoolSafety);
break;
case 141:
$tpl->set_var("roadVisibility",$roadVisibility);
// $tpl->set_var("parking",$parking);
$tpl->set_var("schoolSafety",$schoolSafety);
break;
case 142:
$tpl->set_var("roadVisibility",$roadVisibility);
$tpl->set_var("parking",$parking);
// $tpl->set_var("schoolSafety",$schoolSafety);
break;
default:
$tpl->set_var("roadVisibility",$roadVisibility);
$tpl->set_var("parking",$parking);
$tpl->set_var("schoolSafety",$schoolSafety);
}
//
//声明category,操作它的数据库
$currentCategory = new Category("");
$currentContent = new Content("");
//parse page content
$tpl->set_block($tplkey,"news_row","news_rows");
$tpl->set_block("news_row","third_row","third_rows");
$categoryId=$_GET[categoryId];
//
$getTitle=$contentDao->getObj4PidLang($categoryId,$gCurrentLanguage);
//
$categoryNewsList = $categoryDao->getShowList($categoryId);
$newsList = $contentDao->getValidCategory($categoryNewsList,$aryId2Content);
for($j=0;$jset_var("third_rows");
$category = $newsList[$j];
if(!$category->isSubTag()) continue;
$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->set_var('CATEGORY_ID', $categoryId);
if ($id != $_REQUEST['newsid'] || isset($_REQUEST['newsid3'])) {
$tpl->set_var('ACTIVE_SUB2_FONT_B', '');
// $tpl->set_var("NEWSROW3_SHOW","");
} else {
$tpl->set_var('ACTIVE_SUB2_FONT_B', '');
$tpl->set_var('ACTIVE_SUB2_FONT_E', '');
// $tpl->set_var("NEWSROW3_SHOW","none");
}
// $categoryThirdList = $categoryDao->getShowList($_REQUEST['newsid']);
$categoryThirdList = $categoryDao->getShowList($id);
$thirdList = $contentDao->getValidCategory($categoryThirdList,$aryId2Content);
for($k=0;$kisSubTag()) continue;
$id = $category->getId();
$content = $aryId2Content[$id];
//$tpl->set_var('NEWS_ID', $_REQUEST['newsid']);
$tpl->set_var("3_NEWS_ID",$id);
$tpl->set_var("3_NEWS_ALT",$content->getAlt());
$tpl->set_var("3_NEWS_TITLE",$content->getTitle());
if ($id != $_REQUEST['newsid3']) {
$tpl->set_var('ACTIVE_SUB3_FONT_B', '');
} else {
$tpl->set_var('ACTIVE_SUB3_FONT_B', '');
$tpl->set_var('ACTIVE_SUB3_FONT_E', '');
}
/**/
$tpl->parse("third_rows","third_row",true);
}
$tpl->parse("news_rows","news_row",true);
}
/*
$tpl->set_block($tplkey,"third_row","third_rows");
$categoryThirdList = $categoryDao->getShowList($_REQUEST['newsid']);
$thirdList = $contentDao->getValidCategory($categoryThirdList,$aryId2Content);
for($k=0;$kisSubTag()) continue;
$id = $category->getId();
$content = $aryId2Content[$id];
$tpl->set_var('NEWS_ID', $_REQUEST['newsid']);
$tpl->set_var("3_NEWS_ID",$id);
$tpl->set_var("3_NEWS_ALT",$content->getAlt());
$tpl->set_var("3_NEWS_TITLE",$content->getTitle());
if ($id != $_REQUEST['newsid3']) {
$tpl->set_var('ACTIVE_SUB3_FONT_B', '');
} else {
$tpl->set_var('ACTIVE_SUB3_FONT_B', '');
$tpl->set_var('ACTIVE_SUB3_FONT_E', '');
}
$tpl->parse("third_rows","third_row",true);
}
*/
$tpl->set_var("categoryId",$currentContent->getPid());
$tpl->set_var("categoryTitle",$currentContent->getTitle());
$languageCategoryId = 0;
//top image
$content = $aryPageId2Content[$categoryId];
if(is_object($content)){
//$tpl->set_var("ACTIVE_CATEGORY_IMG", $content->getPname()); // add by huahua
//** add by huahua / to location
$tpl->set_var('CATE_LOCA_TITLE', $content->getTitle()); //
$tpl->set_var('CATE_ALT', $content->getAlt()); //link's title
$cateTitle = $content->getTitle();
if (!isset($_REQUEST['newsid'])) {
$tpl->set_var('NOTE_CATE_LINK_B', '');
}
/**/
} else {
$tpl->set_var('VISIBLE', 'hidden');
}
//just for category pic(pname)
$content2 = $contentDao->getObj4PidLang($categoryId,$gCurrentLanguage);
if(is_object($content2)){
$tpl->set_var("ACTIVE_CATEGORY_IMG", $content2->getPname()); // add by huahua
}
//
$languageCategoryId = $categoryId;
$languageCategoryId = empty($_REQUEST['newsid'])?$languageCategoryId:$_REQUEST['newsid'];
$languageCategoryId = empty($_REQUEST['newsid3'])?$languageCategoryId:$_REQUEST['newsid3'];
$content = $aryPageId2Content[$languageCategoryId];
$content = !is_object($content)?new Content(array()):$content;
if(is_object($content)){
$tpl->set_var("TITLE_NEWS",$content->getTitle());
// echo $getTitle->title;
if($content->getTitle()!=$getTitle->title)
{
$root_type=" ".$getTitle->title." >>";
$tpl->set_var('ROOT_TYPE',$root_type);
}
$tpl->set_var("TITLE_CONTENT",$content->getContent());
//add by Runbo
$tpl->set_var("pageTitle",$content->getpageTitle());
$tpl->set_var("sKey",$content->getsKey());
$tpl->set_var("sDep",$content->getsDep());
//end by Runbo
//echo $content->getContent();
//** add by huahua / to location
if (isset($_REQUEST['newsid']) && !isset($_REQUEST['newsid3'])) {
$tpl->set_var("SUB_LOCA_ID",$content->getPid());
$tpl->set_var('SUB_LOCA_TITLE', $content->getTitle()); //
$tpl->set_var('NOTE_SUB_LINK_B', '');
} elseif (isset($_REQUEST['newsid']) && isset($_REQUEST['newsid3'])) {
$content2 = $aryPageId2Content[$_REQUEST['newsid']];
$content2 = !is_object($content2)?new Content(array()):$content2;
$tpl->set_var("SUB_LOCA_ID",$content2->getPid());
$tpl->set_var('SUB_LOCA_TITLE', $content2->getTitle()); //
$tpl->set_var('SUB_ALT', $content2->getAlt()); // -> link's title
$tpl->set_var('SUB_LOCA_TITLE3', $content->getTitle()); //
}
/**/
}
//COMMON LINK
while(list($key,$val) = each($_REQUEST)){
$tpl->set_var("SUBLIST_".$key,$val);
}
//parse sub list
$languageCategoryId=$_GET['categoryId'];
//echo $languageCategoryId;
$categoryNewsList = $categoryDao->getShowList($languageCategoryId);
//show($categoryNewsList);
$newsList = $contentDao->getValidCategory($categoryNewsList,$aryId2Content);
$tpl->set_block('SubList',"list_row","list_rows");
//print_r($newsList);
for($j=0;$jisMoreTag()) continue;
//** add by huahua
if(!$category->isMoreTag()) {
$tpl->set_var('NOTE_B', '');
} else {
$tpl->set_var('NOTE_B', '');
$tpl->set_var('NOTE_E', '');
}
/**/
$id = $category->getId();
$content = $aryId2Content[$id];
//
$tpl->set_var("SUBLIST_categorySubId",4);
$tpl->set_var("SUBLIST_categoryId",$languageCategoryId);
//
$tpl->set_var("pcontent",$content->getPcontent());
if(empty($_REQUEST['newsid']))
$tpl->set_var('SUBLIST_newsid',$category->getId());
else
$tpl->set_var('SUB_LIST_ID',$category->getId());
$tpl->parse("list_rows","list_row",true);
}
$tpl->parse("SUB_LIST_PART","SubList");
$tpl->set_var("pic",$gCurrentLanguage);
//language part
$aryLangList = $contentDao->getValidLangList($languageCategoryId);
//
//
//////////////////////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","productlist.html");
$tpl->set_block("plist","newsrow","newsrows");
//$categorySubList = $categoryDao->getShowList(5);
//$aryId2Content_p= $contentDao->getTheLangListPidKey($gCurrentLanguage);
//print_r($categorySubList);
//$categoryId=5;
$categoryNewsList = $categoryDao->getShowList($categoryId);
$newsList = $contentDao->getValidCategory($categoryNewsList,$aryId2Content);
//
for($j=0;$jset_var("third_rows");
$category = $newsList[$j];
if(!$category->isSubTag()) continue;
$id = $category->getId();
$content = $aryId2Content[$id];
$tpl->set_var("SUBid",$id);
$tpl->set_var("NEWS_ALT",$content->getAlt());
$tpl->set_var("SUBTitle",$content->getTitle());
$tpl->set_var('CATEGORY_ID', $categoryId);
//
//$tpl->set_var("SUBTitle",$title);
$tpl->parse("newsrows","newsrow","true");
//echo "
";
//print_r($title);
}
$tpl->parse("PLIST","plist");
//产品列表结束
$tpl->parse("BODY",$tplkey);
require_once $ROOT_DIR."config/bottom.inc.php";
?>