Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
鹿
鹿马108官网
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
xieyishang
鹿马108官网
Commits
7351a028
Commit
7351a028
authored
Feb 29, 2024
by
xieyishang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
11~
parent
8754d17a
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
31 additions
and
7 deletions
+31
-7
application/index/controller/Index.php
application/index/controller/Index.php
+27
-3
application/index/view/index/news.html
application/index/view/index/news.html
+3
-3
application/index/view/index/newsdataile.html
application/index/view/index/newsdataile.html
+1
-1
No files found.
application/index/controller/Index.php
View file @
7351a028
...
...
@@ -103,13 +103,23 @@ class Index extends Frontend
public
function
news
(){
$reuurl
=
request
()
->
url
();
$reuurl
=
substr
(
$reuurl
,
6
);
//var_dump($reuurl);die;
$cateid
=
0
;
$domain
=
strstr
(
$reuurl
,
'.html'
);
//是否待了.html
if
(
$domain
){
$reuurl
=
substr
(
$reuurl
,
0
,
strrpos
(
$reuurl
,
".html"
));
}
$domain1
=
strstr
(
$reuurl
,
'-'
);
if
(
$domain1
){
$cateid
=
substr
(
$reuurl
,
strripos
(
$reuurl
,
"-"
)
+
1
);
//分类id
$reuurl
=
substr
(
$reuurl
,
0
,
strrpos
(
$reuurl
,
"-"
));
//文章id
}
if
(
is_numeric
(
$reuurl
)){
//是数字
}
else
{
//不是数字
$reuurl
=
1
;
}
$page
=
$reuurl
;
$page
=
$page
-
1
;
$pagesize
=
5
;
...
...
@@ -131,16 +141,30 @@ class Index extends Frontend
//新闻详情
public
function
newsdataile
(){
// $reuurl = request()->url();
// $newsid = substr($reuurl,13);
// if(is_numeric($newsid)){
// //是数字
// }else{
// //不是数字
// $newsid = 1;
// }
// var_dump($newsid);die;
$reuurl
=
request
()
->
url
();
$newsid
=
substr
(
$reuurl
,
13
);
$domain
=
strstr
(
$newsid
,
'.html'
);
//是否待了.html
if
(
$domain
){
$newsid
=
substr
(
$newsid
,
0
,
strrpos
(
$newsid
,
".html"
));
}
if
(
is_numeric
(
$newsid
)){
//是数字
}
else
{
//不是数字
$newsid
=
1
;
}
// var_dump($newsid);die;
$need_field
=
[
'news_id'
,
'keywords'
,
'description'
,
'news_img'
,
'news_title'
,
'news_comtent'
,
'news_view'
,
'news_sort'
,
'secondary_title'
,
'FROM_UNIXTIME(news_createtime,"%Y-%m-%d") as news_createtime'
];
$detaile
=
Db
::
name
(
'news'
)
->
field
(
$need_field
)
->
where
(
'news_id'
,
$newsid
)
->
select
();
if
(
count
(
$detaile
)
!=
0
){
...
...
application/index/view/index/news.html
View file @
7351a028
...
...
@@ -40,7 +40,7 @@
{foreach $newslist as $key=>$vo }
<div
class=
"container"
>
<a
href=
"{$_SERVER [ 'REQUEST_SCHEME' ]. '://' . $_SERVER [ 'SERVER_NAME' ]}/newsdataile/{$vo.news_id}"
class=
"newsitems"
>
<a
href=
"{$_SERVER [ 'REQUEST_SCHEME' ]. '://' . $_SERVER [ 'SERVER_NAME' ]}/newsdataile/{$vo.news_id}
.html
"
class=
"newsitems"
>
<div
class=
"row"
>
<div
class=
"newsitems_left col-xl-3 col-lg-3 col-md-4 col-sm-5 col-12"
>
<img
src=
"__CDN__{$vo.news_img}"
alt=
""
>
...
...
@@ -89,9 +89,9 @@
for
(
var
i
=
0
;
i
<
pagecount
;
i
++
){
if
((
thispage
-
5
)
<
i
){
if
((
i
+
1
)
==
thispage
){
pagehtml
+=
`<li class="page-item active"><a class="page-link" href="/news/
${
i
+
1
}
">
${
i
+
1
}
</a></li>`
;
pagehtml
+=
`<li class="page-item active"><a class="page-link" href="/news/
${
i
+
1
}
.html
">
${
i
+
1
}
</a></li>`
;
}
else
{
pagehtml
+=
`<li class="page-item"><a class="page-link" href="/news/
${
i
+
1
}
">
${
i
+
1
}
</a></li>`
;
pagehtml
+=
`<li class="page-item"><a class="page-link" href="/news/
${
i
+
1
}
.html
">
${
i
+
1
}
</a></li>`
;
}
}
if
(
i
>
thispage
+
3
){
...
...
application/index/view/index/newsdataile.html
View file @
7351a028
...
...
@@ -38,7 +38,7 @@
<nav
aria-label=
"breadcrumb"
>
<ol
class=
"breadcrumb"
>
<li
class=
"breadcrumb-item"
><a
href=
"javascript:;"
>
当前位置
</a></li>
<li
class=
"breadcrumb-item"
><a
href=
"/news/1"
>
新闻中心
</a></li>
<li
class=
"breadcrumb-item"
><a
href=
"/news/1
.html
"
>
新闻中心
</a></li>
<li
class=
"breadcrumb-item active"
aria-current=
"page"
>
正文
</li>
</ol>
</nav>
...
...
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