Go Back   vb.org Archive > Community Discussions > Modification Requests/Questions (Unpaid)
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools Display Modes
  #1  
Old 09-04-2008, 01:08 PM
uzeyir uzeyir is offline
 
Join Date: Jul 2008
Posts: 10
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default Link Checker BOT

PHP Code:
<?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(
=> "186",
=> "190",
=> "189",
=> "187",
=> "278",
=> "204",
=> "277",
=> "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?
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 10:05 PM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.03447 seconds
  • Memory Usage 2,210KB
  • Queries Executed 11 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (1)ad_showthread_firstpost
  • (1)ad_showthread_firstpost_sig
  • (1)ad_showthread_firstpost_start
  • (1)bbcode_php
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (1)post_thanks_box
  • (1)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (1)post_thanks_postbit_info
  • (1)postbit
  • (1)postbit_onlinestatus
  • (1)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete