PHP-Nuke Services - Addons, Modules, Blocks Vizitati www.westdesign.ro Select Interface Language:EnglishRomanian
  Login or Register HomeForumsDownloadsYour AccountWeb LinksContact   
SectionsShow\Hide
MultiheadlinesShow\Hide
LoginShow\Hide
~ Welcome, alien
Nickname Password
(Register)

~ Membership:

Greetings to the newest member jincesoft
~ New Today: 0
~ New Yesterday: 0
~ Overall: 4306

~ People Online:
~ Visitors: 10
~ Members: 0
~ Total: 10
~Aikon is offline
on Yahoo Msg.
Link to meShow\Hide

aikons.net
Search in FeedsShow\Hide
Search in feeds
HistoryShow\Hide
On 9 February


Speed Up   Pause   Speed Down
DictionaryShow\Hide
Enter the word

Romanian users only

- aikons.net - PHP-Nuke Services Forum Index


Reply to topic Page 1 of 1
Filter News Feeds in Scrolling Block
Message Author
Reply with quote
Post Posted: Wednesday 22 August, 2007 04:06

I am using Multiheadlines on my son's website www.billsarena.com

I have several feeds working for child custody and shared parenting. The problem is that his site is The Internet's First Divorce Support Site for Kids, By a Kid!

Some of the feeds pull an occasional feed that is not appropriate for kids. I would like to be able to filter the feeds as they come in so that objectionable articles will not display in the block. (objectionable would be anything having to do with murder, suicide, sex toys, etc.) Many of the visitors are 10 years old or younger.

Any help would be appreciated.

View user's profile Send private message
Reply with quote
Post Posted: Wednesday 22 August, 2007 09:49

I am almost ready for the next version of MH[I'm in testing phase], which unfortunately doesn't have the filtering feeds capability, but I'm thinking seriously to add this feature to a future version.
In your case here is a quick workaround, considering it's about a child site.
Normally we could use a already defined function "filter_text", but this will just replace the bad text with a anything else. We will assume that if a feed have a bad text, the whole feed content is obscene so replacing only the bad word will not help us, so I had to made a function that will disregard the whole feed.
open functions.php from[modules/Multiheadlines] and just above the line[around 380]
Code:
function insert_todb($cat, $url_id, $title, $link, $description, $pubdate) {

add this code
Code:
function bad_words($title, $description) {
global $CensorList;
   $bad=false;
   foreach ($CensorList as $word) {
      if (is_int(strpos($title, $word)) || is_int(strpos($description, $word))) {
         $bad=true;
      }
   }
return $bad;
}

this will match the feeds against the bad words defined in censorlist[this list is in file config.php at the bottom]
now couple of lines below, where is defined "insert_todb" function replace line
Code:
if (intval($nr)==0) {

with
Code:
if (intval($nr)==0 && !bad_words($title, $description)) {

Feeds containing words from censorlist wount be collected anymore.
You can extend the censor list with other words.

View user's profile Send private message Visit poster's website
Reply with quote
Post Posted: Wednesday 22 August, 2007 15:26

Great, that's exactly what I want as the news that he wants on Child Custody and Shared Parenting is interspersed with some objectionable stuff.

Thanx!!!

View user's profile Send private message
Display posts from previous:
Reply to topic Page 1 of 1
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
  


Page Generation: 0.28 Seconds