Users running a non-download version of Vanilla (pulled from github), on branch release/2019.016 or master from the last 2 weeks should upgrade to release/2019.017 or latest master for security reasons. Downloaded official open sources releases are not affected.

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 19

    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.