免費論壇 繁體 | 簡體
Sclub交友聊天~加入聊天室當版主
分享

30、批量删除未审核通过的帖子和主题

  1. delete from cdb_threads  where displayorder=-2;
  2. delete from cdb_posts  where invisible=-2;
复制
您所在的用户组只能看到部分内容.
如查看全部内容, 请先登录或者注册.
点评
B Color Smilies

您还可以输入:个字符
X

X

TOP

31、批量关闭投票

  1. UPDATE cdb_threads SET closed = 1 WHERE special=1
复制
您所在的用户组只能看到部分内容.
如查看全部内容, 请先登录或者注册.
点评
B Color Smilies

您还可以输入:个字符
X

X

TOP

32、清空用户安全问答!

  1. UPDATE `cdb_members` SET `secques` = ''
复制
您所在的用户组只能看到部分内容.
如查看全部内容, 请先登录或者注册.
点评
B Color Smilies

您还可以输入:个字符
X

X

TOP

33、清空某个用户组的全部积分sql:

  1. update cdb_members set credits = 0, extcredits1 = 0, extcredits2 = 0, extcredits3 = 0, extcredits4 = 0, extcredits5 = 0, extcredits6 = 0, extcredits7 = 0, extcredits8 = 0, where groupid = 用户组id;
复制
您所在的用户组只能看到部分内容.
如查看全部内容, 请先登录或者注册.
点评
B Color Smilies

您还可以输入:个字符
X

X

TOP

34、修改05年11月29日21点33份20秒 前的主题阅读权限100

  1. update cdb_threads set readperm=100 where dateline<1133300000
复制
其中1133300000 是unix时间戳 (以秒为单位) 代表 05年11月29日21点33份20秒   
readperm=100 代表阅读权限
您所在的用户组只能看到部分内容.
如查看全部内容, 请先登录或者注册.
点评
B Color Smilies

您还可以输入:个字符
X

X

TOP

35、把2005年1月1日以前的阅读权限设高.

  1. update cdb_threads set readperm=100 where dateline<1104537600 and digest=0
复制
您所在的用户组只能看到部分内容.
如查看全部内容, 请先登录或者注册.
点评
B Color Smilies

您还可以输入:个字符
X

X

TOP

剩下的受不了了

批量替换帖子里面的评分者的用户名
  1. update cdb_ratelog set uid = '新uid', username = '新username' where uid = '旧的 uid';
复制
所有的附件默认阅读权限为1
  1. update cdb_attachments set readperm=1
复制
统计发帖量大约0的所有用户积分1的总量


    SELECT count(`extcredits1`) FROM `cdb_members` where `posts`=0
[/code]
批量修改uid1~6会员的 showemail 为 1
  1. upDATE `cdb_members` SET `showemail` ='1' WHERE `uid` in(1,2,3,4,5,6);
复制
将主题tid大于14651的所有主题减去16761780
  1. update cdb_threads set tid=tid-16761780 where tid>14651;
  2.     [code]update cdb_posts set tid=tid-16761780 where tid>14651;
  3.     [code]update cdb_attachments set tid=tid-16761780 where tid>14651;
  4.     [code]update cdb_myposts set tid=tid-16761780 where tid>14651;
  5.     [code]update cdb_activities set tid=tid-16761780 where tid>14651;
  6.     [code]update cdb_activityapplies set tid=tid-16761780 where tid>14651;
  7.     [code]update cdb_favorites set tid=tid-16761780 where tid>14651;
  8.     [code]update cdb_mythreads set tid=tid-16761780 where tid>14651;
  9.     [code]update cdb_paymentlog set tid=tid-16761780 where tid>14651;
  10.     [code]update cdb_polloptions set tid=tid-16761780 where tid>14651;
  11.     [code]update cdb_polls set tid=tid-16761780 where tid>14651;
  12.     [code]update cdb_pushedthreads set tid=tid-16761780 where tid>14651;
  13.     [code]update cdb_relatedthreads set tid=tid-16761780 where tid>14651;
  14.     [code]update cdb_rewardlog set tid=tid-16761780 where tid>14651;
  15.     [code]update cdb_rsscaches set tid=tid-16761780 where tid>14651;
  16.     [code]update cdb_sessions set tid=tid-16761780 where tid>14651;
  17.     [code]update cdb_subscriptions set tid=tid-16761780 where tid>14651;
  18.     [code]update cdb_threadsmod set tid=tid-16761780 where tid>14651;
  19.     [code]update cdb_tradelog set tid=tid-16761780 where tid>14651;
  20.     [code]update cdb_trades set tid=tid-16761780 where tid>14651;
