We build. You grow.

Get best community software here

Start a social network, a fan-site, an education project with oxwall - free opensource community software

Newsfeed privacy mod -> hide your activity from the site newsfeed | Forum

Martin
Martin Jan 19 '14

Remark: tested with Oxwall 1.53 - modding 1.6 or earlier versions will need some research and testing first.


After having read many complaints regarding privacy issues with the Newsfeed, and some issues we had ourselves, i've devised a simple mod that will achieve the following things:


- hide your status messages on the "index page newsfeed" if your "view my profile newsfeed" privacy is set to "My friends" or "Only me". This will prevent non-friends and friends-of-friends to read your updates, or participate in your private discussions with your friends. 


hide your comments on the "index page newsfeed". Comments you place in discussions that are created by a owner with his "view my profile newsfeed" privacy set to "My friends" or "Only me", will be hidden from view on the "index page" newsfeed.


hide your group posts on "index page newsfeed". Activity and comments you place in groups are hidden from the index page newsfeed if your  "view my profile newsfeed" privacy is set to "My friends" or "Only me".


So, this mod will only affect the "site" newsfeed widget (if placed on your index page). Behavior of the dashboard and profile newsfeed is not affected.


This mod will "abuse" the newsfeed privacy setting "view my profile newsfeed" parameter for it's operation and we have renamed this setting on the privacy page to "view my newsfeed messages".


File affected: ow_plugins/newsfeed/classes/event_handler.php 


Prerequisites: admin access to Oxwall, FTP access to your Oxwall site and access to the Oxwall database (e.g. via phpmyadmin). Read-only access is sufficient.

  

What will be done: we will change the visibility parameter of each activity post before it is written to the database if the privacy setting requires this.

Instructions and code:


Step 1
Create a new Oxwall user with standard rights and NO friends. Leave this user in existence! 


Step 2
Access the ow_base_users table of your site's Oxwall database. Find the "id" field value of the user you just added, by sorting the view by "id" and move to the last result page and the last record. Note the value of the "id" field of your "friendless user".

 

Step 3 

Download and open the file ow_plugins/newsfeed/classes/event_handler.php in a text editor and move down to around line 382. 

Find the row that says: "$this->service->saveActivity($activity);"

Place the attached code BEFORE that line. (see attached file)  Replace the text in the code that says "PUT THE ID NUMBER OF THE TEST USER HERE"  with the id number you found for the test user.



Step 4 

Save and upload the modded php file and test your work!  Put your "view my profile newsfeed" privacy settings to "My Friends" and post an update anywhere on your site; e.g. on your profile page.  Visit your homepage and see for yourself that your new post is not reflected on the index page Newsfeed. 


Cheers! 


Martin Beek.

The Forum post is edited by Martin Jan 19 '14
Attachments:
  site_newsfeed_privacy_mod.txt (0.7Kb)
Daisy Team
Daisy Jan 24 '14
Topic was moved from Custom Code Modifications.
Kobe White
Kobe White Jan 30 '14
Martin. great work on this mod.
Now I am running the latest version of Oxwall, and followed everything as stated above.
I place the code you have here above ""$this->service->saveActivity($activity);"   which was around line 450 for me. I found the id of the user (id    int(11)   value 4) and changed it according to your directions.
Now I can't find where the link is to change "view my profile newsfeed" privacy settings to "My Friends". Am I completely overlooking something?






Also, will this only affect the user id? Say if I wanted to have all members have the option will I need to put in each ID?

Thanks once again for the great mod!
Den Team
Den Feb 4 '14
Topic was moved from Custom Oxwall Projects.
Sean
Sean Jun 13 '14
Yeah how to hide it for all members ?
Quote from Kobe White Martin. great work on this mod.
Now I am running the latest version of Oxwall, and followed everything as stated above.
I place the code you have here above ""$this->service->saveActivity($activity);"   which was around line 450 for me. I found the id of the user (id    int(11)   value 4) and changed it according to your directions.
Now I can't find where the link is to change "view my profile newsfeed" privacy settings to "My Friends". Am I completely overlooking something?






Also, will this only affect the user id? Say if I wanted to have all members have the option will I need to put in each ID?

Thanks once again for the great mod!