国内流行的内容管理系统(CMS)多端全媒体解决方案 https://www.dedebiz.com
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

50 lines
1.7KB

  1. <?php
  2. /**
  3. * @version $Id: story_list_content.php 1 9:02 2010年9月25日Z 蓝色随想 $
  4. * @package DedeCMS.Module.Book
  5. * @copyright Copyright (c) 2007 - 2020, DesDev, Inc.
  6. * @license http://help.dedecms.com/usersguide/license.html
  7. * @link http://www.dedecms.com
  8. */
  9. require_once(dirname(__FILE__). "/config.php");
  10. require_once DEDEINC. '/datalistcp.class.php';
  11. setcookie("ENV_GOBACK_URL", $dedeNowurl, time()+3600,"/");
  12. CheckPurview('story_books');
  13. if(!isset($action)) $action = '';
  14. if(!isset($booktype)) $booktype = '-1';
  15. if(!isset($keyword)) $keyword = "";
  16. if(!isset($orderby)) $orderby = 0;
  17. if(!isset($bookid)) $bookid = 0;
  18. if(!isset($chapid)) $chapid = 0;
  19. $addquery = "";
  20. $orderby = " ORDER BY ct.id DESC ";
  21. if($booktype!='-1') $addquery .= " And ct.booktype='$booktype' ";
  22. if($keyword!="") $addquery .= " And (ct.bookname like '%$keyword%' Or ct.title like '%$keyword%') ";
  23. if($bookid!=0) $addquery .= " And ct.bookid='$bookid' ";
  24. if($chapid!=0) $addquery .= " And ct.chapterid='$chapid' ";
  25. $query = "
  26. SELECT ct.id,ct.title,ct.bookid,ct.chapterid,ct.sortid,ct.bookname,ct.addtime,ct.booktype,c.chaptername,c.chapnum FROM #@__story_content ct
  27. LEFT JOIN #@__story_chapter c ON c.id = ct.chapterid WHERE ct.id>0 $addquery $orderby
  28. ";
  29. $dlist = new DataListCP();
  30. $dlist->pageSize = 20;
  31. $dlist->SetParameter("keyword", $keyword);
  32. $dlist->SetParameter("booktype", $booktype);
  33. $dlist->SetParameter("bookit", $bookid);
  34. $dlist->SetParameter("chapid", $chapid);
  35. $dlist->SetTemplate(DEDEADMIN. '/templets/story_list_content.htm');
  36. $dlist->SetSource($query);
  37. $dlist->Display();
  38. //ClearAllLink();