home.php 5.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262
  1. <?php
  2. /*
  3. |--------------------------------------------------------------------------
  4. | home
  5. |--------------------------------------------------------------------------
  6. */
  7. Dever::setInput('ad_title', '首页');
  8. Dever::setInput('ad_name', 'home');
  9. $top[0] = array
  10. (
  11. 'img' => array
  12. (
  13. 'src' => '$v.pic_cover',
  14. 'alt' => '$v.name',
  15. ),
  16. '.f_news_tag' => array
  17. (
  18. 'html' => '$v.cate_name',
  19. 'href' => '$v.link',
  20. 'title' => '$v.cate_name',
  21. ),
  22. '.f_news_title a' => array
  23. (
  24. 'html' => '$v.name',
  25. 'href' => '$v.link',
  26. 'title' => '$v.name',
  27. ),
  28. '.f_news_info span|0' => '$v.cdate',
  29. '.f_news_info span|1' => '$v.num_view',
  30. );
  31. $top[1] = array
  32. (
  33. 'a' => array
  34. (
  35. 'html' => '$v.name',
  36. 'href' => '$v.link',
  37. 'title' => '$v.name',
  38. 'img' => array
  39. (
  40. 'src' => '$v.pic_cover',
  41. 'alt' => '$v.name',
  42. ),
  43. 'p' => array
  44. (
  45. 'html' => '$v.name',
  46. ),
  47. 'span' => array
  48. (
  49. 'html' => '$v.cdate',
  50. ),
  51. ),
  52. );
  53. $view
  54. ->set('name', 'index')
  55. ->import('inc/head')
  56. # banner
  57. ->loop
  58. (
  59. '.banner li',
  60. 'main/api.push|key=home_banner&name=首页banner',
  61. array
  62. (
  63. 'a' => array
  64. (
  65. 'href' => '$v.link',
  66. 'title' => '$v.name',
  67. 'target' => '',
  68. 'img' => array
  69. (
  70. 'src' => '$v.pic',
  71. 'alt' => '$v.name',
  72. ),
  73. 'span' => array
  74. (
  75. 'html' => '$v.cate_name',
  76. ),
  77. 'p' => array
  78. (
  79. 'html' => '$v.name',
  80. ),
  81. ),
  82. )
  83. )
  84. # 精选文章
  85. ->loop('#article .f_news_pic', 'content/lib/article.getTop[0,1]', $top[0])
  86. ->loop('#article li', 'content/lib/article.getTop[1,3]', $top[1])
  87. ->loop('#album .f_news_pic', 'content/lib/album.getTop[0,1]', $top[0])
  88. ->loop('#album li', 'content/lib/album.getTop[1,3]', $top[1])
  89. ->loop('#video .f_news_pic', 'content/lib/video.getTop[0,1]', $top[0])
  90. ->loop('#video li', 'content/lib/video.getTop[1,3]', $top[1])
  91. # 人物推荐
  92. ->loop
  93. (
  94. '.mycard section',
  95. 'content/lib/person.getTop',
  96. array
  97. (
  98. 'self' => array
  99. (
  100. 'onclick' => 'location.href=\'<{$v.link}>\'',
  101. 'style' => 'cursor:pointer',
  102. ),
  103. 'img|0' => array
  104. (
  105. 'src' => '$v.avatar',
  106. 'alt' => '$v.name',
  107. ),
  108. 'img|1' => array
  109. (
  110. 'src' => '$v.pic_cover',
  111. 'alt' => '$v.name',
  112. ),
  113. 'li|0' => array
  114. (
  115. 'html' => '<span>name</span><{$v.name}>',
  116. ),
  117. 'li|1' => array
  118. (
  119. 'html' => '<span>role</span><{$v.profession}>',
  120. ),
  121. 'li|2' => array
  122. (
  123. 'html' => '<span>super</span><{$v.ability}>',
  124. ),
  125. 'li|3' => array
  126. (
  127. 'html' => '<span>home</span><{$v.address}>',
  128. ),
  129. )
  130. )
  131. ->loop
  132. (
  133. '.featured_pics li',
  134. 'content/lib/album.getList',
  135. array
  136. (
  137. 'a' => array
  138. (
  139. 'href' => '$v.link',
  140. 'title' => '$v.name',
  141. 'img' => array
  142. (
  143. 'src' => '$v.pic_cover',
  144. 'alt' => '$v.name',
  145. ),
  146. 'span' => array
  147. (
  148. 'html' => '$v.pic_num',
  149. ),
  150. 'p' => array
  151. (
  152. 'html' => '$v.name',
  153. ),
  154. ),
  155. )
  156. )
  157. ->loop
  158. (
  159. '.blogs li',
  160. 'content/lib/article.getList',
  161. array
  162. (
  163. 'a|0' => array
  164. (
  165. 'href' => '$v.link',
  166. 'title' => '$v.name',
  167. 'target' => '',
  168. 'img' => array
  169. (
  170. 'src' => '$v.pic_cover',
  171. 'alt' => '$v.name',
  172. ),
  173. 'h2' => array
  174. (
  175. 'html' => '$v.name',
  176. ),
  177. ),
  178. 'p' => array
  179. (
  180. 'html' => '$v.desc',
  181. ),
  182. '.blogs_time' => array
  183. (
  184. 'html' => '$v.cdate',
  185. ),
  186. '.blogs_onclick' => array
  187. (
  188. 'html' => '$v.num_view',
  189. ),
  190. 'a|1' => array
  191. (
  192. 'href' => '$v.link',
  193. 'title' => '$v.name',
  194. 'target' => '',
  195. ),
  196. )
  197. )
  198. ->import('inc/right')
  199. ->loop
  200. (
  201. '.links li',
  202. 'main/api.push|key=home_link&name=友情链接',
  203. array
  204. (
  205. 'a' => array
  206. (
  207. 'href' => '$v.link',
  208. 'title' => '$v.name',
  209. ),
  210. )
  211. )
  212. ->fetch('.links@style', 'main/api.push?key=home_link&name=友情链接', 'none')
  213. ->import('inc/foot')
  214. # display
  215. ->display();