Announce problem

Started by Mysql, January 17, 2014, 09:30:03 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Mindless

That aint standard Tbdev, thats nexus or some shit, can tell from certain tables, like yupy said, fuck man this is 2013 and folk are running shit house sources from 10 odd years ago, I honestly dont know why you run such old, error ridden code, basically get error_reporting(E_ALL);  onto that file and find out if its a php error, get all err appended with error 1 - error 2 ect until you have all possible err lines identified, get or sql_error added to querys, without doing so you wont find out nothing or where the break point is on that file, even easier is install and http analyser and find out in minutes whats failed.

Yupy.

Don't use short tags <?, use <?php

Mysql

Hi

I have a problem with my announce ,i get tracker sending invalid data and don`t figure where is the problem
Announce.php

<?
ob_start("ob_gzhandler");
require_once("include/bittorrent.php");
require_once("include/benc.php");
function hex2bin($hexdata) {
 
   for ($i=0;$i<strlen($hexdata);$i+=2) {
     $bindata.=chr(hexdec(substr($hexdata,$i,2)));
   }
 
   return $bindata;
}

function err($msg)
{
    benc_resp(array("failure reason" => array(type => "string", value => $msg)));
    exit();
}

function benc_resp($d)
{
    benc_resp_raw(benc(array(type => "dictionary", value => $d)));
}

function benc_resp_raw($x)
{
    header("Content-Type: text/plain");
    header("Pragma: no-cache");
    print($x);
}

function check_ip_limit() {
    global $userid;

    // Check IP limit
    $res = mysql_query("SELECT DISTINCT(ip) AS ip FROM peers WHERE userid=$userid");
    $count = 0;
    $found = FALSE;
    while ($row = mysql_fetch_assoc($res)) {
    $count++;
        if ($row["ip"] == $ip) {
            $found = TRUE;
            break;
        }
    }
   
    if (!$found && $count >= $GLOBALS["MAX_PASSKEY_IPS"])
        err("Too many different IPs for this user (max ".$GLOBALS["MAX_PASSKEY_IPS"].")");
}

if (in_array($_SERVER["HTTP_USER_AGENT"], $GLOBALS["BAN_USERAGENTS"]))
    err("You use a banned client. Please read the FAQ!");

$req = "info_hash:peer_id:!ip:port:uploaded:downloaded:left:!event";
if ($GLOBALS["CLIENT_AUTH"] == CLIENT_AUTH_PASSKEY) {
    if ($GLOBALS["PASSKEY_SOURCE"] == PASSKEY_USE_PARAM) {
        $req .= ":passkey";
        // Using announce.php?passkey={KEY} will lead to an incorrect parameter list,
        // so the first parameter appended by the client gets appended to the passkey parameter.
        // This match will extract the parameter to $_GET
        if (preg_match("/^([a-f0-9]{16})\\?(.*?)\\=(.*)$/is", $_GET["passkey"], $m)) {
            $_GET["passkey"] = $m[1];
            $_GET[$m[2]] = $m[3];
        }
    }
    if ($GLOBALS["PASSKEY_SOURCE"] == PASSKEY_USE_SUBDOMAIN) {
        preg_match("/^([a-f0-9]{16})\\./i", $_SERVER["HTTP_HOST"], $m);
        if (strlen($m[1])==16)
            $passkey = $m[1];
        else
            err("Parameters required for Announce: passkey");
    }
}

foreach (explode(":", $req) as $x)
{
    if ($x[0] == "!")
    {
        $x = substr($x, 1);
        $opt = 1;
    }
    else
        $opt = 0;
    if (!isset($_GET[$x]))
    {
        if (!$opt)
            err("Parameters required for Announce Announce: $x");
        continue;
    }
    $GLOBALS[$x] = unesc($_GET[$x]);
}

foreach (array("info_hash","peer_id") as $x)
{
    if (strlen($GLOBALS[$x]) != 20)
        err("Ungueltiger Wert fuer $x (" . strlen($GLOBALS[$x]) . " - " . urlencode($GLOBALS[$x]) . ")");
}

foreach ($GLOBALS["BAN_PEERIDS"] as $banned_id)
{
    if (substr($GLOBALS["peer_id"],0,strlen($banned_id)) == $banned_id)
        err("You use a banned client. Please read the FAQ!");
}

$ip = getip();
$origip = $ip;
$port = 0 + $port;
$origport = $port;
$downloaded = 0 + $downloaded;
$uploaded = 0 + $uploaded;
$left = 0 + $left;

$rsize = 50;
foreach(array("num want", "numwant", "num_want") as $k)
{
    if (isset($_GET[$k]))
    {
        $rsize = 0 + $_GET[$k];
        break;
    }
}

$agent = $_SERVER["HTTP_USER_AGENT"];

// Deny access made with a browser...
if (ereg("^Mozilla\\/", $agent) || ereg("^Opera\\/", $agent) || ereg("^Links ", $agent) || ereg("^Lynx\\/", $agent))
    err("This torrent is not aware of the Tracker");

if (!$port || $port > 0xffff)
    err("Invalid TCP-Port");

if (!isset($event))
    $event = "";

$seeder = ($left == 0) ? "yes" : "no";

dbconn(false);
$res = mysql_query("SELECT id, name, category, banned,free, activated, seeders + leechers AS numpeers, UNIX_TIMESTAMP(added) AS ts FROM torrents WHERE " . hash_where("info_hash", $info_hash));

$torrent = mysql_fetch_assoc($res);
if (!$torrent)
    err("This torrent is not aware of the Tracker");

if ($torrent["activated"] != "yes")
    err("This torrent is not aware of the Tracker");

$torrentid = $torrent["id"];

$fields = "seeder, peer_id, ip, port, uploaded, downloaded, userid";

$numpeers = $torrent["numpeers"];
$limit = "";
if ($numpeers > $rsize)
    $limit = "ORDER BY RAND() LIMIT $rsize";
$res = mysql_query("SELECT $fields FROM peers WHERE torrent = $torrentid AND connectable = 'yes' $limit");

$resp = "d" . benc_str("interval") . "i" . $GLOBALS["ANNOUNCE_INTERVAL"] . "e" . benc_str("peers") . "l";
unset($self);
while ($row = mysql_fetch_assoc($res))
{
    $row["peer_id"] = hash_pad($row["peer_id"]);

    if ($row["peer_id"] === $peer_id)
    {
        $userid = $row["userid"];
        $self = $row;
        continue;
    }

    $resp .= "d" .
        benc_str("ip") . benc_str($row["ip"]) .
        benc_str("peer id") . benc_str($row["peer_id"]) .
        benc_str("port") . "i" . $row["port"] . "e" .
        "e";
}

$resp .= "ee";

$selfwhere = "torrent = $torrentid AND " . hash_where("peer_id", $peer_id);

if (!isset($self))
{
    $res = mysql_query("SELECT $fields FROM peers WHERE $selfwhere");
    $row = mysql_fetch_assoc($res);
    if ($row)
    {
        $userid = $row["userid"];
       
        $self = $row;
    }
}


//// Up/down stats ////////////////////////////////////////////////////////////

if (!isset($self))
{
    if ($GLOBALS["CLIENT_AUTH"] == CLIENT_AUTH_PASSKEY) {
        $rz = mysql_query("SELECT id, uploaded, downloaded, class, tlimitseeds, tlimitleeches, tlimitall FROM users WHERE passkey=".sqlesc(hex2bin($passkey))." AND enabled = 'yes' ORDER BY last_access DESC LIMIT 1") or err("Tracker error 2");
        if ($MEMBERSONLY && mysql_num_rows($rz) == 0)
            err("Invalid PassKey. Read the FAQ!");
    } else {
        $rz = mysql_query("SELECT id, uploaded, downloaded, class, tlimitseeds, tlimitleeches, tlimitall FROM users WHERE ip=".sqlesc($ip)." AND enabled = 'yes' ORDER BY last_access DESC LIMIT 1") or err("Tracker error 2");
        if ($MEMBERSONLY && mysql_num_rows($rz) == 0)
            err("Unknown IP. Read the FAQ!");
    }
   
    $az = mysql_fetch_assoc($rz);
    $userid = $az["id"];

    // Waiting time check
    $wait = get_wait_time($az["id"], $torrentid, FALSE, $left);
    if (($left > 0 || !$GLOBALS["ONLY_LEECHERS_WAIT"]) && $wait)
        err("Waiting time (still " . ($wait) . "h) - Please read the FAQ!");
   
    // Torrent-limit test
    // $az["tlimitall"] < 0 is unlimited!
    if ($az["tlimitall"] >= 0) {
        $arr = mysql_fetch_assoc(mysql_query("SELECT COUNT(*) AS cnt FROM peers WHERE userid=$userid"));
        $numtorrents = $arr["cnt"];
        $arr = mysql_fetch_assoc(mysql_query("SELECT COUNT(*) AS cnt FROM peers WHERE userid=$userid AND seeder='yes'"));
        $seeds = $arr["cnt"];
        $leeches = $numtorrents - $seeds;
        $limit = get_torrent_limits($az);

        if (   ($limit["total"] > 0)
            &&(($numtorrents >= $limit["total"])
            || ($left == 0 && $seeds >= $limit["seeds"])
            || ($left > 0 && $leeches >= $limit["leeches"])))
                err("Maximum Torrent limit ($limit[seeds] Seeds, $limit[leeches] Leeches, $limit[total] Total)");
       
    }
   
    check_ip_limit();
   
    // Create traffic log entry if not existent
    $res = mysql_query("SELECT * FROM `traffic` WHERE `userid`=$userid AND `torrentid`=$torrentid");
    if (@mysql_num_rows($res) == 0)
        mysql_query("INSERT INTO `traffic` (`userid`,`torrentid`) VALUES ($userid, $torrentid)");
}
else
{
    // We won't check the IP again, since this would disrupt a user's download if he
    // uses another IP to continue browsing on the tracker.
    if ($GLOBALS["CLIENT_AUTH"] == CLIENT_AUTH_PASSKEY) {
        $res = mysql_query("SELECT passkey,id FROM users WHERE id=$userid AND enabled = 'yes'");
        $pkrow = mysql_fetch_assoc($res);
        $passkey = hex2bin($passkey);
        if ($passkey != $pkrow["passkey"])
            err("Invalid PassKey. Read the FAQ!");
           
        check_ip_limit();
    }
   
    $upthis = max(0, $uploaded - $self["uploaded"]);
    // Multiplikatortorrents by Underworld
    $multires = mysql_query("SELECT multi FROM torrents WHERE id =$torrentid ");
    $multiarr = mysql_fetch_assoc($multires);
    if ($multiarr["multi"] > 0)
    {
    $upthis = max(0, $uploaded - $self["uploaded"]);
    $upthis = $upthis * $multiarr["multi"];
    }
    else
    {
    $upthis = max(0, $uploaded - $self["uploaded"]);
    }

    $downthis = max(0, $downloaded - $self["downloaded"]);
    //Eof Multiplikatortorrents
    $downthis = max(0, $downloaded - $self["downloaded"]);

    $arr = mysql_fetch_assoc(mysql_query("SELECT UNIX_TIMESTAMP(last_action) AS lastaction FROM peers WHERE $selfwhere"));
    $interval = time() - $arr["lastaction"];
   
    if ($interval == 0) $interval = 1;

    // If speed is higher than 4 MB/sec, the user is apparently cheating.
    // Frustrate him by adding his desired upload to his download ^^
    if (($upthis / $interval) > $GLOBALS["RATIOFAKER_THRESH"]) {
        // Write mod comment
        write_modcomment($userid, 0, "announce.php: Ratiofaker-Tool verwendet: ".mksize($upthis)." Upload, Fake Rate: ".mksize($upthis / $interval)."/sek");
       
        // Add upload as download and zero out upload.
        $downthis += $upthis;
        $upthis = 0;
    }
// ratiofaker bei multitorrent deaktivieren da es sowieso keinen sinn macht...
if ($multiarr["multi"] == 0)
{
    if (($upthis / $interval) > $GLOBALS["RATIOFAKER_THRESH"]) {
        // Write mod comment
        write_modcomment($userid, 0, "announce.php: Ratiofaker-Tool verwendet: ".mksize($upthis)." Upload, Fake Rate: ".mksize($upthis / $interval)."/sek");

        // Add upload as download and zero out upload.
        $downthis += $upthis;
        $upthis = 0;
    }
}
//Eof ratiofaker
  if ($upthis > 0 || $downthis > 0) {
        // Update traffic for current torrent
        if ($self["seeder"] == "yes")
            mysql_query("UPDATE `traffic` SET `downloaded`=`downloaded`+$downthis, `uploaded`=`uploaded`+$upthis, `uploadtime`=`uploadtime`+$interval WHERE `userid`=$userid AND `torrentid`=$torrentid");
        else
            mysql_query("UPDATE `traffic` SET `downloaded`=`downloaded`+$downthis, `uploaded`=`uploaded`+$upthis, `downloadtime`=`downloadtime`+$interval,`uploadtime`=`uploadtime`+$interval WHERE `userid`=$userid AND `torrentid`=$torrentid");
            mysql_query("UPDATE users SET uploaded = uploaded + $upthis". ($torrent['free']=='no'?", downloaded = downloaded + $downthis ":' '). "WHERE id=$userid") or err("Tracker error 3");
    }
}
// Bad user? If yes, we'll provide him with an invalid peer list :)
$acctdata = mysql_fetch_assoc(mysql_query("SELECT baduser FROM accounts WHERE userid=$userid"));
if ($acctdata["baduser"]==1) {
    $resarr = bdec($resp);
    for ($I=0; $I<count($resarr["value"]["peers"]["value"]); $I++) {
        $tmpip = $resarr["value"]["peers"]["value"][$I]["value"]["ip"]["value"];
        $resarr["value"]["peers"]["value"][$I]["value"]["port"]["value"] += mt_rand(100,250);
       
        $rndnum = mt_rand(1,254);
        $resarr["value"]["peers"]["value"][$I]["value"]["ip"]["value"] =
            preg_replace("/\\.(\\d{1,3})$/", ".$rndnum", $tmpip);
       
    }
    $resp = benc($resarr);
   
    $rndnum = mt_rand(1,254);
    $ip = preg_replace("/\\.(\\d{1,3})$/", ".$rndnum", $ip);
    $port += mt_rand(100,250);
   
}


///////////////////////////////////////////////////////////////////////////////

function portblacklisted($port)
{
    // direct connect
    if ($port >= 411 && $port <= 413) return true;

    // bittorrent
    if ($port >= 6881 && $port <= 6889) return true;

    // kazaa
    if ($port == 1214) return true;

    // gnutella
    if ($port >= 6346 && $port <= 6347) return true;

    // emule
    if ($port == 4662) return true;

    // winmx
    if ($port == 6699) return true;

    return false;
}

$updateset = array();

if ($event == "stopped")
{
    if (isset($self))
    {
        mysql_query("DELETE FROM peers WHERE $selfwhere");
        if (mysql_affected_rows())
        {
            if ($self["seeder"] == "yes")
                $updateset[] = "seeders = seeders - 1";
            else
                $updateset[] = "leechers = leechers - 1";
        }
    }
    mysql_query("INSERT INTO startstoplog (userid,event,`datetime`,torrent,ip,peerid,useragent) VALUES ($userid,'stop',NOW(),$torrentid,".sqlesc($_SERVER["REMOTE_ADDR"]).",".sqlesc($peer_id).",".sqlesc($agent).")");
   
    $announcedelay = @mysql_fetch_assoc(@mysql_query("SELECT * FROM `announcedelay` WHERE `peer_id`=".sqlesc($peer_id)));
    if (is_array($announcedelay)) {
        if ($announcedelay["first"] && $announcedelay["second"] && $announcedelay["quantity"]) {
            $duration1 = $announcedelay["second"]-$announcedelay["first"];
            $duration2 = time() - $announcedelay["second"];
            if ($duration1 < 310 && $duration2 < 10 && $uploaded - $announcedelay["quantity"] == 0) {
                write_modcomment($userid, 0, "announce.php: Evtl. Ratiomaker 0.5+ benutzt: ".mksize($uploaded)." Upload / ".mksize($downloaded)." Download, Fake Rate: ".mksize($uploaded / $duration1)."/sek, Delays: {$duration1}s / {$duration2}s");
            }
        }
    }
   
    $resp = benc_resp(array("failure reason" => array(type => "string", value => "No error - Torrent stopped.")));
}
else
{
    if ($event == "completed") {
        $updateset[] = "times_completed = times_completed + 1";
        mysql_query("INSERT INTO completed (user_id, torrent_id, torrent_name, torrent_category, complete_time) VALUES ($userid, $torrentid, ".sqlesc($torrent["name"]).", ".$torrent["category"].", NOW())");
    }
   
    if (isset($self))
    {
        $announcedelay = @mysql_fetch_assoc(@mysql_query("SELECT * FROM `announcedelay` WHERE `peer_id`=".sqlesc($peer_id)));
        if (is_array($announcedelay)) {
            if ($announcedelay["second"] == 0)
                mysql_query("UPDATE `announcedelay` SET `second`=UNIX_TIMESTAMP(),`quantity`=$uploaded WHERE `peer_id`=".sqlesc($peer_id));
        }
       
        mysql_query("UPDATE peers SET uploaded = $uploaded, downloaded = $downloaded, to_go = $left, last_action = NOW(), seeder = '$seeder'"
            . ($seeder == "yes" && $self["seeder"] != $seeder ? ", finishedat = " . time() : "") . " WHERE $selfwhere");
        if (mysql_affected_rows() && $self["seeder"] != $seeder)
        {
            if ($seeder == "yes")
            {
                $updateset[] = "seeders = seeders + 1";
                $updateset[] = "leechers = leechers - 1";
            }
            else
            {
                $updateset[] = "seeders = seeders - 1";
                $updateset[] = "leechers = leechers + 1";
            }
        }
    }
    else
    {
        if (portblacklisted($origport))
            err("Der TCP-Port $origport is not allowed.");
        else
        {
            $sockres = @fsockopen($origip, $origport, $errno, $errstr, 5);
            if (!$sockres)
                $connectable = "no";
            else
            {
                $connectable = "yes";
                @fclose($sockres);
            }
        }

        $ret = mysql_query("INSERT INTO peers (connectable, torrent, peer_id, ip, port, uploaded, downloaded, to_go, started, last_action, seeder, userid, agent, uploadoffset, downloadoffset) VALUES ('$connectable', $torrentid, " . sqlesc($peer_id) . ", " . sqlesc($ip) . ", $port, $uploaded, $downloaded, $left, NOW(), NOW(), '$seeder', $userid, " . sqlesc($agent) . ", $uploaded, $downloaded)");
        if ($ret)
        {
            if ($seeder == "yes")
                $updateset[] = "seeders = seeders + 1";
            else
                $updateset[] = "leechers = leechers + 1";
        }
        mysql_query("INSERT INTO startstoplog (userid,event,`datetime`,torrent,ip,peerid,useragent) VALUES ($userid,'start',NOW(),$torrentid,".sqlesc($_SERVER["REMOTE_ADDR"]).",".sqlesc($peer_id).",".sqlesc($agent).")");
        mysql_query("INSERT INTO announcedelay (peer_id, first) VALUES (".sqlesc($peer_id).", UNIX_TIMESTAMP())");
        mysql_query("DELETE FROM announcedelay WHERE `first`<UNIX_TIMESTAMP()-900");
    }
}

if ($seeder == "yes")
{
    if ($torrent["banned"] != "yes")
        $updateset[] = "visible = 'yes'";
    $updateset[] = "last_action = NOW()";
}

if (count($updateset))
    mysql_query("UPDATE torrents SET " . join(",", $updateset) . " WHERE id = $torrentid");
benc_resp_raw($resp);
?>


Benc.php
<?

function benc($obj) {
if (!is_array($obj) || !isset($obj["type"]) || !isset($obj["value"]))
return;
$c = $obj["value"];
switch ($obj["type"]) {
case "string":
return benc_str($c);
case "integer":
return benc_int($c);
case "list":
return benc_list($c);
case "dictionary":
return benc_dict($c);
default:
return;
}
}

function benc_str($s) {
return strlen($s) . ":$s";
}

function benc_int($i) {
return "i" . $i . "e";
}

function benc_list($a) {
$s = "l";
foreach ($a as $e) {
$s .= benc($e);
}
$s .= "e";
return $s;
}

function benc_dict($d) {
$s = "d";
$keys = array_keys($d);
sort($keys);
foreach ($keys as $k) {
$v = $d[$k];
$s .= benc_str($k);
$s .= benc($v);
}
$s .= "e";
return $s;
}

function bdec_file($f, $ms) {
$fp = fopen($f, "rb");
if (!$fp)
return;
$e = fread($fp, $ms);
fclose($fp);
return bdec($e);
}

function bdec($s) {
if (preg_match('/^(\d+):/', $s, $m)) {
$l = $m[1];
$pl = strlen($l) + 1;
$v = substr($s, $pl, $l);
$ss = substr($s, 0, $pl + $l);
if (strlen($v) != $l)
return;
return array(type => "string", value => $v, strlen => strlen($ss), string => $ss);
}
if (preg_match('/^i(\d+)e/', $s, $m)) {
$v = $m[1];
$ss = "i" . $v . "e";
if ($v === "-0")
return;
if ($v[0] == "0" && strlen($v) != 1)
return;
return array(type => "integer", value => $v, strlen => strlen($ss), string => $ss);
}
switch ($s[0]) {
case "l":
return bdec_list($s);
case "d":
return bdec_dict($s);
default:
return;
}
}

function bdec_list($s) {
if ($s[0] != "l")
return;
$sl = strlen($s);
$i = 1;
$v = array();
$ss = "l";
for (;;) {
if ($i >= $sl)
return;
if ($s[$i] == "e")
break;
$ret = bdec(substr($s, $i));
if (!isset($ret) || !is_array($ret))
return;
$v[] = $ret;
$i += $ret["strlen"];
$ss .= $ret["string"];
}
$ss .= "e";
return array(type => "list", value => $v, strlen => strlen($ss), string => $ss);
}

function bdec_dict($s) {
if ($s[0] != "d")
return;
$sl = strlen($s);
$i = 1;
$v = array();
$ss = "d";
for (;;) {
if ($i >= $sl)
return;
if ($s[$i] == "e")
break;
$ret = bdec(substr($s, $i));
if (!isset($ret) || !is_array($ret) || $ret["type"] != "string")
return;
$k = $ret["value"];
$i += $ret["strlen"];
$ss .= $ret["string"];
if ($i >= $sl)
return;
$ret = bdec(substr($s, $i));
if (!isset($ret) || !is_array($ret))
return;
$v[$k] = $ret;
$i += $ret["strlen"];
$ss .= $ret["string"];
}
$ss .= "e";
return array(type => "dictionary", value => $v, strlen => strlen($ss), string => $ss);
}

?>



also this is my torrent and peers

CREATE TABLE `peers` (
  `id` int(10) unsigned NOT NULL auto_increment,
  `torrent` int(10) unsigned NOT NULL default '0',
  `peer_id` varchar(20) character set utf8 collate utf8_bin NOT NULL default '',
  `ip` varchar(64) NOT NULL default '',
  `port` smallint(5) unsigned NOT NULL default '0',
  `uploaded` bigint(20) unsigned NOT NULL default '0',
  `downloaded` bigint(20) unsigned NOT NULL default '0',
  `to_go` bigint(20) unsigned NOT NULL default '0',
  `seeder` enum('yes','no') NOT NULL default 'no',
  `started` datetime NOT NULL default '0000-00-00 00:00:00',
  `last_action` datetime NOT NULL default '0000-00-00 00:00:00',
  `connectable` enum('yes','no') NOT NULL default 'yes',
  `userid` int(10) unsigned NOT NULL default '0',
  `agent` varchar(60) NOT NULL default '',
  `finishedat` int(10) unsigned NOT NULL default '0',
  `downloadoffset` bigint(20) unsigned NOT NULL default '0',
  `uploadoffset` bigint(20) unsigned NOT NULL default '0',
  PRIMARY KEY  (`id`),
  UNIQUE KEY `torrent_peer_id` (`torrent`,`peer_id`),
  KEY `torrent` (`torrent`),
  KEY `torrent_seeder` (`torrent`,`seeder`),
  KEY `last_action` (`last_action`),
  KEY `connectable` (`connectable`),
  KEY `userid` (`userid`)
) ENGINE=MyISAM  DEFAULT CHARSET=utf8 AUTO_INCREMENT=100 ;



CREATE TABLE `torrents` (
  `id` int(10) unsigned NOT NULL auto_increment,
  `info_hash` varchar(20) character set utf8 collate utf8_bin NOT NULL default '',
  `name` varchar(255) NOT NULL default '',
  `filename` varchar(255) NOT NULL default '',
  `save_as` varchar(255) NOT NULL default '',
  `search_text` text NOT NULL,
  `descr` text NOT NULL,
  `ori_descr` text NOT NULL,
  `category` int(10) unsigned NOT NULL default '0',
  `size` bigint(20) unsigned NOT NULL default '0',
  `added` datetime NOT NULL default '0000-00-00 00:00:00',
  `type` enum('single','multi') NOT NULL default 'single',
  `numfiles` int(10) unsigned NOT NULL default '0',
  `numpics` int(1) NOT NULL default '0',
  `comments` int(10) unsigned NOT NULL default '0',
  `views` int(10) unsigned NOT NULL default '0',
  `hits` int(10) unsigned NOT NULL default '0',
  `times_completed` int(10) unsigned NOT NULL default '0',
  `leechers` int(10) unsigned NOT NULL default '0',
  `seeders` int(10) unsigned NOT NULL default '0',
  `last_action` datetime NOT NULL default '0000-00-00 00:00:00',
  `visible` enum('yes','no') NOT NULL default 'yes',
  `banned` enum('yes','no') NOT NULL default 'no',
  `activated` enum('yes','no') NOT NULL default 'yes',
  `owner` int(10) unsigned NOT NULL default '0',
  `gu_agent` int(10) unsigned NOT NULL default '0',
  `numratings` int(10) unsigned NOT NULL default '0',
  `ratingsum` int(10) unsigned NOT NULL default '0',
  `nfo` text NOT NULL,
  `team` int(10) NOT NULL default '0',
  `language` enum('na','german','englisch','french','japan','multi') NOT NULL default 'na',
  `free` enum('yes','no') default 'no',
  `vip` enum('yes','no') default 'no',
  `freeuntil` date NOT NULL default '0000-00-00',
  `freetime` enum('yes','no') NOT NULL default 'no',
  `multi` tinyint(2) default '0',
  `allmulti` enum('yes','no') default 'no',
  `nukd` enum('yes','no') default 'no',
  `poster` varchar(155) character set latin1 collate latin1_general_ci NOT NULL default '',
  `scrape_url` varchar(255) NOT NULL default '',
  `reason` varchar(255) NOT NULL default '',
  `skip` enum('yes','no') NOT NULL default 'no',
  `external` enum('yes','no') default 'no',
  `imdb` varchar(10) NOT NULL,
  `last_reseed` datetime NOT NULL default '0000-00-00 00:00:00',
  `sticky` enum('yes','no') NOT NULL default 'no',
  PRIMARY KEY  (`id`),
  UNIQUE KEY `info_hash` (`info_hash`),
  KEY `owner` (`owner`),
  KEY `visible` (`visible`),
  KEY `category_visible` (`category`,`visible`),
  FULLTEXT KEY `ft_search` (`search_text`,`ori_descr`)
) ENGINE=MyISAM  DEFAULT CHARSET=utf8 AUTO_INCREMENT=39 ;


Thanks