Need help on moving the Profile Reactions Count to the left side bar.

Hello again community. I m trying to move the profile Reaction Count Wrap (YAGA) to the left side bar. I want to use smarty method. I can do that with other modules like "UserinfoModule" etc but cant find a module method for yaga reactions. As you already understood i want to use a method inside my default.master.tpl file. Is there any way to do that like for example:

{module name="YagaReactionsModule"}

or so?

Thanks in advance.

Comments

  • R_JR_J Admin

    Not everything in Vanilla is a module block, in fact only a very few things are modules. This is no module.

    This is inserted by /applications/yaga/settings/class.hook.php

      public function ProfileController_AfterUserInfo_Handler($Sender) {
        if(!C('Yaga.Reactions.Enabled')) {
          return;
        }
        $User = $Sender->User;
        $Method = $Sender->RequestMethod;
        if($Method == 'reactions') {
          $ActionID = $Sender->RequestArgs[2];
        }
        else {
          $ActionID = -1;
        }
        echo '<div class="Yaga ReactionsWrap">';
        echo Wrap(T('Yaga.Reactions', 'Reactions'), 'h2', array('class' => 'H'));
    
        // insert the reaction totals in the profile
        $ReactionModel = Yaga::ReactionModel();
        $Actions = Yaga::ActionModel()->Get();
        $String = '';
        foreach($Actions as $Action) {
          $Selected = ($ActionID == $Action->ActionID) ? ' Selected' : '';
          $Count = $ReactionModel->GetUserCount($User->UserID, $Action->ActionID);
          $TempString = Wrap(Wrap(Gdn_Format::BigNumber($Count), 'span', array('title' => $Count)), 'span', array('class' => 'Yaga_ReactionCount CountTotal'));
          $TempString .= Wrap($Action->Name, 'span', array('class' => 'Yaga_ReactionName CountLabel'));
    
          $String .= Wrap(Wrap(Anchor($TempString, '/profile/reactions/' . $User->UserID . '/' . Gdn_Format::Url($User->Name) . '/' . $Action->ActionID, array('class' => 'Yaga_Reaction TextColor', 'title' => $Action->Description)), 'span', array('class' => 'CountItem' . $Selected)), 'span', array('class' => 'CountItemWrap'));
        }
    
        echo Wrap($String, 'div', array('class' => 'DataCounts'));
        echo '</div>';
      }
    

    You would have to write a module by yourself with the above logic.

  • Perfect. Thanks @R_J i will create a module.

  • R_JR_J Admin

    Drop a line if you need support

  • thanx @R_J i appreciate it. Just completed the profile page. ;) 90% of the theme is completed. I finally figured out the way it works and i love it ;)

Sign In or Register to comment.