给内容页的上一篇文章还有下一篇文章加上图片连接(2)_动易Cms教程
'作 用:显示下一篇文章
'参 数:TitleLen ----标题最多字符数,一个汉字=两个英文字符
'=================================================
Private Function GetNextArticle(TitleLen)
Dim rsNext, sqlNext, strNext,picurl
strNext = Replace(XmlText_Class("ShowArticle/NextArticle_Link", "<li>下一{$ItemUnit}: "), "{$ItemUnit}", ChannelItemUnit & ChannelShortName)
sqlNext = "Select Top 1 ArticleID,DefaultPicUrl,Title,Author,UpdateTime,Hits,InfoPurview,InfoPoint from PE_Article Where ChannelID=" & ChannelID & " and Deleted=" & PE_False & " and Status=3 and ReceiveType=0 and ClassID=" & rsArticle("ClassID") & " and ArticleID>" & rsArticle("ArticleID") & " order by ArticleID ASC"
Set rsNext = Conn.Execute(sqlNext)
If TitleLen < 0 Or TitleLen > 255 Then TitleLen = 50
If rsNext.EOF Then
strNext = strNext & XmlText_Class("ShowArticle/NoNextArticle", "没有了")
Else
If Instr(rsNext("DefaultPicUrl"),".") then
picurl="/"&ChannelDir&"/"&UploadDir&"/"&rsNext("DefaultPicUrl")
else
picurl=SiteUrl&"images/nopic.gif"
end if
strNext = strNext & "<br><a class='LinkNextArticle' href='" & GetArticleUrl(ParentDir, ClassDir, rsNext("UpdateTime"), rsNext("ArticleID"), ClassPurview, rsNext("InfoPurview"), rsNext("InfoPoint")) & "'"
strNext = strNext & " title='" & Replace(Replace(Replace(Replace(strList_Title, "{$Title}", rsNext("Title")), "{$Author}", rsNext("Author")), "{$UpdateTime}", rsNext("UpdateTime")), "{$br}", vbCrLf) & "'><img src='"& picurl&"'border=0></a><br><a class='LinkNextArticle' href='" & GetArticleUrl(ParentDir, ClassDir, rsNext("UpdateTime"), rsNext("ArticleID"), ClassPurview, rsNext("InfoPurview"), rsNext("InfoPoint")) & "'"
strNext = strNext & " title='" & Replace(Replace(Replace(Replace(strList_Title, "{$Title}", rsNext("Title")), "{$Author}", rsNext("Author")), "{$UpdateTime}", rsNext("UpdateTime")), "{$br}", vbCrLf) & "'>" & GetSubStr(rsNext("Title"), TitleLen, ShowSuspensionPoints) & "</a>"
End If
rsNext.Close
Set rsNext = Nothing
strNext = strNext & "</li>"
GetNextArticle = strNext
End Function
2.稍微改一下模板的调用代码,比如改成下列代码
<table>
<tr>
<td width=300>{$PrevArticle}</td>
<td width=300>{$NextArticle}</td>
</tr>
</table>
- MAC错误的解决方法
- 如何屏蔽动易后台导航里的某个功能菜单?
- 动易.NET版本留言自动选定栏目方法
- 动易SiteFactoty整合Discuz!NT3.0
- 在任意位置获取根节点ID标签
- 如何开启SiteWeaver6.8的支持,反对功能
- Windows 2008安装动易.NET系统之四----动易系统安装篇
- Windows 2008安装动易.NET系统之三----数据库篇
- Windows 2008安装动易.NET系统之二----IIS、目录环境配置篇
- 数据库修复,SQL Server 2005内部操作不一致的处理
- 如何安装动易.net程序权限配置
- 为什么提示对Windows系统文件夹下的Temp目录没有访问权限?
- 相关链接:
- 教程说明:
动易Cms教程-给内容页的上一篇文章还有下一篇文章加上图片连接(2)。