mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-10-27 09:06:15 +01:00
feat: #4456
This commit is contained in:
@@ -116,6 +116,7 @@
|
|||||||
"hideEmail": 0,
|
"hideEmail": 0,
|
||||||
"allowGuestHandles": 0,
|
"allowGuestHandles": 0,
|
||||||
"guestsIncrementTopicViews": 1,
|
"guestsIncrementTopicViews": 1,
|
||||||
|
"allowGuestReplyNotifications": 1,
|
||||||
"incrementTopicViewsInterval": 60,
|
"incrementTopicViewsInterval": 60,
|
||||||
"recentMaxTopics": 200,
|
"recentMaxTopics": 200,
|
||||||
"disableRecentCategoryFilter": 0,
|
"disableRecentCategoryFilter": 0,
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"handles": "Guest Handles",
|
"settings": "Settings",
|
||||||
"handles.enabled": "Allow guest handles",
|
"handles.enabled": "Allow guest handles",
|
||||||
"handles.enabled-help": "This option exposes a new field that allows guests to pick a name to associate with each post they make. If disabled, they will simply be called \"Guest\"",
|
"handles.enabled-help": "This option exposes a new field that allows guests to pick a name to associate with each post they make. If disabled, they will simply be called \"Guest\"",
|
||||||
"topic-views": "Topic views",
|
"topic-views.enabled": "Allow guests to increase topic view counts",
|
||||||
"topic-views.enabled": "Allow guests to increase topic view counts"
|
"reply-notifications.enabled": "Allow guests to generate reply notifications"
|
||||||
}
|
}
|
||||||
@@ -187,12 +187,14 @@ module.exports = function (Topics) {
|
|||||||
user.setUserField(uid, 'lastonline', Date.now());
|
user.setUserField(uid, 'lastonline', Date.now());
|
||||||
}
|
}
|
||||||
|
|
||||||
Topics.notifyFollowers(postData, uid, {
|
if (parseInt(uid, 10) || meta.config.allowGuestReplyNotifications) {
|
||||||
type: 'new-reply',
|
Topics.notifyFollowers(postData, uid, {
|
||||||
bodyShort: translator.compile('notifications:user_posted_to', postData.user.username, postData.topic.title),
|
type: 'new-reply',
|
||||||
nid: 'new_post:tid:' + postData.topic.tid + ':pid:' + postData.pid + ':uid:' + uid,
|
bodyShort: translator.compile('notifications:user_posted_to', postData.user.username, postData.topic.title),
|
||||||
mergeId: 'notifications:user_posted_to|' + postData.topic.tid,
|
nid: 'new_post:tid:' + postData.topic.tid + ':pid:' + postData.pid + ':uid:' + uid,
|
||||||
});
|
mergeId: 'notifications:user_posted_to|' + postData.topic.tid,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
analytics.increment(['posts', 'posts:byCid:' + data.cid]);
|
analytics.increment(['posts', 'posts:byCid:' + data.cid]);
|
||||||
plugins.fireHook('action:topic.reply', { post: _.clone(postData), data: data });
|
plugins.fireHook('action:topic.reply', { post: _.clone(postData), data: data });
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
<!-- IMPORT admin/partials/settings/header.tpl -->
|
<!-- IMPORT admin/partials/settings/header.tpl -->
|
||||||
|
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col-sm-2 col-xs-12 settings-header">[[admin/settings/guest:handles]]</div>
|
<div class="col-sm-2 col-xs-12 settings-header">[[admin/settings/guest:settings]]</div>
|
||||||
<div class="col-sm-10 col-xs-12">
|
<div class="col-sm-10 col-xs-12">
|
||||||
<form role="form">
|
<form role="form">
|
||||||
<div class="checkbox">
|
<div class="checkbox">
|
||||||
@@ -14,9 +14,6 @@
|
|||||||
[[admin/settings/guest:handles.enabled-help]]
|
[[admin/settings/guest:handles.enabled-help]]
|
||||||
</p>
|
</p>
|
||||||
</form>
|
</form>
|
||||||
</div>
|
|
||||||
<div class="col-sm-2 col-xs-12 settings-header">[[admin/settings/guest:topic-views]]</div>
|
|
||||||
<div class="col-sm-10 col-xs-12">
|
|
||||||
<form role="form">
|
<form role="form">
|
||||||
<div class="checkbox">
|
<div class="checkbox">
|
||||||
<label class="mdl-switch mdl-js-switch mdl-js-ripple-effect">
|
<label class="mdl-switch mdl-js-switch mdl-js-ripple-effect">
|
||||||
@@ -25,6 +22,14 @@
|
|||||||
</label>
|
</label>
|
||||||
</div>
|
</div>
|
||||||
</form>
|
</form>
|
||||||
|
<form role="form">
|
||||||
|
<div class="checkbox">
|
||||||
|
<label class="mdl-switch mdl-js-switch mdl-js-ripple-effect">
|
||||||
|
<input class="mdl-switch__input" type="checkbox" data-field="allowGuestReplyNotifications">
|
||||||
|
<span class="mdl-switch__label"><strong>[[admin/settings/guest:reply-notifications.enabled]]</strong></span>
|
||||||
|
</label>
|
||||||
|
</div>
|
||||||
|
</form>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user