Page 5 of 12

Re: [3.2][BETA] Advanced Polls

Posted: Sun Feb 10, 2019 3:09 pm
by Lord Phobos
Done, cleared cache and removed temporary files from browser, still no popup after vote.

Re: [3.2][BETA] Advanced Polls

Posted: Sun Feb 10, 2019 3:29 pm
by jasolo
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.

Re: [3.2][BETA] Advanced Polls

Posted: Tue Mar 05, 2019 1:31 am
by </Solidjeuh>
Will this be "RC" soon? To the users that has it installed ---> No errors? All good?

Re: [3.2][BETA] Advanced Polls

Posted: Fri May 10, 2019 10:35 pm
by jacobsentertainment
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.

Re: [3.2][BETA] Advanced Polls

Posted: Sat May 11, 2019 8:46 pm
by jasolo
</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.

Re: [3.2][BETA] Advanced Polls

Posted: Sat May 11, 2019 10:17 pm
by jacobsentertainment
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

Re: [3.2][BETA] Advanced Polls

Posted: Mon May 20, 2019 8:03 pm
by sgarret3
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"?

Re: [3.2][BETA] Advanced Polls

Posted: Mon May 20, 2019 8:36 pm
by sgarret3
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.

Re: [3.2][BETA] Advanced Polls

Posted: Mon May 20, 2019 10:00 pm
by jasolo
Are you using the Prosilver style? A modified one? Other?

Re: [3.2][BETA] Advanced Polls

Posted: Mon May 20, 2019 10:03 pm
by sgarret3
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

Re: [3.2][BETA] Advanced Polls

Posted: Mon May 20, 2019 10:20 pm
by jasolo
So the condition (!res.can_vote) would be true in your case, but that means you cannot vote. :!:

Re: [3.2][BETA] Advanced Polls

Posted: Mon May 20, 2019 11:03 pm
by sgarret3
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.

Re: [3.2][BETA] Advanced Polls

Posted: Tue May 21, 2019 8:43 am
by jasolo
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.

Re: [3.2][BETA] Advanced Polls

Posted: Tue May 21, 2019 5:19 pm
by sgarret3
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.

Re: [3.2][BETA] Advanced Polls

Posted: Tue May 21, 2019 6:15 pm
by jasolo