Simple Poll Extended v1.0

Release Notes

 

Description:

This plugin enhances the "Simple Poll Plug-in for Elgg 1.5" in a number of ways. Most importantly it allows users to post Polls associated with a group they belong to. It also causes Polls to be included in the Group Menu and as a widget on the Group Profile Page.

This plugin was loosely based on Diego Andrés Ramírez Aragón's Blogextended Plug-in.

Features:

  • Extends the edit poll view to support before and after description fields.
  • Adds support for poll types
  • Adds support for assigning poll 'ownership' to a group
  • Overwrites post icon with the group icon (if it is associated to a group)

Install:

Just drop it on your mod directory and then go to the admin panel and activate it.
Keep in mind that this plug-in overwrites some poll plug-in behaviors so it needs
to be loaded after it.

The order in Tool Admin should look like:

 poll
 poll_extended
 ....

NOTES:

This Plugin REQUIRES the latest version of the Simple Poll Plug-in for Elgg 1.5 (1.2 or better)
to function properly.

If you have an earlier version you must add the following lines of code to mod/poll/index.php
(starting at line 32)

 // Get a poll posts
  
  if(!$polls = $page_owner->getObjects('poll',50,0))
  {
   //if we didn't get any polls, try to get them from metadata
   $polls = get_entities_from_metadata("content_owner",page_owner(), "object","poll",0, 5, false,false,false);
  }
  
  //if there are still no polls, show a friendly message
  if(empty($polls))
  {
   $area2 .= sprintf(elgg_echo("polls:nonefound"),$page_owner->name);
  }
   
  foreach($polls as $poll)
  {
   $area2 .= elgg_view("poll/listing", array('entity' => $poll));
  }
 
 // code continues-->

You will also need to add the following to the poll/languages/en.php file:

 'polls:nonefound' => "No Polls were found from %s",

How the poll post group 'ownership' works?

This plug-in lets the user specify whether a poll is published to their profile or a
group they belong to. The user continues being the post owner, however the Poll is
published in their profile AND in the group profile.

Disclaimer:

While every effort has been made toward testing, I still consider this to be 'in development'. Of course, that's not to say it isn't useable. I have implemented a version of this for a project I am working on and it appears to be stable.

There's always room for improvement, so feel free to suggest additions, share bug-fixes, or extend and modify.

  • Hi, now this feature is working but river is broken - Thanks

  • Also, Group polls is not giving any options to add/view group polls.

  • @elggboy: If you are having River issues, download the latest version of my simple poll plugin, as it has some fixes to address that.

    @elggboy: The group menu will not (at this time) have a 'create polls' option, since the creator of the poll is still the actual owner, not the group. The creator of a poll merely 'assigns' the poll to a particular group. So what you are suggesting/pointing out is just not the way it works. Sorry.

  • Hi john Great plugin

    2 things I noticed

    1.  the assign to group drop down list only has a facility to assign to 10 groups. if you are a member of 20 groups you wont be able to assign the poll any of the last 10 not on the list.

    2. The pagination (all site polls) seams to list all polls we have 67 polls. Pagination shows 7 pages but all 67 polls are listed on each page

    This is a really big hit on our site Thanks for all your work

  • @malaga jack: 2 responses to the 2 things you noticed.

    1. The groups drop-down calls a 'canned' function in Elgg to populate it and by default it is limited to 10 rows returned. To get around that, find the line (#29) in poll_extended\views\default\groups\groupselector.php which contains the following: $objects = get_entities_from_relationship("member",page_owner(),false,"group"); and change it to $objects = get_entities_from_relationship("member",page_owner(),false,"group","",0,"time_created desc",999,0); This will give a limit of 999 groups and order them in the order they were created.
    2. As for Pagination, I have fixed that in the latest version of the Simple Poll Plugin for Elgg 1.5. The friends and all site polls pages aren't modified by the poll extended plugin (this one). So, feel free to download the update.

    Hope this helps.

  • Thanks for everything John you are a STAR ************** *******************

  • Great job with the plugin.

    I also noticed the river issues when creating a poll.  Do you have a fix so when a new poll is created it shows up in the river?  If it helps, the poll showed up in the river before I installed the extended plugin.

    The activity shows up when someone votes on a poll, and the group assignment works well too, but it would be great to have the poll be published to the river.

  • This does not show up in the River. It did before but not now.

    Great plugin but can this be fixed? I have the latest versions of this plugin and the latest version of the Poll plugin as well.

     

    If i knew PHP i would try and fix this and show to others.

  • Hi, I have both the poll plugins and they each add to the submenu group, so on the group submenu it says:

    poll:group

    "group name's" Polls

    and they both link to the group polls.  What's the best way to narrow it down to one?  Thanks.  It's a great plugin.

  • is the river conflict coming from: default\river\object\poll\publish.php in the following statement:

    $performed_by = $statement->getSubject(); in this the extended poll?

    same line in pols is: 

    $performed_by = get_entity($vars['item']->subject_guid); // $statement->getSubject();

    Thank you

  • I have both the simple poll and poll extended installed and enabled.  I made the code additions as well, but i still do not get the option to select a specific group for the polls my user creates.  Please help.

  • Getting a missing token error in Elgg 1.7. Do you know if this is compatible?

  • @NDD
    LOLZ ;-)
    Told you once before and..
    I ain't gonna tell you no more..
    It's a v1.7 actions / security issue ;-)
    Phone me sometime...

  • yeah it's missing that one line of code that was introduced in 1.7 ;]

  • just did a server uprade, anyone got any ideas why now the when you click to view the polls, it just takes you to the index page, very strange??

  • Thanks a lot John M, this will work for the latest elgg 1.8.6 version?  :)

John M

Seasoned web developer from the US

Stats

  • Category: Uncategorized
  • License: GNU General Public License (GPL) version 2
  • Updated: 2014-11-17
  • Downloads: 1052
  • Recommendations: 1

Other Projects

View John M's plugins