|
|
|
@ -75,7 +75,6 @@ marked.setOptions({
|
|
|
|
|
active_usernames = replies[1];
|
|
|
|
|
var topics = [];
|
|
|
|
|
|
|
|
|
|
if (tids.length > 0) {
|
|
|
|
|
title = replies[2];
|
|
|
|
|
uid = replies[3];
|
|
|
|
|
timestamp = replies[4];
|
|
|
|
@ -93,6 +92,7 @@ marked.setOptions({
|
|
|
|
|
function generate_topic() {
|
|
|
|
|
if (!usernames || !has_read || !moderators || !teaser_info) return;
|
|
|
|
|
|
|
|
|
|
if (tids.length > 0) {
|
|
|
|
|
for (var i=0, ii=title.length; i<ii; i++) {
|
|
|
|
|
topics.push({
|
|
|
|
|
'title' : title[i],
|
|
|
|
@ -111,6 +111,7 @@ marked.setOptions({
|
|
|
|
|
'teaser_username': teaser_info[i].username
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Float pinned topics to the top
|
|
|
|
|
topics = topics.sort(function(a, b) {
|
|
|
|
@ -156,15 +157,14 @@ marked.setOptions({
|
|
|
|
|
teaser_info = teasers;
|
|
|
|
|
generate_topic();
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
else {
|
|
|
|
|
callback({
|
|
|
|
|
'category_name' : category_id ? category_name : 'Recent',
|
|
|
|
|
'show_topic_button' : category_id ? 'show' : 'hidden',
|
|
|
|
|
'category_id': category_id || 0,
|
|
|
|
|
'topics': []
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
// else {
|
|
|
|
|
// callback({
|
|
|
|
|
// 'category_name' : category_id ? category_name : 'Recent',
|
|
|
|
|
// 'show_topic_button' : category_id ? 'show' : 'hidden',
|
|
|
|
|
// 'category_id': category_id || 0,
|
|
|
|
|
// 'topics': []
|
|
|
|
|
// });
|
|
|
|
|
// }
|
|
|
|
|
});
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|