Skip to:
Content
Pages
Categories
Search
Top
Bottom

plugin: bb-Polls

  • @_ck_

    Participant

    I am pleased to announce a new bbPress Polls plugin.

    Your members can now add polls to their topics, or optionally you can allow *anyone* to add a poll to *any* topic, within a specified time period (hours) since the topic was started.

    bb-Polls allows single answer or multiple answer polls.

    No template edits of any kind.

    There are no additional db tables added, it uses bbpress topicmeta only. Only one entry is created per poll, regardless of size or options (this allow very easy cleanup if desired for some reason).

    This is a *very* early beta, however should be functional except for:

    1. missing admin menu (coming soon – edit plugin directly)

    2. missing administrative editing of existing polls.

    3. missing some visual tweaks (plural case, etc.)

    4. missing some more deluxe options (poll ending time, etc.)

    5. missing multi-language support (coming soon)

    If you can live with these limits and would like to help test and give me some useful, constructive feedback, please download:

    http://ckon.wordpress.com/files/2007/08/bb-polls.txt?v010

    (rename .txt to .php, install, activate, start a new test topic)

    The beta is set so only moderators and above can create/see the polls. This will allow you to test without disturbing visitors.

    Please note the visual styles may be WAY off for the default template or your own template. Unfortunately I am using a very customised template. You’ll probably have to edit the built in css which is kept clearly at the top. (the default styles will be fixed soon when I get a chance to do a trunk install this week)

    Upcoming features include the ability to display all polls and the ability to display a poll anywhere within bbpress templates.

    ps. I need to know if this works as in in the trunk version – I don’t see why it wouldn’t but you never know…

