usermessage.php
上传用户:yttaitong
上传日期:2009-05-10
资源大小:128k
文件大小:3k
源码类别:

WEB源码(ASP,PHP,...)

开发平台:

PHP

  1. <?php
  2. /*
  3.     [BBWPS!] (C)2006-2010 小蜜蜂版权所有.
  4. This is NOT a freeware, use is subject to license terms
  5.     时间:2007年12月
  6.     描述:编辑信息页面
  7. */
  8. $mid = $_GET['mid'];
  9. require("global.php");
  10. $un = $_COOKIE["bbwps_user"];
  11. $p->set_file("handle","usermessage.html");
  12. $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
  13.        on ".$prefix."message.cid=".$prefix."city.cid left join ".$prefix."sort on ".$prefix."message.sid=".$prefix."sort.sid where mid ='".$mid."'",1);
  14. $result=$db->fetch_array($sql);
  15. $content = str_replace("<br />","n",$result["content"]);
  16. $i = ($result["etime"]-$result["btime"])/(3600*24);
  17. $p->set_var(array("mid"=> $mid,"title_value"=> $result["title"]));             //传参及标题
  18. $sql1=$db->query("select cid,cname from ".$prefix."city where clevel='0'",1);     //城市
  19. $p->set_block("handle","op","a");
  20. $p->set_block("op","ap","b");
  21. while($row1=$db->fetch_array($sql1)){                                                  //****一级城市******
  22. $p->set_var(array("b"=> "","value1"=> $row1["cid"],"name1"=> "|-".$row1["cname"]));
  23. if($result["cid"]==$row1["cid"])
  24. $p->set_var("selected1",selected);
  25. else
  26. $p->set_var("selected1","");
  27. $result1=$db->query("select cid,cname from ".$prefix."city where cparent='".$row1["cid"]."'",1);
  28. while($row2=$db->fetch_array($result1)){                                                        //****二级城市******
  29. $p->set_var(array("value2"=> $row2["cid"],"name2"=> "&nbsp"."&nbsp"."|-".$row2["cname"]));
  30. if($result["cid"]==$row2["cid"])
  31. $p->set_var("selected2",selected);
  32. else
  33. $p->set_var("selected2","");
  34. $p->parse("b","ap",true);
  35. }
  36. $p->parse("a","op",true);
  37. }
  38. $result2=$db->query("select sname,sid from ".$prefix."sort where slevel = '0'",1);   //分类
  39. $p->set_block("handle","ep","c");
  40. $p->set_block("ep","bp","d");
  41. while($cel1=$db->fetch_array($result2)){                                  //****一级分类******
  42. $p->set_var(array("d"=> "","value3"=> $cel1["sid"],"name3"=> "|-".$cel1["sname"]));
  43. if($result["sid"]==$cel1["sid"])
  44. $p->set_var("selected3",selected);
  45. else
  46. $p->set_var("selected3","");
  47. $sql2=$db->query("select sname,sid from ".$prefix."sort where sparent = '".$cel1["sid"]."'",1);
  48. while($cel2=mysql_fetch_array($sql2)){                                               //****二级分类******
  49. $p->set_var(array("value4"=> $cel2["sid"],"name4"=> "&nbsp"."&nbsp"."|-".$cel2["sname"]));
  50. if($result["sid"]==$cel2["sid"])
  51. $p->set_var("selected4",selected);
  52. else
  53. $p->set_var("selected4","");
  54. $p->parse("d","bp",true);
  55. }
  56. $p->parse("c","ep",true);
  57. }
  58. $p->set_var(array("cont_value"=> $content,"oprice"=> $result["oprice"],"nprice"=> $result["nprice"],"btime"=> date("Y-m-j",$result["btime"]),
  59. "day"=> $i,"mid"=> $mid,"i"=> $i));     //信息内容、原价、折扣价、发表时间、有效时间
  60. $p->set_block("handle","mp","e");
  61. if($result["picture"]){                 //信息图片
  62. $handle = explode(".",$result["picture"]);
  63. $file = date("Y-m-j",$handle[0]);
  64. $p->set_var(array("file"=> $file,"picture"=> $result["picture"]));
  65. $p->parse("e","mp",true);
  66. }
  67. $p->parse("work","handle",true);
  68. require("head.php");
  69. ?>