From 2fa6333ca31b0947a38da73c88c89dfe3a374d5f Mon Sep 17 00:00:00 2001 From: ccd0 Date: Mon, 10 Nov 2014 04:14:13 -0800 Subject: [PATCH] IP Count bugfixes. --- src/Monitoring/ThreadStats.coffee | 4 ++-- src/Monitoring/ThreadUpdater.coffee | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/Monitoring/ThreadStats.coffee b/src/Monitoring/ThreadStats.coffee index 569bdc9fa..09332a834 100755 --- a/src/Monitoring/ThreadStats.coffee +++ b/src/Monitoring/ThreadStats.coffee @@ -63,8 +63,8 @@ ThreadStats = {thread, postCountEl, fileCountEl, ipCountEl} = ThreadStats postCountEl.textContent = postCount fileCountEl.textContent = fileCount - if Conf["IP Count in Stats"] - ipCountEl.textContent = if ipCount? then ipCount else '?' + if ipCount? and Conf["IP Count in Stats"] + ipCountEl.textContent = ipCount (if thread.postLimit and !thread.isSticky then $.addClass else $.rmClass) postCountEl, 'warning' (if thread.fileLimit and !thread.isSticky then $.addClass else $.rmClass) fileCountEl, 'warning' diff --git a/src/Monitoring/ThreadUpdater.coffee b/src/Monitoring/ThreadUpdater.coffee index 779d3a2fe..ca4b7dfaf 100755 --- a/src/Monitoring/ThreadUpdater.coffee +++ b/src/Monitoring/ThreadUpdater.coffee @@ -334,10 +334,10 @@ ThreadUpdater = Header.scrollTo root if root # Update IP count in original post form. - if ipCountEl = $.id('unique-ips') + if OP.unique_ips? and ipCountEl = $.id('unique-ips') ipCountEl.textContent = OP.unique_ips - ipCountEl.previousSibling.textContent = ipCountEl.previousSibling.textContent.replace(/\b(?:is|are)\b/, if OP.unique_ips > 1 then 'are' else 'is') - ipCountEl.nextSibling.textContent = ipCountEl.nextSibling.textContent.replace(/\bposters?\b/, if OP.unique_ips > 1 then 'posters' else 'poster') + ipCountEl.previousSibling.textContent = ipCountEl.previousSibling.textContent.replace(/\b(?:is|are)\b/, if OP.unique_ips is 1 then 'is' else 'are') + ipCountEl.nextSibling.textContent = ipCountEl.nextSibling.textContent.replace(/\bposters?\b/, if OP.unique_ips is 1 then 'poster' else 'posters') $.event 'ThreadUpdate', 404: false