Commit c02be7b8 authored by 夏彬's avatar 夏彬

Merge remote-tracking branch 'origin/test' into test

parents 870657f1 d09047d6
...@@ -12,37 +12,57 @@ function user_ibanshou($num) ...@@ -12,37 +12,57 @@ function user_ibanshou($num)
$thread = Thread::getHotThreads($num); $thread = Thread::getHotThreads($num);
$list = CourseList::getRecommendList($num); $list = CourseList::getRecommendList($num);
$str = '<div class="learnning-course newest"> $str = '<div clas=\"recommend-info\">';
<div class="tit">推荐课程<span></span><a href="'.$config['wxhpro']['xue'].'/home/all-course">全部课程</a></div>
<div class="newest-list clearfix">';
foreach ($list as $val) { foreach ($list as $val) {
$str .= "<div class=\"learn-course-box\"> $str .= "<div class=\"news-item portal-course\">
<div class=\"lc-img\"><a href=\"{$val['url']}\"><img <a href=\"{$val['url']}\" class=\"content pb-none\">
src=\"{$val['preview_pic']}-ym.preview\"></a></div> <div class=\"tit\">{$val['name']}</div>
<h3><a href=\"{$val['url']}\">{$val['name']}</a></h3>
<p><span>{$val['favorite_count']}人已学</span><span>{$val['comment_count']}人评论</span></p> <div class=\"img-item-box\">
<div class=\"img-item\"><img src=\"{$val['preview_pic']}-ym.preview\" alt=\"\"></div>
</div>
</a>
<div class=\"portal-news-info clearfix\">
<span class=\"time fl\">来自扳手学院</span>
<span class=\"fr\">评论 {$val['comment_count']}</span>
<span class=\"fr\">{$val['favorite_count']}人已学</span>
</div>
</div>"; </div>";
} }
$str .= '</div></div><div class="latest-news">
<div class="common-tit-index">热门互动<a href="'.$config['wxhpro']['bbs'].'">参与互动</a></div>
<ul class="news-list">';
foreach ($thread as $val) { foreach ($thread as $val) {
$val['image'] = $val['image'] ? : '/skin/default/images/notimg.gif'; $val['image'] = $val['image'] ? : '/skin/default/images/notimg.gif';
$str .= "<li> $str .= "<div class=\"news-item has-pic one-picture\">
<a href=\"{$val['url']}\"> <a href=\"{$val['url']}\" class=\"content pb-none\" style=\"min-height: 80px;\">
<h3>{$val['subject']}</h3> <div class=\"tit\">{$val['subject']}</div>
<p>{$val['views']}人已参与</p>
<img src=\"{$val['image']}\"> <div class=\"img-item-box clearfix\">
<div class=\"img-item\"><img src=\"{$val['image']}\" alt=\"\"></div>
</div>
</a> </a>
</li>"; <div class=\"portal-news-info clearfix\">
<span class=\"time fl\">来自扳手社区</span>
<span class=\"fr\">{$val['views']}人已参与</span>
</div>
</div>";
} }
echo $str . '</ul></div>'; echo $str . '</div>';
}
function user_ago($tm,$rcs = 0) {
$cur_tm = time(); $dif = $cur_tm-$tm;
$pds = array('秒','分钟','小时','天','周','个月','年');
$lngh = array(1,60,3600,86400,604800,2630880,31570560);
for($v = sizeof($lngh)-1; ($v >= 0)&&(($no = $dif/$lngh[$v])<=1); $v--); if($v < 0) $v = 0; $_tm = $cur_tm-($dif%$lngh[$v]);
$no = floor($no);
//if($no <> 1) $pds[$v] .='s'; //+s
$x=sprintf("%d %s",$no,$pds[$v]);
if(($rcs == 1)&&($v >= 1)&&(($cur_tm-$_tm) > 0)) $x .= time_ago($_tm);
return $x."前";
} }
?> ?>
\ No newline at end of file
...@@ -160,6 +160,7 @@ ...@@ -160,6 +160,7 @@
} }
.news-item { .news-item {
border-bottom: 1px solid #f3f3f3; border-bottom: 1px solid #f3f3f3;
background-color: #fff;
} }
.news-item a.content { .news-item a.content {
position: relative; position: relative;
...@@ -296,7 +297,7 @@ ...@@ -296,7 +297,7 @@
} }
.portal-news-info { .portal-news-info {
padding: 10px 20px 20px 20px; padding: 10px 15px 20px;
font-size: 12px; font-size: 12px;
} }
.portal-news-info span { .portal-news-info span {
...@@ -315,6 +316,7 @@ ...@@ -315,6 +316,7 @@
.portal-course .img-item img{ .portal-course .img-item img{
width: 100%; width: 100%;
vertical-align: top; vertical-align: top;
border-radius: 6px;
} }
.hot-nav ul li a i { .hot-nav ul li a i {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment