bookmark for the post made

v1.18.x
Baris Usakli 12 years ago
parent b7e2bfff3d
commit 88a1fef941

@ -12,6 +12,7 @@
<!-- BEGIN main_posts --> <!-- 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}"> <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="span12">
<div class="post-block"> <div class="post-block">
@ -57,6 +58,7 @@
<!-- END main_posts --> <!-- END main_posts -->
<!-- BEGIN 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}"> <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"> <div class="span1 profile-image-block visible-desktop">
<!--<i class="icon-spinner icon-spin icon-2x pull-left"></i>--> <!--<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) { Topics.getTitleByPid = function(pid, callback) {
RDB.get('pid:' + pid + ':tid', function(err, tid) { RDB.get('pid:' + pid + ':tid', function(err, tid) {
if (!err) { if (!err) {

@ -6,6 +6,7 @@ var utils = require('./../public/src/utils.js'),
bcrypt = require('bcrypt'), bcrypt = require('bcrypt'),
marked = require('marked'), marked = require('marked'),
notifications = require('./notifications.js'), notifications = require('./notifications.js'),
topics = require('./topics.js'),
async = require('async'); async = require('async');
(function(User) { (function(User) {
@ -465,10 +466,15 @@ var utils = require('./../public/src/utils.js'),
User.sendPostNotificationToFollowers = function(uid, tid, pid) { User.sendPostNotificationToFollowers = function(uid, tid, pid) {
User.getUserField(uid, 'username', function(username) { User.getUserField(uid, 'username', function(username) {
User.getFollowers(uid, function(followers) { RDB.smembers('user:'+uid+':followers', function(err, followers) {
var message = username + ' made a new post';
notifications.create(message, 5, 'topic/' + tid + '/' + pid, 'notification_'+new Date().getTime(), function(nid) { topics.getSlug(tid, function(slug) {
notifications.push(nid, followers);
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);
});
}); });
}); });
}); });

Loading…
Cancel
Save