• Home
  • Categories
  • Recent
  • Popular
  • Top
  • Tags
  • Users
  • Groups
  • Documentation
    • Home
    • Read API
    • Write API
    • Plugin Development
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
v3.5.2 Latest
Buy Hosting

Clean users / post in bulk from a plugin

Scheduled Pinned Locked Moved NodeBB Development
5 Posts 4 Posters 526 Views
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • E Offline
    E Offline
    Enrique
    wrote on last edited by
    #1

    Hi!
    I'm trying to clean my users/post list, I want to delete in bulk all the users without posts, I'm trying to write my own plugin to achieve that, I've seen that the User module has a delete user, I can require the module from the plugin library, but how can I call from the admin.js.
    I've also checked the write API plugin, but I was unable to use the cURL from a js script, I'm using node-libcurl.
    What is the best way to achieve that? how can I delete the users from my forum in js, or can I call a custom hook in my plugin?

    Sorry if it's a dumb question, and thank you for your time.

    julianJ 1 Reply Last reply
    0
  • scottalanmillerS Offline
    scottalanmillerS Offline
    scottalanmiller Community Rep
    wrote on last edited by
    #2

    Make sure you include an option for "how long ago" to do the deletion. You don't want to delete an account just a few minutes or even hours old. You might want to make it like "one year old and older" but just make it an option that the end user can select.

    JaredBuschJ 1 Reply Last reply
    0
  • JaredBuschJ Offline
    JaredBuschJ Offline
    JaredBusch GNU/Linux
    replied to scottalanmiller on last edited by
    #3

    @scottalanmiller said in Clean users / post in bulk from a plugin:

    Make sure you include an option for "how long ago" to do the deletion. You don't want to delete an account just a few minutes or even hours old. You might want to make it like "one year old and older" but just make it an option that the end user can select.

    Checking last active might be a choice. Often people will sign in and simply never post, but continue to read content.

    scottalanmillerS 1 Reply Last reply
    0
  • scottalanmillerS Offline
    scottalanmillerS Offline
    scottalanmiller Community Rep
    replied to JaredBusch on last edited by
    #4

    @JaredBusch said in Clean users / post in bulk from a plugin:

    @scottalanmiller said in Clean users / post in bulk from a plugin:

    Make sure you include an option for "how long ago" to do the deletion. You don't want to delete an account just a few minutes or even hours old. You might want to make it like "one year old and older" but just make it an option that the end user can select.

    Checking last active might be a choice. Often people will sign in and simply never post, but continue to read content.

    Yes, good point. That's why we only do it by hand. If the account seems valid, best to leave it. empty accounts don't really do any damage.

    1 Reply Last reply
    0
  • julianJ Offline
    julianJ Offline
    julian GNU/Linux
    replied to Enrique on last edited by
    #5

    @Enrique the main problem you seem to be having is that you are not aware that there is a frontend and a backend to NodeBB. You have to wire up the controls from the ACP and make a call to the backend (via websocket, for example), and then you can call server side libraries.

    1 Reply Last reply
    0

Copyright © 2023 NodeBB | Contributors
  • Login

  • Don't have an account? Register

  • Login or register to search.
Powered by NodeBB Contributors
  • First post
    Last post
0
  • Home
  • Categories
  • Recent
  • Popular
  • Top
  • Tags
  • Users
  • Groups
  • Documentation
    • Home
    • Read API
    • Write API
    • Plugin Development