usermessage.php
资源名称:BBWPS.rar [点击查看]
上传用户:yttaitong
上传日期:2009-05-10
资源大小:128k
文件大小:3k
源码类别:
WEB源码(ASP,PHP,...)
开发平台:
PHP
- <?php
- /*
- [BBWPS!] (C)2006-2010 小蜜蜂版权所有.
- This is NOT a freeware, use is subject to license terms
- 时间:2007年12月
- 描述:编辑信息页面
- */
- $mid = $_GET['mid'];
- require("global.php");
- $un = $_COOKIE["bbwps_user"];
- $p->set_file("handle","usermessage.html");
- $sql = $db->query("select ".$prefix."message.title,".$prefix."message.cid,".$prefix."message.sid,content,picture,oprice,nprice,btime,etime,cname,sname from ".$prefix."message left join ".$prefix."city
- on ".$prefix."message.cid=".$prefix."city.cid left join ".$prefix."sort on ".$prefix."message.sid=".$prefix."sort.sid where mid ='".$mid."'",1);
- $result=$db->fetch_array($sql);
- $content = str_replace("<br />","n",$result["content"]);
- $i = ($result["etime"]-$result["btime"])/(3600*24);
- $p->set_var(array("mid"=> $mid,"title_value"=> $result["title"])); //传参及标题
- $sql1=$db->query("select cid,cname from ".$prefix."city where clevel='0'",1); //城市
- $p->set_block("handle","op","a");
- $p->set_block("op","ap","b");
- while($row1=$db->fetch_array($sql1)){ //****一级城市******
- $p->set_var(array("b"=> "","value1"=> $row1["cid"],"name1"=> "|-".$row1["cname"]));
- if($result["cid"]==$row1["cid"])
- $p->set_var("selected1",selected);
- else
- $p->set_var("selected1","");
- $result1=$db->query("select cid,cname from ".$prefix."city where cparent='".$row1["cid"]."'",1);
- while($row2=$db->fetch_array($result1)){ //****二级城市******
- $p->set_var(array("value2"=> $row2["cid"],"name2"=> " "." "."|-".$row2["cname"]));
- if($result["cid"]==$row2["cid"])
- $p->set_var("selected2",selected);
- else
- $p->set_var("selected2","");
- $p->parse("b","ap",true);
- }
- $p->parse("a","op",true);
- }
- $result2=$db->query("select sname,sid from ".$prefix."sort where slevel = '0'",1); //分类
- $p->set_block("handle","ep","c");
- $p->set_block("ep","bp","d");
- while($cel1=$db->fetch_array($result2)){ //****一级分类******
- $p->set_var(array("d"=> "","value3"=> $cel1["sid"],"name3"=> "|-".$cel1["sname"]));
- if($result["sid"]==$cel1["sid"])
- $p->set_var("selected3",selected);
- else
- $p->set_var("selected3","");
- $sql2=$db->query("select sname,sid from ".$prefix."sort where sparent = '".$cel1["sid"]."'",1);
- while($cel2=mysql_fetch_array($sql2)){ //****二级分类******
- $p->set_var(array("value4"=> $cel2["sid"],"name4"=> " "." "."|-".$cel2["sname"]));
- if($result["sid"]==$cel2["sid"])
- $p->set_var("selected4",selected);
- else
- $p->set_var("selected4","");
- $p->parse("d","bp",true);
- }
- $p->parse("c","ep",true);
- }
- $p->set_var(array("cont_value"=> $content,"oprice"=> $result["oprice"],"nprice"=> $result["nprice"],"btime"=> date("Y-m-j",$result["btime"]),
- "day"=> $i,"mid"=> $mid,"i"=> $i)); //信息内容、原价、折扣价、发表时间、有效时间
- $p->set_block("handle","mp","e");
- if($result["picture"]){ //信息图片
- $handle = explode(".",$result["picture"]);
- $file = date("Y-m-j",$handle[0]);
- $p->set_var(array("file"=> $file,"picture"=> $result["picture"]));
- $p->parse("e","mp",true);
- }
- $p->parse("work","handle",true);
- require("head.php");
- ?>