==iNFO==
Mod Name: Advanced Blacklist
Mod Version: BETA
Mod Author: bheesham
Mod Description: A better blacklist.
Mod Notes: Okay, instead of that hard to understand
text... I'm just going to type it out so that normal
people can understand it. XD
==/iNFO==
==iNSTaLL==
K, now then.
Here's the code for admin_whitelist();
==CODE==
function admin_whitelist() {
$bwurl = $_POST['bwurl'];
$bwsub = $_POST['bwsub'];
$remove = $_POST['remove'];
if($bwsub) {
if($bwurl) {
@mysql_query("INSERT INTO wcddl_whitelist VALUES ('".mysql_real_escape_string($bwurl)."')");
echo 'URL has been whitelisted.';
}
if($remove) {
$fishpan = 0;
foreach($remove as $url) {
mysql_query("DELETE FROM wcddl_whitelist WHERE url = '".mysql_real_escape_string($url)."'");
$fishpan++;
}
echo $fishpan.' sites were Removed from the whitelist.';
}
}
echo '
';
}
==/CODE=
Now then. here is the code for admin_blacklist();
==CODE==
function admin_blacklist() {
echo <<Add site to blacklist
TMP;
if (isset($_GET['add'])) {
if (isset($_POST['addblacklist']) && !empty($_POST['blurl']) && !empty($_POST['blreason'])) {
$blurl = $_POST['blurl'];
$blurl = purl(str_replace("www.","",$blurl),"host");
$blurl = htmlentities($blurl);
$blurl = addslashes($blurl);
$blurl = strtolower($blurl);
$blreason = $_POST['blreason'];
$blreason = str_replace("\r\n", ' ', $blreason);
$blreason = str_replace("\n", ' ', $blreason);
$blreason = str_replace("\r", ' ', $blreason);
$blreason = addslashes($blreason);
$time = time();
if (!empty($blurl)) {
$exists = mysql_query('SELECT * FROM wcddl_blacklist WHERE url="'.addslashes($blurl).'"');
if (mysql_num_rows($exists)==0) {
mysql_query('INSERT INTO wcddl_blacklist (url,date,reason) VALUES ("'.$blurl.'", "'.$time.'", "'.$blreason.'")');
$sid = mysql_query("SELECT id FROM wcddl_sites WHERE url = '".mysql_real_escape_string($blurl)."'");
$sid = mysql_result($sid,"id");
mysql_query("DELETE FROM wcddl_downloads WHERE sid = '".mysql_real_escape_string($sid)."'");
mysql_query("DELETE FROM wcddl_queue WHERE sid = '".mysql_real_escape_string($sid)."'");
echo $blurl.' has been added to the blacklist for: '. stripslashes($blreason) . '
';
}
else
{
echo "$blurl is already blacklisted.
";
}
}
else
{
echo "ERROR! Please take a look at the URL again... make sure that it has the HTTP:// in front of it.
";
}
}
echo <<
Site URL (You need to add the HTTP:// infront, the script will validate it):
Reason (HTML is allowed. Just dont use \'s):
TMP;
echo '
';
echo 'Quick BL
';
echo '
No link back
Down or not funtioning
Spam
Does not exist
Duplicate Site
Does not link directly to download page.
Submits duplicate downloads
';
}
if (isset($_GET['view'])) {
if (isset($_POST['delete'])) {
mysql_query('DELETE FROM wcddl_blacklist WHERE id="'.$_POST['delete'].'"');
echo 'Deleted site with ID ' . $_POST['delete'] . ' the blacklist.';
}
if (isset($_POST['edit'])) {
echo '';
}
$getbl = mysql_query('SELECT * FROM wcddl_blacklist ORDER BY id DESC');
if (mysql_num_rows($getbl) != 0) {
echo '';
}
else
{
echo "No sites in blacklist";
}
}
}
==/CODE==
And yes, You replace the old code with the new codes above.
Now then. If you DO NOT have any sites in your blacklist... then you can use this code.
==CODE==
SET FOREIGN_KEY_CHECKS=0;
DROP TABLE IF EXISTS `wcddl_blacklist`;
CREATE TABLE `wcddl_blacklist` (
`id` int(11) NOT NULL auto_increment,
`url` varchar(255) NOT NULL,
`date` varchar(255) NOT NULL,
`reason` mediumtext NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
==/CODE==
If you already have a blacklist... then you'll have to insert each URL in with this query...
Later on there may be an easier way... but I doubt it cuz i have other stuff i want to code.
==CODE==
INSERT INTO wcddl_blacklist (url,date,reason) VALUES ('[SITE URL]', '1255541430', "[REASON]")
==/CODE==
When you're inserting sites... make sure that there is NO trailing slashes OR http://www. OR http:// in them.
So if You wanted to blacklist lets say... http://www.warezcoders.com/forum
OR <-- Yes.. there is an alternative.
You can copy all of the URL's that you blacklisted already into a text file, then use
the admin panel of the BlackList to add them. A lot faster. A lot easier.
If you have too much sites in your blacklist then.. its gunna be a long day for you if you really want to use it.
You would actually put just warezcoders.com
get it? if you dont, read it over again.
Well... now its time to show the user the blacklist. Or else this would kind of been useless.
Here is the code for that. Make sure tht you include funcs.php
==CODE==
==/CODE==
O, it would be great if you could link back to my site.
http://file-empire.com/
if you dont... then don't expect me to give any support.
==/iNSTaLL==
==MaNuaL iNSTRuCTiONS==
None. Just try to link back to
http://file-empire.com on your website.
==/MaNuaL iNSTRuCTiONS==