Since we're opening this up to allow others to send photos to our gallery, we want to keep it family friendly. We're going to do this by adding two types of checks.
The first check will make sure that the message doesn't contain any obscene words and the second will be to check the image to make sure there's no nudity.
We're going to modify our photo gallery to check incoming messages for profanity and inappropriate photos.
First, upload
ImageFilter.class.php
to your photo gallery site.Next, update
functions.php
, which adds the profanity filter checker with the following code:<?php function cache_image( $imageurl = '',$name ){ $imagename = $name.'.'.get_image_extension($imageurl); if(file_exists('./tmp/'.$imagename)){return 'tmp/'.$imagename;} $image = file_get_contents_curl($imageurl); file_put_contents('tmp/'.$imagename,$image); return...