caching = true; $smarty->cache_lifetime = 60*30; $member = new Member(); define("Member_Id",intval(GetCookie("MemberId"))); //会员登录开始 $flaglogin = 0; if(Member_Id > 0){ $curinfo = $member->Info(Member_Id,'Id,UserName'); if($curinfo['Id']>0) $flaglogin = 1; } if($flaglogin){ $smarty->assign('flaglogin',$flaglogin);//区域 $smarty->assign('username',$curinfo['UserName']);//替换用户名 $memmsg = new Memberguestbook(); $smarty->assign('newmsg',$memmsg->countinfo(" ComId = ".Member_Id." AND Flag = 0 "));//替换用户名 } //会员登录结束 if(!$smarty->is_cached('corporation/index.html')){ $province = new Province(); $smarty->assign('arrprov',$province->arr);//区域 $smarty->assign('memberroot',$member->memberroot);//免费会员根目录 $smarty->assign('newmember',$member->infocon(" ComName,Url,SetUrl,StaticFile "," ComProductSorts <> '' AND ComProductSorts NOT LIKE '%undefined%' AND Integral >= 58 AND MemberFlag In (1,2)"," AddDate DESC ",21));//最新企业 $smarty->assign('com_2001',$member->infocon(" ComName,Url,SetUrl,StaticFile,MainProducts "," CommendFlag LIKE '%2001%' AND MemberFlag In (1,2)"," Integral DESC,AddDate ASC ",9));//推荐企业文字显示 //推荐企业图文滚动显示开始 $commember = $member->infocon(" ComName,Url,SetUrl,StaticFile,ComImage,Content "," CommendFlag LIKE '%2002%' AND ComImage <> '' AND MemberFlag In (1,2)"," Integral DESC,AddDate DESC ",8); //print_r($commember); $i=0; $arrmember = array(); foreach($commember as $row){ $arrmember[$i]['comname'] = $row['ComName']; $arrmember[$i]['url'] = $row['Url'] == '' ? $member->memberroot.$row['StaticFile'] : "http://".$row['Url']; $arrmember[$i]['img'] = $member->imgroot.$row['ComImage'].$member->imgwh[0]['name'].strrchr($row['ComImage'],"."); $arrmember[$i]['content'] = preg_replace("'([\r\n])[\s]+'", "",$row['Content']); $i++; } if($i % 2!=0){ $arrmember[$i]['comname'] = ''; $arrmember[$i]['url'] = ''; $arrmember[$i]['img'] = ''; $arrmember[$i]['content'] = ''; } $smarty->assign('arrmember',$arrmember); //推荐企业图文滚动显示结束 $smarty->assign('category',$member->sortinfo()); //print_r($member->sortinfo()); //公用部分开始 $smarty->assign('bigsortlist',$member->BigSortList(0,""));// $smarty->assign('sortlistjs',$member->SortJsList());// $province = New Province(); $smarty->assign('provincelist',$province->ProvinceList(0,""));// $smarty->assign('ad_1',ReadFileContentAndRet(WEB_ROOT."/Ad/Cor_AD_1.htm")); $smarty->assign('ad_2',ReadFileContentAndRet(WEB_ROOT."/Ad/Cor_AD_2.htm")); //公用部分结束 $smarty->assign('ad_3',ReadFileContentAndRet(WEB_ROOT."/Ad/Cor_AD_3.htm")); $smarty->assign('ad_4',ReadFileContentAndRet(WEB_ROOT."/Ad/Cor_AD_4.htm")); $news = new News(); $smarty->assign('news_stafileforder',$news->inforoot); //$smarty->assign('corp_news',$news->infolist(" Title,InfoFile,SetUrl "," Category LIKE '%3001%' AND Flag = 1 ",15));//企业报道 $smarty->assign('integralmember',$member->infocon(" ComName,Url,SetUrl,StaticFile "," MemberFlag In (1,2)"," Integral DESC, AddDate ASC ",10));//积分排行榜企业 //print_r($member->infocon(" ComName,Url,SetUrl,StaticFile "," MemberFlag In (1,2)"," Integral DESC, AddDate ASC ",10)); } $smarty->display('corporation/index.html'); ?>