Advertisement:
Advertise With Us!

Author Topic: Additional Polls  (Read 57519 times)

Offline iksa

  • Jr. Member
  • **
  • Posts: 104
  • Gender: Male
Re: Additional Polls
« Reply #200 on: January 26, 2013, 08:07:01 PM »
I believe there is a bug in the package-info.xml file of this mod. It says this installs only on 2.0 RC4. I believe this mod would be fully functional also on any other 2.* version. At least I got it installed just fine on my 2.0.3 when I first removed that restriction from package-info.xml.

Offline Arantor

  • Resident Overthinker
  • SMF Friend
  • SMF Legend
  • *
  • Posts: 65,435
Re: Additional Polls
« Reply #201 on: January 26, 2013, 08:09:55 PM »
It's not a bug, it just hasn't been updated by the author for a little over 2 years (when 2.0 RC4 was the then-current version of SMF)

The fact it works is more a testament to the lack of change in SMF for polls since then.

There's always the emulate option in the package manager to avoid editing the package.
Levertine Gallery - a modern, powerful media system designed exclusively for SMF 2.x

Before you send me a PM for support...

Offline iksa

  • Jr. Member
  • **
  • Posts: 104
  • Gender: Male
Re: Additional Polls
« Reply #202 on: January 26, 2013, 08:26:38 PM »
ok, thanks

Offline borish

  • Semi-Newbie
  • *
  • Posts: 65
Re: Additional Polls
« Reply #203 on: October 05, 2014, 06:04:14 AM »
This mod fails to install in SMF 2.0.9 (with 2.0 RC4 emulation). I get an error for a replacement operation in Sources/Display.php for
Code: [Select]
$context['show_view_results_button'] = $context['allow_vote'] && (!$context['allow_poll_view'] || !$context['poll']['show_results'] || !$context['poll']['has_voted']);
$context['poll']['show_view_results_button'] = $context['poll']['allow_vote'] && (!$context['poll']['allow_poll_view'] || !$context['poll']['show_results'] || !$context['poll']['has_voted']);

Offline dougiefresh

  • Sr. Member
  • ****
  • Posts: 824
    • XPtsp.com Community
Re: Additional Polls
« Reply #204 on: January 11, 2015, 06:33:35 PM »
Here is what SMF 2.0 RC4 through SMF 2.0.8 has in Sources/Display.php:
Code: [Select]
$context['show_view_results_button'] = $context['allow_vote'] && (!$context['allow_poll_view'] || !$context['poll']['show_results'] || !$context['poll']['has_voted']);
Here is what SMF 2.0.9 has in Sources/Display.php:
Code: [Select]
$context['show_view_results_button'] = $context['allow_vote'] && $context['allow_poll_view'] && !$context['poll']['show_results'];
Suggested change to that operation (requires edits to the mod):
Code: [Select]
$context['poll']['show_view_results_button'] = $context['poll']['allow_vote'] && $context['poll']['allow_poll_view'] && !$context['poll']['show_results'];

Offline jack_1985

  • Semi-Newbie
  • *
  • Posts: 16
Re: Additional Polls
« Reply #205 on: January 14, 2015, 08:48:13 AM »
Hi everyone,

I installed this mod at SMF 2.0.8. It is functional, but the following error pops up:

Quote
8: Undefined index: poll_hide
in Polls.php
Line: 737

This error appears when someone tries to edit a poll that they have created. The visibility of the votes also seems to reset, when a poll is edited.

Does anyone have any ideas what the cause of this could be, or how it could be fixed?

Any suggestions would be greatly appreciated!  :)

Offline dougiefresh

  • Sr. Member
  • ****
  • Posts: 824
    • XPtsp.com Community
Re: Additional Polls
« Reply #206 on: January 15, 2015, 08:15:49 PM »
@jack_1985: Without seeing your Sources\Polls.php file, I (and probably anyone else) couldn't even begin to help you....

Offline jack_1985

  • Semi-Newbie
  • *
  • Posts: 16
Re: Additional Polls
« Reply #207 on: January 16, 2015, 10:24:55 AM »
Thank you for your reply, dougiefresh. It is much appreciated. I have attached the Polls.php file like you suggested.

If you would be willing to take a look, please note that no changes have been made to this file except the ones required by this mod. I have also double-checked all of those changes myself, and as far as I could tell everything appears to be correct...

Could the problem perhaps lay elsewhere?

Offline jack_1985

  • Semi-Newbie
  • *
  • Posts: 16
Re: Additional Polls
« Reply #208 on: Yesterday at 02:16:17 AM »
Could someone please have a look if they you can find a spare minute? :)

Offline dougiefresh

  • Sr. Member
  • ****
  • Posts: 824
    • XPtsp.com Community
Re: Additional Polls
« Reply #209 on: Yesterday at 05:15:16 PM »
Hi everyone,

I installed this mod at SMF 2.0.8. It is functional, but the following error pops up:

Quote
8: Undefined index: poll_hide
in Polls.php
Line: 737

This error appears when someone tries to edit a poll that they have created. The visibility of the votes also seems to reset, when a poll is edited.

Does anyone have any ideas what the cause of this could be, or how it could be fixed?

Any suggestions would be greatly appreciated!  :)
I'm sorry.  I completely lost track of things....

In Sources/Poll.php, change this line (at line 737):
Code: [Select]
$_POST['poll_hide'] = (int) $_POST['poll_hide'];to this statement:
Code: [Select]
$_POST['poll_hide'] = (int) isset($_POST['poll_hide']) ? $_POST['poll_hide'] : 0;
Hope this helps you.

Offline jack_1985

  • Semi-Newbie
  • *
  • Posts: 16
Re: Additional Polls
« Reply #210 on: Today at 05:51:16 AM »
Thanks dougiefresh!

The error has disappeared. :)

But when editing an existing poll, the visibility option always resets to "show results to everyone". It's only possible to select "run for XXX days" when you first post the poll.

Is that normal?