View Single Post
  #10  
Old 17th March 2015, 05:57
firefly007's Avatar
firefly007 firefly007 is offline
SUPPORT GURU
 
Join Date: Jun 2010
P2P
Posts: 721
Default
1)Name this and call it series_function.php and save it to the function folder.
You will need to get a free API key from TVRAGE by simply registering and add it to
$TVRAGE_KEY = '';
Code:
<?

///////////////////////////////////////////////Auto Series mod By firefly/////////////////////////////////////////////

$TVRAGE_KEY = '';// Register to tvrage and get your API get

function cut_name_r($data) {
$originals = array(".","-","(",")","DVDRip","EXViDT","XviD","RedBlade",
              "dia","dia","2013","TWiST","MAGNiTUDE",
              "WEBRip","FTP","TWiST","HDNORDiC","BLURAY",
              "COMPLETE","LIMITED","HDTV","x264","TLA",
              "NOSCREENS","belli","352p","AUDiO","NEW",
              "JUSTiCE","1080p","FiHTV","HTV","C4TV","2HD",
              "EVOLVE","KILLERS","BALLS","720p","PDTV","FQM",
              "BWB","_","FoV","NOCENCE","iGNiTiON","DVDR",
              "2012","ViDERE","SPANiSH","SCARED","2011","NTSC",
              "WTF","SPARKS","BDRip","SHOCKWAVE","KYR","SKGTV",
              "CRiMSON","TARGET","PSYCHD","ANGELiC","CAM","HP",
              "FooKaS","R6","DIMENSION","X264","HDTV","720p",
              "AQOS","HDRip","CHD","DTS","REAL","AFG","LOL",
              "AC3","R5","S07","E01","S07","E02","S01","E03",
              "S02","E04","S03","E05","S04","E06","S05","E07",
              "S06","E09","S07","E10","S08","E11","S09","E12",
              "S10","E13","S11","S12","E14","BAJSKORV","TERNAL",
              "E24","W4F","UK","S14","DHD","QCF","S20","REPACK",
              "utL","NovaRip","Mux","DL","Tutto",
              "Pronti","GABE","DD5","WEB","utL","NovaRip",
              "Mux","DL","Tutto","Pronti","GABE","DD5","FQM",
              "KGS","NZBSoOTi","BS","Silver007","DOCUMENT","WiDE",
              "LOL","UNiQUE","PSiG","1080p","IMMERSE","Videomann",
              "Videomann","PROD","EwDp","WS","uCorsu",
              "D-Z0N3","IOM","PLAYNOW","LAP","iGNHQ","Dutch","biz",
              "W00D","FiCO","DEiMOS","SUBPACK","KAFFEREP",
              "IOM","PLAYNOW","LAP","iGNHQ","Dutch","biz",
              "W00D","FiCO","DEiMOS","SUBPACK","KAFFEREP",
              "OSiTV","E26","TASTE","YesT","TASTE",
              "E20","BERC","rst","CDR","2006", "E08", "E16","E28","PFa",
              "E83","E65","E64","E66","E68","E89","E88","E86",
              "E87","E85","E82","E81","E80","E79","E78","E77","E76",
              "E75","E74","E73","E72","E71","E63","E62","E61","E87",
              "E70","E29","uCorsu","E22","E19","RiP","HDA","WHEELS","EDITED",
              "FaiLED","UNCUT","ForzaCorsica","SML","iFPD","E23","E15",
              "UNRATED","READNFO","VOD","SUBMERGE","VTFR","boheme",
              "2014 ","SANTi","German","VoMiT","GOREHOUNDS","REMASTERED",
              "LiViDiTY","ALLiAN","FRAGMENT","IGUANA","aAF","FLAWL3S",
              "sUN","RiVER","SMOKEY","TWiZTED","UZY","vYt","UrK","zWW",
              "EXViDiNT","DVDSCREENER","HQ","nLF","Custom","XzR","qug",
              "DOCU","ARROW","DownRev","PAL","HEBDUB","hxa","GECKOS","AFq",
              "fLC","PROPER","NFOFiX","fyO","Qyt","BgFr","EVO","BR","ACAB",
              "Waw","Qzh","SChiZO","TERRA");

$replacements = array(" ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ",
" ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ",
" ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ",
" ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ",
" ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ",
" ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ",
" ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ",
 " "," "," ", " ", " ", " ", " ", " ", " " , " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ",
 " "," "," "," "," ");    
$data = str_ireplace($originals, $replacements, $data);
return $data;
}



class TV
{
        
public function RAGEID($name){
    
$title =  cut_name_r($name);
$NUrl = urlencode(strtolower($title));
$Url1 =  "http://services.tvrage.com/feeds/full_search.php?show='$NUrl";
$feed=    file_get_contents($Url1);

$VAR = new SimpleXmlElement($feed);
$elem_1a  = $VAR -> xpath('show/showid');
return $elem_1a[0];    
}    
 
public function TVRAGE($id,$sw){
global $TVRAGE_KEY;

$ela  = '';$elb  = '';$elc  = '';$eld  = '';$ele  = '';$elf  = '';$elg  = '';$elh  = '';$eli  = '';$elja = '';$elk = '';
    
$Url1 = 'http://services.tvrage.com/myfeeds/showinfo.php?key='.$TVRAGE_KEY.'&sid='.$id;
$feed1= file_get_contents($Url1);
if(false !== $feed1)
{
$VAR = new SimpleXmlElement($feed1);
 
$elem_1a  = $VAR -> xpath('showid');           $ela  = $elem_1a[0];
$elem_2b  = $VAR -> xpath('showname');         $elb  = $elem_2b[0];
$elem_2c  = $VAR -> xpath('seasons');          $elc  = $elem_2c[0];
$elem_2d  = $VAR -> xpath('image');            $eld  = $elem_2d[0];
$elem_2e  = $VAR -> xpath('started');          $ele  = $elem_2e[0];
$elem_2f  = $VAR -> xpath('startdate');        $elf  = $elem_2f[0];
$elem_2g  = $VAR -> xpath('ended');            $elg  = $elem_2g[0];
$elem_2h  = $VAR -> xpath('runtime');          $elh  = $elem_2h[0];
$elem_2i  = $VAR -> xpath('airtime');          $eli  = $elem_2i[0];
$elem_2ja = $VAR -> xpath('network');         $elja  = $elem_2ja[0];
}
 
$Url2 = 'http://services.tvrage.com/myfeeds/episode_list.php?key='.$TVRAGE_KEY.'&sid='.$id;
$feed2=    file_get_contents($Url2);
if(false !== $feed2)
{   
$var2 = new SimpleXmlElement($feed2);
$elem_2a  = $var2 -> xpath('Episodelist/Season/episode/rating');
if (isset($elem_2a[0])){$elk  = $elem_2a[0];}  
}
switch ($sw) {
  case "rageID":       $out = $ela;break;
  case "name":         $out = $elb;break;
  case "seasons":      $out = $elc;break;
  case "image":        $out = $eld;break;
  case "started":      $out = $ele;break;
  case "startdate":    $out = $elf;break;
  case "ended":        $out = $elg;break;
  case "runtime":      $out = $elh;break;
  case "airtime":      $out = $eli;break;
  case "network":      $out = $elja;break;
  case "rate":         $out = $elk;break;
}
return $out;
}

public function TVDB($name,$sw){
global $TVDB_KEY;
$Url = 'http://thetvdb.com/api/GetSeries.php?seriesname=' . str_replace(" ", "%20", $name);
$feed= file_get_contents($Url);
if(false !== $feed)
{
$var1 = new SimpleXmlElement($feed);
$tvdb_id = ''; $tvdb_id = ''; $tvdb_name = ''; $first = ''; $net = ''; $imdb = ''; $zap2it_id = ''; $tvdb_ban = ''; $tvdb_ove = '';
  
$tvdb_id    = $var1 -> xpath('Series/seriesid');
$tvdb_name  = $var1 -> xpath('Series/SeriesName');
$first      = $var1 -> xpath('Series/FirstAired');
$net        = $var1 -> xpath('Series/Network');
$imdb       = $var1 -> xpath('Series/IMDB_ID');
$zap2it_id  = $var1 -> xpath('Series/zap2it_id');
$tvdb_ban   = $var1 -> xpath('Series/banner');
$tvdb_ove   = $var1 -> xpath('Series/Overview');

$id = ''; $name = ''; $firstair = ''; $network = ''; $imdbID = ''; $zap = ''; $ban = ''; $over = ''; 
 
if (isset($tvdb_id[0])) {$id        = $tvdb_id[0];}
if (isset($tvdb_name[0])){$name     = $tvdb_name[0];}
if (isset($first[0])){$firstair     = $first[0];}
if (isset($net[0])){$network        = $net[0];}
if (isset($imdb[0])){$imdbID        = $imdb[0];}
if (isset($zap2it_id[0])){$zap      = $zap2it_id[0];}
if (isset($tvdb_ban[0])){$ban       = $tvdb_ban[0];}
if (isset($tvdb_ove[0])){$over      = $tvdb_ove[0];}
}


 
switch ($sw) {
 
  case "id"    :$out = $id;break;
  case "name"  :$out = $name;break;
  case "air"   :$out = $firstair;break;
  case "net"   :$out = $network;break;
  case "imdb"  :$out = $imdbID;break;
  case "zap"   :$out = $zap;break;
  case "ban"   :$out = 'http://thetvdb.com/banners/_cache/'.$ban;break;
  case "desc"  :$out = $over;break;
  default      :$out = $name;
}
 
return $out;
}

}
Edit details.php and add

Code:
require_once (INCL_DIR.'series_functions.php');
under
Code:
require_once (IMDB_DIR.'imdb.class.php');
Add above

Code:
$my_points = (isset($torrent['torrent_points_'][$CURUSER['id']]) ? (int)$torrent['torrent_points_'][$CURUSER['id']] : 0);
or where ever you want it! Edit add the category/categories you want Or replace

Code:
($torrents['category'] == 5){
with
Code:
if (preg_match("/S(\d+)E(\d+)/i", $torrent["name"])){
Code:
///////////////////////////////////////////////Auto Series mod By firefly/////////////////////////////////////////////
    
    if ($torrents['category'] == 5){
           
        $TV = new TV;

        $RAGEID =  $TV->RAGEID($torrents['name']);
                
        $res = sql_query(" SELECT * FROM series WHERE rageID = '$RAGEID'");
        $row = mysqli_fetch_array($res);
        
    if ($RAGEID == $row["rageID"]){
        $RAGEID  = $row["rageID"];
        $TVDBID  = $row["tvdbID"];
        $NAME    = $row["name"];
        $RUNTIME = $row["runtime"];
        $NETWORK = $row["network"];
        $RATE    = $row["rate"];    
        $POSTER  = $row["poster"];
        $SYM     = $row["sym"];        
    }else{
        $RAGEID  = $TV->TVRAGE($RAGEID,"rageID");
        $NAME    = $TV->TVRAGE($RAGEID,"name");
        $TVDBID  = $TV->TVDB($NAME,"id");
        $RUNTIME = $TV->TVRAGE($RAGEID,"runtime");
        $NETWORK = $TV->TVRAGE($RAGEID,"network");
        $RATE    = $TV->TVRAGE($RAGEID,"rate");    
        $POSTER  = $TV->TVRAGE($RAGEID,"image");
        $SYM     = $TV->TVDB($NAME,"desc");
        sql_query("INSERT INTO series (rageID, tvdbID, name, runtime, network, rate, poster, sym)
         VALUES ('".mysql_escape_string($RAGEID)."', '".mysql_escape_string($TVDBID)."', '".mysql_escape_string($NAME)."', '".mysql_escape_string($RUNTIME)."', '".mysql_escape_string($NETWORK)."', '".mysql_escape_string($RATE)."', '".mysql_escape_string($POSTER)."', '".mysql_escape_string($SYM)."')")or mysql_error();
        }        
        
    if (!empty($POSTER)){      
       $HTMLOUT.= '<tr><td class="heading" valign="top" align="right">Poster</td>
        <td valign="top" align="left"><img src="'.$POSTER.'"></td></tr>';
        }
    if (!empty($RUNTIME)){      
       $HTMLOUT.= '<tr><td class="heading" valign="top" align="right">Runtime</td>
        <td valign="top" align="left">'.$RUNTIME.'</td></tr>';
        }
    if (!empty($NETWORK)){      
       $HTMLOUT.= '<tr><td class="heading" valign="top" align="right">Network</td>
        <td valign="top" align="left">'.$NETWORK.'</td></tr>';
        }
    if (!empty($RATE)){      
       $HTMLOUT.= '<tr><td class="heading" valign="top" align="right">Rating</td>
        <td valign="top" align="left">'.$RATE.'</td></tr>';
        }
    if (!empty($SYM)){      
       $HTMLOUT.= '<tr><td class="heading" valign="top" align="right">Tv Desc</td>
        <td valign="top" align="left">'.$SYM.'</td></tr>';
        }
        }    
    
    ///////////////////////////////////////////END auto Series mod By firefly//////////////////////////////////////////
execute this..

Code:
CREATE TABLE IF NOT EXISTS `series` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `rageID` int(10) NOT NULL,
  `tvdbID` int(11) NOT NULL,
  `name` varchar(255) NOT NULL,
  `runtime` int(10) NOT NULL,
  `network` varchar(255) NOT NULL,
  `rate` int(10) NOT NULL,
  `poster` varchar(255) NOT NULL,
  `sym` longtext NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=MyISAM  DEFAULT CHARSET=latin1 AUTO_INCREMENT=464 ;
__________________




Please Support Majority Report


You can contact me on Skype live:phesadent.elect but please let me know first.


If you are ever need me desperately then please email me at dan.oak44@gmail.com and I will contact u within a week.


Due to free time I'm able to help interested member's with their tracker.

Please Note!
Depending on your requests I will charge you for my assistance for Tracker installs and mods.
All my mods are custom and prices will very depending on the request.
I'm able to install any tracker and mods including themes.

Please PM me


Last edited by firefly007; 17th March 2015 at 08:55.
Reply With Quote
The Following 2 Users Say Thank You to firefly007 For This Useful Post:
DND (17th March 2015), Joe (17th March 2015)