@ -206,10 +206,21 @@ marked.setOptions({
Topics . getTitle = function ( tid , callback ) {
Topics . getTitle = function ( tid , callback ) {
RDB . get ( 'tid:' + tid + ':title' , function ( err , title ) {
RDB . get ( 'tid:' + tid + ':title' , function ( err , title ) {
console . log ( tid , title ) ;
callback ( title ) ;
callback ( title ) ;
} ) ;
} ) ;
}
}
Topics . getTitleByPid = function ( pid , callback ) {
RDB . get ( 'pid:' + pid + ':tid' , function ( err , tid ) {
if ( ! err ) {
Topics . getTitle ( tid , function ( title ) {
callback ( title ) ;
} ) ;
} else callback ( 'Could not grab title' ) ;
} ) ;
}
Topics . markAsRead = function ( tid , uid ) {
Topics . markAsRead = function ( tid , uid ) {
// there is an issue with this fn. if you read a topic that is previously read you will mark the category as read anyways - there is no check
// there is an issue with this fn. if you read a topic that is previously read you will mark the category as read anyways - there is no check
RDB . sadd ( schema . topics ( tid ) . read _by _uid , uid ) ;
RDB . sadd ( schema . topics ( tid ) . read _by _uid , uid ) ;