kingcms 修改浏览次数 修改阅读次数 增加浏览、阅读次数 方法
修改浏览次数 admin/../index.asp sub king_edt()
SQL里加一条 arthit(查看下数据库里浏览量的字段名)
sub king_edt()下几行的
sql="arttitle,artcontent,artfrom,artauthor,artup,artshow,artcommend,arthead,artgrade,artkeywords,artdescription,artpath,artimg,listids"'13
改成sql="arttitle,artcontent,artfrom,artauthor,artup,artshow,artcommend,arthead,artgrade,artkeywords,artdescription,artpath,artimg,listids,arthit"'14
找到类似
if king.ismethod or len(artid)=0 then
dataform=split(sql,",")
redim data(ubound(dataform),0)
for i=0 to ubound(dataform)
data(i,0)=form(dataform(i))
next
if king.ismethod then
pagelistnumber=form("pagelistnumber")
else
data(5,0)=1
data(11,0)=art.lang("common/pinyin")
end if
else
改成
if king.ismethod or len(artid)=0 then
dataform=split(sql,",")
redim data(ubound(dataform),0)
for i=0 to ubound(dataform)
data(i,0)=form(dataform(i))
next
if king.ismethod then
pagelistnumber=form("pagelistnumber")
else
data(5,0)=1
data(11,0)=art.lang("common/pinyin")
data(14,0)=0 '数字14为SQL中的字段个数减1 比如有15个字段 就是14
end if
else
找到类似这个
'artauthor
Il "<p><label>"&art.lang("label/author")&"</label><input maxlength=""100"" type=""text"" name=""artauthor"" id=""artauthor"" value="""&formencode(data(3,0))&""" class=""in3"" />"
Il king.form_eval("artauthor",art.lang("label/authornone"))
Il king.form_eval("artauthor",king.name)
if len(artauthor)>0 then
Il king.form_eval("artauthor",artauthor)
end if
Il king.check("artauthor|6|"&encode(art.lang("check/author"))&"|1-100")&"</p>"
在这下边加一段
'arthit
Il "<p><label>"&art.lang("label/hit")&"</label><input maxlength=""100"" type=""text"" name=""arthit"" id=""arthit"" value="""&(data(14,0))&""" class=""in3"" />"
Il king.check("arthit|0|"&encode(art.lang("check/hit")))
Il king.check("arthit|2|"&encode(art.lang("check/hit1")))&"</p>"
之后找到 类似这段
'Insert Update
if len(artid)>0 then
conn.execute "update kingart set arttitle='"&safe(data(0,0))&"',artcontent='"&safe(data(1,0))&"',artfrom='"&safe(data(2,0))&"',artauthor='"&safe(data(3,0))&"',artup="&safe(data(4,0))&",artshow="&safe(data(5,0))&",artcommend="&safe(data(6,0))&",arthead="&safe(data(7,0))&",artgrade="&safe(data(8,0))&",artpath='"&safe(data(11,0))&"',artimg='"&safe(data(12,0))&"',listids='"&safe(data(13,0))&"',listid="&listid&",artdescription='"&safe(artdescription)&"',artkeywords='"&safe(artkeywords)&"' where artid="&artid&";"
else
conn.execute "insert into kingart ("&sql&",artdate,artorder,listid) values ('"&safe(data(0,0))&"','"&safe(data(1,0))&"','"&safe(data(2,0))&"','"&safe(data(3,0))&"',"&safe(data(4,0))&","&safe(data(5,0))&","&safe(data(6,0))&","&safe(data(7,0))&","&safe(data(8,0))&",'"&safe(artkeywords)&"','"&safe(artdescription)&"','"&safe(data(11,0))&"','"&safe(data(12,0))&"','"&safe(data(13,0))&"','"&tnow&"',"&king.neworder("kingart","artorder")&","&listid&")"
artid=king.newid("kingart","artid")
art.createmap
end if
改成
'Insert Update
if len(artid)>0 then
conn.execute "update kingart set arttitle='"&safe(data(0,0))&"',artcontent='"&safe(data(1,0))&"',artfrom='"&safe(data(2,0))&"',artauthor='"&safe(data(3,0))&"',arthit='"&safe(data(14,0))&"',artup="&safe(data(4,0))&",artshow="&safe(data(5,0))&",artcommend="&safe(data(6,0))&",arthead="&safe(data(7,0))&",artgrade="&safe(data(8,0))&",artpath='"&safe(data(11,0))&"',artimg='"&safe(data(12,0))&"',listids='"&safe(data(13,0))&"',listid="&listid&",artdescription='"&safe(artdescription)&"',artkeywords='"&safe(artkeywords)&"' where artid="&artid&";"
else
conn.execute "insert into kingart ("&sql&",artdate,artorder,listid) values ('"&safe(data(0,0))&"','"&safe(data(1,0))&"','"&safe(data(2,0))&"','"&safe(data(3,0))&"',"&safe(data(4,0))&","&safe(data(5,0))&","&safe(data(6,0))&","&safe(data(7,0))&","&safe(data(8,0))&",'"&safe(artkeywords)&"','"&safe(artdescription)&"','"&safe(data(11,0))&"','"&safe(data(12,0))&"','"&safe(data(13,0))&"','"&safe(data(14,0))&"','"&tnow&"',"&king.neworder("kingart","artorder")&","&listid&")"
artid=king.newid("kingart","artid")
art.createmap
end if
这块要注意一下 if中的可以插进arthit='"&safe(data(14,0))&"' 这个就行不用考虑顺序 而elase中就得考虑sql中的字段顺序了'"&safe(data(14,0))&"' 位置不能错
之后修改page/Article/language/zh-cn.xml
<label>下 加入<hit>浏览量</hit>
<check>下 加入<hit>浏览量不能为空</hit> <hit1>浏览量必须为正整数</hit1>
介绍KingCMS知识的几个网站链接
1、真实记录
http://hi.baidu.com/351net/blog/category/Kingcms
2、空空如也
http://www.7es.cn/kingcms/kingcms.shtml
3、kingcms5.0入门和使用常见问题解答收集
http://bbs.kingcms.com/thread-568-1-1.html
4、KingCMS与SEO-搜索引擎营销