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' => 'name<{$v.name}>',
),
'li|1' => array
(
'html' => 'role<{$v.profession}>',
),
'li|2' => array
(
'html' => 'super<{$v.ability}>',
),
'li|3' => array
(
'html' => 'home<{$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();