<title>/rs/ Setup</title>
Note: With this install script you can only ADD sites <br />
to delete them you have to go directly in the database <br />
<br />
<?php
$sites = array(
"RapidShare" => "'RapidShare',
'#http://[^(\\\\s<)]*rapidshare.com/files/\\\\d+/[^(\\\\s<)]*#',
'#http://[^(\\\\s<)]*rapidshare.com/files/\\\\d+/([^(\\\\s<)]*)#',
'#\\\\| (\\\\d+ KB)#',
'rs'",
"MegaUpload" => "'MegaUpload',
'#http://www.megaupload.com/\\\\?d=[^(\\\\s<)]*#',
'#Filename:.*\">([^<]*)#',
'#File size:.*\">([^<]*)#',
'mu'",
"MiniNova" => "'MiniNova',
'#http://www.mininova.org/tor/\\\\d+#',
'#<h1>([^<]*)#',
'#<strong>Total size:</strong>\\\\n([^<]*)#',
'mn'",
"MediaFire" => "'MediaFire',
'#http://www.mediafire.com/\\\\?\\\\w+#',
'#<title>([^<]*)#',
'#<input type=\"hidden\" id=\"sharedtabsfileinfo1-fs\" value=\"([^\\\\\"]*)#',
'mf'",
"SendSpace" => "'SendSpace',
'#http://www.sendspace.com/file/\\\\w+#',
'#<b>Name:</b>([^\\\\t]*)#',
'#<b>Size:</b>([^\\\\t]*)#',
'ss'",
"VerTor" => "'VerTor',
'#http://www.vertor.com/torrents/\\\\d+/[^(\\\\s<)]*#',
'#<h1>([^<]*)#',
'#size</th>[\\\\s\\\\S]*?g>([^<]*)#',
'vt'",
"BTJunkie" => "'BTJunkie',
'#http://btjunkie.org/torrent/[^(\\\\s<)]*#',
'#<title>([^<]*) Torrent -#',
'#Size</th>[\\\\s\\\\S]*? #000000;border-right: 1px solid #000000;\">([^<]*)#',
'bj'",
"MoNova" => "'MoNova',
'#http://www.monova.org/details/\\\\d+/[^(\\\\s<)]*#',
'#<title>DOWNLOAD : ([^<]*) Torrent#',
'#Total size:</strong>([^<]*)#',
'mo'",
"SeedPeer" => "'SeedPeer',
'#http://www.seedpeer.com/details/\\\\d+.html#',
'#<title>([^<]*) Torrent#',
'#Size</td><td>([^<]*)#',
'sp'",
"H33T" => "'H33T',
'#http://www.h33t.com/details.php\\\\?id=[^(\\\\s<)]*#',
'#<title>h33t - ([^<]*) - #',
'#Size:</td><td class=\"lista\" >([^<]*)#',
'h3'",
"ZShare" => "'ZShare',
'#http://www.zshare.net/download/[^(\\\\s<)]*/#',
'#<title>zSHARE - ([^<]*)#',
'/File Size: <font color=\"#666666\">([^<]*)/',
'zs'",
"NakedMoses" => "'NakedMoses',
'#http://[^(\\\\s<)]*nakedmoses.com/torrents-details.php\\\\?id=\\\\d+#',
'#<title>.*"(.*)"#',
'#Total Size:</b></td><td>([^<]*)#',
'nm'",
"IsoHunt" => "'IsoHunt',
'#http://isohunt.com/torrent_details/\\\\d+/\\\\?tab=summary#',
'#<title>([^\\\\|]*)#', '#<p><i><b>([^<]*)#',
'ih'",
"HotFile" => "'HotFile',
'#http://hotfile.com/dl/[^\\\\s<]*#',
'#<title>.*: ([^<]*)#',
'#<div class=\"arrow_down\"><strong>.*<strong>([^<]*)</strong>#',
'hf'",
"MultiUpload"=> "'MultiUpload',
'#http://www.multiupload.com/[^\\\\s<]*#',
'/font-size:19px; color:#000000;\">([^<]*)/',
'/<font style=\"color:#666666;\">([^<]*)/',
'muu'",
/*"iFile" => "'iFile',
'#http://ifile.it/[^\\\\s<]*#',
'#\\\\t\\\\t([^\\\\t]*)\\\\t\ $#',
'#\\\\t\\\\t(\\\\d+\\\\.\\\\d+[^\\\\t]*)#',
'if'",*/
"DepositFiles"=>"'DepositFiles',
'#http://depositfiles.com/files/[^\\\\s<]*#',
'#File name:[^>]*>([^<]*)#',
'#File size:[^>]*>([^<]*)#',
'df'",
"Uploading" => "'Uploading',
'#http://uploading.com/files/[^(\\\\s<)]*#',
'#\\\\t\\\\t\\\\t\\\\t<h2>([^<]*)</h2><br/>#',
'#File size:[^>]*>([^<]*)#',
'up'",
"Demonoid" => "'Demonoid',
'#http://www.demonoid.com/files/details/\\\\d+/\\\\d+/#',
'#<title>([^<]*) - Demonoid#',
'#Size:</b> ([^<]*)#',
'dm'"/*,
"ThePirateBay"=>"'ThePirateBay',
'##',
'##',
'##',
'pb'"*/
)
?>
<form action="" method="post">
<input type="checkbox" name="install" />This is my first install<br />
<?php
require ('config.php');
$output = '';
foreach (array_keys($sites) as $site) {
$active = $tc_db->GetAll("SELECT `name` FROM `".KU_DBPREFIX."rs_sites` WHERE `name` = '".$site."'");
if (count($active) > 0)
$checked = 'checked';
else
$checked = '';
$output .= '<input type="checkbox" name="'.$site.'" '.$checked.'>'.$site.'<br />';
}
echo $output;
?>
<br />
<br />
Fill this field if and only if you know what you are doing:<br />
<span style="color: #f00; font-weight: bold">Warning: This might fuck up your database, so pay attention.</span><br />
Insert new site here: <input type="text" size="64" name="newsite" />
<br />
<br />
<input type="submit" value="Install!">
</form>
<?php
if (isset($_POST['install'])) {
echo "<b>Creating the rs_sites table... </b><br>";
$tc_db->Execute("CREATE TABLE `".KU_DBPREFIX."rs_sites` (
`id` INT( 20 ) NOT NULL AUTO_INCREMENT PRIMARY KEY ,
`name` VARCHAR( 255 ) NOT NULL ,
`regex` VARCHAR( 255 ) NOT NULL ,
`name_regex` VARCHAR( 255 ) NOT NULL ,
`size_regex` VARCHAR( 255 ) NOT NULL ,
`abbreviation` VARCHAR( 16 ) NOT NULL
) ENGINE = MYISAM DEFAULT CHARSET=utf8;");
echo "Done.<br>";
echo "<b>Creating the rs_links table... </b><br>";
$tc_db->Execute("CREATE TABLE `".KU_DBPREFIX."rs_links` (
`id` INT( 32 ) NOT NULL AUTO_INCREMENT PRIMARY KEY ,
`link` VARCHAR( 255 ) NOT NULL ,
`name` VARCHAR( 64 ) NOT NULL ,
`size` VARCHAR( 64 ) NOT NULL ,
`board` VARCHAR( 64 ) NOT NULL ,
`site` VARCHAR( 64 ) NOT NULL ,
`password` VARCHAR( 64 ) NOT NULL ,
`date` VARCHAR( 32 ) NOT NULL
) ENGINE = MYISAM DEFAULT CHARSET=utf8;");
echo "Done.<br><br>";
}
unset($_POST['install']);
if ($_POST['newsite'] != '') {
echo "<b>Adding in rs_sites the new link... </b><br>";
$query = "REPLACE INTO `".KU_DBPREFIX."rs_sites` (`name`, `regex`, `name_regex`, `size_regex`, `abbreviation`) VALUES (". stripslashes($_POST['newsite']) . ")";
$tc_db->Execute($query);
echo "Done.<br><br>";
unset ($_POST['newsite']);
} elseif (count(array_keys($_POST)) > 0) {
$installsites = array_keys($_POST);
echo "<b>Filling in rs_sites table... </b><br>";
foreach ($installsites as $installsite) {
$exists = $tc_db->GetOne("SELECT id FROM `".KU_DBPREFIX."rs_sites` WHERE `name` = '".$installsite."'");
if($exists != '') {
$query = "REPLACE INTO `".KU_DBPREFIX."rs_sites` (`name`, `regex`, `name_regex`, `size_regex`, `abbreviation`) VALUES (". $sites[$installsite] . ")";
$tc_db->Execute($query);
}
}
echo "Done.<br><br>";
}
?>