search.php 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384
  1. <?php
  2. $view
  3. ->set('name', 'news')
  4. ->set('title', '搜索')
  5. ->import('inc/head')
  6. ->fetch('.index-slide@style', 'display:none')
  7. # 广告
  8. ->loop
  9. (
  10. '.ad-swiper .swiper-slide',
  11. 'main/content.ad|key=search_ad&name=搜索页广告',
  12. array
  13. (
  14. 'a' => array
  15. (
  16. 'href' => '$v.link',
  17. 'title' => '$v.name',
  18. ),
  19. 'img' => array
  20. (
  21. 'src' => '$v.pic',
  22. 'alt' => '$v.name',
  23. ),
  24. )
  25. )
  26. ->fetch('.ad-swiper@style', 'main/content.ad?key=search_ad&name=搜索页广告', 'none')
  27. ->loop
  28. (
  29. '.news-module dl',
  30. 'main/content.news|type=-1',
  31. array
  32. (
  33. 'a|0' => array
  34. (
  35. 'href' => '$v.link',
  36. 'title' => '$v.name',
  37. 'img' => array
  38. (
  39. 'src' => '$v.pic',
  40. 'alt' => '$v.name',
  41. ),
  42. ),
  43. 'a|1' => array
  44. (
  45. 'href' => '$v.link',
  46. 'title' => '$v.name',
  47. 'html' => '$v.name ."<br/>". $v.desc',
  48. ),
  49. 'p' => array
  50. (
  51. 'html' => '$v.info',
  52. ),
  53. 'span' => array
  54. (
  55. 'html' => '$v.pdate_string',
  56. ),
  57. )
  58. )
  59. ->fetch('.no-result@style', 'main/content.getNoNews', 'none')
  60. ->fetch('.dever-page@style', 'main/content.getNews', 'none')
  61. ->fetch('.more@href', 'javascript:;')
  62. ->fetch('.more@dever-show', 'Dever::pageInfo()["link"] ? "1" : "2"')
  63. ->fetch('.more@style', 'Dever::pageInfo()["link"] ? "" : "display:none"')
  64. ->append('body', '<div id="page" dever-page-link="<{Dever::pageInfo()["link"]}>" dever-page-list=".dever-page"></div>')
  65. ->import('inc/foot')
  66. ->display();