Auto Clean Download Titles. (Removes tags like aXXo, DVDRip etc). :p

Status
Not open for further replies.

litewarez

Active Member
1,367
2008
1
0
ok with this module you you will need to add each word you want into an array.. ive started the array with several words for you.

the Function!
Code:
function remove_words($str){
$replace_str = '';
$bad_words = array('DVDRIP','XviD','Limited DVDRip','DvDrip-aXXo','aXXo','PROPER','Rip','Cam','\!','\?');

    if (!is_array($bad_words)){ $bad_words = explode(' ', $bad_words); }
    for ($x=0; $x < count($bad_words); $x++){
        $fix = isset($bad_words[$x]) ? $bad_words[$x] : '';
        $_replace_str = $replace_str;
        if (strlen($replace_str)==1){ 
            $_replace_str = str_pad($_replace_str, strlen($fix), $replace_str);
        }
        $str = preg_replace('/'.$fix.'/i', $_replace_str, $str);
    }
    return $str;
}
also if you are insterting special charactors like ! - ? - & - ^ - *... you will need to add a backslash before this charactor.

usage like so!

FIND:
Code:
mysql_query("INSERT INTO wcddl_queue (sid,title,type,url) VALUES ('".addslashes($sid)."','".addslashes($titles[$i])."','".addslashes($types[$i])."','".addslashes($urls[$i])."')");
Replace with:
Code:
mysql_query("INSERT INTO wcddl_queue (sid,title,type,url) VALUES ('".addslashes($sid)."','".addslashes(remove_words($titles[$i]))."','".addslashes($types[$i])."','".addslashes($urls[$i])."')");
Titles will be change like so!

Bassline Sample Cd (2008) aXXo DVDRip
Bassline Sample Cd (2008)

remember do not put words into the array that may be legit words within download titles. only use the unique words that you dont want.
 
5 comments
yea backup your database and scripts... thisn ios a very simple function and can be inproved alot.... ive posted this snippet on several forums and its causing alot of smiles :) so i might develope this further.. if you have any ideas for it please let me know.... thanks
 
this can also be used for removing swaer words from stuff.... if you change the

$replace_str = '';
with
$replace_str = '#$|%!';



You can use it for comments etc...
 
Status
Not open for further replies.
Back
Top