Navigation

    • Register
    • Login
    • Search
    • Categories
    • Recent
    • Popular
    • Tags
    • Users
    • Groups
    1. Home
    2. Ne Ho
    • Profile
    • Following 0
    • Followers 0
    • Topics 4
    • Posts 27
    • Best 5
    • Groups 0

    Ne Ho

    @Ne Ho

    5
    Reputation
    446
    Profile views
    27
    Posts
    0
    Followers
    0
    Following
    Joined Last Online

    Ne Ho Follow

    Best posts made by Ne Ho

    • RE: Need help with chat notifications, template

      @jtsimoes said in Need help with chat notifications, template:

      will check the class, thank you I let you know

      posted in NodeBB Development
      Ne Ho
      Ne Ho
    • Update Schamper's Shoutbox

      Hello,

      I have updated Schamper's shoutbox plugin https://github.com/Schamper/nodebb-plugin-shoutbox
      Since I only changed 2 files could somebody update it, or should I send a pull request. I dont see a point to share the same plugin with some changed lines as a new shoutbox plugin

      plugin.json

      {
        "id": "nodebb-plugin-shoutbox",
        "name": "Shoutbox",
        "description": "NodeBB Plugin Shoutbox",
        "url": "https://github.com/Schamper/nodebb-plugin-shoutbox",
        "library": "./library.js",
        "hooks": [
          { "hook": "static:app.load", "method": "init.load" },
          { "hook": "filter:admin.header.build", "method": "init.addAdminNavigation" },
          { "hook": "filter:header.build", "method": "init.addGlobalNavigation" },
          { "hook": "filter:sounds.get", "method": "init.getSounds" },
      
          { "hook": "filter:user.customSettings", "method": "settings.addUserSettings" },
          { "hook": "filter:user.getSettings", "method": "settings.getUserSettings" },
          { "hook": "action:user.saveSettings", "method": "settings.saveUserSettings" },
      
          { "hook": "filter:widgets.getWidgets", "method": "widget.define" },
          { "hook": "filter:widget.render:shoutbox", "method": "widget.render" }
        ],
        "staticDirs": {
          "public": "./public"
        },
        "less": [
          "public/less/style.less"
        ],
        "scripts": [
          "public/js/loader.js",
          "public/js/lib/actions.js",
          "public/js/lib/base.js",
          "public/js/lib/commands.js",
          "public/js/lib/settings.js",
          "public/js/lib/sockets.js",
          "public/js/lib/utils.js",
          "public/js/lib/actions/bug.js",
          "public/js/lib/actions/default.js",
          "public/js/lib/actions/gist.js",
          "public/js/lib/actions/hide.js",
          "public/js/lib/actions/settings.js",
          "public/js/lib/commands/default.js"
        ],
        "acpScripts": [
          "public/js/admin.js"
        ],
        "templates": "./templates"
      }
      
      

      library.js

      "use strict";
      
      var	NodeBB = require('./lib/nodebb'),
      	Config = require('./lib/config'),
      	Sockets = require('./lib/sockets'),
      	Commands = require('./lib/commands'),
      
      	app,
      
      	Shoutbox = {};
      
      Shoutbox.init = {};
      Shoutbox.widget = {};
      Shoutbox.settings = {};
      
      Shoutbox.init.load = function(params, callback) {
      	function renderGlobal(req, res, next) {
      		Config.getTemplateData(function(data) {
      			res.render(Config.plugin.id, data);
      		});
      	}
      
      	function renderAdmin(req, res, next) {
      		Config.getTemplateData(function(data) {
      			res.render('admin/plugins/' + Config.plugin.id, data);
      		});
      	}
      
      	var router = params.router;
      	router.get('/' + Config.plugin.id, params.middleware.buildHeader, renderGlobal);
      	router.get('/api/' + Config.plugin.id, renderGlobal);
      
      	router.get('/admin/plugins/' + Config.plugin.id, params.middleware.admin.buildHeader, renderAdmin);
      	router.get('/api/admin/plugins/' + Config.plugin.id, renderAdmin);
      
      	NodeBB.SocketPlugins[Config.plugin.id] = Sockets.events;
      	NodeBB.SocketAdmin[Config.plugin.id] = Config.adminSockets;
      
      	app = params.app;
      
      	Config.init(callback);
      };
      
      Shoutbox.init.addGlobalNavigation = function(header, callback) {
      	if (Config.global.get('toggles.headerLink')) {
      		header.navigation.push({
      			class: '',
      			iconClass: 'fa fa-fw ' + Config.plugin.icon,
      			route: '/' + Config.plugin.id,
      			text: Config.plugin.name
      		});
      	}
      
      	callback(null, header);
      };
      
      Shoutbox.init.addAdminNavigation = function(header, callback) {
      	header.plugins.push({
      		route: '/plugins/' + Config.plugin.id,
      		icon: Config.plugin.icon,
      		name: Config.plugin.name
      	});
      
      	callback(null, header);
      };
      
      Shoutbox.init.getSounds = function(sounds, callback) {
      	sounds.push(__dirname + '/public/sounds/shoutbox-notification.mp3');
      	sounds.push(__dirname + '/public/sounds/shoutbox-wobble.mp3');
      	sounds.push(__dirname + '/public/sounds/shoutbox-cena.mp3');
      	callback(null, sounds);
      };
      
      Shoutbox.widget.define = function(widgets, callback) {
      	widgets.push({
      		name: Config.plugin.name,
      		widget: Config.plugin.id,
      		description: Config.plugin.description,
      		content: ''
      	});
      
      	callback(null, widgets);
      };
      
      Shoutbox.widget.render = function(widget, callback) {
      	//Remove any container
      	widget.data.container = '';
      
      	Config.user.get({ uid: widget.uid, settings: {} }, function(err, result) {
      		Config.getTemplateData(function(data) {
      
      			data.hiddenStyle = '';
      			if (!err && result && result.settings && parseInt(result.settings['shoutbox:toggles:hide'], 10) == 1) {
      				data.hiddenStyle = 'display: none;';
      			}
      
      			app.render('shoutbox/panel', { html: '<div id="tablediv"></div>', time: Date.now() }, function(err, html){   
      			    widget.html = html;
      			    callback(err, widget);
      			});
      		});
      	});
      };
      
      Shoutbox.settings.addUserSettings = function(settings, callback) {
      	app.render('shoutbox/user/settings', { settings: settings.settings }, function(err, html) {
      		settings.customSettings.push({
      			title: Config.plugin.name,
      			content: html
      		});
      
      		callback(null, settings);
      	});
      };
      
      Shoutbox.settings.getUserSettings = function(data, callback) {
      	Config.user.get(data, callback);
      };
      
      Shoutbox.settings.saveUserSettings = function(data) {
      	Config.user.save(data);
      };
      
      module.exports = Shoutbox;
      
      
      posted in NodeBB Plugins
      Ne Ho
      Ne Ho
    • RE: Need help with chat notifications, template

      Thank you very much, it worked, I had to modify the class .unread-count:after what I already had defined and to add the .unread-count as you have suggested

      posted in NodeBB Development
      Ne Ho
      Ne Ho
    • RE: Update Schamper's Shoutbox

      I ended up with this https://github.com/byNeHo/nodebb-plugin-shoutbox
      maybe I can learn from this for some feature plugins

      posted in NodeBB Plugins
      Ne Ho
      Ne Ho
    • RE: Update Schamper's Shoutbox

      @fais3000 yes

      posted in NodeBB Plugins
      Ne Ho
      Ne Ho

    Latest posts made by Ne Ho

    • RE: Update Schamper's Shoutbox

      @fais3000 yes

      posted in NodeBB Plugins
      Ne Ho
      Ne Ho
    • RE: Update Schamper's Shoutbox

      I ended up with this https://github.com/byNeHo/nodebb-plugin-shoutbox
      maybe I can learn from this for some feature plugins

      posted in NodeBB Plugins
      Ne Ho
      Ne Ho
    • Update Schamper's Shoutbox

      Hello,

      I have updated Schamper's shoutbox plugin https://github.com/Schamper/nodebb-plugin-shoutbox
      Since I only changed 2 files could somebody update it, or should I send a pull request. I dont see a point to share the same plugin with some changed lines as a new shoutbox plugin

      plugin.json

      {
        "id": "nodebb-plugin-shoutbox",
        "name": "Shoutbox",
        "description": "NodeBB Plugin Shoutbox",
        "url": "https://github.com/Schamper/nodebb-plugin-shoutbox",
        "library": "./library.js",
        "hooks": [
          { "hook": "static:app.load", "method": "init.load" },
          { "hook": "filter:admin.header.build", "method": "init.addAdminNavigation" },
          { "hook": "filter:header.build", "method": "init.addGlobalNavigation" },
          { "hook": "filter:sounds.get", "method": "init.getSounds" },
      
          { "hook": "filter:user.customSettings", "method": "settings.addUserSettings" },
          { "hook": "filter:user.getSettings", "method": "settings.getUserSettings" },
          { "hook": "action:user.saveSettings", "method": "settings.saveUserSettings" },
      
          { "hook": "filter:widgets.getWidgets", "method": "widget.define" },
          { "hook": "filter:widget.render:shoutbox", "method": "widget.render" }
        ],
        "staticDirs": {
          "public": "./public"
        },
        "less": [
          "public/less/style.less"
        ],
        "scripts": [
          "public/js/loader.js",
          "public/js/lib/actions.js",
          "public/js/lib/base.js",
          "public/js/lib/commands.js",
          "public/js/lib/settings.js",
          "public/js/lib/sockets.js",
          "public/js/lib/utils.js",
          "public/js/lib/actions/bug.js",
          "public/js/lib/actions/default.js",
          "public/js/lib/actions/gist.js",
          "public/js/lib/actions/hide.js",
          "public/js/lib/actions/settings.js",
          "public/js/lib/commands/default.js"
        ],
        "acpScripts": [
          "public/js/admin.js"
        ],
        "templates": "./templates"
      }
      
      

      library.js

      "use strict";
      
      var	NodeBB = require('./lib/nodebb'),
      	Config = require('./lib/config'),
      	Sockets = require('./lib/sockets'),
      	Commands = require('./lib/commands'),
      
      	app,
      
      	Shoutbox = {};
      
      Shoutbox.init = {};
      Shoutbox.widget = {};
      Shoutbox.settings = {};
      
      Shoutbox.init.load = function(params, callback) {
      	function renderGlobal(req, res, next) {
      		Config.getTemplateData(function(data) {
      			res.render(Config.plugin.id, data);
      		});
      	}
      
      	function renderAdmin(req, res, next) {
      		Config.getTemplateData(function(data) {
      			res.render('admin/plugins/' + Config.plugin.id, data);
      		});
      	}
      
      	var router = params.router;
      	router.get('/' + Config.plugin.id, params.middleware.buildHeader, renderGlobal);
      	router.get('/api/' + Config.plugin.id, renderGlobal);
      
      	router.get('/admin/plugins/' + Config.plugin.id, params.middleware.admin.buildHeader, renderAdmin);
      	router.get('/api/admin/plugins/' + Config.plugin.id, renderAdmin);
      
      	NodeBB.SocketPlugins[Config.plugin.id] = Sockets.events;
      	NodeBB.SocketAdmin[Config.plugin.id] = Config.adminSockets;
      
      	app = params.app;
      
      	Config.init(callback);
      };
      
      Shoutbox.init.addGlobalNavigation = function(header, callback) {
      	if (Config.global.get('toggles.headerLink')) {
      		header.navigation.push({
      			class: '',
      			iconClass: 'fa fa-fw ' + Config.plugin.icon,
      			route: '/' + Config.plugin.id,
      			text: Config.plugin.name
      		});
      	}
      
      	callback(null, header);
      };
      
      Shoutbox.init.addAdminNavigation = function(header, callback) {
      	header.plugins.push({
      		route: '/plugins/' + Config.plugin.id,
      		icon: Config.plugin.icon,
      		name: Config.plugin.name
      	});
      
      	callback(null, header);
      };
      
      Shoutbox.init.getSounds = function(sounds, callback) {
      	sounds.push(__dirname + '/public/sounds/shoutbox-notification.mp3');
      	sounds.push(__dirname + '/public/sounds/shoutbox-wobble.mp3');
      	sounds.push(__dirname + '/public/sounds/shoutbox-cena.mp3');
      	callback(null, sounds);
      };
      
      Shoutbox.widget.define = function(widgets, callback) {
      	widgets.push({
      		name: Config.plugin.name,
      		widget: Config.plugin.id,
      		description: Config.plugin.description,
      		content: ''
      	});
      
      	callback(null, widgets);
      };
      
      Shoutbox.widget.render = function(widget, callback) {
      	//Remove any container
      	widget.data.container = '';
      
      	Config.user.get({ uid: widget.uid, settings: {} }, function(err, result) {
      		Config.getTemplateData(function(data) {
      
      			data.hiddenStyle = '';
      			if (!err && result && result.settings && parseInt(result.settings['shoutbox:toggles:hide'], 10) == 1) {
      				data.hiddenStyle = 'display: none;';
      			}
      
      			app.render('shoutbox/panel', { html: '<div id="tablediv"></div>', time: Date.now() }, function(err, html){   
      			    widget.html = html;
      			    callback(err, widget);
      			});
      		});
      	});
      };
      
      Shoutbox.settings.addUserSettings = function(settings, callback) {
      	app.render('shoutbox/user/settings', { settings: settings.settings }, function(err, html) {
      		settings.customSettings.push({
      			title: Config.plugin.name,
      			content: html
      		});
      
      		callback(null, settings);
      	});
      };
      
      Shoutbox.settings.getUserSettings = function(data, callback) {
      	Config.user.get(data, callback);
      };
      
      Shoutbox.settings.saveUserSettings = function(data) {
      	Config.user.save(data);
      };
      
      module.exports = Shoutbox;
      
      
      posted in NodeBB Plugins
      Ne Ho
      Ne Ho
    • RE: Problem with shoutbox plugin after 1.12.2 -> 1.13.0 nodebb upgrade

      @fais3000 I have this issue with the original on version v1.13.3. (Shoutbox.base is undefined)

      posted in Plugin Development
      Ne Ho
      Ne Ho
    • Plugin shoutbox issues after upgrading to v 1.13.0

      Hello,

      I have issues with plugin shoutbox after upgrading to version 1.13.0

      https://github.com/Schamper/nodebb-plugin-shoutbox

      Screenshot_2.png Screenshot_1.png

      There is also a warning in the log

      2019-12-16T00:18:16.751Z [4567/21928] - warn: [widgets.render] passing a string is deprecated!, filter:widget.render:shoutbox. Please set hookData.html in your plugin.
      

      I am not sure if this is enough data to help me out with this

      posted in Technical Support
      Ne Ho
      Ne Ho
    • RE: Need help with chat notifications, template

      Thank you very much, it worked, I had to modify the class .unread-count:after what I already had defined and to add the .unread-count as you have suggested

      posted in NodeBB Development
      Ne Ho
      Ne Ho
    • RE: Need help with chat notifications, template

      @jtsimoes said in Need help with chat notifications, template:

      will check the class, thank you I let you know

      posted in NodeBB Development
      Ne Ho
      Ne Ho
    • Need help with chat notifications, template

      Hello,

      I have forked theme-material and i try to figure out how I should make my chat notifications show up when there is a new message.

      The notification is not showing up if I am not on the forum, when I close the browser (send a message while it is closed from another user) and visit my forum I can not see that there is a new message, it is only visible in the dropdown menu as highlighted, but the count is not visible.

      889af58f-087c-4928-8e42-c25249c0c94e.png

      When i am on the forum and somebody sends a message than everything works as it should, I can see the "{unreadCount.chat}"

      if i change the line to be like in the persona theme

      https://github.com/NodeBB/nodebb-theme-persona/blob/77962c81bab538f6cd82c98451019da0c7a6d391/templates/partials/menu.tpl#L52

      then it also shows up when the number of not seen messages is 0, the count is always visible

      if i replace that line with this one

      <i component="chat/icon" class="fa fa-comment-o fa-fw" data-content="0"></i>
      

      then the notification wont show up

      Could somebody point me out what the right way is to change this line?

      This is how I would like to see the notification when I visit my forum
      Screenshot_2019-03-11 NodeBB.png

      posted in NodeBB Development
      Ne Ho
      Ne Ho
    • RE: Login redirect and logout dont work after upgrade ?

      @Geferon There is 1 small issue when you get time please look at it, on the same chat page there is a search option if you click the chat icon, hower with mouse there you will see that left from the icon there is a href and it is not visible.

      Thank you for helping

      Screenshot_2019-02-23 Cirkus Serveri Forum(3).png

      posted in Technical Support
      Ne Ho
      Ne Ho
    • RE: Login redirect and logout dont work after upgrade ?

      @Geferon i believe we are talking about this page https://github.com/geferon/nodebb-theme-material/blob/master/templates/chats.tpl

      posted in Technical Support
      Ne Ho
      Ne Ho