Discuz 采集帖子后,分散作者,时间

有些Discuz站长为了丰富站点内容,会从其它站点抓取帖子。比如使用火车头程序等。这样做会有两个问题,发布的时间十分接近,发布作者一样。导致浏览站点的人一看便知,数据是从别处抓取的。为了分散时间与作者,在采集完数据后,可在数据库中执行下列SQL,可将数据分散。 //将指定人的帖子时间分散,authorid=2是 uid=2的用户 update `yhw_forum_thread` set dateline=(1284744665+ROUND(RAND() *1000000000)%97701546) WHERE authorid=2; update `yhw_forum_thread` set lastpost=dateline WHERE authorid=2; //将指定人的帖子的作者分散,authorid=2是 uid=2的用户 update yhw_forum_thread set `authorid` = ROUND(RAND() *10000)%(select max(uid) from yhw_common_member) where authorid=2; //下面这句是将不在用户表中的authorid,重新生成。要反复执行多次,直到反更新的条目为0, update yhw_forum_thread set `authorid` = ROUND(RAND() *10000)%(select max(uid) from yhw_common_member) WHERE `authorid` not in (select uid from yhw_common_member); //根据authorid重新生成author和lastposter update `yhw_forum_thread` set author=(select username from yhw_common_member where uid=authorid), lastposter=(select username from yhw_common_member where uid=authorid); //更新forum_post,使author、authorid、dateline与forum_thread一致 update `yhw_forum_post` p set author=(select author from `yhw_forum_thread` t where t.tid=p.tid), authorid=(select authorid from `yhw_forum_thread` t where t.tid=p.tid), dateline=(select dateline from `yhw_forum_thread` t where t.tid=p.tid);