This is a SQL stored procedure script in China, which is a new version published in 2005.04.07. [Please don't pay it else]
- Storage process Name: DV_DISPBBS ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- -------------------------------------------------- -------
Create Procedure [DV_DISPBS] @BoardID INT = 1, @ Pagenow Int = 1, - Current Page Number @Pagesize Int = 1, - Defining Each Page Post Number @AnnounceTable NVARCHAR (10) = 'DV_BBS1 'with encryptionasset NoCount Onselect Announceid from [DV_BBS1] Where BoardId = @ BoardID and rootid = @ AnnounceId Order by AnnounceID
-------------------------------------------------- --------------------------------------------------
- Store process name: DV_List ----------------------------------------------------------- -------------------------------------------------- -------
Create Procedure [DV_LIST] @BoardID INT = 1, @ PageNow INT = 1, - Current Page @PageSize Int = 1, - Defining Each Page Post Number @TL INT = 0, - Query @topicMode Int by time = 0, - Topic @TotalRec Int OutputWith Encryption Asset NoClaim ONDECLARE @Int_topnum INTDECLARE @irc_timeNum INTDECLARE @var_times varchar (5000)
if @pagenow> 1 if @topicmode> 0 begin select @int_timenum = (@ pagenow-1) * @ pagesize set rowcount @int_timenum select @ var_times = lastposttime from Dv_Topic where boardID = @ boardID and istop = 0 and mode = @ topicmode ORDER By LastPostTime DESC
set rowcount @pagesize select TopicID, boardid, title, postusername, postuserid, dateandtime, child, hits, votetotal, lastpost, lastposttime, istop, isvote, isbest, locktopic, Expression, TopicMode, Mode, GetMoney, GetMoneyType, UseTools, IsSmsTopic from dv_topic where boardID = @ boardID and istop = 0 and mode = @ topicmode andlastposttime <@var_times ORDER BY lastposttime descset nocount off return end else begin select @int_timenum = (@ pagenow-1) * @ pagesize set rowcount @int_timenum select @ var_times = lastposttime From dv_topic where boardid = @ Boardid and iStop = 0 Order by LastPostTime DESC
set rowcount @pagesize select TopicID, boardid, title, postusername, postuserid, dateandtime, child, hits, votetotal, lastpost, lastposttime, istop, isvote, isbest, locktopic, Expression, TopicMode, Mode, GetMoney, GetMoneyType, UseTools, IsSmsTopic from dv_topic Where boardid = @ BoardID and istop = 0 and lastposttime <@var_times Order by LastPostTime DESC
Set NoCount Off Return End
else if @topicmode> 0 begin set rowcount @pagesize select TopicID, boardid, title, postusername, postuserid, dateandtime, child, hits, votetotal, lastpost, lastposttime, istop, isvote, isbest, locktopic, Expression, TopicMode, Mode, GetMoney, GetMoneyType, UseTools, IsSmsTopic from Dv_topic where boardID = @ boardid and istop = 0 and mode = @ topicmodeORDER BY lastposttime desc end else begin set rowcount @pagesize select TopicID, boardid, title, postusername, postuserid, dateandtime, child, hits, votetotal, lastpost, lastposttime, istop, isvote, isbest, locktopic, Expression, TopicMode, Mode, GetMoney, GetMoneyType, UseTools, IsSmsTopic from Dv_topicwhere boardID = @ boardid and istop = 0 ORDER BY lastposttime desc end ---------- -------------------------------------------------- ------------------------------------------ Store process name: DV_LOADSETUP --- -------------------------------------------------- -----------------------------------------------
Create Procedure [DV_LoadSetup] with encryptionasselect * from [DV_SetUp]
-------------------------------------------------- --------------------------------------------------
- Storage Procedure Name: DV_Toplist --------------------------------------------- -------------------------------------------------- -------
CREATE PROCEDURE [dv_toplist] @pagenow int, @ pagesize int, @ reture_value int output, @ intUserRecordCount int outputwith encryptionas / * define local variables * / declare @intBeginID intdeclare @intEndID intdeclare @intPageCount intdeclare @intRowCount int
/ * Close count * / set nocount on
/ * Number of general users * / select @intuserRecordCount = count (*) from [dv_user] if (@intuserRecordCount = 0) - If there is no user, return zero set @reture_value = 0 / * Decision page Number * / IF (@PAGENOW - 1) * @PageSize> @intuserRecordCountSet @reture_value = 1 - RETURN (-1) / * Question USERID * / set @introwcount = (@PAGENOW - 1) * @PageSize 1 / * Limit Bar Number * / set rowcount @introwcountselect @INTBEGINID = Userid from [DV_USER] Order by Userid DESC
/ * End Userid * / set @introwcount = @PAGEnow * @ Pagesize / * Restrictions * / set rowcount @introwcountselect @intendid = userid from [DV_USER] Order by UserID DESC
/ * Restore system variable * / set rowcount 0set nocount off
select username, useremail, userclass, UserIM, UserPost, JoinDate, userwealth, userid from [dv_user] where userid between @intEndID and @intBeginID order by userid descreturn (@@ rowcount) - select @@ rowcount
-------------------------------------------------- --------------------------------------------------
The following talk about this new version of the script difference between this new version
1. Delete the original DV_TSQL, add the DV_DISPBBS process.
2, in Dv_List process, there are four TopicID, boardid, title, postusername, postuserid, dateandtime, child, hits, votetotal, lastpost, lastposttime, istop, isvote, isbest, locktopic, Expression, TopicMode, Mode, GetMoney, GetMoneyType, UseTools Issmstopic from red is new.