复制
此操作前请注意备份!!(按照5.0数据表进行修改的  6.0的需要查看下数据库对比下)


将积分1加到积分2上  并清零积分1的sql
  1. update cdb_members set extcredits1=extcredits1+extcredits2;
  2. update cdb_members set extcredits1='0';
复制
把300天未登录的ID移到某一特殊用户组
  1. update cdb_members set adminid=-1,groupid=特殊用户组ID where  lastactivity< unix_timestamp()-300*24*3600
复制
服务器上禁止IP访问命令
  1. iptables -I INPUT -p TCP -s 218.0.211.0/24 --dport 80 -j DROP
复制
查一个IP有哪个会员登录
  1.   select * from cdb_membsers where lastip="IP"
复制
  1. upDATE cdb_posts p, cdb_attachments a SET p.attachment=1 WHERE p.pid=a.pid;
复制
找回丢失附件的sql语句


更新昨日发贴数
昨日发贴数:
  1.   select count(*) from cdb_posts where   dateline>昨天0时的时间戳 and     dateline<今天0时的时间戳
复制
更新昨日发贴数:
  1. upDATE `cdb_settings` SET `value` = '昨日发帖数\t1428' WHERE `variable` ='historyposts' LIMIT 1 ;
复制
把"新手上路"用户组下的所有会员转换到另一个特殊的用户组
pl:特殊用户组没有关联任何的管理组
  1. update cdb_members set groupid=特殊用户组的id where groupid=新手上路用户组的id and adminid=0
复制
删除一个板块的所有回复
  1.   delete from cdb_posts where fid = '需要删除回复的版块id' and first = 0;
复制
  1.   delete from cdb_forums where fid=23 limit 1;
复制
删除fid23的板块


圈子sgid字段缺少 添加的sql
  1. ALTER TABLE cdb_threads ADD sgid mediumint(8) unsigned NOT NULL default '0'
复制
  1. update cdb_threads set replies=(select count(*) from cdb_posts where tid=47708) where tid=47708
复制
更新tid27708主题的统计


关闭所有板块的允许其它模块共享
  1. update cdb_forums set allowshare=0
复制
  1. upDATE `cdb_memberfields` SET `sightml` = ' '
复制
所有用户的签名清空
  1. upDATE cdb_posts SET subject=REPLACE(subject,'#','楼');
复制
批量替换帖子中的回复* #的显示为 *楼



删除一个主题的所有回复
  1.   delete from cdb_posts where tid = '需要删除回复的主题的tid' and first = 0;
复制
  1. upDATE `cdb_settings` SET `value` = '1' WHERE CONVERT( `variable` USING utf8 ) = 'thumbstatus' LIMIT 1 ;
复制
设置缩略图为     为图片附件添加缩略图
  1. upDATE `cdb_settings` SET `value` = '2' WHERE CONVERT( `variable` USING utf8 ) = 'thumbstatus' LIMIT 1 ;
复制
设置缩略图为     将图片附件缩到指定的大小


批量验证所有未验证的会员
  1. upDATE `cdb_members` SET `gro[code]upid` = '10' WHERE gro[code]upid='8';
复制
批量删除游客回帖和主题
  1.     delete from cdb_threads where authorid=0;
  2.     delete from cdb_posts where authorid=0;
复制
删除在180天之前的全部短消息
  1.     delete from cdb_pms where dateline<1190518730
复制
清空某个用户的已发短消息
  1. update cdb_pms set delstatus=1 where msgfromid=发送者ID
复制
所有用户组(包括系统用户组,普通用户组,特殊用户组)都可以参与投票的SQL语句:
  1. update cdb_usergro[code]ups set allowvote=1 where gro[code]upid<4 or gro[code]upid>9
复制
  1. upDATE `cdb_usergro[code]ups` SET `raterange` = '1\t-1\t1\t100\n2\t-1\t1\t100'
复制
开启所有用户组的扩展积分1和2的评分值为 最小-1 最大1 24小时100



图片附件设置正确 但是不直接显示的调整sql:
  1. update cdb_attachments set `isimage` =1 where SUBSTRING(`filename`,-3,3)='jpg' or SUBSTRING(`filename`,-3,3)='gif'
复制
固定天数内一部份附件到远程附件的sql
  1. update cdb_attachments set remote = '1' where dateline<unix_timestamp()-86400*天数
复制
修改所有用户组评分的SQL语句
  1. update `cdb_usergro[code]ups` set `raterange`='扩展积分ID\t评分最小值\t评分最大值\t24小时最大评分数\n扩展积分ID\t评分最小值\t评分最大值\t24小时最大评分数'
