--不返回语句运行的计数信息
set nocount on 

update webinfo set follow='0'
GO
if not exists(select * from sitepara where pcode='mdays')
insert into sitepara (ptype,pcode,pvalue,pseq,pnote) values('sys','mdays','30','1','监控周期（天）')
GO
if not exists(select * from sitepara where pcode='mcount')
insert into sitepara (ptype,pcode,pvalue,pseq,pnote) values('sys','mcount','20','2','每周期内发文标准（篇）')
GO
if not exists(select * from sitepara where pcode='SSOType')
insert into sitepara (ptype,pcode,pvalue,pseq,pnote) values('SSO','SSOType','1','30','基础平台类型')
GO
if not exists(select * from sitepara where pcode='ServiceUrl')
insert into sitepara (ptype,pcode,pvalue,pseq,pnote) values('SSO','ServiceUrl','','31','基础平台服务地址')
GO
if not exists(select * from sitepara where pcode='PassportUrl')
insert into sitepara (ptype,pcode,pvalue,pseq,pnote) values('SSO','PassportUrl','','32','Passport验证地址')
GO
if not exists(select * from sitepara where pcode='MemberUrl')
insert into sitepara (ptype,pcode,pvalue,pseq,pnote) values('SSO','MemberUrl','','33','Member地址')
GO
if not exists(select * from sitepara where pcode='OfficeUrl')
insert into sitepara (ptype,pcode,pvalue,pseq,pnote) values('SSO','OfficeUrl','','34','验证成功后跳转地址')
GO
if not exists(select * from sitepara where pcode='ServerId')
insert into sitepara (ptype,pcode,pvalue,pseq,pnote) values('SSO','ServerId','','35','服务ID')
GO
if not exists(select * from sitepara where pcode='ServerKey')
insert into sitepara (ptype,pcode,pvalue,pseq,pnote) values('SSO','ServerKey','','36','服务KEY')
GO
if not exists(select * from sitepara where pcode='WebUrl')
insert into sitepara (ptype,pcode,pvalue,pseq,pnote) values('SSO','WebUrl','','37','用户请求访问的地址')
GO
if not exists(select * from sitepara where pcode='Root')
insert into sitepara (ptype,pcode,pvalue,pseq,pnote) values('SSO','Root','','38','root参数')
GO
if not exists(select * from sitepara where pcode='Control')
insert into sitepara (ptype,pcode,pvalue,pseq,pnote) values('SSO','Control','0','39','开启基础平台控制')
GO
if not exists(select * from sitepara where pcode='PassportSel')
insert into sitepara (ptype,pcode,pvalue,pseq,pnote) values('SSO','PassportSel','0','40','启用Passport登录')
GO
if not exists(select * from sitepara where pcode='smtphost')
insert into sitepara (ptype,pcode,pvalue,pseq,pnote) values('SMTP','smtphost','smtp.zdsoft.net','58','SMTP服务器地址')
GO
if not exists(select * from sitepara where pcode='smtpname')
insert into sitepara (ptype,pcode,pvalue,pseq,pnote) values('SMTP','smtpname','zdsoft@zdsoft.net','59','SMTP服务器身份认证账号')
GO
if not exists(select * from sitepara where pcode='smtppwd')
insert into sitepara (ptype,pcode,pvalue,pseq,pnote) values('SMTP','smtppwd','M9BKxRzTKx7IwaXfnxSYtw','60','SMTP服务器身份认证密码')
GO
if not exists(select * from sitepara where pcode='smtpadress')
insert into sitepara (ptype,pcode,pvalue,pseq,pnote) values('SMTP','smtpadress','zdsoft@zdsoft.net','61','发信人邮件地址')
GO
if not exists(select * from sitepara where pcode='smtpfrom')
insert into sitepara (ptype,pcode,pvalue,pseq,pnote) values('SMTP','smtpfrom','浙大万朋','62','发信人显示的名称')
GO
if not exists(select * from sitepara where pcode='picSize')
insert into sitepara (ptype,pcode,pvalue,pseq,pnote) values('uploadFiles','picSize','0','96','图片上传大小限制')
GO
if not exists(select * from sitepara where pcode='flashSize')
insert into sitepara (ptype,pcode,pvalue,pseq,pnote) values('uploadFiles','flashSize','0','97','flash上传大小限制')
GO
if not exists(select * from sitepara where pcode='mediaSize')
insert into sitepara (ptype,pcode,pvalue,pseq,pnote) values('uploadFiles','mediaSize','0','98','媒体文件上传大小限制')
GO
if not exists(select * from sitepara where pcode='otherSize')
insert into sitepara (ptype,pcode,pvalue,pseq,pnote) values('uploadFiles','otherSize','0','99','其他文件上传大小限制')
GO
if not exists(select * from sitepara where pcode='picType')
insert into sitepara (ptype,pcode,pvalue,pseq,pnote) values('uploadFiles','picType','gif|jpg|jpeg|bmp|png|ico|tif','100','图片格式')
GO
if not exists(select * from sitepara where pcode='flashType')
insert into sitepara (ptype,pcode,pvalue,pseq,pnote) values('uploadFiles','flashType','swf','101','Flash格式')
GO
if not exists(select * from sitepara where pcode='mediaType')
insert into sitepara (ptype,pcode,pvalue,pseq,pnote) values('uploadFiles','mediaType','rm|mp3|wav|mid|midi|ra|avi|wma','102','媒体格式')
GO
if not exists(select * from sitepara where pcode='otherType')
insert into sitepara (ptype,pcode,pvalue,pseq,pnote) values('uploadFiles','otherType','rar|zip|exe|doc|xls|chm|hlp|wps|ppt|xlsx','103','其它格式')
GO
if not exists(select * from sitepara where pcode='UserPwdRank')
insert into sitepara (ptype,pcode,pvalue,pseq,pnote) values('uploadFiles','UserPwdRank','1','87','普通用户密码等级设置')
GO

