All users' status is invisible
-
I recently migrated my forums from SMF to NodeBB. And one thing that I noticed is that everybody has their status set to invisible.
Is there any way to change this setting for all 12k of my users on the forum?
-
Here's a script you can use to change the status of all users:
'use strict'; var nconf = require('nconf'); var async = require('async'); nconf.file({ file: 'config.json', }); nconf.defaults({ base_dir: __dirname, views_dir: './build/public/templates', }); var db = require('./src/database'); async.series([ db.init, setUsersOnline, ], (err) => { if (err) { console.error(err); process.exit(1); } process.exit(); }); function setUsersOnline(callback) { var batch = require('./src/batch'); batch.processSortedSet('users:joindate', function (uids, next) { const lastonline = Date.now(); const data = { lastonline, status: 'online', }; async.parallel([ cb => async.each(uids, (uid, next) => { db.setObject(`user:${uid}`, data, next); }, cb), cb => db.sortedSetAdd('users:online', uids.map(() => lastonline), uids, cb), ], next); }, callback); }
Create a new file called
set-users-online.js
in your main nodebb directory (the one withconfig.js
etc), paste that script into it, and runnode set-users-online
from within that directory to set all of your users to online.However, I'm not sure why your default for status would be Invisible in the first place. As far as I can tell, it's Online by default. You mentioned it's every user, how did you confirm that?
-
@PitaJ Whenever I'm looking at online users, they're always invisible. All of the migrated accounts that I use were also invisible.
-
-
-
No need to run the script, just wait for the next release, or run master if you are brave
-
@baris What's the timeline for the next release?
-
@djensen47 No set time yet, should be out
though. https://github.com/NodeBB/NodeBB/issues?q=is%3Aopen+is%3Aissue+milestone%3A1.11.0