diff options
author | Renard | 2020-08-08 14:02:28 -0400 |
---|---|---|
committer | Renard | 2020-08-08 14:02:28 -0400 |
commit | 34c67231d5d10c14135e58ac642af4d82730a0eb (patch) | |
tree | a5ac6c45d086481c9e39fd86d6235e975a3461ce /cgi | |
parent | 07eca7f8eadaa3e2cae64d810be40efafbe80768 (diff) | |
download | weabot-34c67231d5d10c14135e58ac642af4d82730a0eb.tar.gz weabot-34c67231d5d10c14135e58ac642af4d82730a0eb.tar.xz weabot-34c67231d5d10c14135e58ac642af4d82730a0eb.zip |
a
Diffstat (limited to 'cgi')
-rw-r--r-- | cgi/modapi.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/cgi/modapi.py b/cgi/modapi.py index 44c1746..1452e83 100644 --- a/cgi/modapi.py +++ b/cgi/modapi.py @@ -140,7 +140,7 @@ def api_process(self, path_split): board = setBoard(data_board) #sql = "SELECT id, timestamp, bumped, timestamp_formatted, name, tripcode, email, subject, message, file, thumb FROM posts WHERE boardid = %s AND parentid = 0 AND IS_DELETED = 0 ORDER BY bumped DESC LIMIT %d" % (board['id'], limit) - sql = "SELECT INET6_NTOA(p.ip) AS p.ip, p.IS_DELETED AS p.deleted, p.id, p.timestamp, p.bumped, p.expires, p.expires_formatted, p.timestamp_formatted, p.name, p.tripcode, p.email, p.subject, p.message, p.file, p.file_size, p.image_width, p.image_height, p.thumb, p.thumb_height, p.thumb_width, p.locked, coalesce(x.count,0) AS total_replies, coalesce(x.files,0) AS total_files FROM `posts` AS p LEFT JOIN (SELECT parentid, count(1) as count, count(nullif(file, '')) as files FROM `posts` WHERE boardid = %(board)s GROUP BY parentid) AS x ON p.id=x.parentid WHERE p.parentid = 0 AND p.boardid = %(board)s ORDER BY `bumped` DESC LIMIT %(limit)d OFFSET %(offset)d" % { + sql = "SELECT INET6_NTOA(p.ip) AS ip, p.IS_DELETED AS deleted, p.id, p.timestamp, p.bumped, p.expires, p.expires_formatted, p.timestamp_formatted, p.name, p.tripcode, p.email, p.subject, p.message, p.file, p.file_size, p.image_width, p.image_height, p.thumb, p.thumb_height, p.thumb_width, p.locked, coalesce(x.count,0) AS total_replies, coalesce(x.files,0) AS total_files FROM `posts` AS p LEFT JOIN (SELECT parentid, count(1) as count, count(nullif(file, '')) as files FROM `posts` WHERE boardid = %(board)s GROUP BY parentid) AS x ON p.id=x.parentid WHERE p.parentid = 0 AND p.boardid = %(board)s ORDER BY `bumped` DESC LIMIT %(limit)d OFFSET %(offset)d" % { 'board': board["id"], 'limit': limit, 'offset': offset} threads = FetchAll(sql) |