1、实现文章模块的一键生成;同时其他自定义模块也可以这样实现
从后台目录admin/Article/index.asp的第555行开始,代码如下
case"createpage"
if len(list)>0 then
'重新获取listid,将子栏目包括进去,by何苦,在根列表点击下拉-生成列表及文章,可以实现包含子分类在内的模块文章一键生成.
set rs=conn.execute("select listid from kingart_list where listid in (" & list & ") or listid1 in (" & list & ");")
list = ""
if not rs.eof and not rs.bof then
data = rs.getrows()
for i=0 to ubound(data,2)
if len(list)>0 then
list = list & "," & data(0, i)
else
list = data(0,i)
end if
next
end if
rs.close
set rs = nothing
'------以上是加的,文章模块可以实现一键生成的代码
set rs=conn.execute("select artid from kingart where listid in ("&list&");")
if not rs.eof and not rs.bof then
把注释中间的代码是添加进去即可。
结果:在文章管理的根目录下,全选,点击下拉菜单中的 生成列表及文章,即可实现文章模块所有文件的一键生成.
2、kingCMS文章模块,分页功能默认打勾方法 根据实际情况修改(查询 '默认分页 )修改,已做注释
-----------------------------------------------------
打开\admin\Article下的 index.asp文件
修改两个地方:
第一个:修改分页字数,默认是2000,查找代码654行:pagelistnumber=2000
修改成你想要的参数: pagelistnumber=300
第二个:修改自动分行默认打勾选:在代码796行
if cstr(form("pagelist"))="1" then checked=" checked=""checked""" else checked=""
修改成:
if cstr(form("pagelist"))="1" or cstr(form("pagelist"))="" then checked=" checked=""checked""" else checked=""
3、单页面的调用 注:where onepath like '%page%' 是判断onepath中是否包含page,
这是建立单页路径的时候指定的路径名的一部分
---------------------------------------------------
{king:sql cmd="select top 10 * from kingonepage where onepath like '%page%' order by oneid desc;"}
<a href="../../(king:onepath/)">(king:onetitle/)</a>
{/king}
4、一级栏目列表调用下级文章修改法
原文:http://www.cgboke.com/kingcms/2008_10_23_101440259.htm
因数据库结构问题,只修改到支持两级。
一、打开/page/article/fun.asp
二、搜索到public sub createlist(l1)
把public sub createlist(l1)
......
end sub这个函数替换成如下代码:(就是两个 ' *** Copyright © KingCMS.com All Rights Reserved. *** 之间)
---------------------------------------------------------------
public sub createlist(l1)
dim tmphtm,outhtm
dim tmphtmlist,tmplist
dim jshtm,jsnumber,zebra
dim rs,irs,i,j,data,datalist,pid,plist,pidcount,length,datalista,datalistb'pidcount 总页数
dim sql,suij,suijpagelist
dim jsorder,listid,listpath,listname
if len(l1)=0 then exit sub
sql="listid,listname,listpath,listtemplate1,listtemplate2,listtitle,listkeyword,listdescription"'7 datalist
set rs=conn.execute("select "&sql&" from kingart_list where listid in ("&l1&");")
if not rs.eof and not rs.bof then
datalist=rs.getrows()
else
redim datalist(0,-1)
end if
rs.close
set rs=nothing
sql="artid,listid,arttitle,artfrom,artdescription,artdate,artkeywords,artauthor,artpath,artimg,artgrade,artcontent"'10 data
for j=0 to ubound(datalist,2)
set rs=conn.execute("select listid,listid1 from kingart_list where list&king_ext,outhtm
end if
rs.close
set rs=nothing
next
end sub