HackerOne users: Testing against this community violates our program's Terms of Service and will result in your bounty being denied.
Options

Sharing some tweaks to make work with 2.1

KezzBKezzB New
edited October 2012 in Feedback

Hiya,

I'm working with the 2.1 alpha at the moment and had to do some tweaks to get things working.

I thought I'd share so you don't have to figure them out when 2.1 comes out.

public function PostController_BeforeCommentRender_Handler(&$Sender)

changed to:

public function DiscussionController_BeforeCommentDisplay_Handler(&$Sender)

And

$Comments = $Sender->Data('CommentData');

changed to:

$Comments = $Sender->Data('Comments');

And

public function PostController_CommentInfo_Handler(&$Sender)

changed to:

public function DiscussionController_DiscussionInfo_Handler(&$Sender)

Hope that helps!

Kezz

Comments

  • Options

    THANK YOU. PostCounts have been broken for me for weeks! Thanks for finally getting them working!!!

  • Options

    You might change the &$Sender to $Sender - everywhere. you will probably be happier in the long run.

    I may not provide the completed solution you might desire, but I do try to provide honest suggestions to help you solve your issue.

  • Options

    Looks like this has solved the issue for me. Thanks!

  • Options
    x00x00 MVP
    edited August 2014

    The whole thing can be simplified to just


    No need to query the databases again, when he data is freely available with he the author.

    grep is your friend.

  • Options

    Hey all, I just tried installing this plugin, running Vanilla 2.1.9 and made the changes suggested by @KezzB and @peregrine, but when I try to enable the plugin, vanilla tells me the addon was unable to be enabled because it generated a fatal error: "Whoops: there was an error."
    Am I doing something wrong?

  • Options
    R_JR_J Ex-Fanboy Munich Admin

    Use the code x00 has posted.

  • Options
    R_JR_J Ex-Fanboy Munich Admin

    ... but you would like to add

    public function DiscussionController_DiscussionInfo_Handler($Sender) {
        $this->_AttachPostCount($Sender);
    }
    
  • Options
    phreakphreak Vanilla*APP (White Label) & Vanilla*Skins Shop MVP

    @linc: Wouldn't it be good to update the current PostCount plugin with this code.

    I would also add a postcount class, so it easier for designers to style it.

    echo ''.T(Plural(number_format($Posts),'Posts: %s','Posts: %s')).'';

    • VanillaAPP | iOS & Android App for Vanilla - White label app for Vanilla Forums OS
    • VanillaSkins | Plugins, Themes, Graphics and Custom Development for Vanilla
  • Options
    LincLinc Detroit Admin

    @Bleistivt done

Sign In or Register to comment.