Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- /*BEGIN_INFO
- Advanced Backlink Check, on 1st submissions of every site this will check their page for a backlink, if true = returned its all ok, if false = returned it blacklists the site without queueing the webmaster's DDLs. Also checks and blacklists free TLDs and free sub-domains, by chris ([email protected])
- END_INFO*/
- if(!defined("WCDDL_GUTS"))
- exit;
- // Config
- $modEnabled = true;
- $subBacklink = str_replace('http://www.', 'http://', 'http://www.warezrelease.org'); // Inlude http://www in the final url.
- $reason1 = "Add our linkback, then <a href='/contact.php'>email us here</a>.";
- $reason2 = "We dont allow free TLDs on our DDL, go buy yourself a real domain then you can submit downloads.";
- $reason3 = "Any type of free sub-domain or host is not allowed, go get a real host & domain, until then you cant submit. Thanks.";
- $reason4 = "Haha that domain don't even exist! Probably you're a spammer, sigh.";
- $reason9 = "No Thanks!";
- $date = date("Y-m-d");
- $email = $_POST['email'];
- $surl = $_POST['surl'];
- $surl = parse_url(trim($surl));
- $surl= str_replace("www.","",$surl['host']);
- if ($modEnabled) {
- function subBacklink($link, $useragent=false, $subBacklink) {
- global $subBacklink;
- $useragent = 'Googlebot/2.1 (+http://www.google.com/bot.html)';
- $ch = curl_init();
- curl_setopt($ch, CURLOPT_HEADER, 0);
- curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
- if($useragent)
- curl_setopt($ch, CURLOPT_USERAGENT, $useragent);
- curl_setopt($ch, CURLOPT_URL, $link);
- $page = curl_exec($ch);
- $httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
- curl_close($ch);
- if($httpCode == 404)
- return false;
- if (preg_match('#<a[^>]+href="http://(www\.)?warezrelease\.org/?"[^>]*>#i',$page))
- return true;
- else
- return false;
- }
- function url_exists($surl) {
- $resURL = curl_init();
- curl_setopt($resURL, CURLOPT_URL, $surl);
- curl_setopt($resURL, CURLOPT_BINARYTRANSFER, 1);
- curl_setopt($resURL, CURLOPT_HEADERFUNCTION, 'curlHeaderCallback');
- curl_setopt($resURL, CURLOPT_FAILONERROR, 1);
- curl_exec ($resURL);
- $intReturnCode = curl_getinfo($resURL, CURLINFO_HTTP_CODE);
- curl_close ($resURL);
- if ($intReturnCode != 200 && $intReturnCode != 302 && $intReturnCode != 304)
- return true;
- else
- return false;
- }
- function blacklistemail($email,$surl) {
- global $core;
- $to = $email; // note the comma
- $from = $core->adminemail;
- $subject = 'Your website is blacklisted at WarezRelease';
- $message = 'Your website is blacklisted at '.$core->siteurl.'.<br />
- <br />
- Domain: '.$surl.'<br />
- Email: '.$email.'<br />
- <br />
- Possible reasons are:<br />
- <br />
- 1. Your domain/site does not contain a valid linkback or atleast our bot can not find one.<br />
- 2. You may have submitted before without a backlink but since then have added one.<br />
- 3. Our bot can not even access your domain/site due to a mod you have installed, crappy host, free domain/host, downtime etc.
- <br /><br />
- In most cases you can rectify and solve the issue, then you can get un-blacklisted by either emailing us at:
- <br /><br />
- Regards, <a href="'.$core->siteurl.'">'.$core->siteurl.'</a> Team.';
- // To send HTML mail, the Content-type header must be set
- $headers = 'MIME-Version: 1.0' . "\r\n";
- $headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n";
- $headers .= 'From: '.$from.'' . "\r\n";
- mail($to, $subject, $message, $headers);
- }
- $domcheck = true;
- $blacklistdomreason = '';
- $freeD = '@^(?:http:\/\/)?([^/]+)\.(co\.nr|co\.cc|tk|free)@i'; // Free domains, add more here.
- $freesubD = '@^(?:http:\/\/)?([^/]+)\.(blogspot\.com|blogbus\.com|forumotion\.com|forum24\.com|mysiteproject\.com|qualtrics\.com|doattend\.com|ning\.com|eventzilla\.net|forumup\.com|page\.tl|posterous\.com|over-blog\.com|webs\.com|espacioblog\.com|pbworks\.com|mysoulspot\.com|fora\.se|healthkicker\.com|springnote\.com|renspace\.com|site11\.com|blog\.com|beep\.com|nofeehost\.com)@i'; // Free subdomains, add more here.
- $nonengD = '@^(?:http:\/\/)?([^/]+)\.(fm|eu|ws|de|pk|ru|ro|pl|cz|so|it|hk|in|to|crackserver\.biz|crackdownload\.biz|co\.uk)@i'; // Non english or spammy sits, add more here.
- if (preg_match($freeD, $surl)) { $blacklistdomreason = $reason2; }
- if (preg_match($freesubD, $surl)) { $blacklistdomreason = $reason3; }
- if (preg_match($nonengD, $surl)) { $blacklistdomreason = $reason9; }
- if ($domcheck == true and $blacklistdomreason != '') {
- mysql_query("INSERT INTO wcddl_blacklist (url,reason,dat,email) VALUES ('".mysql_real_escape_string($surl)."','".mysql_real_escape_string($blacklistdomreason)."','".mysql_real_escape_string($date)."','".mysql_real_escape_string($email)."')");
- }
- if (subBacklink ($surl, $subBacklink) == false) {
- mysql_query("INSERT INTO wcddl_blacklist (url,reason,dat,email) VALUES ('".mysql_real_escape_string($surl)."','".mysql_real_escape_string($reason1)."','".mysql_real_escape_string($date)."','".mysql_real_escape_string($email)."')");
- blacklistemail($email,$surl);
- mysql_query("DELETE FROM wcddl_blacklist WHERE url=''");
- }
- if (url_exists($surl) == true) {
- mysql_query("INSERT INTO wcddl_blacklist (url,reason,dat,email) VALUES ('".mysql_real_escape_string($surl)."','".mysql_real_escape_string($reason4)."','".mysql_real_escape_string($date)."','".mysql_real_escape_string($email)."')");
- }
- mysql_query("DELETE FROM wcddl_blacklist WHERE url=''");
- mysql_query("DELETE FROM wcddl_sites WHERE url=''");
- }
- $core->attachDataHook("submitChecksPass","subBacklink");
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement