[3.2][BETA] Advanced Polls

A place for Extension Authors to post and receive feedback on Extensions still in development. No Extensions within this forum should be used within a live environment!
Scam Warning
Forum rules
READ: phpBB.com Board-Wide Rules and Regulations

IMPORTANT: Extensions Development rules

IMPORTANT FOR NEEDED EVENTS!!!
If you need an event for your extension please read this for the steps to follow to request the event(s)
User avatar
jasolo
Registered User
Posts: 79
Joined: Sat Jan 20, 2018 9:17 pm

Re: [3.2][BETA] Advanced Polls

Post by jasolo »

I have found the culprit. When the result are visible, the extension uses the official function vote_poll() in styles/prosilver/template/ajax.js and then another function from the extension. But around phpBB 3.2.5 the second line of vote_poll() was changed from:

Code: Select all

var poll = $('.topic_poll');
to:

Code: Select all

var poll = $(this).closest('.topic_poll'); 
And after that change the variable poll gets nothing when vote_poll() is used from my extension. :( Changing that file is a bad idea because that change will disappear with future phpBB updates, so the solution is to clone the old vote_poll function in my extension and use it instead of the official one. I'll release this fix soon, but I would prefer a clever fix with one or two lines and using the original function instead of cloning the old one. :roll:

User avatar
jasolo
Registered User
Posts: 79
Joined: Sat Jan 20, 2018 9:17 pm

Re: [3.2][BETA] Advanced Polls

Post by jasolo »

Thanks to kasimi for the fix! :D Better than my idea of cloning. :? The fixed version for phpBB 3.2.9 and 3.3 is here: https://github.com/jasoloz/advancedpoll ... .2.4.1.zip

User avatar
Aurelienazerty
Registered User
Posts: 182
Joined: Sat Jan 08, 2005 8:21 pm
Contact:

Re: [3.2][BETA] Advanced Polls

Post by Aurelienazerty »

Thanks it's works great !

One more thing : an improvement should be to order the voter name by something, maybe user_id it's easier, only add an ORDER BY vote_user_id line 311 in your core/advencedpolls.php

User avatar
jasolo
Registered User
Posts: 79
Joined: Sat Jan 20, 2018 9:17 pm

Re: [3.2][BETA] Advanced Polls

Post by jasolo »

The actual code shows the users in the order they voted. User_id is just the seniority of the user in the forum, I'm not sure that's more useful than who voted first. Surely you mean to order by 'username', joining the table 'users' to the query, but that could be an option. Chronological order makes sense as default.

Post Reply

Return to “Extensions in Development”