[3.2][RC] Poll on Index

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!
Anti-Spam Guide
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
kasimi
Extension Customisations
Extension Customisations
Posts: 3392
Joined: Sat Sep 10, 2011 7:12 pm
Location: Germany
Contact:

[3.2][RC] Poll on Index

Post by kasimi » Mon Aug 27, 2018 8:33 pm

Extension Name: Poll on Index by kasimi

Extension Description: This extension displays selected polls on the index page.

Extension Version: 1.0.0

Development status: There are no known bugs. Please test, test, test. :)

Requirements:
  • PHP at least 5.5.0
  • phpBB at least 3.2.0
  • prosilver based style
Screenshots:
  • A poll on the index page. Users can vote without having to go to the topic.

    Image
  • The extension adds a new forum permission “Can show poll on index”.

    Image
  • When a users with this permission creates a poll, there is a new option that allows you to choose to display the poll on the index page, either indefinitely or until the poll ends.

    Image

Install path: ext/kasimi/pollonindex

Demo URL: https://kasimi.net

Extension Download: https://github.com/kasimi/phpbb-ext-pol ... master.zip

GitHub Repo: https://github.com/kasimi/phpbb-ext-pollonindex

User avatar
3Di
Registered User
Posts: 13151
Joined: Mon Apr 04, 2005 11:09 pm
Location: Milan (IT) Frankfurt (DE)
Name: Marco
Contact:

Re: [3.2][BETA] Poll on Index

Post by 3Di » Mon Aug 27, 2018 8:43 pm

What happens when multiple polls have been selected to be shown on the index page?

I mean, what about the page layout.

Nice idea btw. :)
:game_die: The new Dice Roller extension for phpBB 3.2 is out! :game_die:

Please PM me only to request paid works. Thx.
Want to compensate me for my interest? Donate
Extensions, Scripts, MOD porting, Update/Upgrades
My development's activity º PhpStorm's proud user

User avatar
kasimi
Extension Customisations
Extension Customisations
Posts: 3392
Joined: Sat Sep 10, 2011 7:12 pm
Location: Germany
Contact:

Re: [3.2][BETA] Poll on Index

Post by kasimi » Mon Aug 27, 2018 8:59 pm

In that case you will see multiple polls on the index page. The sooner a poll ends the higher it is ranked.

Note that you can achieve a similar result with the SiteMaker extension by blitze. The difference is that this extension is light weight, allows giving users permission to show polls on the index, and displays the polls a bit differently (wrapped in forabg).

User avatar
3Di
Registered User
Posts: 13151
Joined: Mon Apr 04, 2005 11:09 pm
Location: Milan (IT) Frankfurt (DE)
Name: Marco
Contact:

Re: [3.2][BETA] Poll on Index

Post by 3Di » Mon Aug 27, 2018 9:09 pm

I see, okay.
I don't know.. I think there should be a sort of limitation like max 3 or so on though.

Ah, may I suggest a three radion buttons instead of the dropdown? :)
:game_die: The new Dice Roller extension for phpBB 3.2 is out! :game_die:

Please PM me only to request paid works. Thx.
Want to compensate me for my interest? Donate
Extensions, Scripts, MOD porting, Update/Upgrades
My development's activity º PhpStorm's proud user

NastyBoy
Registered User
Posts: 85
Joined: Wed May 31, 2017 7:03 pm
Location: Germany
Name: Tim
Contact:

Re: [3.2][BETA] Poll on Index

Post by NastyBoy » Wed Sep 12, 2018 10:16 pm

That is a cool ext. thank you for that

User avatar
noth
Registered User
Posts: 2471
Joined: Fri Jan 07, 2005 7:10 pm
Location: North Surrey
Contact:

Re: [3.2][BETA] Poll on Index

Post by noth » Thu Sep 13, 2018 7:04 am

yeah what a great idea! Very nice!

the way the permissions is set up is fine, there is no Ext tab control, instead you go to the specific poll(s) that you want featured on the index and use a drop down at the bottom to flag that that poll will display on the index NOT BAD !! works great !! :D

mrgtb
Registered User
Posts: 549
Joined: Wed Oct 03, 2007 10:51 am

Re: [3.2][BETA] Poll on Index

Post by mrgtb » Tue Sep 18, 2018 6:51 pm

Very nice, good idea as well to show a vote poll on index page.

I have noticed something though. If you have a guest forum added and allow guests to create and vote on polls on that forum, along with start topics and post replies. While they can cast a vote from the thread itself on the vote poll, or reply to it with a post, they cannot vote from the index page if having permission to vote on polls on the forum its added on as a guest. But members can vote from the index page on the vote poll added on it. Not a biggie, but thought I'd mention it with guests when they have permission to vote on a forum with polls.

I have also noticed looking at my site using Internet Explorer 11 on Windows 7 and not FireFox looking at the Vote Poll. That FA icon used in the header bar is making the header area bigger (taller) than the rest of the other header bars used on index page.

<i class="icon fa-bar-chart fa-fw" aria-hidden="true"></i>

So I would remove the FA icon and not show that in the header bar. I removed it from the poll template testing and now the header bar is the same size as all others on the index page without it displayed before the Poll text in IE

User avatar
kasimi
Extension Customisations
Extension Customisations
Posts: 3392
Joined: Sat Sep 10, 2011 7:12 pm
Location: Germany
Contact:

Re: [3.2][BETA] Poll on Index

Post by kasimi » Fri Sep 21, 2018 4:59 pm

