Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
C
cms_sys
Project
Project
Details
Activity
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
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
西魏
cms_sys
Commits
47568e22
Commit
47568e22
authored
Mar 04, 2019
by
sunxin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
分页
parent
b033abee
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
32 additions
and
22 deletions
+32
-22
4.6.5-to-4.7.0-mysql.sql
doc/4.6.5-to-4.7.0-mysql.sql
+0
-0
db-mcms-mysql-4.7.0.sql
doc/db-mcms-mysql-4.7.0.sql
+0
-0
SearchAction.java
src/main/java/net/mingsoft/cms/action/web/SearchAction.java
+8
-6
IArticleDao.xml
src/main/java/net/mingsoft/cms/dao/IArticleDao.xml
+2
-0
CmsParserUtil.java
src/main/java/net/mingsoft/cms/util/CmsParserUtil.java
+18
-12
news-list.htm
src/main/webapp/templets/1/default/news-list.htm
+2
-2
news-show.htm
src/main/webapp/templets/1/default/news-show.htm
+1
-1
search.htm
src/main/webapp/templets/1/default/search.htm
+1
-1
No files found.
doc/4.6.5-to-4.7.0-mysql.sql
View file @
47568e22
This diff is collapsed.
Click to expand it.
doc/db-mcms-mysql-4.7.0.sql
View file @
47568e22
This source diff could not be displayed because it is too large. You can
view the blob
instead.
src/main/java/net/mingsoft/cms/action/web/SearchAction.java
View file @
47568e22
...
...
@@ -174,15 +174,17 @@ public class SearchAction extends BaseAction {
map
.
put
(
ParserUtil
.
PAGE_NO
,
BasicUtil
.
getInt
(
ParserUtil
.
PAGE_NO
,
1
));
@SuppressWarnings
(
"unused"
)
int
pageNo
=
(
int
)
map
.
get
(
ParserUtil
.
PAGE_NO
);
int
next
,
pre
;
if
(
StringUtil
.
isBlank
(
pageNo
)){
next
=
2
;
int
next
,
pre
;
if
(
StringUtil
.
isBlank
(
pageNo
)
||
pageNo
==
1
){
//如果总页数等于1,下一页就是第一页,不等于就有第二页
next
=
1
==
total
?
total
:
2
;
pre
=
1
;
}
else
{
next
=
pageNo
+
1
;
pre
=
pageNo
==
1
?
1
:
pageNo
+
1
;
next
=
pageNo
==
total
?
total
:
pageNo
+
1
;
pre
=
pageNo
-
1
==
0
?
1
:
pageNo
-
1
;
}
String
url
=
BasicUtil
.
getUrl
()
+
request
.
getServletPath
()
+
"?"
+
BasicUtil
.
assemblyRequestUrlParams
(
ParserUtil
.
PAGE_NO
.
split
(
""
));
String
str
=
ParserUtil
.
PAGE_NO
+
","
;
String
url
=
BasicUtil
.
getUrl
()
+
request
.
getServletPath
()
+
"?"
+
BasicUtil
.
assemblyRequestUrlParams
(
str
.
split
(
","
));
String
pageNoStr
=
"&"
+
ParserUtil
.
PAGE_NO
+
"="
;
//下一页
String
nextUrl
=
url
+
pageNoStr
+
next
;
...
...
src/main/java/net/mingsoft/cms/dao/IArticleDao.xml
View file @
47568e22
...
...
@@ -52,6 +52,8 @@
<result
column=
"column_path"
property=
"columnPath"
/>
<result
column=
"column_url"
property=
"columnUrl"
/>
<result
column=
"category_title"
property=
"categoryTitle"
/>
<result
column=
"column_category_id"
property=
"categoryId"
/>
<!-- 与Category类别类绑定ID -->
<result
column=
"category_parent_id"
property=
"categoryParentId"
/>
<!-- 关联表category的父类型编号 -->
<result
column=
"category_id"
property=
"categoryId"
/>
<result
column=
"COLUMN_CM_ID"
property=
"columnContentModelId"
/>
<result
column=
"COLUMN_TYPE"
property=
"columnType"
/>
...
...
src/main/java/net/mingsoft/cms/util/CmsParserUtil.java
View file @
47568e22
...
...
@@ -45,16 +45,12 @@ public class CmsParserUtil extends ParserUtil {
public
static
void
generate
(
String
templatePath
,
String
targetPath
)
throws
IOException
{
Map
<
String
,
Object
>
map
=
new
HashMap
<
String
,
Object
>();
map
.
put
(
IS_DO
,
false
);
boolean
mobileStyle
=
false
;
String
content
=
CmsParserUtil
.
generate
(
templatePath
,
map
,
mobileStyle
);
String
content
=
CmsParserUtil
.
generate
(
templatePath
,
map
,
false
);
FileUtil
.
writeString
(
content
,
ParserUtil
.
buildHtmlPath
(
targetPath
),
Const
.
UTF8
);
//判断是否有移动端 不能将这个判断放在上面,会出现PC端一直是移动端的内容
if
(!
StringUtil
.
isBlank
(
BasicUtil
.
getApp
().
getAppMobileStyle
()))
{
mobileStyle
=
true
;
}
// 生成移动页面
if
(
mobileStyle
)
{
if
(
ParserUtil
.
isMobile
(
templatePath
)
)
{
// 手机端m
map
.
put
(
ParserUtil
.
MOBILE
,
BasicUtil
.
getApp
().
getAppMobileStyle
());
content
=
CmsParserUtil
.
generate
(
templatePath
,
map
,
true
);
...
...
@@ -109,6 +105,11 @@ public class CmsParserUtil extends ParserUtil {
parserParams
.
put
(
RCOUNT
,
pageSize
);
parserParams
.
put
(
TYPE_ID
,
column
.
getCategoryId
());
parserParams
.
put
(
IS_DO
,
false
);
parserParams
.
put
(
HTML
,
HTML
);
//如果单站点,就废弃站点地址
if
(
ParserUtil
.
IS_SINGLE
)
{
parserParams
.
put
(
ParserUtil
.
URL
,
BasicUtil
.
getUrl
());
}
if
(
i
==
0
)
{
// 数据库中第一页是从开始0*size
// 首页路径index.html
...
...
@@ -131,7 +132,7 @@ public class CmsParserUtil extends ParserUtil {
FileUtil
.
writeString
(
tag
.
rendering
(),
columnListPath
,
Const
.
UTF8
);
// 判断是手机端生成还是pc端,防止重复生成
if
(
ObjectUtil
.
isNotNull
(
BasicUtil
.
getApp
().
getAppMobileStyle
()))
{
if
(
ParserUtil
.
isMobile
(
column
.
getColumnListUrl
()))
{
writer
=
new
StringWriter
();
mobileTemplate
.
process
(
null
,
writer
);
tag
=
new
TagParser
(
writer
.
toString
(),
parserParams
);
...
...
@@ -215,20 +216,25 @@ public class CmsParserUtil extends ParserUtil {
parserParams
.
put
(
ID
,
articleId
);
// 第一篇文章没有上一篇
if
(
ai
>
0
)
{
parserParams
.
put
(
PRE_ID
,
articleIdList
.
get
(
ai
-
1
).
getArticleId
());
ColumnArticleIdBean
preCaBean
=
articleIdList
.
get
(
ai
-
1
);
if
(
articleIdList
.
get
(
ai
).
getColumnPath
().
contains
(
preCaBean
.
getCategoryId
()+
""
)){
parserParams
.
put
(
PRE_ID
,
preCaBean
.
getArticleId
());
}
}
// 最后一篇文章没有下一篇
if
(
ai
+
1
<
articleIdList
.
size
())
{
parserParams
.
put
(
NEXT_ID
,
articleIdList
.
get
(
ai
+
1
).
getArticleId
());
ColumnArticleIdBean
nextCaBean
=
articleIdList
.
get
(
ai
+
1
);
if
(
articleIdList
.
get
(
ai
).
getColumnPath
().
contains
(
nextCaBean
.
getCategoryId
()+
""
)){
parserParams
.
put
(
NEXT_ID
,
nextCaBean
.
getArticleId
());
}
}
parserParams
.
put
(
IS_DO
,
false
);
String
content
=
CmsParserUtil
.
generate
(
articleIdList
.
get
(
ai
).
getColumnUrl
(),
parserParams
,
false
);
FileUtil
.
writeString
(
content
,
writePath
,
Const
.
UTF8
);
// 手机端
if
(
StringUtils
.
isNotEmpty
(
BasicUtil
.
getApp
().
getAppMobileStyle
()
))
{
if
(
ParserUtil
.
isMobile
(
columnUrl
))
{
writePath
=
ParserUtil
.
buildMobileHtmlPath
(
articleColumnPath
+
File
.
separator
+
articleId
);
//如果是封面就生成index.html
if
(
articleIdList
.
get
(
ai
).
getColumnType
()
==
ColumnTypeEnum
.
COLUMN_TYPE_COVER
.
toInt
())
{
...
...
src/main/webapp/templets/1/default/news-list.htm
View file @
47568e22
...
...
@@ -21,12 +21,12 @@
<div
class=
"ms-content-main-div"
>
<ul
class=
"ms-content-main-ul"
>
{ms:arclist size=
20 ispaging=true
}
{ms:arclist size=
10 ispaging=true
}
<li>
<a
href=
"{ms:global.url/}[field.link/]"
>
<!-- <span class="ms-content-main-li-span">·</span> -->
<span
class=
"ms-content-main-li-title"
>
[field.title/]
</span>
<span
class=
"ms-content-main-li-time"
>
[field.date?string("yyyy-
mm
-dd")/]
</span>
<span
class=
"ms-content-main-li-time"
>
[field.date?string("yyyy-
MM
-dd")/]
</span>
</a>
</li>
{/ms:arclist}
...
...
src/main/webapp/templets/1/default/news-show.htm
View file @
47568e22
...
...
@@ -30,7 +30,7 @@
<div
class=
"ms-content-right-main-icon-source"
>
来源:{ms:field.source/}
<span
class=
"ms-content-right-vertical"
>
|
</span>
</div>
<div
class=
"ms-content-right-main-icon-time"
>
时间:{ms:field.date?string("yyyy-
mm
-dd")/}
</div>
<div
class=
"ms-content-right-main-icon-time"
>
时间:{ms:field.date?string("yyyy-
MM
-dd")/}
</div>
</div>
<div
class=
"ms-content-icon-right"
>
<div
class=
"ms-content-right-main-icon-clicks"
></div>
...
...
src/main/webapp/templets/1/default/search.htm
View file @
47568e22
...
...
@@ -16,7 +16,7 @@
<!-- 共7个结果 -->
</div>
<ul
class=
"ms-content-main-ul"
>
{ms:arclist size=
3
ispaging=true}
{ms:arclist size=
10
ispaging=true}
<li>
<a
href=
"{ms:global.url/}/[field.link/]"
>
[field.title/]
...
...
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