How to add a field for sensitive content and filter

Jonathan Goncalves Posted in Component Development 7 years ago

Hello Guys, I'm creating a new plugin, and I want a little help to know the better way to add a new field that the user say if its content are sensitive or not.
That content will be filtered on the another users feed, based on a new configuration that I'll create. So I want a help to it too.

After I finished it, I'll publish here for everyone.

Replies
ph Rally Homelancer Replied 7 years ago

You could add a new value to the Privacy form maybe starting at 20+ like 21 for 'Restricted' posts. So that Ossn code developers will still have values 4 to 19 as reserved to something like:
4 - Friends except...
5 - Specific Friends
6 - Friends of Friends
7 - Friends of Friends except...
8 - Friends in a group or groups
9 - Friends in a group or groups, except...
10 - Only me
11-20 Reserved for Ossn core
21 - Start of user defined privacy values. Like 'Restricted (for 16+ only)'

Then on the gathering of the posts, you can check for the Privacy value and do whatever.

Of course, you will need to extend the class of OssnWall on your component to include the new processing of the new Privacy values.

Breton Jonathan Goncalves Replied 7 years ago

Meanwhile I cant upload because the way Im making it is altering some files that I shouldnt .
But what I want is add a flag on user post form , and the user choose if its content is sensitive (if the content is +18, like sexual contente and another post types).

Another user may choose if he want to see these contents or if he want to hide it).

The only thing is missing for me now is:
- add a column on post row to say if the content is sensitive or not.
- compare the user sensitive choose with the post sensitive type, and hide or not. ( or add a where Clause to not bring this content)

The problem is that what I analysed, I cant add a where class whitout edit the OssnWall component - like I said, the only way I can make it, is editing this component and
I cant hide by the hooks or callbacks.
Unless I include it on ossnWall component, but I prefer ask you before anything.

Indonesian Arsalan Shah Replied 7 years ago

If you put component on github or some where public we might take a look what you wanted to add. Can you explain more how do you mean by filtered contents?