mrgtb wrote:
Tue Sep 18, 2018 6:51 pm
I have noticed something though. If you have a guest forum added and allow guests to create and vote on polls on that forum, along with start topics and post replies. While they can cast a vote from the thread itself on the vote poll, or reply to it with a post, they cannot vote from the index page if having permission to vote on polls on the forum its added on as a guest. But members can vote from the index page on the vote poll added on it. Not a biggie, but thought I'd mention it with guests when they have permission to vote on a forum with polls.
I can't reproduce this with phpBB 3.2.3. I gave the guest group the "Can vote in polls" permission in a forum an existing poll was in and guests were able to vote both in the topic and on the index page.

mrgtb
Registered User
Posts: 549
Joined: Wed Oct 03, 2007 10:51 am

Re: [3.2][BETA] Poll on Index

Post by mrgtb » Fri Sep 21, 2018 6:53 pm

kasimi wrote:
Fri Sep 21, 2018 4:59 pm
mrgtb wrote:
Tue Sep 18, 2018 6:51 pm
I have noticed something though. If you have a guest forum added and allow guests to create and vote on polls on that forum, along with start topics and post replies. While they can cast a vote from the thread itself on the vote poll, or reply to it with a post, they cannot vote from the index page if having permission to vote on polls on the forum its added on as a guest. But members can vote from the index page on the vote poll added on it. Not a biggie, but thought I'd mention it with guests when they have permission to vote on a forum with polls.
I can't reproduce this with phpBB 3.2.3. I gave the guest group the "Can vote in polls" permission in a forum an existing poll was in and guests were able to vote both in the topic and on the index page.
Visit my forum, the link is my signature below and you can see the vote poll on the index page. I'm also running the very latest phpBB version and you can see in the topic you can vote, but not on the index page as a guest.

I have guests setup to be able to create polls/vote on polls on that guest forum. They can't "change a vote" though, that is set to no for them.

This is the forum permissions I have set for guests on that guest forum:

Can create polls (Yes)
Can show poll on index (No)
Can vote in polls (Yes)
Can change existing vote (No)

User avatar
kasimi
Extension Customisations
Extension Customisations
Posts: 3392
Joined: Sat Sep 10, 2011 7:12 pm
Location: Germany
Contact:

Re: [3.2][BETA] Poll on Index

Post by kasimi » Fri Sep 21, 2018 7:14 pm

Does this help?
  • Open ext/kasimi/pollonindex/event/listener.php
  • Find

    Code: Select all

    $cur_voted_id = explode(',', $this->request->variable($cookie_name, '', true, request_interface::COOKIE));
    
  • Replace with

    Code: Select all

    $cur_voted_id = $this->request->variable($cookie_name, '', true, request_interface::COOKIE);
    $cur_voted_id = $cur_voted_id ? explode(',', $cur_voted_id) : [];
    

mrgtb
Registered User
Posts: 549
Joined: Wed Oct 03, 2007 10:51 am

Re: [3.2][BETA] Poll on Index

Post by mrgtb » Fri Sep 21, 2018 7:19 pm

I just did that edit and replaced the file. Seems okay now

User avatar
kasimi
Extension Customisations
Extension Customisations
Posts: 3392
Joined: Sat Sep 10, 2011 7:12 pm
Location: Germany
Contact:

Re: [3.2][BETA] Poll on Index

Post by kasimi » Sat Sep 22, 2018 8:26 am

I pushed some fixes. You can update the usual way: disable extension, delete old extension folder, upload new extension folder, enable extension.

Changes:
  • Fixed voting for guests
  • Changed poll option's select box to radio buttons
  • Display topic title in the header bar
  • Removed FontAwesome icon from header bar
There is a bug when voting while multiple polls are displayed on the index. In this situation, prosilver animates the results of all polls, not just the one you've voted for. The fix requires a core edit: https://github.com/phpbb/phpbb/pull/5366/files which means the extension eventually will require phpBB 3.2.4 and won't be submitted to the CDB before 3.2.4 is released.

mrgtb
Registered User
Posts: 549
Joined: Wed Oct 03, 2007 10:51 am

Re: [3.2][BETA] Poll on Index

Post by mrgtb » Sat Sep 22, 2018 8:34 am

So you have updated the extension on Github now. And you can actually make that CORE file edit to the ajax file with Prosilver theme to work proper with multiple poles displayed on index page before phpBB 3.2.4 comes out, if don't want to wait for it being done in that version later? As phpBB 3.2.4 could possibly be 3-6 months away yet, seeing as 3.2.3 has only just been released this week. Meaning 3.2.4 is not really coming anytime soon.

Anyway, I installed the latest version with your changes and did that core prosilver file edit to ajax file because I've already changed prosilver theme a fair bit. Not an issue for me doing it before 3.2.4 comes, also stuck two vote polls on index now to see what happens

User avatar
kasimi
Extension Customisations
Extension Customisations
Posts: 3392
Joined: Sat Sep 10, 2011 7:12 pm
Location: Germany
Contact:

Re: [3.2][BETA] Poll on Index

Post by kasimi » Sat Sep 22, 2018 9:15 am

Extensions that require core edits to properly function wouldn't pass CDB validation anyway so there really is no point in submitting it before 3.2.4 is out. I understand it could take a while but that's how it is. In the meantime, let's keep testing. :)

mrgtb
Registered User
Posts: 549
Joined: Wed Oct 03, 2007 10:51 am

Re: [3.2][BETA] Poll on Index

Post by mrgtb » Sat Sep 22, 2018 9:22 am

Yeah, I understand that. Which is why I made the core edit now to use it proper with two polls on index testing.

When you say there was a problem with "animation", why the core file edit was needed to ajax. Do you mean when you have not voted and click the button to "show results". If you had two polls displayed on index page it was showing the same animation for both?

Post Reply

Return to “Extensions in Development”

Who is online

Users browsing this forum: Google [Bot], mastnacek, Naguissa, wojtek64 and 20 guests