diff --git a/public/language/tr/category.json b/public/language/tr/category.json index 0a4500b7c7..fd41b09848 100644 --- a/public/language/tr/category.json +++ b/public/language/tr/category.json @@ -1,6 +1,6 @@ { "new_topic_button": "Yeni Başlık", - "no_topics": " Bu kategoride hiç konu yok.
Yeni bir konu açmak istemez misiniz?", + "no_topics": " Bu kategoride hiç konu yok.
Yeni bir konu açmak istemez misiniz?", "sidebar.recent_replies": "Güncel Cevaplar", "sidebar.active_participants": "Aktif Katılımcılar", "sidebar.moderators": "Moderatörler", diff --git a/public/templates/category.tpl b/public/templates/category.tpl index a8b73e765c..322ba52c39 100644 --- a/public/templates/category.tpl +++ b/public/templates/category.tpl @@ -111,14 +111,16 @@ -
+ +
[[category:sidebar.moderators]]
- +
+
diff --git a/src/categories.js b/src/categories.js index 85849b6523..4a1e0fcef7 100644 --- a/src/categories.js +++ b/src/categories.js @@ -107,7 +107,6 @@ var db = require('./database'), if (!category.topics.length) { getModerators(function(err, moderators) { - category.moderator_block_class = moderators.length > 0 ? '' : 'none'; category.moderators = moderators; category.show_sidebar = 'hidden'; category.no_topics_message = 'show'; @@ -115,7 +114,6 @@ var db = require('./database'), }); } else { async.parallel([getModerators, getActiveUsers], function(err, results) { - category.moderator_block_class = results[0].length > 0 ? '' : 'none'; category.moderators = results[0]; category.active_users = results[1]; category.show_sidebar = category.topics.length > 0 ? 'show' : 'hidden'; @@ -191,7 +189,7 @@ var db = require('./database'), db.getSetMembers('cid:' + cid + ':moderators', function(err, mods) { if (!err) { if (mods && mods.length) { - user.getMultipleUserFields(mods, ['username'], function(err, moderators) { + user.getMultipleUserFields(mods, ['uid', 'username', 'userslug', 'picture'], function(err, moderators) { callback(err, moderators); }); } else { diff --git a/src/meta.js b/src/meta.js index 3a1caec33a..7f1e496de7 100644 --- a/src/meta.js +++ b/src/meta.js @@ -251,14 +251,19 @@ var fs = require('fs'), var paths = jsPath.split('/'), mappedPath = paths[1]; - jsPath = jsPath.replace(path.join('plugins', mappedPath), ''); - return path.join(plugins.staticDirs[mappedPath], jsPath); + if (plugins.staticDirs[mappedPath]) { + jsPath = jsPath.replace(path.join('plugins', mappedPath), ''); + return path.join(plugins.staticDirs[mappedPath], jsPath); + } else { + winston.warn('[meta.scripts.get] Could not resolve mapped path: ' + mappedPath + '. Are you sure it is defined by a plugin?'); + return null; + } } else { return path.join(__dirname, '..', '/public', jsPath); } }); - Meta.js.scripts = jsPaths; + Meta.js.scripts = jsPaths.filter(function(path) { return path !== null }); if (process.env.NODE_ENV !== 'development') { async.parallel({ diff --git a/src/plugins.js b/src/plugins.js index 93d3ceab14..f2346dfc71 100644 --- a/src/plugins.js +++ b/src/plugins.js @@ -164,6 +164,8 @@ var fs = require('fs'), fs.exists(staticDir, function(exists) { if (exists) { Plugins.staticDirs[mappedPath] = staticDir; + } else { + winston.warn('[plugins/' + pluginData.id + '] Mapped path \'' + mappedPath + ' => ' + staticDir + '\' not found.'); } }); }(staticDir)); diff --git a/src/routes/user.js b/src/routes/user.js index 26ea4cc4f5..348cd7636c 100644 --- a/src/routes/user.js +++ b/src/routes/user.js @@ -494,33 +494,40 @@ var fs = require('fs'), var websockets = require('../socket.io'); user.getUsers('users:online', 0, 49, function (err, data) { - var onlineUsers = []; - data = data.filter(function(item) { - return item.status !== 'offline'; - }); - - function iterator(userData, next) { - var online = websockets.isUserOnline(userData.uid); - if(!online) { - db.sortedSetRemove('users:online', userData.uid); - return next(null); + uid = 0; + if (req.user) { + uid = req.user.uid; + } + user.isAdministrator(uid, function (err, isAdministrator) { + if (true != isAdministrator) { + data = data.filter(function(item) { + return item.status !== 'offline'; + }); } - onlineUsers.push(userData); - next(null); - } + function iterator(userData, next) { + var online = websockets.isUserOnline(userData.uid); + if(!online) { + db.sortedSetRemove('users:online', userData.uid); + return next(null); + } - var anonymousUserCount = websockets.getOnlineAnonCount(); + onlineUsers.push(userData); + next(null); + } - async.each(data, iterator, function(err) { - res.json({ - search_display: 'none', - loadmore_display: 'block', - users: onlineUsers, - anonymousUserCount: anonymousUserCount, - show_anon: anonymousUserCount?'':'hide' + var anonymousUserCount = websockets.getOnlineAnonCount(); + + async.each(data, iterator, function(err) { + res.json({ + search_display: 'none', + loadmore_display: 'block', + users: onlineUsers, + anonymousUserCount: anonymousUserCount, + show_anon: anonymousUserCount?'':'hide' + }); }); }); });