uzeyir
09-04-2008, 01:08 PM
<?php
///////////////////////////////////////////////////////////
// Script created by: Fatheed for Neopluz.org//////////////
// Use: Checking to see if links are dead or not /////////
//////////////////////////////////////////////////////////
function ss_link_check($_url,$_type="RS") {
//RS = RapidShare; MU = MegaUpload; ES = EasyShare; FF = FileFactory; SS = SendSpace;
$_sites=array(
"RS" => "Error",
"MU" => "Unfortunately, the link you have clicked is not available.",
"ES" => "File not found",
"FF" => "Sorry, this file is no longer available. It may have been deleted by the uploader, or has expired.",
"SS" => "Sorry, the file you requested is not available.",
"FFFH" => "Your requested file is not found"
);
$_fgc=file_get_contents($_url);
if (preg_match("/".$_sites[$_type]."/",$_fgc) or $_fgc=="") {
$_correct=false;
}
else {
$_correct=true;
}
return $_correct;
}
//Include the vBulletin configuration file
include ("includes/config.php");
//Search the DB
if ($config['MasterServer']['usepconnect']==1) {
$_connection=mysql_pconnect(
$config['MasterServer']['servername'].":".$config['MasterServer']['port'],
$config['MasterServer']['username'],
$config['MasterServer']['password']);
}
else {
$_connection=mysql_connect(
$config['MasterServer']['servername'].":".$config['MasterServer']['port'],
$config['MasterServer']['username'],
$config['MasterServer']['password']);
}
mysql_select_db(
$config['Database']['dbname'],
$_connection);
$_boards_array=array(
1 => "186",
2 => "190",
3 => "189",
4 => "187",
5 => "278",
6 => "204",
7 => "277",
8 => "153"
);
foreach ($_boards_array as $_key => $_cboard) {
echo("<b>Board ID:</b> ".$_cboard."<br />");
$_query1=mysql_query('SELECT * FROM '.$config['Database']['tableprefix'].'thread WHERE forumid="'.$_cboard.'" ORDER BY threadid DESC');
while ($_rows1=mysql_fetch_array($_query1)) {
$_threadid=$_rows1["threadid"];
$_firstpostid=$_rows1["firstpostid"];
$_query2=mysql_query('SELECT * FROM '.$config['Database']['tableprefix'].'post WHERE postid="'.$_firstpostid.'"');
while ($_rows2=mysql_fetch_array($_query2)) {
$_pagetext=$_rows2["pagetext"];
$_link=preg_match_all("@\[(?i)url\](.*?)\[/(?i)url\]@si",$_pagetext,$_url,PREG_SET_ORDER);
$_replace=preg_replace("@\[(?i)url\](.*?)\[/(?i)url\]@si","@\[(?i)url\](.*?)\[/(?i)url\]@si",$_pagetext);
$_not_working=0;
foreach ($_url as $_key2 => $_site) {
if (preg_match("/rapidshare/",$_url[$_key2][1])) {
$_type="RS";
}
else if (preg_match("/megaupload/",$_url[$_key2][1])) {
$_type="MU";
}
else if (preg_match("/easyshare/",$_url[$_key2][1])) {
$_type="ES";
}
else if (preg_match("/filefactory/",$_url[$_key2][1])) {
$_type="FF";
}
else if (preg_match("/sendspace/",$_url[$_key2][1])) {
$_type="SS";
}
else if (preg_match("/fastfreefilehosting/",$_url[$_key2][1])) {
$_type="FFFH";
}
else {
$_type=0;
}
$message=$phper[2];
echo($_url[$_key2][1]." / ".mysql_error($_connection)." / ".$message."<br />");
if ($_type!==0) {
if (ss_link_check($_url[$_key2][1],$_type)) {
//blah
}
else {
$_not_working+=1;
}
}
}
$_delete=$_not_working;
$_delete=$_delete*100;
if ($_delete > 0) {
mysql_query('UPDATE '.$config['Database']['tableprefix'].'thread SET forumid="3" WHERE threadid="'.$_threadid.'"');
mysql_query('UPDATE '.$config['Database']['tableprefix'].'post SET pagetext="'.$_pagetext.'" WHERE postid="'.$_firstpostid.'"');
}
}
}
}
?>
the bot i attach didnt wprk for me.anyone to make this work?
///////////////////////////////////////////////////////////
// Script created by: Fatheed for Neopluz.org//////////////
// Use: Checking to see if links are dead or not /////////
//////////////////////////////////////////////////////////
function ss_link_check($_url,$_type="RS") {
//RS = RapidShare; MU = MegaUpload; ES = EasyShare; FF = FileFactory; SS = SendSpace;
$_sites=array(
"RS" => "Error",
"MU" => "Unfortunately, the link you have clicked is not available.",
"ES" => "File not found",
"FF" => "Sorry, this file is no longer available. It may have been deleted by the uploader, or has expired.",
"SS" => "Sorry, the file you requested is not available.",
"FFFH" => "Your requested file is not found"
);
$_fgc=file_get_contents($_url);
if (preg_match("/".$_sites[$_type]."/",$_fgc) or $_fgc=="") {
$_correct=false;
}
else {
$_correct=true;
}
return $_correct;
}
//Include the vBulletin configuration file
include ("includes/config.php");
//Search the DB
if ($config['MasterServer']['usepconnect']==1) {
$_connection=mysql_pconnect(
$config['MasterServer']['servername'].":".$config['MasterServer']['port'],
$config['MasterServer']['username'],
$config['MasterServer']['password']);
}
else {
$_connection=mysql_connect(
$config['MasterServer']['servername'].":".$config['MasterServer']['port'],
$config['MasterServer']['username'],
$config['MasterServer']['password']);
}
mysql_select_db(
$config['Database']['dbname'],
$_connection);
$_boards_array=array(
1 => "186",
2 => "190",
3 => "189",
4 => "187",
5 => "278",
6 => "204",
7 => "277",
8 => "153"
);
foreach ($_boards_array as $_key => $_cboard) {
echo("<b>Board ID:</b> ".$_cboard."<br />");
$_query1=mysql_query('SELECT * FROM '.$config['Database']['tableprefix'].'thread WHERE forumid="'.$_cboard.'" ORDER BY threadid DESC');
while ($_rows1=mysql_fetch_array($_query1)) {
$_threadid=$_rows1["threadid"];
$_firstpostid=$_rows1["firstpostid"];
$_query2=mysql_query('SELECT * FROM '.$config['Database']['tableprefix'].'post WHERE postid="'.$_firstpostid.'"');
while ($_rows2=mysql_fetch_array($_query2)) {
$_pagetext=$_rows2["pagetext"];
$_link=preg_match_all("@\[(?i)url\](.*?)\[/(?i)url\]@si",$_pagetext,$_url,PREG_SET_ORDER);
$_replace=preg_replace("@\[(?i)url\](.*?)\[/(?i)url\]@si","@\[(?i)url\](.*?)\[/(?i)url\]@si",$_pagetext);
$_not_working=0;
foreach ($_url as $_key2 => $_site) {
if (preg_match("/rapidshare/",$_url[$_key2][1])) {
$_type="RS";
}
else if (preg_match("/megaupload/",$_url[$_key2][1])) {
$_type="MU";
}
else if (preg_match("/easyshare/",$_url[$_key2][1])) {
$_type="ES";
}
else if (preg_match("/filefactory/",$_url[$_key2][1])) {
$_type="FF";
}
else if (preg_match("/sendspace/",$_url[$_key2][1])) {
$_type="SS";
}
else if (preg_match("/fastfreefilehosting/",$_url[$_key2][1])) {
$_type="FFFH";
}
else {
$_type=0;
}
$message=$phper[2];
echo($_url[$_key2][1]." / ".mysql_error($_connection)." / ".$message."<br />");
if ($_type!==0) {
if (ss_link_check($_url[$_key2][1],$_type)) {
//blah
}
else {
$_not_working+=1;
}
}
}
$_delete=$_not_working;
$_delete=$_delete*100;
if ($_delete > 0) {
mysql_query('UPDATE '.$config['Database']['tableprefix'].'thread SET forumid="3" WHERE threadid="'.$_threadid.'"');
mysql_query('UPDATE '.$config['Database']['tableprefix'].'post SET pagetext="'.$_pagetext.'" WHERE postid="'.$_firstpostid.'"');
}
}
}
}
?>
the bot i attach didnt wprk for me.anyone to make this work?