index.php
资源名称:BBWPS.rar [点击查看]
上传用户:yttaitong
上传日期:2009-05-10
资源大小:128k
文件大小:4k
源码类别:
WEB源码(ASP,PHP,...)
开发平台:
PHP
- <?php
- /*
- [BBWPS!] (C)2006-2010 小蜜蜂版权所有.
- This is NOT a freeware, use is subject to license terms
- 时间:2007年12月
- 描述:前台控制层
- */
- error_reporting(0);
- require_once("./function/function.php");
- require_once("./function/func_global.php");
- require_once("./config.php");
- require_once("./config/module.php");
- require_once("./config/baseCheckCode.php");
- require_once("./class/mysql_class.php");
- require_once("./class/template_class.php");
- require_once("./class/http_class.php");
- require_once("./class/ParseOut_class.php");
- require_once("./class/tagParse_class.php");
- require_once("./function/checkModuleSession.php");
- require_once("./class/define_class.php");
- $queryParameter=$_SERVER['QUERY_STRING'];//获得参数字符串
- $queryParameter=str_replace(".html","",$queryParameter);
- $queryParameterArray=explode("--",$queryParameter);
- foreach ($queryParameterArray as $queryP){
- $_GETA=explode("-",$queryP);
- $_GET[$_GETA[0]]=$_GETA[1];
- $f=$_GET[$_GETA[0]];
- }
- $f=$_GET["f"];
- $p=new template("./template");
- $db=new DB($hostname, $username, $password, $database);
- $p->set_file("handle_mark","index.html");
- //解析页头
- $cid = $_GET['cid'];
- $p->set_var("templatePath","http://".$host."/".$installPath."/template");
- $p->set_var("dns",$basePath);
- $p->set_var("basePath",$basePath);
- $p->set_var("headtitle",$moduleName);
- $p->set_file("handle_module","module.html");
- foreach($moduleArray as $key){
- if(!$key['isstart'])continue;
- $p->set_var("keypath",$key['dns']);
- $p->set_var("keyname",$key['name']);
- $p->parse("module","handle_module",true);
- }
- //系统参数
- $sql = "select * from {$prefix}setting";
- $setting = $db->query($sql,1);
- $set = $db->fetch_array($setting);
- $pagesize = $set["list_num"];
- $n_pagesize = $set["new_message_num"];
- $h_pagesize = $set["hot_message_num"];
- $s_u_pagesize = $set["sort_update_num"];
- $s_pagesize = $set["sort_num"];
- $v_pagesize = $set["vouch_message_num"];
- require_once("./function/page.php");
- if(!$cid){
- $cid = $set["city"];
- }
- $ci = $db->query("select cname from ".$prefix."city where cid='$cid'",1);
- $ty = $db->fetch_array($ci);
- $city = $ty["cname"] ;
- $p->set_var("city_name",$city);
- //*******城市显示******
- $sql ="select cid,cname from ".$prefix."city where clevel='0' order by ".$prefix."city.seq asc";
- $result = $db->query($sql,1);
- while($row = $db->fetch_array($result)){
- if($city!=$row["cname"]){
- $newcity .= " <a href=?cid-".$row["cid"].".html>".$row["cname"]."</a>";
- }
- }
- $p->set_var("othercity",$newcity);
- $p->set_var("city_id",$cid.".html");
- //************分类显示**********
- $p->set_file("handle_channel","channel.html");
- $s = "select sid,sname from ".$prefix."sort where slevel='0' order by ".$prefix."sort.seq asc";
- $sort = $db->query($s,1);
- while($cel = $db->fetch_array($sort)){
- $sortlist .= " <a href=?f-sort--sid-".$cel["sid"]."--cid-".$cid.".html>".$cel["sname"]."</a>";
- $p->set_var(array("csid"=>$cel["sid"],"ccid"=>$cid,"cname"=>$cel["sname"]));
- $p->parse("channel","handle_channel",true);
- }
- //$p->set_var("sortlist",$sortlist);
- unset($setting,$set,$sql,$result,$row,$s,$sort,$cel);
- //页面主体
- if(!$f){
- include_once("./front/index.php"); //引用
- }
- else {
- include_once("./front/".$f.".php"); //引用
- }
- $array=array(
- "username"=>'$rs["username"]?$rs["username"]=$rs["username"]:$rs["username"]="匿名";',
- "date"=>'date("y-m-d",$rs["date"]);',
- "btime"=>'date("y-m-d",$rs["btime"]);', //转换时间展示格式
- "etime"=>'date("y-m-d",$rs["etime"]);', //转换时间展示格式
- "picture"=>'$absultePath.$rs["picture"];', //修改图片的路径
- "finsh"=>'$rs["finish"]?$rs["finish"]="已完成":$rs["finish"]="连载中";'//状态转换
- );
- $defineObj=new DefineClass("./template/$parseTemplateName","./defsql/");
- $p=$defineObj->ParseTemplate($array);
- //广告跟模块通信
- $p=parseADTag($p,"./template/index.html");
- $t = new tagParse($p,"./template/index.html",$baseCheckCode);
- $t->setInstallPath($installPath);
- $t->setModuleArray($moduleArray);
- $t->setOpenCash(TRUE);
- $t->setCashTime(10*60,10*60);
- $t->setCashDir("./cache");
- $p = $t->parse();
- $t->__tagdParse();
- //end
- $p->parse("servlet_body","handle");
- $p->parse("index","handle_mark");
- $p->p("index");
- $db->close();
- ?>