[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)
Lord Phobos
Registered User
Posts: 613
Joined: Tue May 18, 2004 11:41 pm

Re: [3.2][BETA] Advanced Polls

Post by Lord Phobos » Sun Feb 10, 2019 3:09 pm

Done, cleared cache and removed temporary files from browser, still no popup after vote.

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

Re: [3.2][BETA] Advanced Polls

Post by jasolo » Sun Feb 10, 2019 3:29 pm

The new line is inserted in the same code that does not work for you, maybe that is the problem. Let's try another location. Change this part:

Code: Select all

			// Display "Your vote has been cast." message. Disappears after 5 seconds.
			var confirmationDelay = (res.can_vote) ? 300 : 900;
to this one:

Code: Select all

			// Display "Your vote has been cast." message. Disappears after 5 seconds.
			phpbb.confirm(poll.find('.vote-submitted').text());			
			var confirmationDelay = (res.can_vote) ? 300 : 900;
Another option is to replace the line with

Code: Select all

phpbb.confirm('Vote submitted');
because "poll.find(" is also used in the problematic code. Check also the browser console for any error.

User avatar
</Solidjeuh>
Registered User
Posts: 1562
Joined: Tue Mar 29, 2016 3:45 am
Location: Aalst (Belgium)
Name: Andy Dm
Contact:

Re: [3.2][BETA] Advanced Polls

Post by </Solidjeuh> » Tue Mar 05, 2019 1:31 am

Will this be "RC" soon? To the users that has it installed ---> No errors? All good?
Register a free account & Play!!
~~~ https://www.solidjeuh.be ~~~
Have a secret? --> https://www.tellyoursecrets.eu

User avatar
jacobsentertainment
Registered User
Posts: 10
Joined: Wed Nov 05, 2014 3:11 am
Location: Netherlands/Germany
Name: Olaf Jacobs
Contact:

Re: [3.2][BETA] Advanced Polls

Post by jacobsentertainment » Fri May 10, 2019 10:35 pm

Hi all,

I was also wondering if the "Average question" from cachete has an solution. Im also looking for an option to show the average of the votes given in an poll.

Also would like to change the % of votes given by current voter (displayed behind the bar) to be switched of or change this to total points given, this might be as an option in the ACP to be defined witch value would be displayed.

Also what Tarantino wrote could be an usefull update to this great tool.

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

Re: [3.2][BETA] Advanced Polls

Post by jasolo » Sat May 11, 2019 8:46 pm

</Solidjeuh> wrote:
Tue Mar 05, 2019 1:31 am
Will this be "RC" soon? To the users that has it installed ---> No errors? All good?
Not in the near future. Despite its beta state, it is very reliable.
jacobsentertainment wrote:
Fri May 10, 2019 10:35 pm
I was also wondering if the "Average question" from cachete has an solution. I'm also looking for an option to show the average of the votes given in an poll.
After that post, Cachete contacted me by private message and I suggested him where he could find the solution, but that was months ago and I don't have his code. I think he was changing the extension to show only the averages, not as an additional option.
jacobsentertainment wrote:
Fri May 10, 2019 10:35 pm
Also what Tarantino wrote could be an usefull update to this great tool.
Thanks for reminding me that feature. ;) I only need some free time.

User avatar
jacobsentertainment
Registered User
Posts: 10
Joined: Wed Nov 05, 2014 3:11 am
Location: Netherlands/Germany
Name: Olaf Jacobs
Contact:

Re: [3.2][BETA] Advanced Polls

Post by jacobsentertainment » Sat May 11, 2019 10:17 pm

jasolo wrote:
Sat May 11, 2019 8:46 pm


After that post, Cachete contacted me by private message and I suggested him where he could find the solution, but that was months ago and I don't have his code. I think he was changing the extension to show only the averages, not as an additional option.
Ok lets see if he has it sorted and would share the info 8-)
Thanks for reminding me that feature. ;) I only need some free time.
I agree on that one :D

sgarret3
Registered User
Posts: 6
Joined: Mon May 20, 2019 7:50 pm

Re: [3.2][BETA] Advanced Polls

Post by sgarret3 » Mon May 20, 2019 8:03 pm

