Skip to:
Content
Pages
Categories
Search
Top
Bottom

Request: “Thank You button”

  • For some forums, a thank you button could be implemented with a count of how many people have found a post useful.

    Thanks for a great work with the forum plugin!

    -Timothy

Viewing 4 replies - 1 through 4 (of 4 total)

  • chrishajer
    Participant

    @chrishajer

    bb-ratings is not the same thing, but maybe useful?

    http://bbpress.org/plugins/topic/6?replies=4

    Required 0.74 (according to the plugin page.)

    Thanks!

    I know I’m bumping an old thread, but has anyone tackled this?

    I’m iffy on PHP, and was considering attempting this, unless someone else has something in the works.


    _ck_
    Participant

    @_ck_

    This would be a good beginning project for a first bbPress plugin, I’d encourage you and just ask for help if you need it.

    Basically you’d want to store within and display within the topic meta adding the user id number to a list so people can’t thank twice – or so you can list the names of those that thanked. Use “implode” and “explode” to make the list and count the names.

    As a shortcut you could store the actual username and output the raw string with the commas to show all the names that thanked. Then by counting the commas (+1), or exploding into an array and counting the array, you’d get the number of people that thanked. You could give admin the option to show the list of names that thanked or just the count (or both).

    The trickiest part is you have to give a button to thank with, which gives you either a form or an href. Then you have to look for the get/post data and process it. I recommend using a href via a GET instead of POST so bbPress doesn’t have to redirect to clear the post data (it’s nasty to reload twice).

    I just realized you mentioned “posts” vs “topic” and the problem with that is that bbPress doesn’t have a per-post metadata table. This would make it a bit more complicated as you’d have to track which post number within a topic was thanked and store it in the topic’s meta anyway. But if somehow a post is moved to another topic, this becomes a problem as the meta would not move with it (rare but could happen with plugins like move-it).

Viewing 4 replies - 1 through 4 (of 4 total)

You must be logged in to reply to this topic.