不错呦!smile@林凯西,确保“准备文件”中的几个文件都有安装,S...您好,看了您这篇帖子觉得很有帮助。但是有个问题想请...我的修改过了怎么还被恶意注册呢 @jjjjiiii 用PJ快9年了,主要是A...PJ3啊,貌似很少有人用PJ了,现在不是WP就是z...@332347365,我当时接入时错误码没有-10...楼主,ChkValue值应为-103是什么意思呢?...大哥 你最近能看到我发的信息,请跟我联系,我有个制...
上一篇下一篇
编辑:dnawo 日期:2007-01-16
很多网站在新闻显示页底部都有提供上一篇下一篇的链接,这边我们写两个函数用以实现该功能:
'函数名:prevpage
'返回值:上一篇新闻的链接
'参数说明:
'id=当前新闻id值
'url=新闻详细页地址。格式:newsview.asp?id=
'itype=显示样式:
' 1:〖上一篇 下一篇〗;默认类型
' 2:〖上一篇:标题 下一篇:标题〗;
' 3:〖上一篇:标题
' 下一篇:标题〗
function prevpage(id,url,itype)
Dim temprs,sqlstr
Set temprs = Server.CreateObject("ADODB.RecordSet")
Sqlstr = "Select top 1 * from news1 where id<" & id & " order by id desc"
temprs.open sqlstr,conn,1,2
If temprs.bof then
If itype=1 then
prevpage = "没有了" & " "
Elseif itype=2 then
prevpage = "上一篇:没有了" & " "
Elseif itype=3 then
prevpage = "上一篇:没有了" & "<br />"
Else
prevpage = "没有了" & " "
End if
Else
If itype=1 then
prevpage = "<a href=""" & url & temprs("id") & """>上一篇</a>" & " "
Elseif itype=2 then
prevpage = "上一篇:<a href=""" & url & temprs("id") & """>" & temprs("title") & "</a>" & " "
Elseif itype=3 then
prevpage = "上一篇:<a href=""" & url & temprs("id") & """>" & temprs("title") & "</a>" & "<br />"
Else
prevpage = "<a href=""" & url & temprs("id") & """>上一篇</a>" & " "
End if
End if
temprs.close
set temprs = nothing
end function
'函数名:nextpage
'返回值:下一篇新闻的链接
'参数说明:
'id=当前新闻id值
'url=新闻详细页地址。格式:newsview.asp?id=
'itype=显示样式:
' 1:〖上一篇 下一篇〗;默认类型
' 2:〖上一篇:标题 下一篇:标题〗;
' 3:〖上一篇:标题
' 下一篇:标题〗
function nextpage(id,url,itype)
Dim temprs,sqlstr
Set temprs = Server.CreateObject("ADODB.RecordSet")
Sqlstr = "Select top 1 * from news1 where id>" & id & " order by id asc"
temprs.open sqlstr,conn,1,2
If temprs.eof then
If itype=1 then
nextpage = "没有了"
Elseif itype=2 then
nextpage = "下一篇:没有了"
Elseif itype=3 then
nextpage = "下一篇:没有了"
Else
nextpage = "没有了"
End if
Else
If itype=1 then
nextpage = "<a href=""" & url & temprs("id") & """>下一篇</a>"
Elseif itype=2 then
nextpage = "下一篇:<a href=""" & url & temprs("id") & """>" & temprs("title") & "</a>"
Elseif itype=3 then
nextpage = "下一篇:<a href=""" & url & temprs("id") & """>" & temprs("title") & "</a>"
Else
nextpage = "<a href=""" & url & temprs("id") & """>下一篇</a>"
End if
End if
temprs.close
set temprs = nothing
end function
'函数名:prevpage
'返回值:上一篇新闻的链接
'参数说明:
'id=当前新闻id值
'url=新闻详细页地址。格式:newsview.asp?id=
'itype=显示样式:
' 1:〖上一篇 下一篇〗;默认类型
' 2:〖上一篇:标题 下一篇:标题〗;
' 3:〖上一篇:标题
' 下一篇:标题〗
function prevpage(id,url,itype)
Dim temprs,sqlstr
Set temprs = Server.CreateObject("ADODB.RecordSet")
Sqlstr = "Select top 1 * from news1 where id<" & id & " order by id desc"
temprs.open sqlstr,conn,1,2
If temprs.bof then
If itype=1 then
prevpage = "没有了" & " "
Elseif itype=2 then
prevpage = "上一篇:没有了" & " "
Elseif itype=3 then
prevpage = "上一篇:没有了" & "<br />"
Else
prevpage = "没有了" & " "
End if
Else
If itype=1 then
prevpage = "<a href=""" & url & temprs("id") & """>上一篇</a>" & " "
Elseif itype=2 then
prevpage = "上一篇:<a href=""" & url & temprs("id") & """>" & temprs("title") & "</a>" & " "
Elseif itype=3 then
prevpage = "上一篇:<a href=""" & url & temprs("id") & """>" & temprs("title") & "</a>" & "<br />"
Else
prevpage = "<a href=""" & url & temprs("id") & """>上一篇</a>" & " "
End if
End if
temprs.close
set temprs = nothing
end function
'函数名:nextpage
'返回值:下一篇新闻的链接
'参数说明:
'id=当前新闻id值
'url=新闻详细页地址。格式:newsview.asp?id=
'itype=显示样式:
' 1:〖上一篇 下一篇〗;默认类型
' 2:〖上一篇:标题 下一篇:标题〗;
' 3:〖上一篇:标题
' 下一篇:标题〗
function nextpage(id,url,itype)
Dim temprs,sqlstr
Set temprs = Server.CreateObject("ADODB.RecordSet")
Sqlstr = "Select top 1 * from news1 where id>" & id & " order by id asc"
temprs.open sqlstr,conn,1,2
If temprs.eof then
If itype=1 then
nextpage = "没有了"
Elseif itype=2 then
nextpage = "下一篇:没有了"
Elseif itype=3 then
nextpage = "下一篇:没有了"
Else
nextpage = "没有了"
End if
Else
If itype=1 then
nextpage = "<a href=""" & url & temprs("id") & """>下一篇</a>"
Elseif itype=2 then
nextpage = "下一篇:<a href=""" & url & temprs("id") & """>" & temprs("title") & "</a>"
Elseif itype=3 then
nextpage = "下一篇:<a href=""" & url & temprs("id") & """>" & temprs("title") & "</a>"
Else
nextpage = "<a href=""" & url & temprs("id") & """>下一篇</a>"
End if
End if
temprs.close
set temprs = nothing
end function






评论: 1 | 引用: 0 | 查看次数: 5010
发表评论
请登录后再发表评论!