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 - 51 through 75 (of 75 total)
  • @mazdakam

    Member

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

    https://opensvn.csie.org/wppersian/bbpress/files/poll.zip

    @_ck_

    Participant

    I am pleased to announce that v0.19 now supports ajax-ishâ„¢ behaviours on all actions except form submits (saving data). The view poll results actually happens with a real update, if votes happen while you are waiting to vote and you go check, they will increase. I might even add an auto-refresh to it (every 30 seconds?) to freak people out.

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

    You can also turn off ajax entirely in the settings and if there’s no proper javascript support it falls back to regular actions of course.

    I’ve only tested on firefox out of exhaustion right now, so I’ll need feedback from other browsers. Ajax on submits will take quite a bit more research for me, never done it before and I’ve heard it’s problematic on different browsers.

    @mazdakam, sorry about the float:left – I used it to try to make it behave with some other templates I was testing. I realise now how that would messup your configuration…

    @_ck_

    Participant

    Whoops, I finally considered testing it in internet explorer and I can see it has a few issues – sorry about that. Working on the bugs now…

    @null

    Member

    Some strange things happening here (Opera 9):

    http://www.sourceskins.com/pollbug.gif

    Same with the: Do you want to make a poll question

    Using version 0.20

    @howtogeek

    Member

    I’m just getting some weird error about mysql_real_escape_string. Haven’t looked into it.

    @_ck_

    Participant

    Please try again with v0.21

    https://ckon.files.wordpress.com/2007/08/bb-polls.txt?v021

    Many little bug fixes.

    mysql_real_escape_string requires php >= 4.3.0

    is this a problem for anyone?

    php prior to 4.3 has lots of security issues

    v0.21 looks/works fine in my opera 9.0

    Many thanks for all the beta testing, I think we’re stable now in all modern browsers…

    @howtogeek

    Member

    I’m using php 5.1.6 on my test system, which is where I was using it.

    @_ck_

    Participant

    Ah. See if it goes away with 0.21 ?

    php.net says mysql_real_escape can cause a warning in certain situations but it shouldn’t be fatal – I think I can block that with “@”. Or I can drop to the older mysql_escape_string.

    @null

    Member

    Still not good here (also deactivated all other plugins):

    http://www.sourceskins.com/pollbug2.gif

    Also plz remove the capitals:

    VOTE NOW -> Vote

    SAVE POLL -> Save Poll

    No need to shout :D

    I also miss a Cancel button when creating a poll

    @_ck_

    Participant

    Null, so that is v0.21?

    What OS are you on windows/mac

    What version of opera is that?

    Can you do a quick test in IE / Firefox for me and see if it does the same?

    Yes I was thinking the same about the cancel button, will add shortly in future version. Working on the ajax-ish voting right now.

    ps. all the button text, actually ALL the text is completely editable at the top

    @null

    Member

    Poll version 0.21

    Got the same results in:

    Ie7

    FF

    Safari

    Opera

    All latest versions

    OS Windows XP

    Server for website Linux

    Server API Apache

    PHP Version 5.0.4

    @_ck_

    Participant

    That’s the default bbpress template right?

    I have a very similar setup but not seeing any of that.

    Can anyone else report on this issue?

    0.22 will be out shortly, I have ajax voting done.

    Gotta fix how it calculates totals for multiple answer votes.

    @fel64

    Member

    Can you use $bbdb->escape() ? In future you could even use $bbdb->prepare() but I’m not sure how that one works.

    @_ck_

    Participant

    Wasn’t aware of that one. I will look into it.

    I’ve dropped it to the older escape routine.

    Will just have to see if it works with non-english pages or not.

    Is *anyone* else experiencing what Null is showing?

    I cannot reproduce it.

    v0.22 now adds ajax-ish voting so it’s almost entirely ajax except for the poll setup form which will take much more work than I am willing to do right now. (also cancel button added to poll setup)

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

    It’s getting really good, ready for the the members to give it a go.

    Can’t believe I didn’t have any code at all for this three days ago and its over 15k now with nearly 400 lines.

    Now I need someone to come up with some pretty CSS styles.

    @null

    Member

    Hmm if I press Vote, nothing happens… If I refresh the page, the bar appears.

    New tip:

    If 0 votes still keep a bit of barcolor visible like:

    [=========] 3 votes

    [===] 2 votes

    [] 0 votes

    @_ck_

    Participant

    Yeah sorry about that.

    I just checked opera on 0.22 / 0.23 and the ajax vote is broken on that. Works in IE + firefox though.

    Opera still doesn’t have any level of javascript debugging does it?

    I just realised there’s also a problem in that you can vote without anything selected which is something I somehow overlooked entirely.

    @_ck_

    Participant

    Ah I think I see the problem.

    Unlike all the other browsers, Opera has taken it upon itself to cache the javascript request instead of actually fetching it each time (this is one way it cheats for speed).

    Will add some code for a unique URL to force it to work.

    okay, here you go, v0.24

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

    should fix the issues with opera (and anything else caching)

    I’ve also now added hidden near the top of the code a “test_mode”

    If you change “test_mode” to “true” it will allow you do keep voting on any poll for testing purposes. You can switch back and forth to view/vote etc. Obviously change it back on a live site with members or people will be able to stuff the ballot box.

    Keep in mind that previous poll data may have been made invalid by the bug in opera so start with a fresh poll. Do not keep re-using the old polls for testing with v0.24. I have not changed data structures but if the data got inserted wrong, it could be invalid for that topic.

    (I’ll make a “delete poll” option soon for administrators.

    The space it takes is trivial, so don’t worry about that)

    @null

    Member

    Hmm You took away the brake between the option for single or multy votes? Shame :( Ow and yes that caching in Opera is true, I always solve it to give it an unique time thingy to force Opera to reload instead of using cache.

    Also I get this bug in Opera now:

    You haven’t selected anything!

    Well I DID select something :) Can’t vote at all now, keeps saying that message!

    Also the other issue with the standard template isn’t solved yet!

    @_ck_

    Participant

    Null, I am testing using opera 9 on windows.

    I am using 0.24 of the plugin on the bbpress trunk.

    I am able to create a new poll & vote with no alerts.

    There is no problem with the css layout.

    Make sure you create a NEW poll for testing with 0.24

    Wait I just thought of something.

    Are you using a personal firewall like Norton?

    They sometimes filter javascript in bad ways.

    I am also starting to think that php 5 is doing something weird with the data escaping since you say you get it in all browsers. Unfortunately I do not have a php 5 server to test on.

    Can anyone else reproduce what Null is reporting or does it work?

    ps. you can turn off ajax if you want to test it normally by changing the “use_ajax” option near the top of the code. Set it to “false”.

    pps. Null, is this off the site in your profile?

    Can you create a poll for me to see off one of the pages so I can see the bug in action?

    @null

    Member

    No, I have a special test site for this stuff: http://www.sourceskins.com/bbpress go take a look if you have it there too…

    I also run the latest stable release, no trunk versions

    @_ck_

    Participant

    Oh that was immediately more helpful than anything else I’ve asked or you’ve answered. There is something really strange going on in that the code is being inserted twice. Some hook is firing twice when it should only be once. I have to investigate.

    Er, What other plugins do you have running?

    I see your bbmenu in there.

    Can you try deactivating everything?

    Also, post your post.php template in code tags here – are you positive it’s stock?

    I think I know exactly what is happening but I don’t know why.

    My plugin hooks topicmeta

    add_action('topicmeta','bb_polls_pre_poll');

    Topicmeta can only happen once on a topic page.

    Somehow it’s firing more than once on your page.

    Deactivate all other plugins for a minute just to make sure something doesn’t have a major bug.

    Try this experimental fix which unhooks itself after the first execute to prevent a second run:

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

    @null

    Member

    No wait I think what is wrong here.

    I am also testing a highly alpha new cool plugin here, that why I have edited post.php. I think it’s in conflict with your hook. Brb uploading original post.php

    Edit:

    Lol that fixed it…. darn that fixed all bugs I’ve had version 0.24 is fine

    Now how to prevent this in the future when I am going to release my plugin hmmmmmmm

    ps. You see the bbmenu tabs? i dont see them :S

    @_ck_

    Participant

    My new version 0.25 should still work with your plugin.

    It unhooks after the first run.

    But still, topicmeta should not fire more than once per topic page IMHO.

    Alright, signing out for the day, have fun!

    ps. make me some nice css skins!

    @null

    Member

    Whaha i had some nice skins, 4 years ago, never took the time to cancel the .com

    That plugin of mine is still so buggy (and not working) it proberbly caused the 2 launches of topicmeta. To be honest, if I told you what I wanted to create, you’d fix it in 1 day i guess. I still need to reverse engineer it, learn how stuff works and puzzle it togther. Working on it for 2 weeks now, no working results yet :(:(:(

    But I’ll get it right…. ever……

    @peterwsterling

    Participant

    I really struggled to find a polls feature for bbPress that met my needs, so I created my own!
    It’s here if anyone wants it:
    http://www.sterling-adventures.co.uk/blog/products/bbpress-wordpress-user-defined-polls-plugin/

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