[REQ] Improved / Enhanced Polls

Looking for a MOD? Have a MOD request? Post here for help. (Note: This forum is community supported; phpBB does not have official MOD authors)
Scam Warning
Locked
User avatar
Linda Carter
Registered User
Posts: 514
Joined: Fri Feb 15, 2008 6:45 am

[REQ] Improved / Enhanced Polls

Post by Linda Carter »

Description of the phpBB 2 hack:

Hides the poll results until the poll is closed/expired and adds the ending time to any vote. It can be set to run on certain polls and not others.
## Included files: 1 - templates/xxx/viewtopic_poll_notyet.tpl
## Files to edit: 7
## language/lang_english/lang_main.php
## includes/functions_post.php
## posting.php
## viewtopic.php
## templates/xxx/posting_poll_body.tpl
## templates/xxx/viewtopic_poll_result.tpl
## templates/xxx/viewtopic_poll_ballot.tpl

- You have to execute one query via phpmyAdmin. Alternate you can use the file db_update.php included on this MOD to alter the database automatically.
# (just upload to phpBB folder, run the file and delete after successfully installation).

SQL command:

ALTER TABLE phpbb_vote_desc ADD show_endtime TINYINT (1) default '1', ADD show_results TINYINT (1) default '1';
Download link:
http://www.phpbbhacks.com/download/1371

And something else I would like to see here on phpBB 3: :)

I have posted that the kind of poll I wanted was that from vBulletin, see bellow:

Image
Click the image to resize on another window

And when you click on the number of votes (hyperlinks), another screen is showed detailing who voted on each option:

Image
Click the image to resize on another window

That will also be great, if possible. I never saw such kind of poll on any script, other than vBulletin. :)
"Whoever has not known himself has known nothing. But whoever has known himself has simultaneously achieved knowledge about the depth of all things."
User avatar
Linda Carter
Registered User
Posts: 514
Joined: Fri Feb 15, 2008 6:45 am

Re: [REQ] Improved / Enhanced Polls

Post by Linda Carter »

*bump* :ugeek:

I was looking today the idea from the first MOD:

Hides the poll results until the poll is closed/expired and adds the ending time to any vote. It can be set to run on certain polls and not others.

And the concept is quite simple, actually. Perhaps someone who knows phpBB 3 better than I do can adapt this MOD? At first sight I see no complications that could prevent or make the implementation very hard.
"Whoever has not known himself has known nothing. But whoever has known himself has simultaneously achieved knowledge about the depth of all things."
lycwolf
Registered User
Posts: 8
Joined: Tue Nov 27, 2007 1:42 am

Re: [REQ] Improved / Enhanced Polls

Post by lycwolf »

I second a request for this....

