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

Hook for AuthorInfo

Hello,

I'm using Yaga with Rank, Badgets, and Reactions. For now I want to show user rank as title similar vanillaforums.org used, through research, I do it well on User header for Discussion, I am use DiscussionController_AuthorInfo_Handler function with:

$AuthorInfo = $Sender->EventArguments['Author'];
$RankModel = Yaga::RankModel();
 $Rank = $RankModel->GetByID($AuthorInfo->RankID);
 echo Wrap('·', 'span', array('class' => 'Bullet'));
 echo Wrap($Rank->Name, 'span', array('class' => 'MItem RankName'));

Now, I want do this on User Profile profile, But I'm not found what is the right hook function for User Controller to overwrite it. It should on !

Please help.
John

Comments

  • R_JR_J Ex-Fanboy Munich Admin

    Search for the plugin Eventi (you can use the plugin that comes with 2.0 also for 2.1). That will help a lot to find the right hooks!

  • Thanks @R_J

    public function ProfileController_UsernameMeta_Handler($Sender) 
       {
          $AuthorInfo = $Sender->User;
          $RankModel = Yaga::RankModel();
          $Rank = $RankModel->GetByID($AuthorInfo->RankID);
          echo Wrap('·', 'span', array('class' => 'Bullet'));
          echo Wrap($Rank->Name, 'span', array('class' => 'MItem RankName'));
       }
    

    The complete code at the above.

  • hgtonighthgtonight ∞ · New Moderator

    Awesome!

    Once Yaga hits 1.0 I plan on making a couple plugins that do stuff like this!

    Search first

    Check out the Documentation! We are always looking for new content and pull requests.

    Click on insightful, awesome, and funny reactions to thank community volunteers for their valuable posts.

  • Great application, please add this on the next release. I'm looking for a big changes :)

  • hgtonighthgtonight ∞ · New Moderator

    I meant to post this earlier, but I made this into a plugin called Rank in Meta: http://vanillaforums.org/addon/yagarankinmeta-plugin

    Search first

    Check out the Documentation! We are always looking for new content and pull requests.

    Click on insightful, awesome, and funny reactions to thank community volunteers for their valuable posts.

Sign In or Register to comment.