Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
S
s_ibanshou
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
蒋林
s_ibanshou
Commits
c02be7b8
Commit
c02be7b8
authored
Aug 22, 2017
by
夏彬
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'origin/test' into test
parents
870657f1
d09047d6
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
45 additions
and
23 deletions
+45
-23
userfun.php
e/class/userfun.php
+42
-22
banshou.css
skin/default/css/banshou.css
+3
-1
No files found.
e/class/userfun.php
View file @
c02be7b8
...
...
@@ -12,37 +12,57 @@ function user_ibanshou($num)
$thread
=
Thread
::
getHotThreads
(
$num
);
$list
=
CourseList
::
getRecommendList
(
$num
);
$str
=
'<div class="learnning-course newest">
<div class="tit">推荐课程<span></span><a href="'
.
$config
[
'wxhpro'
][
'xue'
]
.
'/home/all-course">全部课程</a></div>
<div class="newest-list clearfix">'
;
$str
=
'<div clas=\"recommend-info\">'
;
foreach
(
$list
as
$val
)
{
$str
.=
"<div class=
\"
learn-course-box
\"
>
<div class=
\"
lc-img
\"
><a href=
\"
{
$val
[
'url'
]
}
\"
><img
src=
\"
{
$val
[
'preview_pic'
]
}
-ym.preview
\"
></a></div>
<h3><a href=
\"
{
$val
[
'url'
]
}
\"
>
{
$val
[
'name'
]
}
</a></h3>
<p><span>
{
$val
[
'favorite_count'
]
}
人已学</span><span>
{
$val
[
'comment_count'
]
}
人评论</span></p>
</div>"
;
$str
.=
"<div class=
\"
news-item portal-course
\"
>
<a href=
\"
{
$val
[
'url'
]
}
\"
class=
\"
content pb-none
\"
>
<div class=
\"
tit
\"
>
{
$val
[
'name'
]
}
</div>
<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>"
;
}
$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
)
{
$val
[
'image'
]
=
$val
[
'image'
]
?
:
'/skin/default/images/notimg.gif'
;
$str
.=
"<li>
<a href=
\"
{
$val
[
'url'
]
}
\"
>
<h3>
{
$val
[
'subject'
]
}
</h3>
<p>
{
$val
[
'views'
]
}
人已参与</p>
<img src=
\"
{
$val
[
'image'
]
}
\"
>
</a>
</li>"
;
$str
.=
"<div class=
\"
news-item has-pic one-picture
\"
>
<a href=
\"
{
$val
[
'url'
]
}
\"
class=
\"
content pb-none
\"
style=
\"
min-height: 80px;
\"
>
<div class=
\"
tit
\"
>
{
$val
[
'subject'
]
}
</div>
<div class=
\"
img-item-box clearfix
\"
>
<div class=
\"
img-item
\"
><img src=
\"
{
$val
[
'image'
]
}
\"
alt=
\"\"
></div>
</div>
</a>
<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
skin/default/css/banshou.css
View file @
c02be7b8
...
...
@@ -160,6 +160,7 @@
}
.news-item
{
border-bottom
:
1px
solid
#f3f3f3
;
background-color
:
#fff
;
}
.news-item
a
.content
{
position
:
relative
;
...
...
@@ -296,7 +297,7 @@
}
.portal-news-info
{
padding
:
10px
20px
20
px
20px
;
padding
:
10px
15
px
20px
;
font-size
:
12px
;
}
.portal-news-info
span
{
...
...
@@ -315,6 +316,7 @@
.portal-course
.img-item
img
{
width
:
100%
;
vertical-align
:
top
;
border-radius
:
6px
;
}
.hot-nav
ul
li
a
i
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment