--- torrentflux-2.3.orig/html/searchEngines/isoHuntEngine.php
+++ torrentflux-2.3/html/searchEngines/isoHuntEngine.php
@@ -1,407 +1,816 @@
mainURL = "isohunt.com";
+
$this->altURL = "isohunt.com";
+
$this->mainTitle = "isoHunt";
+
$this->engineName = "isoHunt";
+
+
$this->author = "kboy";
+
$this->version = "1.05";
+
$this->updateURL = "http://www.torrentflux.com/forum/index.php/topic,878.0.html";
+
+
$this->Initialize($cfg);
+
+
}
+
+
//----------------------------------------------------------------
+
// Function to Make the Request (overriding base)
+
function makeRequest($request)
+
{
+
return parent::makeRequest($request, true);
+
}
+
+
//----------------------------------------------------------------
+
// Function to get Latest..
+
function getLatest()
+
{
+
$request = "/latest.php?mode=bt";
+
+
if (!empty($this->pg))
+
{
+
$request .= "&pg=" . $this->pg;
+
}
+
+
if ($this->makeRequest($request))
+
{
+
return $this->parseResponse(true);
+
}
+
else
+
{
+
return $this->msg;
+
}
+
}
+
+
//----------------------------------------------------------------
+
// Function to perform Search.
+
function performSearch($searchTerm)
+
{
+
// This is what isohunt is looking for in a request.
+
// http://isohunt.com/torrents.php?ihq=test&ext=&op=and
+
+
// create the request string.
+
$searchTerm = str_replace(" ", "+", $searchTerm);
+
$request = "/torrents?ihq=".$searchTerm;
+
//$request .= "&ext=&op=and";
+
if (!empty($this->pg))
+
{
+
$request .= "&ihs1=18&iho1=d&iht=-1&ihp=" . $this->pg;
+
}
+
+
// make the request if successful call the parse routine.
+
if ($this->makeRequest($request))
+
{
+
return $this->parseResponse(false);
+
}
+
else
+
{
+
return $this->msg;
+
}
+
+
}
+
+
//----------------------------------------------------------------
+
// Function to parse the response.
+
function parseResponse($latest = true)
+
{
+
$output = $this->tableHeader();
+
+
$thing = $this->htmlPage;
+
+
// Strip out those Nasty Iframes.
+
$thing = eregi_replace("
",'',$thing);
+
+
// We got a response so display it.
+
// Chop the front end off.
+
if ($latest)
+
{
+
$start = strrpos($thing, "New torrents on isoHunt");
+
} else {
+
$start = strrpos($thing, "isoHunt Rank");
+
}
+
+
$thing = substr($thing, $start, strlen($thing) - $start);
+
+
if ($latest)
+
{
+
$end = strrpos($thing, "adclick");
+
} else {
+
$end = strrpos($thing, "ยป");
+
}
+
+
$thing = substr($thing, 0, $end);
+
$tmpList = $thing;
+
//echo $tmpList;
+
+
if (strpos($tmpList,"/download/") || strpos($tmpList,"torrent_details"))
+
{
+
// ok so now we have the listing.
+
$tmpListArr = split("",$tmpList);
+
+
array_pop($tmpListArr);
+
$bg = $this->cfg["bgLight"];
+
+
+
foreach($tmpListArr as $key =>$value)
+
{
+
//echo $value;
+
$buildLine = true;
+
if (strpos($value,"/download/") || strpos($value,"torrent_details"))
+
{
+
$ts = new isoHunt($value,$latest);
+
+
// Determine if we should build this output
+
if (is_int(array_search($ts->CatName,$this->catFilter)))
+
{
+
$buildLine = false;
+
}
+
+
if ($this->hideSeedless == "yes")
+
{
+
if($ts->Seeds == "N/A" || $ts->Seeds == "0")
+
{
+
$buildLine = false;
+
}
+
}
+
+
if (!empty($ts->torrentFile) && $buildLine) {
+
+
$output .= trim($ts->BuildOutput($bg));
+
+
// ok switch colors.
+
if ($bg == $this->cfg["bgLight"])
+
{
+
$bg = $this->cfg["bgDark"];
+
}
+
else
+
{
+
$bg = $this->cfg["bgLight"];
+
}
+
}
+
+
}
+
}
+
// set thing to end of this table.
+
$thing = substr($thing,strpos($thing,""));
+
if (!is_integer(strpos($thing,"name=ihLogin")))
+
{
+
$thing = "";
+
}
+
}
+
+
$output .= "";
+
+
// is there paging at the bottom?
+
if (strpos($this->htmlPage, "";
+
+
+
+
return $output;
+
}
+
}
+
+
// This is a worker class that takes in a row in a table and parses it.
+
class mininova
+
{
+
var $torrentName = "";
+
var $torrentDisplayName = "";
+
var $torrentFile = "";
+
var $torrentSize = "";
+
var $torrentStatus = "";
+
var $CatId = "";
+
var $CatName = "";
+
var $fileCount = "";
+
var $Seeds = "";
+
var $Peers = "";
+
var $Data = "";
+
+
var $dateAdded = "";
+
var $dwnldCount = "";
+
- function mininova( $htmlLine , $latest = true)
+
+ function mininova( $htmlLine , $latest = true, $curCat="", $curCatId="")
+
{
+
+
if (strlen($htmlLine) > 0)
+
{
+
+
$this->Data = $htmlLine;
+
+
+
// Chunck up the row into columns.
+
$tmpListArr = split("",$htmlLine);
+
array_pop($tmpListArr);
-//print_r($tmpListArr);
+
+
+
//Age Type Torrent Names MB S L
+
if(count($tmpListArr) > 4)
+
{
+
if ($latest)
+
{
+
// Latest Request //
-
- $this->CatName = $this->cleanLine($tmpListArr["1"]); // Type
- $tmpStr = substr($tmpListArr["2"],strpos($tmpListArr["2"],"/tor/")+5);
+
+ $this->MainCategory = $curCat; // Type
+
+ $this->MainId = $curCatId; // Type
+
+ $tmpStr = substr($tmpListArr["1"],strpos($tmpListArr["1"],"/tor/")+5);
+
$this->torrentFile = "http://www.mininova.org/get/".substr($tmpStr,0,strpos($tmpStr,'">'));
- $this->torrentName = $this->cleanLine($tmpListArr["2"]); // Name
-
- $this->torrentSize = $this->cleanLine($tmpListArr["3"]); // MB
- $this->Seeds = $this->cleanLine($tmpListArr["4"]); // Seeds
- $this->Peers = $this->cleanLine($tmpListArr["5"]); // Leechers
-
+
+ $this->torrentName = $this->cleanLine($tmpListArr["1"]); // Name
+
+
+
+ $this->torrentSize = $this->cleanLine($tmpListArr["2"]); // MB
+
+ $this->Seeds = $this->cleanLine($tmpListArr["3"]); // Seeds
+
+ $this->Peers = $this->cleanLine($tmpListArr["4"]); // Leechers
+
}
+
else
+
{
+
// Search Request //
-
-
+
$this->CatName = $this->cleanLine($tmpListArr["1"]); // Type
+
$tmpStr = substr($tmpListArr["2"],strpos($tmpListArr["2"],"/tor/")+5);
+
$this->torrentFile = "http://www.mininova.org/get/".substr($tmpStr,0,strpos($tmpStr,'">'));
+
$this->torrentName = $this->cleanLine($tmpListArr["2"]); // Name
+
+
$this->torrentSize = $this->cleanLine($tmpListArr["3"]); // MB
+
$this->Seeds = $this->cleanLine($tmpListArr["4"]); // Seeds
+
$this->Peers = $this->cleanLine($tmpListArr["5"]); // Leechers
-
- $this->torrentDisplayName = $this->torrentName;
-
+
}
+
+
if ($this->Peers == '')
+
{
+
$this->Peers = "N/A";
+
if (empty($this->Seeds)) $this->Seeds = "N/A";
+
}
+
+
if ($this->Seeds == '') $this->Seeds = "N/A";
+
+
$this->torrentDisplayName = str_replace(".torrent",'',$this->torrentName);
+
if(strlen($this->torrentDisplayName) > 50)
+
{
+
$this->torrentDisplayName = substr($this->torrentDisplayName,0,50)."...";
+
}
+
+
}
+
}
+
}
+
+
function cleanLine($stringIn,$tags='')
+
{
+
if(empty($tags))
+
return trim(str_replace(array(" "," ")," ",strip_tags($stringIn)));
+
else
+
return trim(str_replace(array(" "," ")," ",strip_tags($stringIn,$tags)));
+
}
+
+
function dumpArray($arrIn)
+
{
+
foreach($arrIn as $key => $value)
+
{
+
echo "\nkey(".$key.")"."value(".$value.")";
+
}
+
}
+
//----------------------------------------------------------------
+
// Function to build output for the table.
+
function BuildOutput($bg)
+
{
+
$output = "\n";
+
$output .= " torrentFile."\">torrentName."\" border=0> | \n";
+
$output .= " torrentFile."\" title=\"".$this->torrentName."\">".$this->torrentDisplayName." | \n";
+
$output .= " ". $this->CatName ." | \n";
+
$output .= " ".$this->torrentSize." | \n";
+
$output .= " ".$this->Seeds." | \n";
+
$output .= " ".$this->Peers." | \n";
+
$output .= "
\n";
+
+
return $output;
+
+
}
+
}
+
+
?>
+
--- torrentflux-2.3.orig/html/searchEngines/PirateBayEngine.php
+++ torrentflux-2.3/html/searchEngines/PirateBayEngine.php
@@ -1,503 +1,1082 @@
mainURL = "thepiratebay.org";
+
$this->altURL = "thepiratebay.org";
+
$this->mainTitle = "The PirateBay";
+
$this->engineName = "PirateBay";
+
+
$this->author = "kboy";
- $this->version = "1.05";
+
+ $this->version = "1.06";
+
$this->updateURL = "http://www.torrentflux.com/forum/index.php/topic,1125.0.html";
+
+
$this->Initialize($cfg);
+
}
+
+
function populateMainCategories()
+
{
+
$this->mainCatalog["000"] = "Top100";
+
$this->mainCatalog["100"] = "Audio";
+
$this->mainCatalog["200"] = "Video";
+
$this->mainCatalog["300"] = "Applications";
+
$this->mainCatalog["400"] = "Games";
+
$this->mainCatalog["500"] = "Porn";
- $this->mainCatalog["600"] = "E-books";
+
+ $this->mainCatalog["600"] = "Other";
+
}
+
+
//----------------------------------------------------------------
+
// Function to Get Sub Categories
+
function getSubCategories($mainGenre)
+
{
+
$output = array();
+
+
switch ($mainGenre)
+
{
+
case "100" :
+
$output["101"] = "Music";
+
$output["102"] = "Audio books";
+
$output["103"] = "Sound clips";
+
$output["199"] = "Other";
+
break;
+
case "200" :
+
$output["201"] = "Movies";
+
$output["202"] = "Movies DVDR";
+
$output["203"] = "Music videos";
+
$output["204"] = "Movie clips";
+
$output["205"] = "TV shows";
+
$output["206"] = "Handheld";
+
$output["299"] = "Other";
+
break;
+
case "300" :
+
$output["301"] = "Windows";
+
$output["302"] = "Mac";
+
$output["303"] = "UNIX";
+
$output["304"] = "Handheld";
+
$output["399"] = "Other OS";
+
break;
+
case "400" :
+
$output["401"] = "PC";
+
$output["402"] = "Mac";
+
$output["403"] = "PS2";
+
$output["404"] = "XBOX";
+
$output["405"] = "Gamecube";
+
$output["406"] = "Handheld";
+
$output["499"] = "Other";
+
break;
+
case "500" :
+
$output["501"] = "Movies";
+
$output["502"] = "Movies DVDR";
+
$output["503"] = "Pictures";
+
$output["504"] = "Games";
+
$output["599"] = "Other";
+
break;
+
case "600" :
+
$output["601"] = "E-books";
+
$output["602"] = "Comics";
+
$output["603"] = "Pictures";
+
$output["604"] = "Covers";
+
$output["699"] = "Other";
+
break;
+
}
+
+
return $output;
+
+
}
+
+
//----------------------------------------------------------------
+
// Function to Make the Request (overriding base)
+
function makeRequest($request)
+
{
+
return parent::makeRequest($request, false);
+
}
+
+
//----------------------------------------------------------------
+
// Function to get Latest..
+
function getLatest()
+
{
+
//recent.php
+
//top100.php
+
+
if ($_REQUEST["mainGenre"] == "000")
+
{
+
$request = "/top/all";
+
}
+
else
+
{
+
if (array_key_exists("subGenre",$_REQUEST))
+
{
+
$request = "/brwsearch.php?b=1&c=".$_REQUEST["subGenre"];
+
}
+
elseif (array_key_exists("mainGenre",$_REQUEST))
+
{
+
if ($_REQUEST["mainGenre"] == "000")
+
{
+
$request = "/top/all";
+
} else {
+
$request = "/brwsearch.php?b=1&c=0&d=".$_REQUEST["mainGenre"];
+
}
+
}
+
else
+
{
+
$request = "/recent.php?orderby=se";
+
}
+
if (!empty($this->pg))
+
{
+
$request .= "&page=" . $this->pg;
+
}
+
}
+
+
if ($this->makeRequest($request))
+
{
+
return $this->parseResponse();
+
}
+
else
+
{
+
return $this->msg;
+
}
+
+
}
+
+
//----------------------------------------------------------------
+
// Function to perform Search.
+
function performSearch($searchTerm)
+
{
+
if (array_key_exists("subGenre",$_REQUEST))
+
{
+
$request = "/brwsearch.php?b=1&c=".$_REQUEST["subGenre"];
+
}
+
elseif (array_key_exists("mainGenre",$_REQUEST))
+
{
+
$request = "/brwsearch.php?b=1&c=0&d=".$_REQUEST["mainGenre"];
+
}
+
else
+
{
+
$request = "/search.php?orderby=".$searchTerm;
+
}
+
+
if(strlen($searchTerm) > 0)
+
{
+
$searchTerm = str_replace(" ", "+", $searchTerm);
+
$request .= "&q=".$searchTerm;
+
}
+
+
$request .= "&audio=&video=&apps=&games=&porn=&other=&what=search&orderby=";
+
+
if (!empty($this->pg))
+
{
+
$request .= "&page=" . $this->pg;
+
}
+
+
if ($this->makeRequest($request))
+
{
+
return $this->parseResponse();
+
}
+
else
+
{
+
return $this->msg;
+
}
+
}
+
+
//----------------------------------------------------------------
+
// Override the base to show custom table header.
+
// Function to setup the table header
+
function tableHeader()
+
{
+
$output = "";
+
+
$output .= "
\n";
+
$output .= "cfg["table_header_bg"]."\">";
+
$output .= " | ";
+
$output .= " Torrent Name (";
+
+
$tmpURI = str_replace(array("?hideSeedless=yes","&hideSeedless=yes","?hideSeedless=no","&hideSeedless=no"),"",$_SERVER["REQUEST_URI"]);
+
+
// Check to see if Question mark is there.
+
if (strpos($tmpURI,'?'))
+
{
+
$tmpURI .= "&";
+
}
+
else
+
{
+
$tmpURI .= "?";
+
}
+
+
if($this->hideSeedless == "yes")
+
{
+
$output .= "Show Seedless";
+
}
+
else
+
{
+
$output .= "Hide Seedless";
+
}
+
+
$output .= ") | ";
+
$output .= " Category | ";
+
$output .= " Size | ";
+
$output .= " Date Added | ";
+
$output .= " Seeds | ";
+
$output .= " Peers | ";
+
$output .= "
\n";
+
+
return $output;
+
}
+
+
//----------------------------------------------------------------
+
// Function to parse the response.
+
function parseResponse()
+
{
+
$output = $this->tableHeader();
+
+
$thing = $this->htmlPage;
+
+
// We got a response so display it.
+
// Chop the front end off.
- $thing = str_replace("Recent Torrents","Search results",$thing);
-
- while (is_integer(strpos($thing,"Search results")))
- {
- $thing = substr($thing,strpos($thing,"Search results"));
- $thing = substr($thing,strpos($thing,""));
- $thing = substr($thing,strpos($thing,""));
-
- $tmpList = substr($thing,0,strpos($thing,"