Art.php 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  1. <?php
  2. namespace app\index\controller;
  3. use think\Controller;
  4. class Art extends Base
  5. {
  6. public function __construct()
  7. {
  8. parent::__construct();
  9. }
  10. public function index()
  11. {
  12. return $this->label_fetch('art/index');
  13. }
  14. public function type()
  15. {
  16. $info = $this->label_type();
  17. return $this->label_fetch( mac_tpl_fetch('art',$info['type_tpl'],'type') );
  18. }
  19. public function show()
  20. {
  21. $this->check_show();
  22. $info = $this->label_type();
  23. return $this->label_fetch( mac_tpl_fetch('art',$info['type_tpl_list'],'show') );
  24. }
  25. public function ajax_show()
  26. {
  27. $this->check_ajax();
  28. $this->check_show(1);
  29. $info = $this->label_type();
  30. return $this->label_fetch('art/ajax_show');
  31. }
  32. public function search()
  33. {
  34. $param = mac_param_url();
  35. $this->check_search($param);
  36. $this->label_search($param);
  37. return $this->label_fetch('art/search');
  38. }
  39. public function ajax_search()
  40. {
  41. $param = mac_param_url();
  42. $this->check_ajax();
  43. $this->check_search($param,1);
  44. $this->label_search($param);
  45. return $this->label_fetch('art/ajax_search');
  46. }
  47. public function detail()
  48. {
  49. $info = $this->label_art_detail([],2);
  50. if(!empty($info['art_pwd']) && session('2-1-'.$info['art_id'])!='1'){
  51. return $this->label_fetch('art/detail_pwd');
  52. }
  53. $tpl = mac_tpl_fetch('art',$info['art_tpl'],'detail');
  54. $tplFile = isset($GLOBALS['MAC_ROOT_TEMPLATE']) ? $GLOBALS['MAC_ROOT_TEMPLATE'] . $tpl . '.html' : '';
  55. if (empty($tplFile) || !is_file($tplFile)) {
  56. $tpl = 'art/detail';
  57. }
  58. return $this->label_fetch($tpl);
  59. }
  60. public function ajax_detail()
  61. {
  62. $this->check_ajax();
  63. $info = $this->label_art_detail();
  64. return $this->label_fetch('art/ajax_detail');
  65. }
  66. public function rss()
  67. {
  68. $info = $this->label_art_detail();
  69. return $this->label_fetch('art/rss');
  70. }
  71. }