I am having the same problem as Lord Phobos. After someone submits the vote, nothing changes, so everyone keeps telling me it is not working. The vote is submitted and counted, but they don't see anything to acknowledge their vote.

I've tried adding the lines of code suggested (with cache resets) but no improvement, nothing pops up to say 'vote submitted'. Is there a line of code that would force the browser to reload the page after hitting "submit", or force the poll results to recompute after hitting "submit"?

sgarret3
Registered User
Posts: 6
Joined: Mon May 20, 2019 7:50 pm

Re: [3.2][BETA] Advanced Polls

Post by sgarret3 » Mon May 20, 2019 8:36 pm

Can I insert something like:

Code: Select all

document.location.reload(true);
Where you guys were recommending those lines to show a 'submitted' text. I'm not seeing the submitted message from those lines, so not sure if that is the correct spot, or what it would break.

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

Re: [3.2][BETA] Advanced Polls

Post by jasolo » Mon May 20, 2019 10:00 pm

Are you using the Prosilver style? A modified one? Other?

sgarret3
Registered User
Posts: 6
Joined: Mon May 20, 2019 7:50 pm

Re: [3.2][BETA] Advanced Polls

Post by sgarret3 » Mon May 20, 2019 10:03 pm

Yes, whatever the default is for version 3.2.7 - Prosilver. It looks just like this board.

Ok, I commented out a bracket, and it seems to have fixed everything:

Code: Select all

if (!res.can_vote) {	poll.find('.polls').delay(400).fadeIn(500);

	//  }	 ---------- I commented this bracket out ----------

// Display "Your vote has been cast." message. Disappears after 5 seconds.

I am not using a compiler, so I don't know if I have thrown the brackets out of whack. Probably broke something somewhere, but seems to make everything work properly after clicking "submit". I am now executing the code underneath the line:

Code: Select all

// Display "Your vote has been cast." message. Disappears after 5 seconds.
And I wasn't before. :D

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

Re: [3.2][BETA] Advanced Polls

Post by jasolo » Mon May 20, 2019 10:20 pm

So the condition (!res.can_vote) would be true in your case, but that means you cannot vote. :!:

sgarret3
Registered User
Posts: 6
Joined: Mon May 20, 2019 7:50 pm

Re: [3.2][BETA] Advanced Polls

Post by sgarret3 » Mon May 20, 2019 11:03 pm

I definitely see what you are saying, but now I am entering the correct code underneath (displays the vote) where I didn't before. Both with the bracket and without the bracket, the vote is counted, but with the bracket (the way it was) it looks to everyone like it is not functioning since I don't hit the vote display code. So, it would seem that tall the eligible voters are entering the (!res.can_vote) branch - when they shouldn't.

Do you know where the (res.can_vote) function is? I can't find it. My coding is horrible, but something seems off or backwards.

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

Re: [3.2][BETA] Advanced Polls

Post by jasolo » Tue May 21, 2019 8:43 am

Just to be sure, print to the console the value of res.can_vote or also the value of the object res.

res.can_vote is one of the variables from the object res, that contains data of the poll. The extension Advanced Polls replaces the ajax callback when votes are hidden. The replaced callback is vote_poll in styles/prosilver/template/ajax.js. Curiously the original callback and the one from the extension have the same code at that part.

The value of can_vote comes from ext/wolfsblvt/advancedpolls/core/advancedpolls.php:

Code: Select all

'can_vote'			=> $s_vote_incomplete || $s_can_change_vote,
That two variables are also defined in that PHP file.

sgarret3
Registered User
Posts: 6
Joined: Mon May 20, 2019 7:50 pm

Re: [3.2][BETA] Advanced Polls

Post by sgarret3 » Tue May 21, 2019 5:19 pm

Sorry, don't have enough posts yet to send private messages, and my programming skills are atrocious. I am at the php programming level of inserting "print a variable statements". I am happy to do that, but not sure where to do that. Every time I try to print out the (res.can_vote) variables. I get an internal server error. When I try to just print a simple message to show me where I am in the code, it doesn't get displayed in phpBB.

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

Re: [3.2][BETA] Advanced Polls

Post by jasolo » Tue May 21, 2019 6:15 pm


Post Reply

Return to “Extensions in Development”