--增加v7.0.0.16818版本数据接口
if not exists(select * from siteDataex where mcode='pv' and versionid='v7.0.0.16818')
insert into siteDataex (mcode,mname,sql,parameter,versionid) values('pv','访问量','select SUM([time]) as pv from stat','dt1,datetime|dt2,datetime','v7.0.0.16818')
GO
if not exists(select * from siteDataex where mcode='pwdlevel' and versionid='v7.0.0.16818')
insert into siteDataex (mcode,mname,sql,parameter,versionid) values('pwdlevel','管理员密码等级','select (select count(*) from users where pkid>0 and pwdlevel = 3 and manageAll = 0) as user_high ,(select count(*) from users where pkid>0 and pwdlevel = 2 and manageAll = 0) as user_middle ,(select count(*) from users where pkid>0 and pwdlevel = 1 and manageAll = 0) as user_low ,(select count(*) from users where pkid>0 and (pwdlevel is null or pwdlevel<1) and manageAll = 0) as user_unknown,(select count(*) from users where pkid>0 and pwdlevel = 3 and manageAll > 0) as admin_high ,(select count(*) from users where pkid>0 and pwdlevel = 2 and manageAll > 0) as admin_middle ,(select count(*) from users where pkid>0 and pwdlevel = 1 and manageAll > 0) as admin_low,(select count(*) from users where pkid>0 and (pwdlevel is null or pwdlevel<1) and manageAll > 0) as admin_unknown','','v7.0.0.16818')
GO
if not exists(select * from siteDataex where mcode='colpublish' and versionid='v7.0.0.16818')
insert into siteDataex (mcode,mname,sql,parameter,versionid) values('colpublish','栏目发文量','select count(n.pkid) as colpublish from news N, bigclass B, users U Where N.bigclassId=B.pkId and N.usersId = U.pkId and N.updatetime >=@dt1 and N.updatetime <=@dt2','dt1,datetime|dt2,datetime','v7.0.0.16818')
GO
if not exists(select * from siteDataex where mcode='coltotal' and versionid='v7.0.0.16818')
insert into siteDataex (mcode,mname,sql,parameter,versionid) values('coltotal','栏目活跃度','select B.name as classname, count(N.pkId) as classnum from news N join bigclass B on N.bigclassId=B.pkId and N.updatetime >=@dt1 and N.updatetime <=@dt2 group by B.name order by classnum desc','dt1,datetime|dt2,datetime','v7.0.0.16818')
GO

--返回语句运行的计数信息
set nocount off 