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

Disable display from Main Activity

This discussion is related to the Yaga Disable Activity Reactions addon.
AoleeAolee Hobbyist & Coder ✭✭

Is it possible to hide the display of awards from Main Activity but keep it on user activity?

Tagged:

Comments

  • AoleeAolee Hobbyist & Coder ✭✭
    edited October 2019

    Just did a dirty hack, not the best but it does the job.


    1) Edit the Activity model ./applications/dashboard/models/class.activitymodel.php

    public function getWhere($where = [], $orderFields = '', $orderDirection = '', $limit = false, $offset = false, $hidemain = 0) {

    2) check the activity id of BadgeAward and RankPromotion

    3) edit Applications/dashboard/models/class.activitymodel.php

      foreach ($where as $key => $value) {
          if (strpos($key, '.') === false) {
            $where['a.'.$key] = $value;
            unset($where[$key]);
          }
        }
        $result = $this->SQL
          ->where($where)
          ->orderBy($orderFields, $orderDirection)
          ->limit($limit, $offset);
    //added this "if" check to exclude the activity ids  
         if($hidemain){
            $result->where('a.ActivityTypeID <>', 32);
            $result->where('a.ActivityTypeID <>', 33);
        }
         $result = $result->get();
    
        self::getUsers($result->resultArray());
    

    4) edit the activity controller ./applications/dashboard/controllers/class.activitycontroller.php

     if ($this->Head) {
          $this->Head->addRss(url('/activity/feed.rss', true), $this->Head->title());
        }
    
        // Comment submission
        $session = Gdn::session();
        $comment = $this->Form->getFormValue('Comment');
    
        //comment the original
        //$activities = $this->ActivityModel->getWhere(['NotifyUserID' => $notifyUserID], '', '', $limit, $offset)->resultArray();
        $activities = $this->ActivityModel->getWhere(['NotifyUserID' => $notifyUserID], '', '', $limit, $offset, 1)->resultArray();
        $this->ActivityModel->joinComments($activities);
    


  • AoleeAolee Hobbyist & Coder ✭✭


Sign In or Register to comment.