Viewing 25 replies - 26 through 50 (of 75 total)
  • @mazdakam

    Member

    yes i found these to your to do :)

    : admin menu (coming soon – edit plugin directly)

    : administrative editing of existing polls.

    : multi-language support

    @mazdakam

    Member

    here is my screen shot from our forum

    http://tinypic.com/view.php?pic=6bxbtde

    @fel64

    Member

    Can someone demonstrate what the polls are like? Has someone got one live to look at?

    _ck_, you’re storing who voted for what in the topicmeta, right? You mentioned that unserialising stuff was a huge performance hit earlier, wouldn’t this be an issue especially with a large number of voters? What are your thoughts about implementing a bb_votes table to record who voted and how? (I’m not saying that’s better, I’m just wondering what your thoughts are on this because it interests me :) )

    LOL! so why did everyone cry out for a poll plugin then?

    I’m not sure everybody did.

    @howtogeek

    Member

    I agree with fel64 that a bb_votes table would be a much better option for scaling.

    @fel64

    Member

    I’m _not_ saying it’s better. It could be. I’m just wondering about other people’s thoughts and reasons on optimising this. :)

    @_ck_

    Participant

    Actually originally in my code, I was unserializing the data ONCE, then the array is passed globally, already in place. Serializing data is only bad if you are going to be constantly unserializing it in the same bbpress instance. I don’t do that (on purpose).

    (update, actually I have to go back and fix the process with that, I did a quick fix around a bug and fetched $topic each time but that needs to be a global also – all the code used to be in one routine so $topic was only fetched once, but that’s changed – I can fix)

    I used meta data because that’s what it’s there for. There is no need on a forum to create extra tables for stuff that won’t be used outside bbpress. I look at all the downsides of poll plugins like WP-Polls and tried to avoid them.

    The goal was to use bbpress routines wherever possible for future tweaks. As I go back and cleanup bits of code I can already see where and how to make it more ajax-like (though that’s not a priority).

    @_ck_

    Participant

    mazdakam thanks for the screenshot! It’s facinating to see it in Right-To-Left.

    By the way, the newest version let’s you change the word “poll” to whatever the proper word is in your language (Farsi?)

    I can see I also need to allow the word “votes” to be changed. Will add that tonight.

    @_ck_

    Participant

    version 0.15 fixes the cache performance so the data is only unserialized once (I should note that bb-polls adds ZERO extra queries to any page, it’s already fetched with the topic) v0.15 also allows all the labels to be changed for other languages. More CSS classes are added/fixed, slight colour tweaks.

    http://ckon.wordpress.com/files/2007/08/bb-polls.txt?v015

    I’ll get a proper admin menu in there after another version or two when I’ve thought out all the options properly (to prevent the need for any database changes)

    Is there any interest in it having ajax-like action even if it’s not “real” ajax? Basically so there is no page refresh. I can use some simple dhtml tricks.

    @mazdakam

    Member

    _ck_ i dont think you insert __() and _e() in new version take a look at it please again

    @_ck_

    Participant

    Sorry, I have to learn how those translation calls work, never used them before.

    I wanted to allow the text changes to be made within the admin menu so no external files have to be edited.

    ah, found the instructions:

    https://codex.wordpress.org/Localizing_WordPress#Localization_Technology

    I’ll have 0.16 up shortly with that changed.

    @null

    Member

    Some AJAX could be:

    When clicking vote, see the results (without page refresh)

    When clicking see results (and not vote) and see the results

    When seeing the results, but being bulid up and the bars move to their final width

    Like:

    Start

    =

    =

    =

    Fase 2

    ==

    ===

    =

    Fase 3

    ====

    =========

    ==

    Final fase, final status

    ======

    ============

    ===

    But I wouldn’t recomment this, cause it gets irritating after the WOW factor is gone

    @_ck_

    Participant

    mazdakam, try this for better translations?

    http://ckon.wordpress.com/files/2007/08/bb-polls.txt?v016

    I’ve put ALL the text near the top for easier editing.

    @Null, I’m not going to spend too much time “ajax-ing” it.

    But I think i can make all the actions happen without reloading the page. I’m going to simply replace the contents in the <div id=poll></div> dynamically. Should be enough to keep everyone happy.

    @null

    Member

    And makes it much lighter/faster. I am game :)

    @fel64

    Member

    Serializing data is only bad if you are going to be constantly unserializing it in the same bbpress instance.

    _Anything_ is bad if you do it unnecessarily. I don’t understand why you were unhappy with serialising earlier in this case.

    Obviously topicmeta is there to be used for topicmeta. That doesn’t mean it needs to store everything that could be construed as topicmeta. My question wasn’t what where the orthodox place to store topicmeta was, but a comparison of unserialising very large arrays vs. a single query. But then I think that serialising is linear, anyway, so it probably remains very good value.

    @_ck_

    Participant

    example of when serializing is bad:

    a loop of 50 topics being displayed where the data has to be unserialized each and every time because of the way the data is fetched – it’s very easy to accidentally make this happen

    fortunately polls are only displayed on the topic page where the data has already been fetched from the db and deserialized once

    What bothers me even more however is using things like is_topic() which can get caught within the topic list loop on the front-page/forum page, because of how much work it does and how repetitive it is without being cached.

    Unfortunately I cannot figure out a less intensive way and it can’t be cached. bbpress should be storing a simple string flag for it the moment it determines its heading towards that template, not post-processed by looking at the filenames. The difference in overhead is significant.

    ps. actually, I just realised I am doing that bad version of deserializing. I have to trick bbpress not to deserialize all that data… will work on it

    @null

    Member

    Admin page suggestion:

    Being able to change the colors of the bars…

    @_ck_

    Participant

    The CSS is fully editable for the bar colours. You can even make the bars fancy images if you so desire.

    I guess I am going to have to make a proof-of-concept to show people that it doesn’t have to look anything like my default. I can even make it look like polldaddy.

    ps. @fel64 v0.17 now tricks bbpress in keeping the poll data completely unserialized until the plugin actually needs it (easy fix). It still has bbpress cache the data with the topic for fast loads. What’s nice about this is the topic title “[poll]” can still tell if the topic has a poll by just checking for the object without deserializing it (ie. $topic->poll_options) – oh it’s also completely compatible with any currently saved poll data and can deal with it already being unserialized, it just fixes it on the next vote

    @_ck_

    Participant

    So what are the ethics involved in making the styles compatible with polldaddy’s, so that all of their skins could be used?

    Is that “legal” and if so, is it still “ethical” ? Are styles “copyright” ? I vaguely remember reading that “look & feel” cannot be copywrited.

    I’ll consider doing it if that would be desirable and still ethical.

    @null

    Member

    I know it uses CSS, I also know users are lazy and don’t wanna edit the plugin file in oder to change some bar color.

    Using the admin page is way more easy for them to change this and easy to add in.

    Just a suggestion :D

    @_ck_

    Participant

    Okay point taken.

    Like I said earlier, I will give them several default styles to choose from the admin page (basically the top 10 that other people come up with). It’s too tedious to just change each bar colour. Someone can make a style where they all are the same colour or alternating row colours.

    @sambauers

    Participant

    > Is that “legal” and if so, is it still “ethical” ? Are styles “copyright” ? I vaguely remember reading that “look & feel” cannot be copywrited.

    By the looks of their site, not legal. Style is dictated by a combination of CSS and Markup (which is code, so is copyright). To make your markup compatible with someone’s proprietary CSS you would have to investigate and probably copy some of the markup structures, which brings you into iffy legal territory. The least you will need is permission from the copyright holder.

    Copying look and feel can get you into trouble too. The look and feel of a commercial product is known as it’s “get up”, and that is considered intellectual property, more akin to a trademark than a copyright, but still intellectual property.

    Of course, IANAL and your countries laws may vary. : )

    @_ck_

    Participant

    Good advice and very clear points. Not worth the risk.

    I’ve been looking at some of their templates and it’s not that amazing anyway. They also use tables. If I clear up my layout and document it well, I am sure some css gurus out there can make something even better.

    In other news I fixed the nagging refresh bug

    http://ckon.wordpress.com/files/2007/08/bb-polls.txt?v018

    (the post data that’s left on the page when you hit f5) but I hate the way it has to be done (redirect after processing the post data, back to the same page – that’s twice the load for bbpress – can’t find any other documented solutions).

    I think my next code attempt will be to make it load in place (like ajax but not really ajax).

    @mazdakam

    Member

    thanks for inserting string in functions i translated them :) and if you want i can send you the installation pack

    there is another problem in style:

    http://tinypic.com/view.php?pic=5zbd5wh

    that was not in v0.14

    @mazdakam

    Member

    oh i got it

    you should just remove

    float:left;

    from .poll

    @mazdakam

    Member

    here is my pack there is some modification for translating in hard code

Viewing 25 replies - 26 through 50 (of 75 total)
  • You must be logged in to reply to this topic.
Skip to toolbar