index.php 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. <?php
  2. require('../../class/connect.php');
  3. require('../../data/dbcache/class.php');
  4. require('../../class/db_sql.php');
  5. $link=db_connect();
  6. $empire=new mysqlquery();
  7. $editor=1;
  8. $classid=(int)$_GET['classid'];
  9. $id=(int)$_GET['id'];
  10. if(empty($id)||empty($classid)||!$class_r[$classid]['tbname']||InfoIsInTable($class_r[$classid]['tbname']))
  11. {
  12. printerror("NotVote","history.go(-1)",9);
  13. }
  14. $infor=$empire->fetch1("select id,classid,title,isurl,titleurl from {$dbtbpre}ecms_".$class_r[$classid]['tbname']." where id='$id' limit 1");
  15. if(empty($infor['id'])||$infor['classid']!=$classid)
  16. {
  17. printerror("NotVote","history.go(-1)",9);
  18. }
  19. $pubid=ReturnInfoPubid($classid,$id);
  20. $r=$empire->fetch1("select id,title,votetext,voteclass,votenum from {$dbtbpre}enewsinfovote where pubid='$pubid' limit 1");
  21. if(empty($r['id'])||empty($r['votetext']))
  22. {
  23. printerror("NotVote","history.go(-1)",9);
  24. }
  25. if(empty($r['title']))
  26. {
  27. $r['title']=$infor['title'];
  28. }
  29. $r_exp="\r\n";
  30. $f_exp="::::::";
  31. if($r['voteclass'])
  32. {
  33. $voteclass="多选";
  34. }
  35. else
  36. {
  37. $voteclass="单选";
  38. }
  39. $titleurl=sys_ReturnBqTitleLink($infor);
  40. $infor[title]=stripSlashes($infor[title]);
  41. //导入模板
  42. require(ECMS_PATH.'e/template/public/vote.php');
  43. db_close();
  44. $empire=null;
  45. ?>