Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- /// phpBB3 RS Link checker - Gavo
- /// add ?topic=1000 to start at topic number 1000
- /// Your Forums Graveyard ID
- $shittip="158";
- // Sitename + Filename
- $scripturl="YOUR DOMAIN.ORG/CHECK.php";
- // Amount Of Topics To Check In 1 Pass
- $posts="40";
- // No More Edits Needed
- require "config.php";
- $con = mysql_connect("$dbhost","$dbuser","$dbpasswd");
- if (!$con) { die('Cant Connect To DB' .mysql_error()); }
- mysql_select_db("$dbname", $con);
- ?>
- <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
- <html xmlns="http://www.w3.org/1999/xhtml">
- <head>
- <title>Link Checker</title>
- <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
- <style type="text/css"><!--
- html, body {
- margin: 0;
- padding: 0;
- }
- body {
- margin: 0;
- font-family: 'Trebuchet MS', Verdana, Georgia, Arial, sans-serif;
- font-size: 12px;
- text-align: center;
- color: #000;
- line-height: 1.3em;
- background-color: #001535;
- background-image: url(linkchecker.gif);
- background-repeat: repeat-x;
- background-position: left top;
- }
- h1 {
- font: bold small-caps 1.25em Georgia, "Times New Roman", Times, serif;
- text-transform: uppercase;
- color: #B05A04;
- }
- h2 {
- font: small-caps 1em Georgia, "Times New Roman", Times, serif;
- color: #B06E04;
- }
- p, a {
- font: 0.9em Arial, Geneva, Helvetica, sans-serif;
- color: #999;
- }
- #container {
- min-height: 650px;
- width: 670px;
- margin: 0.5em auto 0.5em auto;
- background: #fff;
- text-align:center;
- -moz-border-radius: 20px;
- padding: 0.5em;
- }
- #container li {
- float: left;
- width: 150px;
- height:150px;
- list-style-type:none;
- border: solid #ccc;
- border-width: 1px 1px 0 0;
- -moz-border-radius-topright:10px;
- margin:1em;
- text-align:center;
- display:inline;
- }
- --></style>
- </head>
- <script language="javascript">
- function pageScroll() {
- window.scrollBy(0,400); // horizontal and vertical scroll increments
- scrolldelay = setTimeout('pageScroll()',100); // scrolls every 100 milliseconds
- }
- </script>
- <body>
- <p><h1>Waz-Warez LinkBot - By Gavo</h1></p>
- <div id="container">
- <a href="javascript:pageScroll()">Scroll Page</a>
- <p onClick="pageScroll()" />
- <?php
- $topic = mysql_real_escape_string($_GET['topic']);
- for ($i=0;$i<=$posts;$i++) {
- $topic++;
- $live =0;
- $dead =0;
- $x=0;
- $result = mysql_query('SELECT post_text FROM ' . $table_prefix . 'posts WHERE topic_id="'.$topic.'" AND forum_id NOT like"'.$shittip.'"') or die(mysql_error());
- if(mysql_num_rows($result) == 0) { echo "<h4>Post ID not found</h4>"; }
- else {
- while($row = mysql_fetch_array($result))
- {
- $text=$row['post_text'];
- $text = str_replace("["," ",$text);
- $text = str_replace("]"," ",$text);
- $text = str_replace(".",".",$text);
- $text = str_replace(":",":",$text);
- $text = htmlentities($text);
- }
- $alllinks = $text;
- $alllinks = explode(" ", $alllinks);
- $alllinks = implode("\n", $alllinks);
- $alllinks = explode("\n", $alllinks);
- $x = 1;
- foreach($alllinks as $link)
- {
- if(eregi("rapidshare.com/files/", $link)) {if ($dead>10 || $live>10) {echo"...";} else {rscheck($link , $x);$x++;}}
- }
- if ($dead + $live == "0") {echo "".$topic." No Download Links or Already Binned<br />";}
- if ($dead < $live) {echo"Topic <h2><font color=\"green\">".$topic." OK</font></h2>";}
- if ($dead > $live) {global $topic;binit($topic);}
- }
- }
- refresh_page ($topic);
- mysql_close($con);
- $con = null;
- function refresh_page($pid) {
- global $scripturl;
- echo "<meta http-equiv=\"refresh\" content=\"1;url=http://".$scripturl."?topic=".$pid."\">";
- }
- function binit($tid) {
- global $shittip;
- global $table_prefix;
- echo "<h2> - BINNING - ".$tid."</h2>";
- mysql_query('UPDATE ' . $table_prefix . 'posts SET forum_id="' . $shittip . '" WHERE topic_id="' . $tid . '"');
- mysql_query('UPDATE ' . $table_prefix . 'topics SET forum_id="' . $shittip . '" WHERE topic_id="' . $tid . '"');
- mysql_query('UPDATE ' . $table_prefix . 'forums SET forum_posts = forum_posts + 1 WHERE forum_id ="' . $shittip . '"');
- mysql_query('UPDATE ' . $table_prefix . 'forums SET forum_topics = forum_topics + 1 WHERE forum_id ="' . $shittip . '"');
- }
- function rscheck($link , $x)
- {
- global $live;
- global $dead;
- $files_pattern= '/\/files\/([^\/]*)\//';
- $filename_pattern= '/\/files\/.*\/(.*)/';
- preg_match($files_pattern, $link, $matches_id);
- preg_match($filename_pattern, $link, $matches_name);
- $res= file_get_contents("http://api.rapidshare.com/cgi-bin/rsapi.cgi?sub=checkfiles_v1&files={$matches_id[1]}&filenames={$matches_name[1]}");
- list($fId,$fName,$fSize,$fServerId,$fStatus,$fShortHost,$fmd5) =explode(',',$res);
- if ($fStatus==1) {
- echo"<span style='background-color:green;color:Black;font-size:8pt;text-align:left; margin: 1px 0px'>$x: Active:</span> <a href=\"$link\" target=\"_blank\">$link</a><br />\n";$live++;
- }
- else {
- echo "<span style='background-color: red; color:Black;font-size:8pt;text-align:left;margin:1px 0px'>$x: Dead:</span> <a href=\"$link\" target=\"_blank\">$link</a><br />\n";$dead++;
- }
- }
- ?>
- </div>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement