How to Disable "Joined Member" on the news feed

Disable the "MyName joined the MySite"  on newsfeed :
Go to app/Plugin/SocialIntegration/Controller/AuthsController.php
Find and remove this code
// insert into activity feed
            $this->loadModel('Activity');
            $this->Activity->save(array('type' => APP_USER,
                'action' => 'user_create',
                'user_id' => $this->User->id
            ));
 
Go to app/Lib/MooListener.php
Find and remove this code
// insert into activity feed
$controller->loadModel( 'Activity' );
$controller->Activity->save( array( 'type' => APP_USER,
 'action'  => 'user_create',
 'user_id' => $controller->User->id
) );
Disabled someone joined a group?
 
Go to app/Plugin/Group/Controller/GroupsController.php
Find and remove this code
 
$data = array('type' => 'Group_Group',
                'action' => 'group_join',
                'user_id' => $uid,
                'item_type' => 'Group_Group',
                'items' => $group['id'],
                'target_id' => $group['id'],
                'plugin' => 'Group',
                'privacy' => $group['type']
            );
            $this->Activity->save($data);
Done!
Posted in How To on 02/18/16 at 03:40
Comments (17)
Eddie  
Michel, yes I think this would be a good idea to reduce the database size too lol
Eddie  
@KakaLot, in your humble opinion after we archive the database; what would be the best way to purge the database of all obsolete data and freeing up space without causing issues? Could we do this up to a certain date? Basically what would be the best SQL query to use to purge the database by date inference to these activities above?
KakaLot  
@Eddie: to delete old feeds, just run this query on your database.

DELETE FROM `{PREFIX}activities` WHERE `action` = 'user_create' OR `action` = 'group_join';

replace {PREFIX} with the prefix when you install your mooSocial site. If you didnt specific any prefix, the query will look like this :
DELETE FROM `activities` WHERE `action` = 'user_create' OR `action` = 'group_join';

** Remember : backup your database before run this query.
** I dont have any responsible if your database is lost...  more
Eddie  
Thanks @KakaLot

#code
KakaLot  
Eddie : you're welcome
This is great! Great help he KakaLot! What about it you don't want to show that someone became friends with someone else?
julz  
how do we remove the "is now friends with" feed entries?
Mark  
no worries about this, we will add an option in admincp for you to manage this at next version julz
Layla  
Mark Is this available in version 2.4.1?
I think this will be available in 2.5.0
Layla  
Ryan Nguyen I disabled hardcoded in PHP. I comment out all activities "friends with" and "joined". Thanks anyway for fast response
No login
Login or register to post your comment
Cookies on mooCommunity - Social Networking Script.
This site uses cookies to store your information on your computer.