Private Posts MOD
2 posts
• Page 1 of 1
Private Posts MOD
Hey there guys,Not sure if this should go in the general existing MODs section, or here. Nevertheless, here it is

Recently, I came across a MOD that allowed posts to be privatised to the point where you literally couldn't read them unless you were logged in. This is beyond the point of simply hiding menu's to only show when you're logged in, but actually so that if someone goes to a privatised post, they're shown 'You cannot view this post, please login' etc.
Something like this would be SUPER handy on SIMMs that have adult content (sexual references, violence, medical procedures, blah blah). So if anyone knows where such a MOD is for download, or would be able to consider making one, that'd be awesome! I just can't remember the SIMM on which I saw it recently, ugh...
Thanks in advance,
J
"Impossible is a word humans use far too often."—Seven Of Nine (Star Trek: Voyager)
-
-
Posts: 10
Re: Private Posts MOD
Replying a year late but that may have been a sim I manage (usswolff.com or ussasgard.com).
The mod itself is designed to search for certain keywords in either the subject or tags fields of a post and based on that, will not display the post unless the vistor is a currently logged in user.
The mod was an outgrowth of a discussion I had with some fellow webmasters about protecting underage visitors from graphic content in posts and while the whole "I certify I am over the age of XX" works for applicants to the simm, it doesn't work for the general public. What teenager is going to be honest and say their under 18 when they're looking for mature content.
The result of the discussion was that the only way was to restrict unregistered users from viewing certain restricted content was to have the post display system look for the keywords we use (18+,mature, etc) and do a simple check if the user is logged in. If they are logged into Nova their over 18 (both simms do not permit players under 18 from joining) so can safely view the content.
The actual mod was quite simple, use base override on the sim_viewpost & sim_viewlog php files, replacing this line of code:
- Code: Select all
<?php echo text_output($content);?>
with
- Code: Select all
<?php
$title_pattern = '/(\\[|\\()(nudity|sex|language|violence|mature|content|18\+|\/)+/i';
$tags_pattern = '/(nudity|sex|language|violence|mature|content|18\+)/i';
if (preg_match($title_pattern, $title) !== 0 OR preg_match($tags_pattern, $tags) !== 0) { $matureflag = TRUE; } else { $matureflag = FALSE; }
if (Auth::is_logged_in() OR $matureflag == FALSE) { echo text_output($content); }
else { echo "Viewing Mature content is restricted to logged in Members only."; }
?>
Now when a player tags a post with [] or () and one of the content flags, the system flags the post as mature and if they're not logged in, replaces the post content with the disclaimer.
-
-
Posts: 29
2 posts
• Page 1 of 1
Who is online
Users browsing this forum: No registered users and 1 guest