Please? :(
User avatar
Linda Carter
Registered User
Posts: 514
Joined: Fri Feb 15, 2008 6:45 am

Re: [REQ] Improved / Enhanced Polls

Post by Linda Carter »

lycwolf wrote:I second a request for this....

Please? :(
Yes, specially the first request concerning the phpBB 2 MOD, I really don't know why the phpBB developers can't add these options to all polls. :(

Please, instead of recycling the same polls all over again, let's see if there's a way to add more options. That's what users are looking for - more options to customize their boards. The more, the better. :P

EDIT: More ideas (taken from the vB discussion forum, ideas that were not fully implemented even on vB):
- Have a private results option (only admins/thread starter can see);

- Have a do not show results before voting option;
- Have a do not show results before and after voting option;

- Allow other users to add ONE other poll choice to your poll if the poll starter ticks that option;

- Allow short poll comments to explain each choice (optional);

- Multiple polls on one thread - Useful for questionnaires and feedback forms;

- Decline vote. This lets the user say he doesnt want to vote (it doesnt affect the poll) but it will always direct him to the poll results instead of showing the poll options every time he goes to the thread;

- Allow voter to change his vote - This can be disabled by the poll starter;

- Dynamic polls - Administrators can have the option of enabling dynamic polls. This means the option with most votes at the top followed by the next with the most votes all the way to the bottom;

- Reset poll results;

- More accurate poll totals. (Sometimes the total percentages don't add up to 100%);

- The use of Ajax when voting and adding more options in a poll (i.e. if you choose a poll with 4 options and in the poll settings you decided you need another option, you change it to 5 and click "update", the extra option box should be added using ajax);

- When adding a poll to a thread and allowing multiple choices, create an option to limit users to X options. For example, only being able to select 3 out of the 10 choices in a poll;

- Do not post thread until poll is posted (when the option to add a poll is selected). This could off course be done in a number of ways;
Looks like there is one software package called UBB.Classic that used to have a good system of polls, and perhaps might be used as inspiration to develop these ideas (quoted above) on phpBB).
"Whoever has not known himself has known nothing. But whoever has known himself has simultaneously achieved knowledge about the depth of all things."
User avatar
A_Jelly_Doughnut
Former Team Member
Posts: 34457
Joined: Sat Jan 18, 2003 1:26 am
Location: Where the Rivers Run
Contact:

Re: [REQ] Improved / Enhanced Polls

Post by A_Jelly_Doughnut »

Linda Carter: This would indeed be a fairly simple MOD to create for phpBB3. To do this for all polls, you could find this in viewtopic.php:

Code: Select all

	foreach ($poll_info as $poll_option)
	{
		$option_pct = ($poll_total > 0) ? $poll_option['poll_option_total'] / $poll_total : 0;
		$option_pct_txt = sprintf("%.1d%%", ($option_pct * 100));

		$template->assign_block_vars('poll_option', array(
			'POLL_OPTION_ID' 		=> $poll_option['poll_option_id'],
			'POLL_OPTION_CAPTION' 	=> $poll_option['poll_option_text'],
			'POLL_OPTION_RESULT' 	=> $poll_option['poll_option_total'],
			'POLL_OPTION_PERCENT' 	=> $option_pct_txt,
			'POLL_OPTION_PCT'		=> round($option_pct * 100),
			'POLL_OPTION_IMG' 		=> $user->img('poll_center', $option_pct_txt, round($option_pct * 250)),
			'POLL_OPTION_VOTED'		=> (in_array($poll_option['poll_option_id'], $cur_voted_id)) ? true : false)
		);
	}
And replace it with

Code: Select all

if (($topic_data['poll_length'] != 0 && $topic_data['poll_start'] + $topic_data['poll_length'] > time()) || $topic_data['poll_length'] == 0)
{
   foreach ($poll_info as $poll_option)
   {
      $option_pct = ($poll_total > 0) ? $poll_option['poll_option_total'] / $poll_total : 0;
      $option_pct_txt = sprintf("%.1d%%", ($option_pct * 100));

      $template->assign_block_vars('poll_option', array(
         'POLL_OPTION_ID'       => $poll_option['poll_option_id'],
         'POLL_OPTION_CAPTION'    => $poll_option['poll_option_text'],
         'POLL_OPTION_RESULT'    => $poll_option['poll_option_total'],
         'POLL_OPTION_PERCENT'    => $option_pct_txt,
         'POLL_OPTION_PCT'      => round($option_pct * 100),
         'POLL_OPTION_IMG'       => $user->img('poll_center', $option_pct_txt, round($option_pct * 250)),
         'POLL_OPTION_VOTED'      => (in_array($poll_option['poll_option_id'], $cur_voted_id)) ? true : false)
      );
   }
}
Of course, this does not add an option on a per-poll basis. That would require a database schema change.
Last edited by Highway of Life on Thu Sep 04, 2008 2:32 am, edited 1 time in total.
Reason: off topic replies have been split -- will continue via PM
A Donut's Blog
"Bach's Prelude (Cello Suite No. 1) is driving Indiana country roads in Autumn" - Ann Kish
User avatar
Linda Carter
Registered User
Posts: 514
Joined: Fri Feb 15, 2008 6:45 am

Re: [REQ] Improved / Enhanced Polls

Post by Linda Carter »

Wait, have you tested the code above? How's that working for you? :)
"Whoever has not known himself has known nothing. But whoever has known himself has simultaneously achieved knowledge about the depth of all things."
User avatar
DavidIQ
Customisations Team Leader
Customisations Team Leader
Posts: 17320
Joined: Thu Jan 06, 2005 1:30 pm
Location: Fishkill, NY
Name: David Colón
Contact:

Re: [REQ] Improved / Enhanced Polls

Post by DavidIQ »

I think that's for you to find out ;-)
Apply to become a Jr. Extension Validator
My extensions | In need of phpBB services? | Was I helpful today?
No unsolicited PMs unless you're planning on asking for paid help.
User avatar
Linda Carter
Registered User
Posts: 514
Joined: Fri Feb 15, 2008 6:45 am

Re: [REQ] Improved / Enhanced Polls

Post by Linda Carter »

DavidIQ wrote:I think that's for you to find out ;-)
I know, but I am not sure if he is using the same SQL changes on the database from phpBB 2. Sorry, I forgot to ask that on my post.

I am talking about this MOD:

Hides the poll results until the poll is closed/expired and adds the ending time to any vote. It can be set to run on certain polls and not others.

This is the SQL command:

ALTER TABLE phpbb_vote_desc ADD show_endtime TINYINT (1) default '1', ADD show_results TINYINT (1) default '1';
"Whoever has not known himself has known nothing. But whoever has known himself has simultaneously achieved knowledge about the depth of all things."
User avatar
Phil
Former Team Member
Posts: 10403
Joined: Sat Nov 25, 2006 4:11 am
Name: Phil Crumm
Contact:

Re: [REQ] Improved / Enhanced Polls

Post by Phil »

As he said, adding it on a per-poll basis would require the editing of the schema, like that query does. However, his edit does not allow it on a per-poll basis, so such a query is not needed.
Moving on, with the wind. | My Corner of the Web
User avatar
Linda Carter
Registered User
Posts: 514
Joined: Fri Feb 15, 2008 6:45 am

Re: [REQ] Improved / Enhanced Polls

Post by Linda Carter »

Renewing my request to see one of these projects alive... I mean, one MOD being developed by someone and approved by by the MOD-team... :mrgreen:

At least both the "hide results from the poll until it's closed" and "show nicknames from members who voted"... the last one it's more important to me than all the others. The creator of the poll should be allowed to turn on this option. :)
"Whoever has not known himself has known nothing. But whoever has known himself has simultaneously achieved knowledge about the depth of all things."
User avatar
Linda Carter
Registered User
Posts: 514
Joined: Fri Feb 15, 2008 6:45 am

Re: [REQ] Improved / Enhanced Polls

Post by Linda Carter »

*BUMP* :ugeek:
"Whoever has not known himself has known nothing. But whoever has known himself has simultaneously achieved knowledge about the depth of all things."
Locked

Return to “[3.0.x] MOD Requests”