Home Upgrade Search Memberlist Extras Hacker Tools Award Goals Help Wiki Contact

Feedback 

HF polls showing incorrect poll results?

So I made a thread earlier on which web browser members preffered... Now if you add up all the users who voted for google chrome it doesn't tally up with the result on the right... The result should say 17 not 15.

[Image: 0d17f7de89085f8b79635daf3ca11300.png]

Dunno whether this is a known bug or not, couldn't find anything when searching.
"This is an issue caused by MyBB not having a normalized database structure. They most likely do it to make it faster to get the numbers. That also means that the cached numbers and the actual votes don't add up on larger boards.
Mentors use this userscript to count the actual votes on the MotM poll, which will look at the usernames and change the numbers.
"
source: https://hackforums.net/showthread.php?ti...id47329450

Attached userscript:
Code
// ==UserScript==
// @name      Hack Forums - Poll Counter
// @namespace    Xerotic
// @description  Counts polls properly when they are public (or mod of the section)
// @require      http://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js
// @include      *hackforums.net/polls.php*
// @grant      none
// @version      1.0
// ==/UserScript==

var total_count = 0;

$('.quick_keys').first().find('tr').each(function() {
if(!$(this).children().first().hasClass('thread')) {
  if($(this).children().first().hasClass('tfoot')) {
   $(this).children().first().next().html('<strong>' + total_count + ' votes</strong>');
  } else {
   $(this).children().first().next().next().html($(this).children().first().next().​find('a').length);
   total_count += parseInt($(this).children().first().next().find('a').length);
  }
}
});
I don't middleman any deals on- or off-site. Please don't message me requesting my past services and certainly don't fall for anybody who claims to be me.
Thanks minimalist, can always count on you for a solid answer to any questions in this section xD


Possibly Related Threads...
Thread / Author Replies Views Last Post
by OmniscientSep 28, 2024 08:22 AM 19 500 Sep 28, 2024 08:22 AM
Last Post: DashPHP
[Feedback] by TB12Oct 29, 2021 01:51 PM 21 763 Oct 29, 2021 01:51 PM
Last Post: TB12
[Feedback] by NEROMay 25, 2021 02:22 PM 2 232 May 25, 2021 02:22 PM
Last Post: Omniscient