以文本方式查看主题

-  堕落街论坛  (http://duoluojie.1314179.com.cn:443/index.asp)
--  灌水乐园  (http://duoluojie.1314179.com.cn:443/list.asp?boardid=29)
----  继续灌水!(有人看的懂没)  (http://duoluojie.1314179.com.cn:443/dispbbs.asp?boardid=29&id=163757)

--  作者:天下云
--  发布时间:2007/4/7 9:47:00
--  继续灌水!(有人看的懂没)

use bbsDB

go


set nocount on

print \'---->>>>>>>各位大虾注意了,本论坛即将发布年度无记名评奖<<<<<<<<----\'

--评估总体人气:如果论坛总点击率>1000,人气较旺

if(select sum(SclickCount)from bbsSection)>1000
 begin
  print \'论坛人气年度评估:熊旺旺,大家辛苦了!\'
 end
else
 begin
  print \'论坛人气年度评估:一般般,大家加油啊!\'
 end

--评选品牌版块和倒胃版块:主贴数量最多和最少的版块

print \'年度品牌版块:\'

select 版块名称=Sname,主贴数量=StopicCount,简介=Sprofile from bbsSection where StopicCount=(select max(StopicCount) from bbsSection)


print \'年度倒胃版块:\'

select 版块名称=Sname,主贴数量=StopicCount,简介=Sprofile from bbsSection where StopicCount=(select min(StopicCount) from bbsSection)

--评选回帖人气最旺的前两名作者

print \'年度回帖人气最in的前两名获奖作者:\'

select 大名=Uname,星级=Uclass from bbsUsers where UID in (select top 2 TuID from bbsTopic order by TclickCount desc)


--评选最差版主:如果存在发贴量为0或者点击率低于500的版块,则评选最差版主
if exists (select * from bbsSection where StopicCount = 0 or SclickCount<=500)
 begin
  print \'请下列版块的斑竹加油哦!\'
  
  select 版块名称=Sname,主贴数量=StopicCount,点击率=SclickCount from bbsSection
   where StopicCount=0 or SclickCount<=500
 end

/*--发主贴:
心酸果冻在.NET技术版块发贴:
怯怯的问:什么是.NET啊?
微软的.NET广告超过半个北京城啊...
--*/


declare @userID varchar(10),@sID int   --存放用户编号和版块编号

select @userID=UID from bbsUsers where Uname=\'心酸果冻\'

select @sID=SID from bbsSection where Sname like \'%.NET技术%\'

--发贴
insert into bbsTopic(TsID,TuID,Tface,Ttopic,Tcontents)
 values(@sID,@userID,3,\'什么是.NET啊?\',\'我靠!微软的.NET广告超过半个北京城啊...\')

--更新版块表,主贴数+1
update bbsSection set StopicCount = StopicCount+1 where SID = @sID


--更新用户积分
if not exists (select * from bbsTopic where Ttopic like \'什么是.NET啊?\' and TuID<>@userID)
 update bbsUsers set Upoint = Upoint+100 where UID = @userID
else
 update bbsUsers set Upoint = Upoint+50 where UID = @userID

--更新用户级别

update bbsUsers set Uclass = case
    when Upoint <500 then 1
    when Upoint between 500 and 1000 then 2
    when Upoint between 1001 and 2000 then 3
    when Upoint between 2001 and 4000 then 4
    when Upoint between 4001 and 5000 then 5
    else 6
         end
  where UID = @userID


--对外发布

select 发贴作者=\'心酸果冻\',发贴时间=convert(varchar(10),Ttime,111),主题=Ttopic,内容=Tcontents from bbsTopic where TID=@@identity


--显示目前的最新排名

select 昵称=Uname,星级=case
   when Uclass=0 then \' \'
   when Uclass=1 then \'★\'
   when Uclass=2 then \'★★\'
   when Uclass=3 then \'★★★\'
   when Uclass=4 then \'★★★★\'
   when Uclass=5 then \'★★★★★\' 
   else             \'★★★★★★\'
        end
 ,积分=Upoint from bbsUsers


go


--  作者:●.Кid
--  发布时间:2007/4/7 9:50:00
--  

冒味.


--  作者:天下云
--  发布时间:2007/4/7 9:52:00
--  
你懂???
--  作者:●.Кid
--  发布时间:2007/4/7 9:55:00
--  

没看.


--  作者:天下云
--  发布时间:2007/4/7 9:58:00
--  
以下是引用●.Кid在2007-4-7 9:55:00的发言:

没看.

伤心...我知道这太专业了

但是你也看的懂 中文撒