From 8c8980de42f8b73e36316bcb394dfae462734eaf Mon Sep 17 00:00:00 2001 From: Egil Moeller Date: Sat, 27 Mar 2010 19:33:53 +0100 Subject: Added ability to show last changed pads --- .../twitterStyleTags/controllers/tagBrowser.js | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) (limited to 'etherpad/src/plugins/twitterStyleTags/controllers') diff --git a/etherpad/src/plugins/twitterStyleTags/controllers/tagBrowser.js b/etherpad/src/plugins/twitterStyleTags/controllers/tagBrowser.js index f5e63f7..46175c8 100644 --- a/etherpad/src/plugins/twitterStyleTags/controllers/tagBrowser.js +++ b/etherpad/src/plugins/twitterStyleTags/controllers/tagBrowser.js @@ -196,12 +196,21 @@ function onRequest() { var newTags = sqlobj.executeRaw(queryNewTagsSql.sql, queryNewTagsSql.params); var matchingPads; - if (tags.length > 0 || antiTags.length > 0) { - var sql = "select p.PAD_ID as ID, p.TAGS from PAD_TAG_CACHE as p, " + querySql.sql + " as q where p.PAD_ID = q.ID limit 10" + var sql = '' + + 'select ' + + ' m.id as ID, ' + + ' c.TAGS ' + + 'from ' + + querySql.sql + ' as q ' + + ' join PAD_SQLMETA as m on ' + + ' m.id = q.ID ' + + ' join PAD_TAG_CACHE as c on ' + + ' c.PAD_ID = q.ID ' + + 'order by ' + + ' lastWriteTime desc ' + + 'limit 10'; + matchingPads = sqlobj.executeRaw(sql, querySql.params); - } else { - matchingPads = []; - } for (i = 0; i < matchingPads.length; i++) { matchingPads[i].TAGS = matchingPads[i].TAGS.split('#'); -- cgit v1.2.3-1-g7c22