复制
将主题tid大于4009的所有主题减去16773200
  1. update cdb_activities set tid=tid-16773200 where tid>4009;
  2.     [code]update cdb_activityapplies set tid=tid-16773200 where tid>4009;
  3.     [code]update cdb_attachments set tid=tid-16773200 where tid>4009;
  4.     [code]update cdb_campaigns set tid=tid-16773200 where tid>4009;
  5.     [code]update cdb_debateposts set tid=tid-16773200 where tid>4009;
  6.     [code]update cdb_debates set tid=tid-16773200 where tid>4009;
  7.     [code]update cdb_favorites set tid=tid-16773200 where tid>4009;
  8.     [code]update cdb_forumrecommend set tid=tid-16773200 where tid>4009;
  9.     [code]update cdb_myposts set tid=tid-16773200 where tid>4009;
  10.     [code]update cdb_mythreads set tid=tid-16773200 where tid>4009;
  11.     [code]update cdb_paymentlog set tid=tid-16773200 where tid>4009;
  12.     [code]update cdb_polloptions set tid=tid-16773200 where tid>4009;
  13.     [code]update cdb_polls set tid=tid-16773200 where tid>4009;
  14.     [code]update cdb_posts set tid=tid-16773200 where tid>4009;
  15.     [code]update cdb_relatedthreads set tid=tid-16773200 where tid>4009;
  16.     [code]update cdb_rewardlog set tid=tid-16773200 where tid>4009;
  17.     [code]update cdb_rsscaches set tid=tid-16773200 where tid>4009;
  18.     [code]update cdb_sessions set tid=tid-16773200 where tid>4009;
  19.     [code]update cdb_subscriptions set tid=tid-16773200 where tid>4009;
  20.     [code]update cdb_threads set tid=tid-16773200 where tid>4009;
  21.     [code]update cdb_threadsmod set tid=tid-16773200 where tid>4009;
  22.     [code]update cdb_threadtags set tid=tid-16773200 where tid>4009;
  23.     [code]update cdb_tradelog set tid=tid-16773200 where tid>4009;
  24.     [code]update cdb_trades set tid=tid-16773200 where tid>4009;
  25.     [code]update cdb_typeoptionvars set tid=tid-16773200 where tid>4009;
  26.     [code]update cdb_videos set tid=tid-16773200 where tid>4009;
  27.     [code]update cdb_videotags set tid=tid-16773200 where tid>4009;
  28.     如果安装了s[code]upesite  有了推送主题表还加上:
  29.     [code]update cdb_pushedthreads set tid=tid-16773200 where tid>4009;
复制
以上sql为6.0版本



批量替换论坛标题内容
  1. upDATE `cdb_threads` SET `subject` = replace (`subject`,'需要替换的','替换后的')
复制
  1. upDATE `cdb_attachments` SET `thumb` = '0'
复制
取消所有附件的缩略图数据
  1. upDATE `cdb_threads` SET `highlight` = '0'
复制
取消全部帖子的高亮显示


论坛里所有回复长度小于20的而且没有附件的贴子全部删除掉


    delete from cdb_posts where length(message)<20 and attachment=0
[/code]
查询ftp上的附件是否在数据库内
phpmyadmin中 执行sql:


    select * from cdb_attachments where attachment like "%文件名称%"
[/code]
一次性给一个贴内的所有回帖人加积分
  1. update cdb_members set extcredits2=extcredits2+10  where uid in(SELECT authorid FROM `cdb_posts` WHERE tid=主题ID)
  2.     extcredits2  是需要增加的积分字段 , 使用的时候要注意增加的哪个积分字段
复制
truncate cdb_validating
[/code]
清空用户审核数据表
  1. upDATE `cdb_members` SET `oltime` = '0'
复制
所有用户的在线时间修改为0

把体积大于 819200kb的附件指定为远程附件
  1. update cdb_attachments set remote = '1' WHERE filesize > 819200

  2.     ALTER TABLE `cdb_threads` CHANGE `tid` `tid` MEDIUMINT(8) UNSIGNED NOT NULL AUTO_INCREMENT;
复制
您所在的用户组只能看到部分内容.
如查看全部内容, 请先登录或者注册.
点评
B Color Smilies

您还可以输入:个字符
X

X

TOP

 

B Color Image Link Quote Code Smilies
高级模式 | 发新话题

您需要登录后才可以回帖 登录|立即注册

快速
返回顶部
返回首页