View Single Post
  #2 (permalink)  
Old March 1st, 2008
arne_bab's Avatar
arne_bab arne_bab is offline
Draketo, small dragon.
 
Join Date: May 31st, 2002
Location: Heidelberg, Germany
Posts: 1,881
arne_bab is a great assister to others; your light through the dark tunnel
Default

Would you like to help us, refine the filters?

Currently you can look at them in the following file: SourceForge.net Repository - [phex] View of /phex/trunk/src/main/java/phex/rules/DefaultSearchFilterRules.java

They work in the following way:

# Create the adult rule
Rule adultRule = new Rule();

# the condition when the filter gets active
FilenameCondition adultcondition = new FilenameCondition( );
adultcondition.addTerm( "blah" ).addTerm( "foo" )

-> activate when the search contains any one (or several) of the terms "Blah" and "Foo".

# Add the condition to the rule
adultRule.addCondition( adultcondition );

# What should happen: Don't show it in searches.
adultRule.addConsequence( FilterFromSearchConsequence.INSTANCE );

# Should it be active all the time?
adultRule.setPermanentlyEnabled( false );

# is it a default rule of Phex (can't be deleted)?
adultRule.setDefaultRule( true );

# Now assign it to the name.
ADULT_FILTER_RULE = adultRule;


If you want to contribute a default rule, you can just create it in phex and then give us the parameters, so we can add it.
You can see the terms we filter on for adult material in the link above. If you think, some should be changed, just tell us which

Alternatively you can naturally also post a patch...

Best wishes,
Arne
__________________

-> put this banner into your own signature! <-
--
Erst im Spiel lebt der Mensch.
Nur ludantaj homoj vivas.
GnuFU.net - Gnutella For Users
Draketo.de - Shortstories, Poems, Music and strange Ideas.
Reply With Quote