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
521c85e5
Commit
521c85e5
authored
Mar 13, 2018
by
汪波
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'origin/test' into test
parents
c3196443
27327f4a
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
64 additions
and
17 deletions
+64
-17
userfun.php
e/class/userfun.php
+52
-17
indexloginstatus.php
e/member/login/indexloginstatus.php
+12
-0
No files found.
e/class/userfun.php
View file @
521c85e5
...
@@ -5,20 +5,49 @@ use internalApi\xue\CourseList;
...
@@ -5,20 +5,49 @@ use internalApi\xue\CourseList;
function
user_ibanshou
(
$num
)
function
user_ibanshou
(
$num
)
{
{
require
__DIR__
.
'/../extend/internalApi/autoload.php'
;
require
__DIR__
.
'/../extend/internalApi/autoload.php'
;
require
__DIR__
.
'/../config/config_ibanshou.php'
;
require
__DIR__
.
'/../config/config_ibanshou.php'
;
\internalApi\base\Client
::
config
(
$config
[
'wxh.internal'
][
'client'
]);
\internalApi\base\Client
::
config
(
$config
[
'wxh.internal'
][
'client'
]);
$thread
=
Thread
::
getHotThreads
(
$num
);
$thread
=
Thread
::
getHotThreads
(
$num
);
$list
=
CourseList
::
getRecommendList
(
$num
);
$list
=
CourseList
::
getRecommendList
(
$num
);
$str
=
'<div clas=\"recommend-info\">'
;
$str
=
'<div clas=\"recommend-info\">'
;
foreach
(
$list
as
$val
)
{
foreach
(
$list
as
$val
)
{
//自适应 http, https
//自适应 http, https
$val
[
'url'
]
=
str_replace
(
'http://'
,
'//'
,
$val
[
'url'
]);
$val
[
'url'
]
=
str_replace
(
'http://'
,
'//'
,
$val
[
'url'
]);
if
(
$val
[
'homework'
]
==
4
)
{
if
(
$val
[
'liveStatus'
]
==
0
)
{
$str
.=
<<<EOD
<div class="tuan-list">
<a href="{$val['url']}">
<img src="{$val['preview_pic']}-ym.preview\">
<h3>{$val['name']}</h3>
<p class="clearfix">
<span class="price">{$val['liveReservationNum']}<b>人已预约</b></span>
<span class="go-buy-btn">预约报名<i class="iconfont icon-xiangyou1"></i></span>
</p>
</a>
</div>
EOD;
$str
.=
<<<EOD
}
else
{
$str
.=
<<<EOD
<div class="tuan-list">
<a href="{$val['url']}">
<img src="{$val['preview_pic']}-ym.preview\">
<h3>{$val['name']}</h3>
<p class="clearfix">
<span class="price">{$val['liveWatchNum']}<b>人观看中</b></span>
<span class="go-buy-btn">正在直播<i class="iconfont icon-xiangyou1"></i></span>
</p>
</a>
</div>
EOD;
}
}
else
{
$str
.=
<<<EOD
<div class=\"news-item portal-course\">
<div class=\"news-item portal-course\">
<a href=\"{$val['url']}\" class=\"content pb-none\">
<a href=\"{$val['url']}\" class=\"content pb-none\">
<div class=\"tit\">{$val['name']}</div>
<div class=\"tit\">{$val['name']}</div>
...
@@ -33,14 +62,16 @@ function user_ibanshou($num)
...
@@ -33,14 +62,16 @@ function user_ibanshou($num)
</div>
</div>
</div>
</div>
EOD;
EOD;
}
}
}
foreach
(
$thread
as
$val
)
{
foreach
(
$thread
as
$val
)
{
//自适应 http, https
//自适应 http, https
$val
[
'image'
]
=
$val
[
'image'
]
?
str_replace
(
'http://'
,
'//'
,
$val
[
'image'
])
:
'/skin/default/images/notimg.gif'
;
$val
[
'image'
]
=
$val
[
'image'
]
?
str_replace
(
'http://'
,
'//'
,
$val
[
'image'
])
:
'/skin/default/images/notimg.gif'
;
$val
[
'url'
]
=
str_replace
(
'http://'
,
'//'
,
$val
[
'url'
]);
$val
[
'url'
]
=
str_replace
(
'http://'
,
'//'
,
$val
[
'url'
]);
$str
.=
<<<EOD
$str
.=
<<<EOD
<div class=\"news-item has-pic one-picture\">
<div class=\"news-item has-pic one-picture\">
<a href=\"{$val['url']}\" class=\"content pb-none\" style=\"min-height: 80px;\">
<a href=\"{$val['url']}\" class=\"content pb-none\" style=\"min-height: 80px;\">
<div class=\"tit\">{$val['subject']}</div>
<div class=\"tit\">{$val['subject']}</div>
...
@@ -60,17 +91,21 @@ EOD;
...
@@ -60,17 +91,21 @@ EOD;
echo
$str
.
'</div>'
;
echo
$str
.
'</div>'
;
}
}
function
user_ago
(
$tm
,
$rcs
=
0
)
{
function
user_ago
(
$tm
,
$rcs
=
0
)
$cur_tm
=
time
();
$dif
=
$cur_tm
-
$tm
;
{
$pds
=
array
(
'秒'
,
'分钟'
,
'小时'
,
'天'
,
'周'
,
'个月'
,
'年'
);
$cur_tm
=
time
();
$lngh
=
array
(
1
,
60
,
3600
,
86400
,
604800
,
2630880
,
31570560
);
$dif
=
$cur_tm
-
$tm
;
for
(
$v
=
sizeof
(
$lngh
)
-
1
;
(
$v
>=
0
)
&&
((
$no
=
$dif
/
$lngh
[
$v
])
<=
1
);
$v
--
);
if
(
$v
<
0
)
$v
=
0
;
$_tm
=
$cur_tm
-
(
$dif
%
$lngh
[
$v
]);
$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
);
$no
=
floor
(
$no
);
//if($no <> 1) $pds[$v] .='s'; //+s
//if($no <> 1) $pds[$v] .='s'; //+s
$x
=
sprintf
(
"%d %s"
,
$no
,
$pds
[
$v
]);
$x
=
sprintf
(
"%d %s"
,
$no
,
$pds
[
$v
]);
if
((
$rcs
==
1
)
&&
(
$v
>=
1
)
&&
((
$cur_tm
-
$_tm
)
>
0
))
$x
.=
time_ago
(
$_tm
);
if
((
$rcs
==
1
)
&&
(
$v
>=
1
)
&&
((
$cur_tm
-
$_tm
)
>
0
))
$x
.=
time_ago
(
$_tm
);
return
$x
.
"前"
;
return
$x
.
"前"
;
}
}
?>
?>
\ No newline at end of file
e/member/login/indexloginstatus.php
0 → 100644
View file @
521c85e5
<?php
require
(
"../../class/connect.php"
);
$iscas
=
getcvar
(
'mlcas'
);
?>
<?php
if
(
!
$iscas
)
{
?>
$(function(){
console.log($(".books").attr('href'));
$(".books").attr("href", "/e/member/login");
console.log($(".books").attr('href'));
});
<?php
}
?>
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