Please upgrade here. These earlier versions are no longer being updated and have security issues.
HackerOne users: Testing against this community violates our program's Terms of Service and will result in your bounty being denied.

How to 'unthank' and how to limit where thanks can be given?

edited August 2011 in Vanilla 2.0 - 2.8
Hi, could someone give me a few pointers on how I can tweak this addon so that...

a) I can 'un-thank' an accidentally added 'thank'
b) 'Thanks' can ONLY be given to the first post in a discussion.

I'm actually trying to use this Addon in order to attempt to manage attendees for events, so I've reworded the 'Thank' button to 'Click to Attend', and shown the list of attendees with a 'To Be Attended By' intro rather than a 'Thanked By'...I've worked out how the tweak I needed to make in order to allow users to 'Thank' their own posts (so if I create an event, I can also flag that I'm going to attend).

Thanks in advance.
Tagged:

Best Answers

  • SS ✭✭
    Answer ✓
    I see. You are trying to hack addon to make it something similar of "attendance management". It is not good idea, I think.

    I can implement "get back "thank" feature. It is easy, but it will be configurable (optional). Thank only for discussion config option also can be implemented.
  • SS ✭✭
    Answer ✓
    Done. Get version 2.14.2.0.18. See README file.



Answers

  • SS ✭✭
    Which version and theme you are using?

    > How to 'unthank' and how to limit where thanks can be given?
    Thanks system is the ONE WAY reputation system. There is no "-1" button".
    However, you can manually delete row from table gdn_thankslog. After that run http://site/dashboard/utility/structure/vanilla to recalculate thanks count for users.

    > b) 'Thanks' can ONLY be given to the first post in a discussion.
    Never heard about this problem.
    Probably bad theme. What theme?

    > I needed to make in order to allow users to 'Thank' their own posts
    Impossible. It is make no sense.
  • edited August 2011
    Which version and theme you are using?
    The version 2.1.13 and the default theme.

    Thanks system is the ONE WAY reputation system. There is no "-1" button".
    However, you can manually delete row from table gdn_thankslog. After that run http://site/dashboard/utility/structure/vanilla to recalculate thanks count for users.
    Yup I know it is as it stands, but there must be a way implement a '-1' as an extension to the addon though?

    It "knows" if a user has thanked on a post already (because the 'Thanks' disappears), so surely a "UnThank" can be added in as well???

    > b) 'Thanks' can ONLY be given to the first post in a discussion.
    Never heard about this problem.
    Probably bad theme. What theme?
    No my bad explanation, its not a problem, I *want* to implement a change so that "Thanks" can only be given to the first post in a discussion!

    > I needed to make in order to allow users to 'Thank' their own posts
    Impossible. It is make no sense.
    I've done the impossible then!

    In classthankfulpeople.plugin.php, in
    public function DiscussionController_CommentOptions_Handler

    I've replaced
    if ($SessionUserID <= 0 || $Object->InsertUserID == $SessionUserID) return;

    with
    if ($SessionUserID <= 0 ) return;

    ...
    As I understand it, you don't want to have "NoThanks", and I understand that, but I'm not actually using this for 'Thanks' - I'm using it as an 'attendance management' solution....I post a discussion which announces an event, and ask my forum visitors to click on the "ATTENDING" button (instead of 'Thanks')....they then get listed as 'Attending...' instead of 'Thanked By...'.

    I need to be able to say I'm attending events I've posted, hence the change above.

    Any chance of any further hints/pointers to send me in the right direction?? I realise I'm using your AddOn for a purpose it wasn't originally intended, but it comes VERY CLOSE to solving a long outstanding problem I've had and if I can just make these changes I'll have some very happy users!!!

    Thanks. (no pun intended!)



  • SS ✭✭
    Answer ✓
    I see. You are trying to hack addon to make it something similar of "attendance management". It is not good idea, I think.

    I can implement "get back "thank" feature. It is easy, but it will be configurable (optional). Thank only for discussion config option also can be implemented.
  • SS ✭✭
    Answer ✓
    Done. Get version 2.14.2.0.18. See README file.



  • *AWESOME* stuff, really appreciate that thanks.

    I just modify the 'locale' translations for my own purposes so I don't mess up your code now!

    (Pity there's no Thank button to press on the forums here!)
  • @S, apologies, can you clarify where I should insert the config?

    Is it supposed to be in class.thankfulpeople.plugin.php after the

    <?php if (!defined('APPLICATION')) exit(); line?

    I've tried inserting
    $Configuration['Plugins']['ThankfulPeople']['AllowTakeBack'] = True; $Configuration['Plugins']['ThankfulPeople']['Only'] = array('discussion');

    ...assuming this would mean I could only thank for the first post in a discussion and after thanking could revoke my thank, but it doesn't seem to do that???

  • SS ✭✭
    @FunkyMagic
    Config file is usualy located in
    conf/config.php
    You should put/modify all settings there.
Sign In or Register to comment.