123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262 |
- <?php
- /*
- |--------------------------------------------------------------------------
- | home
- |--------------------------------------------------------------------------
- */
- Dever::setInput('ad_title', '首页');
- Dever::setInput('ad_name', 'home');
- $top[0] = array
- (
- 'img' => array
- (
- 'src' => '$v.pic_cover',
- 'alt' => '$v.name',
- ),
- '.f_news_tag' => array
- (
- 'html' => '$v.cate_name',
- 'href' => '$v.link',
- 'title' => '$v.cate_name',
- ),
- '.f_news_title a' => array
- (
- 'html' => '$v.name',
- 'href' => '$v.link',
- 'title' => '$v.name',
- ),
- '.f_news_info span|0' => '$v.cdate',
- '.f_news_info span|1' => '$v.num_view',
- );
- $top[1] = array
- (
- 'a' => array
- (
- 'html' => '$v.name',
- 'href' => '$v.link',
- 'title' => '$v.name',
- 'img' => array
- (
- 'src' => '$v.pic_cover',
- 'alt' => '$v.name',
- ),
- 'p' => array
- (
- 'html' => '$v.name',
- ),
- 'span' => array
- (
- 'html' => '$v.cdate',
- ),
- ),
- );
- $view
- ->set('name', 'index')
- ->import('inc/head')
- # banner
- ->loop
- (
- '.banner li',
- 'main/api.push|key=home_banner&name=首页banner',
- array
- (
- 'a' => array
- (
- 'href' => '$v.link',
- 'title' => '$v.name',
- 'target' => '',
- 'img' => array
- (
- 'src' => '$v.pic',
- 'alt' => '$v.name',
- ),
- 'span' => array
- (
- 'html' => '$v.cate_name',
- ),
- 'p' => array
- (
- 'html' => '$v.name',
- ),
- ),
- )
- )
- # 精选文章
- ->loop('#article .f_news_pic', 'content/lib/article.getTop[0,1]', $top[0])
- ->loop('#article li', 'content/lib/article.getTop[1,3]', $top[1])
- ->loop('#album .f_news_pic', 'content/lib/album.getTop[0,1]', $top[0])
- ->loop('#album li', 'content/lib/album.getTop[1,3]', $top[1])
- ->loop('#video .f_news_pic', 'content/lib/video.getTop[0,1]', $top[0])
- ->loop('#video li', 'content/lib/video.getTop[1,3]', $top[1])
- # 人物推荐
- ->loop
- (
- '.mycard section',
- 'content/lib/person.getTop',
- array
- (
- 'self' => array
- (
- 'onclick' => 'location.href=\'<{$v.link}>\'',
- 'style' => 'cursor:pointer',
- ),
- 'img|0' => array
- (
- 'src' => '$v.avatar',
- 'alt' => '$v.name',
- ),
- 'img|1' => array
- (
- 'src' => '$v.pic_cover',
- 'alt' => '$v.name',
- ),
- 'li|0' => array
- (
- 'html' => '<span>name</span><{$v.name}>',
- ),
- 'li|1' => array
- (
- 'html' => '<span>role</span><{$v.profession}>',
- ),
- 'li|2' => array
- (
- 'html' => '<span>super</span><{$v.ability}>',
- ),
- 'li|3' => array
- (
- 'html' => '<span>home</span><{$v.address}>',
- ),
- )
- )
- ->loop
- (
- '.featured_pics li',
- 'content/lib/album.getList',
- array
- (
- 'a' => array
- (
- 'href' => '$v.link',
- 'title' => '$v.name',
- 'img' => array
- (
- 'src' => '$v.pic_cover',
- 'alt' => '$v.name',
- ),
- 'span' => array
- (
- 'html' => '$v.pic_num',
- ),
- 'p' => array
- (
- 'html' => '$v.name',
- ),
- ),
- )
- )
- ->loop
- (
- '.blogs li',
- 'content/lib/article.getList',
- array
- (
- 'a|0' => array
- (
- 'href' => '$v.link',
- 'title' => '$v.name',
- 'target' => '',
- 'img' => array
- (
- 'src' => '$v.pic_cover',
- 'alt' => '$v.name',
- ),
- 'h2' => array
- (
- 'html' => '$v.name',
- ),
- ),
- 'p' => array
- (
- 'html' => '$v.desc',
- ),
- '.blogs_time' => array
- (
- 'html' => '$v.cdate',
- ),
- '.blogs_onclick' => array
- (
- 'html' => '$v.num_view',
- ),
- 'a|1' => array
- (
- 'href' => '$v.link',
- 'title' => '$v.name',
- 'target' => '',
- ),
- )
- )
- ->import('inc/right')
- ->loop
- (
- '.links li',
- 'main/api.push|key=home_link&name=友情链接',
- array
- (
- 'a' => array
- (
- 'href' => '$v.link',
- 'title' => '$v.name',
- ),
- )
- )
- ->fetch('.links@style', 'main/api.push?key=home_link&name=友情链接', 'none')
- ->import('inc/foot')
- # display
- ->display();
-
|