|
#1
|
|||
|
|||
Subtitles
SQL
Code:
CREATE TABLE `subs` ( `id` int(10) unsigned NOT NULL auto_increment, `title` varchar(255) NOT NULL default '', `filename` varchar(255) NOT NULL default '', `cd` int(10) unsigned NOT NULL default '0', `frame` varchar(255) NOT NULL default '', `comment` text NOT NULL, `added` datetime default NULL, `size` int(10) unsigned NOT NULL default '0', `uppedby` int(10) unsigned NOT NULL default '0', `url` varchar(255) NOT NULL default '', `hits` int(10) unsigned NOT NULL default '0', PRIMARY KEY (`id`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1; downloadsubs.php Code:
<? require "include/bittorrent.php"; dbconn(); if (!$CURUSER) { Header("Location: $BASEURL/"); die; } $filename = substr($HTTP_SERVER_VARS["PATH_INFO"], strrpos($HTTP_SERVER_VARS["PATH_INFO"], "/") + 1); if (!$filename) die("File name missing\n"); if (get_user_class() < UC_POWER_USER && filesize("$SUBSPATH/$filename") > 1024*1024) die("Sorry, you need to be a power user or higher to download files larger than 1.00 MB.\n"); $filename = sqlesc($filename); $res = mysql_query("SELECT * FROM subs WHERE filename=$filename") or sqlerr(); $arr = mysql_fetch_assoc($res); if (!$arr) die("Not found\n"); mysql_query("UPDATE subs SET hits=hits+1 WHERE id=$arr[id]") or sqlerr(__FILE, __LINE__); $file = "$SUBSPATH/$arr[filename]"; if (!is_file($file)) die("File not found\n"); $f = fopen($file, "rb"); if (!$f) die("Cannot open file\n"); header("Content-Length: " . filesize($file)); header("Content-Type: application/octet-stream"); do { $s = fread($f, 4096); print($s); } while (!feof($f)); closefile($f); exit; ?> Then add this in bittorent.php or config.php Code:
//Directory for subs $SUBSPATH = "subs"; # local path to subs dir, chmod 777 Enjoy ! Last edited by sammygo; 1st May 2009 at 16:03. |
The Following 8 Users Say Thank You to sammygo For This Useful Post: | ||
#2
|
|||
|
|||
top subtitle uploaders
does anyone have a top subtitles uploaders ?
A top where it can be seen who uploaded most subtitles ? I sincerely tried and had no luck :( Thank you very much |
#3
|
||||
|
||||
|
Tags |
subtitles |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
[TBDev] shoutcast radio for tbdev | Slatkis | TBDev | 14 | 3rd June 2017 09:08 |
TorrentStrike theme engine to TBdev | Kotafi | Mods & Themes | 6 | 13th May 2012 04:42 |
[TBDEV] Pets Scripts for TBDev | BacKUP | TBDev | 4 | 7th September 2011 15:36 |
[YSE] Subtitles | ibizaland | Yuna Scatari Edition (YSE) | 2 | 21st June 2009 00:12 |
[REQ] Subtitles | svenxxx | Template Shares | 0 | 30th April 2009 12:06 |