mirror of
https://github.com/NodeBB/NodeBB.git
synced 2026-05-07 18:56:57 +02:00
Merge branch 'master' of https://github.com/designcreateplay/NodeBB
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"new_topic_button": "Yeni Başlık",
|
||||
"no_topics": "<strong> Bu kategoride hiç konu yok. </ strong> <br /> Yeni bir konu açmak istemez misiniz?",
|
||||
"no_topics": "<strong> Bu kategoride hiç konu yok. </strong> <br /> 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",
|
||||
|
||||
@@ -111,14 +111,16 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="panel panel-default {moderator_block_class}">
|
||||
<!-- IF moderators.length -->
|
||||
<div class="panel panel-default">
|
||||
<div class="panel-heading">[[category:sidebar.moderators]]</div>
|
||||
<div class="panel-body moderators">
|
||||
<!-- BEGIN moderators -->
|
||||
<a href="../../user/{moderators.userslug}"><img title="{moderators.username}" src="{moderators.picture}" class="img-rounded" /></a>
|
||||
<a data-uid="{moderators.uid}" href="../../user/{moderators.userslug}"><img title="{moderators.username}" src="{moderators.picture}" class="img-rounded user-img" /></a>
|
||||
<!-- END moderators -->
|
||||
</div>
|
||||
</div>
|
||||
<!-- ENDIF moderators.length -->
|
||||
|
||||
<!-- BEGIN sidebars -->
|
||||
<div class="panel panel-default">
|
||||
|
||||
@@ -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 {
|
||||
|
||||
11
src/meta.js
11
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({
|
||||
|
||||
@@ -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));
|
||||
|
||||
@@ -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'
|
||||
});
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user