donglun7151 2014-01-14 14:18
浏览 68

没有php的PHPBB3大规模用户删除

At the moment I have a serious problem, over a couple of days forum-spammers have breached my phpbb3 forum and posted so many topics and posts that it is just too much for the ACP mass-prune feature to handle (it always gets out of memory and I can't give it more).

So, I was wondering, is their a way to delete these users and posts from the database itself so I don't need any php interaction? Or a phpbb user prune function written in Perl/Python that can run over time?

I've searched the web and every website just says "use the ACP" but at the moment that is not possible for me.

  • 写回答

1条回答 默认 最新

  • douzi7890 2014-01-14 15:55
    关注

    A semi-manual way to do this is to go to each spam user's profile, select Administer User and then at the bottom of the Overview (the default) page, select Delete Posts. This will delete that specific user and all of their associated topics. This is the recommended way.

    Another option is to reduce the criteria on your prune user page. Set smaller date windows, set more specific post criteria, etc.

    If the above don't work, this topic also points out a couple very dangerous queries that may be helpful, but it only removes topics that don't have associated users. This is likely the case if you ran your query and it timed out. A portion of the query ran.

    Remember, PHPBB does NOT recommend running queries directly. The first two options I provided are their recommended method of removing mass users and posts. These are dangerous to run against your database (translation: make a backup first)

    Query 1 - Removes search results:

    delete from phpbb_search_wordmatch where post_id in
    (SELECT post_id
        FROM `phpbb_posts`
        WHERE topic_id
        IN (
           SELECT topic_id
           FROM phpbb_topics
           WHERE `topic_poster` NOT
           IN (
               SELECT user_id
               FROM phpbb_users
           )
        )
    )
    

    Query 2 - Removes Topics:

    DELETE
    FROM `phpbb_topics`
    WHERE `topic_poster` NOT
    IN (
        SELECT user_id
        FROM phpbb_users
    )
    

    Query 3 - Removes Posts:

    DELETE
    FROM `phpbb_posts`
    WHERE topic_id
    IN (
        SELECT topic_id
        FROM phpbb_topics
        WHERE `topic_poster` NOT
        IN (
            SELECT user_id
            FROM phpbb_users
        )
    )
    
    评论

报告相同问题?

悬赏问题

  • ¥15 虚幻5 UE美术毛发渲染
  • ¥15 CVRP 图论 物流运输优化
  • ¥15 Tableau online 嵌入ppt失败
  • ¥100 支付宝网页转账系统不识别账号
  • ¥15 基于单片机的靶位控制系统
  • ¥15 真我手机蓝牙传输进度消息被关闭了,怎么打开?(关键词-消息通知)
  • ¥15 装 pytorch 的时候出了好多问题,遇到这种情况怎么处理?
  • ¥20 IOS游览器某宝手机网页版自动立即购买JavaScript脚本
  • ¥15 手机接入宽带网线,如何释放宽带全部速度
  • ¥30 关于#r语言#的问题:如何对R语言中mfgarch包中构建的garch-midas模型进行样本内长期波动率预测和样本外长期波动率预测