show.php 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  1. <?php
  2. require("../class/connect.php");
  3. require("../class/db_sql.php");
  4. require("../class/q_functions.php");
  5. require("../data/dbcache/class.php");
  6. $link=db_connect();
  7. $empire=new mysqlquery();
  8. define('WapPage','show');
  9. $usewapstyle='';
  10. $wapstyle=0;
  11. $pr=array();
  12. require("wapfun.php");
  13. $classid=(int)$_GET['classid'];
  14. $id=(int)$_GET['id'];
  15. if(!$classid||!$class_r[$classid]['tbname']||!$id||InfoIsInTable($class_r[$classid]['tbname']))
  16. {
  17. DoWapShowMsg('您来自的链接不存在','index.php?style='.$wapstyle);
  18. }
  19. $cpage=(int)$_GET['cpage'];
  20. $cid=(int)$_GET['cid'];
  21. $bclassid=(int)$_GET['bclassid'];
  22. if(empty($cid))
  23. {
  24. $cid=$classid;
  25. }
  26. $listurl="list.php?classid=".$cid."&amp;style=".$wapstyle."&amp;bclassid=".$bclassid."&amp;page=".$cpage;
  27. $r=$empire->fetch1("select * from {$dbtbpre}ecms_".$class_r[$classid]['tbname']." where id='$id' limit 1");
  28. if(!$r['id']||$classid!=$r[classid])
  29. {
  30. DoWapShowMsg('您来自的链接不存在',$listurl);
  31. }
  32. $GLOBALS['navclassid']=$classid;
  33. if($r['groupid']||$class_r[$classid]['cgtoinfo'])
  34. {
  35. DoWapShowMsg('此信息不能查看',$listurl);
  36. }
  37. //系统模型
  38. $modid=$class_r[$classid][modid];
  39. //副表
  40. $finfor=$empire->fetch1("select ".ReturnSqlFtextF($modid)." from {$dbtbpre}ecms_".$class_r[$classid]['tbname']."_data_".$r[stb]." where id='$r[id]' limit 1");
  41. $r=array_merge($r,$finfor);
  42. $ret_r=ReturnAddF($modid,1);
  43. //更新点击
  44. $empire->query("update {$dbtbpre}ecms_".$class_r[$classid]['tbname']." set onclick=onclick+1 where id='$id' limit 1");
  45. $r['onclick']=$r['onclick']+1;
  46. $pagetitle=$r['title'];
  47. $pagekey=$pagetitle;
  48. $pagedes=$pagetitle;
  49. //存文本内容
  50. $savetxtf=$emod_r[$modid]['savetxtf'];
  51. if($savetxtf&&$r[$savetxtf])
  52. {
  53. $r[$savetxtf]=GetTxtFieldText($r[$savetxtf]);
  54. }
  55. //分页字段
  56. $pagef=$emod_r[$modid]['pagef'];
  57. if($pagef&&$r[$pagef])
  58. {
  59. //替换掉分页符
  60. $r[$pagef]=str_replace('[!--empirenews.page--]','',$r[$pagef]);
  61. $r[$pagef]=str_replace('[/!--empirenews.page--]','',$r[$pagef]);
  62. }
  63. //参数
  64. $ecmsvar_mbr=array();
  65. $ecmsvar_mbr['wapstyle']=$wapstyle;
  66. $ecmsvar_mbr['fbclassid']=$bclassid;
  67. $ecmsvar_mbr['fclassid']=$cid;
  68. $ecmsvar_mbr['fcpage']=$cpage;
  69. $ecmsvar_mbr['urladdcs']=ewap_UrlAddCs();
  70. require('template/'.$usewapstyle.'/show.temp.php');
  71. db_close();
  72. $empire=null;
  73. ?>