mirror of
https://github.com/NodeBB/NodeBB.git
synced 2026-01-22 23:42:54 +01:00
bookmark for the post made
This commit is contained in:
@@ -12,6 +12,7 @@
|
||||
|
||||
|
||||
<!-- BEGIN main_posts -->
|
||||
<a name="{main_posts.pid}"></a>
|
||||
<li class="row post-row main-post" data-pid="{main_posts.pid}" data-uid="{main_posts.uid}" data-deleted="{main_posts.deleted}">
|
||||
<div class="span12">
|
||||
<div class="post-block">
|
||||
@@ -57,6 +58,7 @@
|
||||
<!-- END main_posts -->
|
||||
|
||||
<!-- BEGIN posts -->
|
||||
<a name="{posts.pid}"></a>
|
||||
<li class="row post-row" data-pid="{posts.pid}" data-uid="{posts.uid}" data-username="{posts.username}" data-deleted="{posts.deleted}">
|
||||
<div class="span1 profile-image-block visible-desktop">
|
||||
<!--<i class="icon-spinner icon-spin icon-2x pull-left"></i>-->
|
||||
|
||||
@@ -201,6 +201,12 @@ marked.setOptions({
|
||||
});
|
||||
}
|
||||
|
||||
Topics.getSlug = function(tid, callback) {
|
||||
RDB.get('tid:' + tid + ':slug', function(err, slug) {
|
||||
callback(slug);
|
||||
});
|
||||
}
|
||||
|
||||
Topics.getTitleByPid = function(pid, callback) {
|
||||
RDB.get('pid:' + pid + ':tid', function(err, tid) {
|
||||
if (!err) {
|
||||
|
||||
14
src/user.js
14
src/user.js
@@ -6,6 +6,7 @@ var utils = require('./../public/src/utils.js'),
|
||||
bcrypt = require('bcrypt'),
|
||||
marked = require('marked'),
|
||||
notifications = require('./notifications.js'),
|
||||
topics = require('./topics.js'),
|
||||
async = require('async');
|
||||
|
||||
(function(User) {
|
||||
@@ -465,10 +466,15 @@ var utils = require('./../public/src/utils.js'),
|
||||
User.sendPostNotificationToFollowers = function(uid, tid, pid) {
|
||||
|
||||
User.getUserField(uid, 'username', function(username) {
|
||||
User.getFollowers(uid, function(followers) {
|
||||
var message = username + ' made a new post';
|
||||
notifications.create(message, 5, 'topic/' + tid + '/' + pid, 'notification_'+new Date().getTime(), function(nid) {
|
||||
notifications.push(nid, followers);
|
||||
RDB.smembers('user:'+uid+':followers', function(err, followers) {
|
||||
|
||||
topics.getSlug(tid, function(slug) {
|
||||
|
||||
var message = username + ' made a new post';
|
||||
|
||||
notifications.create(message, 5, global.config.url + 'topic/' + slug + '#' + pid, 'notification_'+new Date().getTime(), function(nid) {
|
||||
notifications.push(nid, followers);
|
||||
});
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user