Discuz 论坛 版主回复后在帖子列表后加版主回复字样
2012-07-19 18:07
507 查看
找到 存储过程 dnt_gettopiclist
BEGIN
SET @strSQL = 'SELECT TOP ' + STR(@pagesize) +' [rate],a.[tid],[iconid],[typeid],[title],b.tailtitle,[price],[hide],[readperm],
[special],[poster],[posterid],[replies],[views],[postdatetime],[lastpost],[lastposter],
[lastpostid],[lastposterid],[replies],[highlight],[digest],[displayorder],[attachment],[closed],[magic],[special] FROM
[dnt_topics] a left join #a b on a.tid=b.tid WHERE [fid]=' +STR(@fid) + ' AND [displayorder]=0 ORDER BY [lastpostid] DESC'
END
ELSE
BEGIN
SET @strSQL = 'SELECT TOP ' + STR(@pagesize) +'[rate], a.[tid],[iconid],[typeid],[title],b.tailtitle,[price],[hide],[readperm],
[special],[poster],[posterid],[replies],[views],[postdatetime],[lastpost],[lastposter],
[lastpostid],[lastposterid],[replies],[highlight],[digest],[displayorder],[attachment],[closed],[magic],[special] FROM
[dnt_topics] a left join #a b on a.tid=b.tid WHERE [lastpostid] < (SELECT min([lastpostid]) FROM (SELECT TOP ' + STR
((@pageindex-1)*@pagesize-@startnum) + ' [lastpostid] FROM [dnt_topics] WHERE [fid]=' +STR
(@fid) + ' AND [displayorder]=0 ORDER BY [lastpostid] DESC) AS tblTmp )
AND [fid]=' +STR(@fid) + ' AND [displayorder]=0 ORDER BY [lastpostid] DESC'
END
print @strSQL
EXEC(@strSQL)
ALTER PROCEDURE [dbo].[dnt_gettopiclist] @fid int, @pagesize int, @startnum int, @pageindex int AS DECLARE @strSQL varchar(5000) if object_id('tempdb..#a') is not null drop table #a --创建临时表 select distinct a.tid,'<font color=red>版主回复</font>' tailtitle into #a from dnt_posts1 a,dnt_users b where a.posterid=b.uid and a.fid=@fid and b.groupid<=3--用户组别<=3的 --之后topics 与临时表#a 再做左连接就可以实现了IF @pageindex = 1
BEGIN
SET @strSQL = 'SELECT TOP ' + STR(@pagesize) +' [rate],a.[tid],[iconid],[typeid],[title],b.tailtitle,[price],[hide],[readperm],
[special],[poster],[posterid],[replies],[views],[postdatetime],[lastpost],[lastposter],
[lastpostid],[lastposterid],[replies],[highlight],[digest],[displayorder],[attachment],[closed],[magic],[special] FROM
[dnt_topics] a left join #a b on a.tid=b.tid WHERE [fid]=' +STR(@fid) + ' AND [displayorder]=0 ORDER BY [lastpostid] DESC'
END
ELSE
BEGIN
SET @strSQL = 'SELECT TOP ' + STR(@pagesize) +'[rate], a.[tid],[iconid],[typeid],[title],b.tailtitle,[price],[hide],[readperm],
[special],[poster],[posterid],[replies],[views],[postdatetime],[lastpost],[lastposter],
[lastpostid],[lastposterid],[replies],[highlight],[digest],[displayorder],[attachment],[closed],[magic],[special] FROM
[dnt_topics] a left join #a b on a.tid=b.tid WHERE [lastpostid] < (SELECT min([lastpostid]) FROM (SELECT TOP ' + STR
((@pageindex-1)*@pagesize-@startnum) + ' [lastpostid] FROM [dnt_topics] WHERE [fid]=' +STR
(@fid) + ' AND [displayorder]=0 ORDER BY [lastpostid] DESC) AS tblTmp )
AND [fid]=' +STR(@fid) + ' AND [displayorder]=0 ORDER BY [lastpostid] DESC'
END
print @strSQL
EXEC(@strSQL)
相关文章推荐
- discuz论坛主题帖子列表页面的最后回复人的url改成id形式的伪静态
- discuz 只刪除帖子列表的快速发帖,不刪除帖子内的快速回复
- 学习Discuz! X3.2记录:自定义论坛帖子字段,在门户中显示帖子列表
- discuz论坛中的游客回复中,出现游客回复后,内容插入数据库,但是不显示
- 【转载】解决浏览器和discuz7.0论坛不兼容的方法,解决快捷回复弹出下载窗口的问题
- 论坛帖子放js代码不让混淆功能影响js运行的方式,如discuz的管理员调用其它数据到帖子中
- Discuz!X论坛开发(三)二次开发 教你识别程序目录和文件列表for discuzx!1--NO.2
- destoon调用discuz论坛中带图片帖子的实现方法
- Discuz X3.2 论坛关闭后,MySQL帖子导出为.csv
- DISCUZ论坛中如何设置列表文章显示的条数呢?
- Discuz!NT版本论坛帖子调用
- Discuz!X论坛开发(四)二次开发 教你识别程序目录和文件列表for discuzx!1--NO.3
- 学习Discuz! X3.2记录:快速回复插件,通过js使选择的下拉列表填充到回帖内容中
- 给Discuz X论坛帖子的外部链接增加nofollow属性
- 使用ClientSocket控件实现CSDN论坛帖子的自动回复(修改)
- discuz 6.0 添加 版主已回复
- Discuz!X论坛开发(五)二次开发 教你识别程序目录和文件列表for discuzx!1--NO.4
- destoon调用discuz论坛中带图片帖子的实现方法
- 获取CSDN论坛帖子列表
- Discuz!论坛教程之去掉帖子列表页的附件图标的方法