index.php 934 B

1234567891011121314151617181920212223242526272829303132333435363738
  1. <?php
  2. require("../../class/connect.php");
  3. $id=(int)$_GET['id'];
  4. $classid=(int)$_GET['classid'];
  5. $enews=$_GET['enews'];
  6. if($id&&$classid)
  7. {
  8. include("../../class/db_sql.php");
  9. include("../../data/dbcache/class.php");
  10. include("../../class/q_functions.php");
  11. $link=db_connect();
  12. $empire=new mysqlquery();
  13. $editor=1;
  14. if(empty($class_r[$classid][tbname])||InfoIsInTable($class_r[$classid][tbname]))
  15. {
  16. printerror("ErrorUrl","",1);
  17. }
  18. //下一条记录
  19. if($enews=="next")
  20. {
  21. $where="id>$id and classid='$classid' order by id";
  22. }
  23. //上一条记录pre
  24. else
  25. {
  26. $where="id<$id and classid='$classid' order by id desc";
  27. }
  28. $r=$empire->fetch1("select isurl,titleurl,classid,id from {$dbtbpre}ecms_".$class_r[$classid][tbname]." where ".$where." limit 1");
  29. if(empty($r[id]))
  30. {
  31. printerror("NotNextInfo","",1);
  32. }
  33. $titleurl=sys_ReturnBqTitleLink($r);
  34. db_close();
  35. $empire=null;
  36. Header("Location:$titleurl");
  37. }
  38. ?>