@ -27,7 +27,10 @@ var RDB = require('./redis.js'),
postcount = [ ] ,
locked = [ ] ,
deleted = [ ] ,
pinned = [ ] ;
pinned = [ ] ,
recent _post = [ ] ,
recent _author = [ ] ,
recent _picture = [ ] ;
for ( var i = 0 , ii = tids . length ; i < ii ; i ++ ) {
title . push ( 'tid:' + tids [ i ] + ':title' ) ;
@ -38,6 +41,9 @@ var RDB = require('./redis.js'),
locked . push ( 'tid:' + tids [ i ] + ':locked' ) ;
deleted . push ( 'tid:' + tids [ i ] + ':deleted' ) ;
pinned . push ( 'tid:' + tids [ i ] + ':pinned' ) ;
recent _post . push ( 'tid:' + tids [ i ] + ':recent:post' ) ;
recent _author . push ( 'tid:' + tids [ i ] + ':recent:author' ) ;
recent _picture . push ( 'tid:' + tids [ i ] + ':recent:picture' ) ;
}
var multi = RDB . multi ( )
@ -53,6 +59,9 @@ var RDB = require('./redis.js'),
. mget ( locked )
. mget ( deleted )
. mget ( pinned )
. mget ( recent _post )
. mget ( recent _author )
. mget ( recent _picture )
}
@ -69,6 +78,9 @@ var RDB = require('./redis.js'),
locked = replies [ 6 ] ;
deleted = replies [ 7 ] ;
pinned = replies [ 8 ] ;
recent _post = replies [ 9 ] ;
recent _author = replies [ 10 ] ;
recent _picture = replies [ 11 ] ;
var usernames ,
has _read ;
@ -76,6 +88,7 @@ var RDB = require('./redis.js'),
function generate _topic ( ) {
if ( ! usernames || ! has _read ) return ;
for ( var i = 0 , ii = title . length ; i < ii ; i ++ ) {
topics . push ( {
'title' : title [ i ] ,
@ -89,7 +102,10 @@ var RDB = require('./redis.js'),
'deleted' : deleted [ i ] ,
'pinned' : parseInt ( pinned [ i ] || 0 ) , // For sorting purposes
'pin-icon' : pinned [ i ] === '1' ? 'icon-pushpin' : 'none' ,
'badgeclass' : ( has _read [ i ] && current _user != 0 ) ? '' : 'badge-important'
'badgeclass' : ( has _read [ i ] && current _user != 0 ) ? '' : 'badge-important' ,
'recent_post' : recent _post [ i ] ,
'recent_author' : recent _author [ i ] ,
'recent_picture' : recent _picture [ i ]
} ) ;
}