Bravo List
Register
Go Back   > Bravo List > Source Code > Archived Trackers > Template Shares > Mods & Themes
Reply
  #1  
Old 4th May 2011, 20:00
smoky28's Avatar
smoky28 smoky28 is offline
Senior Member
 
Join Date: Aug 2010
Hungary
Posts: 82
Smile TSSE 5.6 - Torrent Control Sytem
edited: detalis.php 742 line

Code:
header("Location: http://site name/details.php?id=".$_GET['id']."");
pic upload pic folder browse.php upload ftp root
PHP Code:
CREATE TABLE IF NOT EXISTS `torrents` (
  `
idint(10unsigned NOT NULL AUTO_INCREMENT,
  `
info_hashchar(20NOT NULL DEFAULT '',
  `
namevarchar(255NOT NULL DEFAULT '',
  `
filenamevarchar(255NOT NULL DEFAULT '',
  `
descrtext NOT NULL,
  `
categoryint(10unsigned NOT NULL DEFAULT '0',
  `
sizebigint(20unsigned NOT NULL DEFAULT '0',
  `
addeddatetime NOT NULL DEFAULT '0000-00-00 00:00:00',
  `
numfilesint(10unsigned NOT NULL DEFAULT '0',
  `
commentsint(10unsigned NOT NULL DEFAULT '0',
  `
hitsint(10unsigned NOT NULL DEFAULT '0',
  `
times_completedint(10unsigned NOT NULL DEFAULT '0',
  `
leechersint(10unsigned NOT NULL DEFAULT '0',
  `
seedersint(10unsigned NOT NULL DEFAULT '0',
  `
last_actiondatetime NOT NULL DEFAULT '0000-00-00 00:00:00',
  `
visibleenum('yes','no'NOT NULL DEFAULT 'yes',
  `
bannedenum('yes','no'NOT NULL DEFAULT 'no',
  `
ownerint(10unsigned NOT NULL DEFAULT '0',
  `
freeenum('yes','no') DEFAULT 'no',
  `
anonymousenum('yes','no'NOT NULL DEFAULT 'no',
  `
stickyenum('yes','no'NOT NULL DEFAULT 'no',
  `
offensiveenum('yes','no'NOT NULL DEFAULT 'no',
  `
silverenum('yes','no'NOT NULL DEFAULT 'no',
  `
t_imagevarchar(255NOT NULL DEFAULT '',
  `
t_linktext NOT NULL,
  `
isnukedenum('yes','no'NOT NULL DEFAULT 'no',
  `
WhyNukedvarchar(255NOT NULL DEFAULT 'Bad quality!',
  `
isrequestenum('yes','no'NOT NULL DEFAULT 'no',
  `
ts_externalenum('yes','no'NOT NULL DEFAULT 'no',
  `
ts_external_urlvarchar(128NOT NULL DEFAULT '',
  `
ts_external_lastupdateint(10unsigned NOT NULL DEFAULT '0',
  `
allowcommentsenum('yes','no'NOT NULL DEFAULT 'yes',
  `
doubleuploadenum('yes','no'NOT NULL DEFAULT 'no',
  `
isSceneint(11unsigned NOT NULL DEFAULT '0',
  `
moderatedenum('yes','error','no'NOT NULL DEFAULT 'no',
  `
moderatorvarchar(40CHARACTER SET latin1 COLLATE latin1_general_ci NOT NULL,
  `
errorvarchar(40CHARACTER SET latin1 COLLATE latin1_general_ci NOT NULL,
  `
genrevarchar(40NOT NULL,
  `
Torrent név Engvarchar(80) default NULL,
  
PRIMARY KEY (`id`),
  
KEY `info_hash` (`info_hash`),
  
KEY `category` (`category`),
  
KEY `times_completed` (`times_completed`,`leechers`,`seeders`),
  
KEY `visible` (`visible`,`banned`),
  
KEY `t_image` (`t_image`)
ENGINE=MyISAM  DEFAULT CHARSET=latin1 AUTO_INCREMENT=2856 
Click the image to open in full size.[
Attached Files
File Type: rar ellenörzés.rar (40.7 KB, 406 views)
__________________
Sky-Tech Developer Team Hungary

Reply With Quote
The Following 5 Users Say Thank You to smoky28 For This Useful Post:
Edgein (4th May 2011), lafouine022 (5th May 2011), Marco (22nd April 2013), peiratikos (11th November 2011), szotyi66 (2nd December 2011)
  #2  
Old 4th May 2011, 22:58
lafouine022 lafouine022 is offline
Senior Member
 
Join Date: Feb 2010
P2P
Posts: 120
Thumbs up
PHP Code:
ALTER TABLE `torrentsADD `moderatedenum('yes','error','no'NOT NULL DEFAULT 'no';  
ALTER TABLE `torrentsADD `moderatorvarchar(40CHARACTER SET latin1 COLLATE latin1_general_ci NOT NULL;
ALTER TABLE `torrentsADD `errorvarchar(40CHARACTER SET latin1 COLLATE latin1_general_ci NOT NULL;
ALTER TABLE `torrentsADD `Torrent név Engvarchar(80) default NULL
is good ;)

but good mod

Last edited by lafouine022; 5th May 2011 at 04:13.
Reply With Quote
  #3  
Old 5th May 2011, 19:45
Marco Marco is offline
Senior Member
 
Join Date: Jun 2009
Seychelles
Posts: 327
Default Hello
can you put only the modifications from browse and details ?
i have a modified details.php


köszi
Reply With Quote
  #4  
Old 5th May 2011, 20:08
smoky28's Avatar
smoky28 smoky28 is offline
Senior Member
 
Join Date: Aug 2010
Hungary
Posts: 82
Thumbs up Szivesen
Nincs mit Marco ez a forum ezért jőtt létre

Marco is nothing to this forum is created
__________________
Sky-Tech Developer Team Hungary

Reply With Quote
The Following User Says Thank You to smoky28 For This Useful Post:
Marco (22nd April 2013)
  #5  
Old 6th May 2011, 12:47
Omenke Omenke is offline
Senior Member
 
Join Date: May 2010
Hungary
Posts: 35
Default
Quote:
Originally Posted by smoky28 View Post
Nincs mit Marco ez a forum ezért jőtt létre
Nem csak azt köszönte meg, hanem azt hogy postold a browse és a details php amit be kell szúrni sorokat.

De egyébként én már postoltam egy komplett moderálást ami töviről hegyire le van írva mit hova stb.
Bár ezt nem tudom a tiéd hogy működik, de az enyém olyan, hogy nem tudod addig letölteni a torrentet míg nincs ellenőrizve.

Szia

Not only did they thanked me, but that postold and browse the details of what you must to insert php lines.

But anyway I have a complete postoltam töviről hegyire moderation is what is written to, etc..
Although I do not know that it works on yours, but mine is such that you can not download torrents but until then is not verified.

Hi
Reply With Quote
  #6  
Old 6th May 2011, 17:56
smoky28's Avatar
smoky28 smoky28 is offline
Senior Member
 
Join Date: Aug 2010
Hungary
Posts: 82
Talking
A browse és a detalis php benne van a rar fájlban és semit nem kell modositani rajtuk.

Browse detalis php and is included in the rar file and semi not be modified.
__________________
Sky-Tech Developer Team Hungary

Reply With Quote
  #7  
Old 7th May 2011, 08:05
Omenke Omenke is offline
Senior Member
 
Join Date: May 2010
Hungary
Posts: 35
Default
Quote:
Originally Posted by smoky28 View Post
A browse és a detalis php benne van a rar fájlban és semit nem kell modositani rajtuk.
Az rendben van csak nem biztos hogy az nemi úgy jó is :D

Pld nekem nem lenne jó a te details és bwrosed php d.

Ezért jobb postolni mit hova tegyen.

The fine is just not sure that the sex is so good: D

Eg I would not be good for your details and bwrosed php d.

Therefore it is better to take what postolni.
Reply With Quote
  #8  
Old 7th May 2011, 08:51
Edgein's Avatar
Edgein Edgein is offline
Senior Member
 
Join Date: Sep 2008
Netherlands
Posts: 154
Exclamation english
common people's
this forum is english it's nicer for the other users

grtzz
Reply With Quote
  #9  
Old 7th May 2011, 09:10
smoky28's Avatar
smoky28 smoky28 is offline
Senior Member
 
Join Date: Aug 2010
Hungary
Posts: 82
Smile Update torrent control system
My detalis.php
Edited detalis.php 742 lines And this line should be to rewrite the domain name youheader("Location: http://site name/details.php?id=".$_GET['id']."");
More than the detalis.php you do not need to change anything but since the torrent control in the Hungarian so he does not speak or read the language so it shall be attached to pay.

And so I have total control for all but the torrent has its own anyit torrent could not be verified because we are biased so as to preclude that fill his own even if it has an error in the charger torrents.

PHP Code:
<?php
/*
+--------------------------------------------------------------------------
|   TS Special Edition v.5.7 
|   ========================================
|   by xam
|   (c) 2005 - 2008 Template Shares Services
|   http://templateshares.net
|   ========================================
|   Web: http://templateshares.net
|   Time: April 7, 2009, 2:44 pm
|   Signature Key: TSSE451412009
|   Email: contact@templateshares.net
|   TS SE IS NOT FREE SOFTWARE!
+---------------------------------------------------------------------------
*/
require_once('global.php');
require_once(
INC_PATH.'/commenttable.php');
gzip();
dbconn(true);
loggedinorreturn();
maxsysop();
if (!
defined('NcodeImageResizer'))
{
    
define('NcodeImageResizer'true);
}
define('D_VERSION''3.5.7 by xam');

if(
$usergroups['candownload'] != 'yes')
{
    
$lang->load('browse');
    
print_no_permission(false,true,sprintf($lang->browse['downloaddisabledmsg'], ''));
}

$id = isset($_GET['id']) ? intval($_GET['id']) : (isset($_POST['id']) ? intval($_POST['id']) : '');
$is_mod is_mod($usergroups);

if (!
is_valid_id($id))
{
    
print_no_permission(true);
}

$tab 'details';
if (isset(
$_GET['tab']) AND $_GET['tab'] != '')
{
    
$tab htmlspecialchars_uni($_GET['tab']);
}
$lang->load('details');
$query sql_query('SELECT t.name, t.allowcomments, t.banned, t.descr, t.category, t.size, t.numfiles, t.anonymous, t.added, t.comments, t.hits, t.times_completed, t.leechers, t.seeders, t.owner, t.free, t.sticky, t.offensive, t.silver, t.t_image, t.t_link, t.isnuked, t.WhyNuked, t.isrequest, t.ts_external, t.doubleupload, t.isScene, t.moderated, t.moderator, t.error, n.nfo, c.name as categoryname, c.vip, c.pid, c.type, c.id as categoryid, d.video_info, d.audio_info, u.username, u.donor, u.warned, u.leechwarn, g.namestyle FROM torrents t LEFT JOIN ts_nfo n ON (t.id=n.id) LEFT JOIN categories c ON (t.category=c.id) LEFT JOIN ts_torrents_details d ON (t.id=d.tid) LEFT JOIN users u ON (t.owner=u.id) LEFT JOIN usergroups g ON (u.usergroup=g.gid) WHERE t.id = '.sqlesc($id)) or sqlerr(__FILE__,__LINE__);
if (
mysql_num_rows($query) == OR !$query OR !($torrent mysql_fetch_assoc($query)))
{
    
stderr($lang->global['error'], $lang->global['notorrentid']);
}
elseif (
$usergroups['canviewviptorrents'] != 'yes' && $torrent['vip'] == 'yes')
    
stderr($lang->global['error'], $lang->global['viptorrent'], false);
elseif (
$torrent['banned'] == 'yes' && !$is_mod)
    
stderr($lang->global['error'], $lang->global['torrentbanned']);
    
//XXX Torrents Confirm Dialog by Danix
elseif ($torrent["category"] == "??" OR $torrent['category'] == "??" OR $torrent['category'] == "??")  
{
    
$alert = ('
                <script type="text/javascript">
                    //<![CDATA[
                    var alert = confirm("'
.$lang->global['xxxtorrent'].'")
                    if (alert)
                    {
                        alert("'
.$lang->global['xxxtorrent'].'")
                    }
                    else
                    {
                        window.location = "'
.$BASEURL.'/";
                    }
                    //]]>
                </script>'
);
    echo 
$alert;
}         
             
/*
+--------------------------------------------------------------------------
|    auto free
+---------------------------------------------------------------------------
*/
 
$q mysql_query("SELECT size FROM torrents WHERE id = $id");
    if (
mysql_num_rows($q) > 0)
    {
        
$rf mysql_fetch_array($q);
        
        if (
$rf["size"] >= 4831838208)     /* remplace for auto freeleech 4831838208 octet= 4.5 GB for me. use staff tool calculette ;)*/
        
{
            
mysql_query("UPDATE torrents SET free = 'yes' WHERE id = $id");
        }else{
        if (
$rf["size"] >= 2684354560)   /* remplace for auto silver 15032385536 octet= 2.5 GB for me. use staff tool calculette ;)*/
           
mysql_query("UPDATE torrents SET silver = 'yes' WHERE id = $id");
        }
    }  


$lang->load('upload');
$lang->load('quick_editor');
require_once(
INC_PATH.'/class_tsquickbbcodeeditor.php');
$QuickEditor = new TSQuickBBCodeEditor();
$QuickEditor->ImagePath $BASEURL.'/'.$pic_base_url;
$QuickEditor->SmiliePath $BASEURL.'/'.$pic_base_url.'smilies/';

include(
INC_PATH.'/functions_quick_editor.php');
define('TOTAL_FILES'$torrent['numfiles']);
include(
INC_PATH.'/functions_filelist.php');
require_once(
INC_PATH.'/functions_mkprettytime.php');

if (
$torrent['type'] == 's')
{
    require(
TSDIR.'/'.$cache.'/categories.php');
    foreach (
$_categoriesC as $catarray)
    {
        if (
$catarray['id'] == $torrent['pid'])
        {
            
$parentcategory $catarray['name'];
            
$parentcatid $catarray['id'];
            break;
        }
    }    
    if (
$parentcategory && $parentcatid)
    {
        
$seolink ts_seo($parentcatid,$parentcategory,'c');
        
$seolink2 ts_seo($torrent['categoryid'],$torrent['categoryname'],'c');
        
$torrent["categoryname"] = '<a href="'.$seolink.'" target="_self" alt="'.$parentcategory.'" title="'.$parentcategory.'" />'.$parentcategory.'</a> / <a href="'.$seolink2.'" target="_self" alt="'.$torrent['categoryname'].'" title="'.$torrent['categoryname'].'" />'.$torrent['categoryname'].'</a>';
    }
}
else
{
    
$seolink2 ts_seo($torrent['categoryid'],$torrent['categoryname'],'c');
    
$torrent["categoryname"] = '<a href="'.$seolink2.'" target="_self" alt="'.$torrent['categoryname'].'" title="'.$torrent['categoryname'].'" />'.$torrent['categoryname'].'</a>';
}

$isfree = ($torrent['free'] == 'yes' '<img src="'.$BASEURL.'/'.$pic_base_url.'freedownload.gif" class="inlineimg" />' '');
$issilver = ($torrent['silver'] == 'yes' '<img src="'.$BASEURL.'/'.$pic_base_url.'silverdownload.gif" class="inlineimg" />' '');
$isdoubleupload = ($torrent['doubleupload'] == 'yes' '<img src="'.$BASEURL.'/'.$pic_base_url.'x2.gif" class="inlineimg" />' '');

stdhead(sprintf($lang->details['detailsfor'], $torrent['name']), true'supernote','INDETAILS');

$gigs $CURUSER['downloaded'] / (1024*1024*1024);
$ratio = ($CURUSER['downloaded'] > $CURUSER['uploaded'] / $CURUSER['downloaded'] : 0);
$percentage $ratio 100;
if (
$gigs $hitrun_gig AND $ratio <= $hitrun_ratio AND $torrent['owner'] != $CURUSER['id'] AND !$is_mod AND $CURUSER['downloaded'] <> 0)
{
    
$warning_message show_notice(sprintf($lang->details['hitrunwarning'], number_format($ratio2), number_format($percentage3), $hitrun_ratio), true);
}
elseif (
$ratio <= ($hitrun_ratio 0.2) AND $torrent['owner'] != $CURUSER['id'] AND !$is_mod AND $CURUSER['downloaded'] <> 0)
{
    
$warning_message show_notice(sprintf($lang->details['hitrunwarning2'], number_format($ratio2), mksize($percentage), $hitrun_ratio$id), true);
}

if (isset(
$warning_message))
{
    echo 
$warning_message;
}

$sratio $torrent['leechers'] > $torrent['seeders'] / $torrent['leechers'] : 1;
$lratio $torrent['seeders'] > $torrent['leechers'] / $torrent['seeders'] : 1;
$video_info = @explode('~'$torrent['video_info']);
$audio_info = @explode('~'$torrent['audio_info']);

if (
$usergroups['canreport'] == 'yes')
{
    
$lang->load('report');
    
$head $lang->report['report'].' TORRENT';
    
$report '
    '
.($useajax == 'yes' '<script type="text/javascript" src="./scripts/quick_report.js"></script>
    <div id="QuickReportDone" name="QuickReportDone" style="display: none;">'
.$lang->report['done'].'</div>' '').'
    <div id="ShowQuickReport" name="ShowQuickReport" style="display: inline;">
        <form method="post" action="report.php" name="quickreport" id="quickreport">
        <input type="hidden" name="action" value="reporttorrent">
        <input type="hidden" name="do" value="save">
        <input type="hidden" name="siv" value="false">
        <input type="hidden" name="returnto" value="details.php?id='
.$id.'&tab=report&reported=true">
        <input type="hidden" name="reportid" value="'
.$id.'">
        <table border="0" width="100%" cellspacing="0" cellpadding="5">
            <tr>
                <td class="rowhead">'
.$lang->report['reporttype'].'</td>
                <td>'
.$head.'</td>
            </tr>
            <tr>
                <td class="rowhead">'
.$lang->report['reportid'].'</td>
                <td>'
.$id.'</td>
            </tr>
            <tr>
                <td class="rowhead">'
.$lang->report['reason'].'</td>
                <td><textarea name="reason" id="reason" rows="6" cols="90"></textarea><br />                
                '
.($useajax == 'yes' '<input type="button" class="button" value="'.$lang->global['buttonreport'].'" name="quickreportbutton" id="quickreportbutton" onclick="javascript:TSajaxquickreport(\''.$id.'\');" />' '<input type="submit" name="submit" value="'.$lang->global['buttonreport'].'" class="button" />').' <img src="'.$BASEURL.'/'.$pic_base_url.'ajax-loader.gif" class="inlineimg" border="0" alt="" title="" id="report-loading-layer" style="display:none;" /></td>
            </tr>            
        </table>
        </form>
    </div>'
;
}
else
{
    
$report $lang->global['nopermission'];
}
$showcommenttable '';
$count TSRowCount('id''comments''torrent='.$id);
if (!
$count)
{
    
$showcommenttable .= '        
    <table class="none" border="0" cellspacing="0" cellpadding="5" width="100%">
        <tr>
            <td>
                <div style="display: block;" id="ajax_comment_preview">'
.$lang->details['nocommentsyet'].'</div>    
                <div style="display: block;" id="ajax_comment_preview2"></div>
            </td>
        </tr>
    </table>
    '
;
}
else
{        
    list(
$pagertop$pagerbottom$limit) = pager($ts_perpage$count$_SERVER['SCRIPT_NAME'].'?id='.$id.'&tab=comments&', array('lastpagedefault' => '1'), false);
    
$subres sql_query("SELECT c.id, c.torrent as torrentid, c.text, c.user, c.added, c.editedby, c.editedat, c.modnotice, c.modeditid, c.modeditusername, c.modedittime, c.totalvotes, uu.username as editedbyuname, gg.namestyle as editbynamestyle, u.added as registered, u.enabled, u.warned, u.leechwarn, u.username, u.title, u.usergroup, u.last_access, u.options, u.donor, u.uploaded, u.downloaded, u.avatar as useravatar, u.signature, g.title as grouptitle, g.namestyle FROM comments c LEFT JOIN users uu ON (c.editedby=uu.id) LEFT JOIN usergroups gg ON (uu.usergroup=gg.gid) LEFT JOIN users u ON (c.user=u.id) LEFT JOIN usergroups g ON (u.usergroup=g.gid) WHERE c.torrent = ".sqlesc($id)." ORDER BY c.id $limit") or sqlerr(__FILE____LINE__);

    
$allrows = array();
    while (
$subrow mysql_fetch_assoc($subres))
    {
        
$allrows[] = $subrow;        
    }    
    
$showcommenttable .= $pagertop.commenttable($allrows,'','',false,true,true).$pagerbottom;
}

$rowspan 9;
$reseed '';
if (
$torrent['seeders'] == && $torrent['ts_external'] == 'no')
{
    
$reseed '
    <tr>
        <td style="padding-left: 5px;" class="subheader" valign="top" width="147">'
.$lang->details['askreseed'].'</td>
        <td valign="top" style="padding-left: 5px;">'
.sprintf($lang->details['askreseed2'], $id).'</td>
    </tr>'
;
    
$rowspan++;
}

if (
$torrent['isScene'] > 0)
{
    
$rowspan++;
    
$isScene '
    <tr>
        <td style="padding-left: 5px;" class="subheader" valign="top" width="147">'
.$lang->upload['scene'].'</td>
        <td valign="top" style="padding-left: 5px;">'
.$lang->global['greenyes'].'</td>
    </tr>
    '
;
    
$rowspan++;
    
$isScene .= '
    <tr>
        <td style="padding-left: 5px;" class="subheader" valign="top" width="147">'
.$lang->details['scene3'].'</td>
        <td valign="top" style="padding-left: 5px;">'
.mkprettytime($torrent['isScene']).'</td>
    </tr>
    '
;
}

if (isset(
$_GET['cerror']))
{
    switch (
$_GET['cerror'])
    {
        case 
1:
            
$cerror $lang->global['notorrentid'];
        break;                
        case 
2:
            
$cerror $lang->global['dontleavefieldsblank'];
        break;
        case 
3:
            
$cerror sprintf($lang->global['flooderror'], $usergroups['floodlimit'], $lang->comment['floodcomment'], "-");
        break;
        default:
            
$cerror $lang->global['error'];
        break;
    }
}

if (
$usergroups['canpeers'] != 'yes' OR $torrent['ts_external'] == 'yes')
{
    
$peerstable sprintf($lang->details['peers3'], ts_nf($torrent['seeders']), ts_nf($torrent['leechers']), (ts_nf($torrent['seeders'] + $torrent['leechers']))).($torrent['seeders'] == && $torrent['ts_external'] == 'no' '<br />'.sprintf($lang->details['askreseed2'],$id) : '');
}
else
{
    function 
getagent($httpagent=''$peer_id="")
    {
        global 
$lang;
        return (
$httpagent $httpagent : ($peer_id $peer_id $lang->global['unknown']));
    }

    function 
dltable($name$arr$torrent)
    {
        global 
$CURUSER,$pic_base_url$lang,$usergroups,$is_mod$BASEURL;
        
$totalcount count($arr);
        
$p '<b>'.$totalcount.' '.$name.'</b>';
        if (!
count($totalcount))
            return 
$p;
        
$s '<table width="100%" border="0" cellspacing="0" cellpadding="3">
                    <tr>
                        <td colspan="11" class="thead">'
.$p.'</td>
                    </tr>
                    <tr>
                        <td class="subheader">'
.$lang->details['userip'].'</td>
                        <td class="subheader" align="center">'
.$lang->details['conn'].'</td>
                        <td class="subheader" align="center">'
.$lang->details['up'].'</td>
                        <td class="subheader" align="center">'
.$lang->details['urate'].'</td>
                        <td class="subheader" align="center">'
.$lang->details['down'].'</td>
                        <td class="subheader" align="center">'
.$lang->details['drate'].'</td>
                        <td class="subheader" align="center">'
.$lang->details['ratio'].'</td>
                        <td class="subheader" align="center">'
.$lang->details['done'].'</td>
                        <td class="subheader" align="center">'
.$lang->details['since'].'</td>
                        <td class="subheader" align="center">'
.$lang->details['idle'].'</td>
                        <td class="subheader" align="center">'
.$lang->details['client'].'</td>
                </tr>'
;
        
$now TIMENOW;
        include_once(
INC_PATH.'/functions_ratio.php');
        foreach (
$arr as $e)
        {
            
            if ((
preg_match('#I3#is'$e['options']) OR preg_match('#I4#is'$e['options'])) AND !$is_mod AND $CURUSER['id'] != $e['id'])
            {
                
$s .= '
                <tr>
                    <td align="center">'
.$lang->global['anonymous'].'</td>
                    '
.str_repeat('<td align="center">---</td>'10).'
                </tr>'
;
                continue;
            }

            if (isset(
$num))
            {
                ++
$num;
            }
            else
            {
                
$num 1;
            }

            
$dnsstuff "<br /><a href=\"http://dnsstuff.com/tools/whois.ch?ip=".htmlspecialchars_uni($e["ip"])."\" target=_blank><font class=\"small\" color=\"brown\"><b>".htmlspecialchars_uni($e["ip"])."</b></font></a>:<u><font class=\"small\" color=\"red\"><b>"$e['port'] . "</b></font></u></td>\n";
            
$pregreplace "<br /><font class=\"small\" color=\"brown\"><b>".preg_replace('/\.\d+\.\d+$/'"***"htmlspecialchars_uni($e["ip"])) . "</b></font></a>:<u><font class=\"small\" color=\"red\"><b>". (int)$e['port'] . "</b></font></u></td>\n";
            
$highlight $CURUSER["id"] == $e["id"] ? " bgcolor=#BBAF9B" "";
            
$s .= "<tr$highlight>\n";
            if (!empty(
$e["username"]))
            {

                if (
$is_mod || $torrent['anonymous'] != 'yes' || $e['id'] != $torrent['owner'])
                {
                    
$s .= "<td style=\"space: nowrap; text-align: center;\"><a href=\"".ts_seo($e['userid'], $e['username'])."\"><b>".get_user_color($e["username"],$e["namestyle"])."</b></a>" . ($e["donor"] == "yes" "<img src=".$pic_base_url."star.gif title='".$lang->global['imgdonated']."'>" "") . ($e["enabled"] == "no" "<img src=".$pic_base_url."disabled.gif title=\"".$lang->global['imgdisabled']."\" style='margin-left: 2px'>" : ($e["warned"] == "yes" "<a href=\"rules.php#warning\" class=\"altlink\"><img src=\"".$pic_base_url."warned.gif\" title=\"".$lang->global['imgwarned']."\" border=\"0\"></a>" ""));
                    
$s .= ($is_mod $dnsstuff $pregreplace);
                }
                else
                    
$s .= "<td>".$lang->global['anonymous']."</a></td>\n";
            }
            else
                
$s .= "<td>".$lang->global['unknown']."</td>\n";
            
            
$secs max(1, ($now $e["st"]) - ($now $e["la"]));
            
$s .= "<td align=\"center\">" . ($e['connectable'] == "yes" "<font color=green>".$lang->details['yes']."</font>" "<font color=red>".$lang->details['no']."</font>") . "</td>\n";
            
$s .= "<td align=\"right\">" mksize($e["uploaded"]) . "</td>\n";
            
$s .= "<td align=\"right\"><span style=\"space: nowrap;\">" mksize(($e["uploaded"] - $e["uploadoffset"]) / $secs) . "/s</span></td>\n";
            
$s .= "<td align=\"right\">" mksize($e["downloaded"]) . "</td>\n";
            if (
$e["seeder"] == "no")
                
$s .= "<td align=\"right\"><span style=\"space: nowrap;\">" mksize(($e["downloaded"] - $e["downloadoffset"]) / $secs) . "/s</span></td>\n";
            else
                
$s .= "<td align=\"right\"><span style=\"space: nowrap;\">" mksize(($e["downloaded"] - $e["downloadoffset"]) / max(1$e["finishedat"] - $e['st'])) .    "/s</span></td>\n";
            if (
$e["downloaded"])
            {
              
$ratio floor(($e["uploaded"] / $e["downloaded"]) * 1000) / 1000;
                
$s .= "<td align=\"right\"><font color=" get_ratio_color($ratio) . ">" number_format($ratio2) . "</font></td>\n";
            }
               else
              if (
$e["uploaded"])
                
$s .= "<td align=\"right\">".$lang->details['inf']."</td>\n";
              else
                
$s .= "<td align=right>---</td>\n";
            
$s .= "<td align=\"right\">" sprintf("%.2f%%"100 * (- ($e["to_go"] / $torrent["size"]))) . "</td>\n";
            
$s .= "<td align=\"right\">" mkprettytime($now $e["st"]) . "</td>\n";
            
$s .= "<td align=\"right\">" mkprettytime($now $e["la"]) . "</td>\n";
            
$s .= "<td align=\"left\">" htmlspecialchars_uni(getagent($e["agent"], $e["peer_id"])) . "</td>\n";
            
$s .= "</tr>\n";
        }
        
$s .= "</table>\n";
        return 
$s;
    }
    
$downloaders = array();
    
$seeders = array();
    
$subres sql_query("SELECT p.seeder, p.finishedat, p.downloadoffset, p.uploadoffset, p.ip, p.port, p.uploaded, p.downloaded, p.to_go, UNIX_TIMESTAMP(p.started) AS st, p.connectable, p.agent, p.peer_id, UNIX_TIMESTAMP(p.last_action) AS la, p.userid,  u.id, u.enabled, u.username, u.options, u.warned, u.donor, g.namestyle FROM peers p LEFT JOIN users u ON (p.userid=u.id) LEFT JOIN usergroups g ON (u.usergroup=g.gid) WHERE p.torrent = ".sqlesc($id)) or sqlerr(__FILE__,__LINE__);
    while (
$subrow mysql_fetch_array($subres))
    {
        if (
$subrow["seeder"] == "yes")
            
$seeders[] = $subrow;
        else
            
$downloaders[] = $subrow;
    }

    function 
leech_sort($a,$b)
    {
        if ( isset( 
$_GET["usort"] ) ) return seed_sort($a,$b);                
        
$x $a["to_go"];
        
$y $b["to_go"];
        if (
$x == $y)
            return 
0;
        if (
$x $y)
            return -
1;
        return 
1;
    }
    function 
seed_sort($a,$b)
    {
        
$x $a["uploaded"];
        
$y $b["uploaded"];
        if (
$x == $y)
            return 
0;
        if (
$x $y)
            return 
1;
        return -
1;
    }

    
usort($seeders"seed_sort");
    
usort($downloaders"leech_sort");
    
    
$peerstable dltable($lang->details['seeders2'], $seeders$torrent);
    
$peerstable .= '<br />'.dltable($lang->details['leechers2'], $downloaders$torrent);
}

$QuickEditor->FormName='comment';
$QuickEditor->TextAreaName='message';
$showcommenttable .= '    
<br />
<!-- start: BBcode Styles -->
'
.$QuickEditor->GenerateCSS().'
'
.$QuickEditor->GenerateJavascript().'
<!-- start: BBcode Styles -->
'
.(!empty($cerror) ? '<div class="error">'.$cerror.'</div>' '').'
'
.($useajax == 'yes' '<script type="text/javascript" src="'.$BASEURL.'/scripts/quick_comment.js"></script>' '').'
<script type="text/javascript" src="'
.$BASEURL.'/scripts/quick_preview.js"></script>
<form name="comment" id="comment" method="post" action="comment.php?action=add&tid='
.$id.'">
<input type="hidden" name="ctype" value="quickcomment">
<input type="hidden" name="page" value="'
.intval(isset($_GET['page']) ? $_GET['page'] : 0).'">
    <table width="100%" border="0" cellspacing="0" cellpadding="5">
        <tr>
            <td class="thead">'
.ts_collapse('quickcomment').'<a name="startquickcomment">'.$lang->details['quickcomment'].'</a></td>
        </tr>
        '
.ts_collapse('quickcomment'2).'
        <tr>
            <td>
                '
.$QuickEditor->GenerateBBCode().'
            </td>
        </tr>
        <tr>
            <td align="center"><textarea name="message" style="width:850px;height:120px;" id="message"></textarea></td>    
        </tr>            
        <tr>
            <td align="center">
            '
.($useajax == 'yes' '<img src="'.$BASEURL.'/'.$pic_base_url.'ajax-loader.gif" class="inlineimg" border="0" alt="" title="" id="loading-layer" style="display:none;" /> <input type="button" class="button" value="'.$lang->global['buttonsubmit'].'" name="quickcomment" id="quickcomment" onclick="javascript:TSajaxquickcomment(\''.$id.'\');" />' '<input type="submit" name="submit" value="'.$lang->global['buttonsubmit'].'" class="button" />').'
            <input type="button" class="button" name="button" value="'
.$lang->global['buttonpreview'].'" onclick="javascript:TSajaxquickpreview();" /> <input type="button" value="'.$lang->global['advancedbutton'].'" class="button" onclick="jumpto(\''.$BASEURL.'/comment.php?action=add&tid='.$id.'\')" />
            </td>
        </tr>
    </table>
</form>'
;

if (
$usergroups['canbookmark'] == 'yes')
{
    
$onclick1 $onclick2 '';
    if (
$useajax == 'yes')
    {
        
$onclick1 ' onclick="TSajaxquickbookmark('.$id.',\'add\'); return false;"';
        
$onclick2 ' onclick="TSajaxquickbookmark('.$id.',\'delete\'); return false;"';
    }
    
$bookmark '
    '
.($useajax == 'yes' '
    <script type="text/javascript" src="./scripts/quick_bookmark.js"></script>' 
'').'
    <p>
    <span id="bookmark-loading-layer" style="display:none; float: left;"><img src="'
.$BASEURL.'/'.$pic_base_url.'ajax-loader.gif" border="0" alt="" title="" class="inlineimg"></span>
    <span id="bookmark-done-layer" style="display:none; float: left;"><img src="'
.$BASEURL.'/'.$pic_base_url.'input_true.gif" border="0" alt="" title="" class="inlineimg"></span>
    <a href="'
.$BASEURL.'/bookmarks.php?action=add&torrentid='.$id.'"'.$onclick1.'>'.$lang->details['bookmark'].'</a> - <a href="'.$BASEURL.'/bookmarks.php?action=delete&torrentid='.$id.'"'.$onclick2.'>'.$lang->details['removebookmark'].'</a>
    </p>'
;
}
else
{
    
$bookmark $lang->global['nopermission'];
}

if(
$torrent['anonymous'] == 'yes' AND $torrent['owner'] != $CURUSER['id'] AND !$is_mod
{
        
$username $lang->global['anonymous'];
}
else
{
    
$username '<a href="'.ts_seo($torrent['owner'], $torrent['username']).'">'.get_user_color($torrent['username'], $torrent['namestyle']).'</a>'.($torrent['donor'] == 'yes' ' <img src="'.$BASEURL.'/'.$pic_base_url.'star.gif" alt="'.$lang->global['imgdonated'].'" title="'.$lang->global['imgdonated'].'">' '').($torrent['warned'] == 'yes' || $torrent['leechwarn'] == 'yes' '<img src="'.$BASEURL.'/'.$pic_base_url.'warned.gif" alt="'.$lang->global['imgwarned'].'" title="'.$lang->global['imgwarned'].'">' '');
}

if (
$ratingsystem == 'yes' AND $usergroups['canrate'] == 'yes')
{
    require(
'ratings/includes/rating_functions.php');
    
$rating show_rating($id$CURUSER['id']);
}

if (
$thankssystem == 'yes')
{
    
$AllThanks '
    <script type="text/javascript" src="'
.$BASEURL.'/scripts/quick_thanks.js?v='.O_SCRIPT_VERSION.'"></script>
    <img src="'
.$BASEURL.'/'.$pic_base_url.'ajax-loader.gif" class="inlineimg" border="0" alt="" title="" id="thanks-loading-layer" style="display:none; float: left;" />    
    '
;
    
$IsThanked=false;
    
$ThanksArray=array();
    
$Tquery sql_query('SELECT t.uid, u.username, g.namestyle FROM ts_thanks t LEFT JOIN users u ON (u.id=t.uid) LEFT JOIN usergroups g ON (u.usergroup=g.gid) WHERE t.tid = \''.$id.'\' ORDER BY u.username');
    if (
mysql_num_rows($Tquery) > 0)
    {    
        while(
$thanks=mysql_fetch_assoc($Tquery))
        {
            if (
$thanks['uid'] == $CURUSER['id'])
            {
                
$IsThanked=true;
            }
            
$ThanksArray[] = '<a href="'.ts_seo($thanks['uid'], $thanks['username']).'">'.get_user_color($thanks['username'], $thanks['namestyle']).'</a>';
        }
    }
    
    
$TButton '';
    if (!
$IsThanked AND $torrent['owner'] != $CURUSER['id'])
    {
        
$TButton '<div id="thanks_button"><input type="button" value="'.$lang->global['buttonthanks'].'" onclick="javascript:TSajaxquickthanks('.$id.');" /></div>';
    }
    elseif (
$IsThanked)
    {
        
$TButton '<div id="thanks_button"><input type="button" value="'.$lang->global['buttonthanks2'].'" onclick="javascript:TSajaxquickthanks('.$id.', true);" /></div>';
    }
    
    if (
count($ThanksArray) == 0)
    {
        
$AllThanks $AllThanks.$TButton.'<div id="torrent_thanks" name="torrent_thanks"><b><i>'.$lang->details['nothanksyet'].'</i></b></div>';
    }
    else
    {
        
$AllThanks $AllThanks.$TButton.'<div id="torrent_thanks" name="torrent_thanks">'.implode(', '$ThanksArray).'</div>';
    }
}
////////////// torrent similair /////////////////////
        
$searchname substr($torrent['name'], 08);
        
$query1 str_replace(" ",".",sqlesc("%".$searchname."%"));
        
$query2 str_replace("."," ",sqlesc("%".$searchname."%"));
           
$r mysql_query("SELECT id, name, size, added, seeders, leechers, category FROM torrents WHERE name LIKE {$query1} AND seeders > '0' AND id <> '$id' OR name LIKE {$query2} AND seeders > '0' AND id <> '$id' ORDER BY seeders DESC LIMIT 10") or sqlerr();
            if (
mysql_num_rows($r) > 0)
   {
   
$torrents "\n" .
   
"<td class=subheader align=center>".$lang->details['type']."</td><td class=subheader>".$lang->details['Nom']."</td><td class=subheader align=center>".$lang->details['size']."</td><td class=subheader align=center>".$lang->details['added']."</td><td class=subheader align=center>Seeders</td><td class=subheader align=center>Leechers</td>\n";
   while (
$a mysql_fetch_assoc($r))
   {
   
$r2 mysql_query("SELECT name, image FROM categories WHERE id=$a[category]") or sqlerr(__FILE____LINE__);
    
$a2 mysql_fetch_assoc($r2);
    
$cat "<img src=\"/pic/$a2[image]\" alt=\"$a2[name]\">";

   
$name $a["name"];
   
$torrents .= "<tr><td width=10% align=center><img src=\"/pic/categories/" .$a2["image"]. "\"></td><td class=hoptobutton><a href=details.php?id=" $a["id"] . "&hit=1><b>" htmlspecialchars($name) . "</b></a></td><td class=hoptobutton style='padding: 1px' align=center>"mksize($a[size]) ."</td><td class=hoptobutton style='padding: 1px' align=center>$a[added]</td><td class=hoptobutton style='padding: 1px' align=center>$a[seeders]</td><td class=hoptobutton style='padding: 1px' align=center>$a[leechers]</td></tr>\n";
   }
   
$torrents .= "</table>";
   
$similair1 =("<table width=100% class=main border=1 cellspacing=0 cellpadding=5><td class=thead>".$lang->details['similaire']."</td></table><table width=100% class=main border=1 cellspacing=0 cellpadding=5><tr align=left>$torrents</tr>\n");
   
   }
////////////// Torrent similair /////////////////////  
$ShowTLINK '';
if (!empty(
$torrent['t_link']))
{
    require_once(
INC_PATH.'/functions_imdb_rating.php');
    if (
$IMDBRating TSSEGetIMDBRatingImage($torrent['t_link']))
    {        
        
$torrent['t_link'] = str_replace('<b>User Rating:</b>''<b>Arány:</b> '.$IMDBRating['image'], $torrent['t_link']);
    }
    else
    {
        
$torrent['t_link'] = format_urls(str_replace('"''&quot;'$torrent['t_link']), '_blank');
    }
    
$ShowTLINK '
    <table width="100%" border="0" cellpadding="5" cellspacing="0">
        <tr>
            <td class="thead">
                '
.($is_mod '
                <span style="float: right;"><div id="imdbupdatebutton" name="imdbupdatebutton"><a href="#" onclick="TS_IMDB(\''
.$id.'\'); return false;"><b><u><i>'.$lang->global['refresh'].'</i></u></b></a></div></span>' '').$lang->details['t_link'].'
            </td>
        </tr>
        <tr>
            <td>
                <div id="imdbdetails" name="imdbdetails">'
.$torrent['t_link'].'</div>
            </td>
        </tr>
    </table>
    <br />'
;
}

if (
$is_mod and $torrent['owner'] != $CURUSER['id']){
$ellenorzes '
    <td style="padding-left: 5px;" class="subheader" valign="top" width="147">Moderálás</td>
        <td style="padding-left: 5px;" valign="top" width="430"><form action="'
.$PHP_SELF.'" method="post">
    <input name="mod" type="radio" value="yes">Helyes
    <input name="mod" type="radio" value="error">Helytelen
    <b>Hibák felsorolása:</b><input name="error" type="text">
    <input type="submit" value="OK">
    </form>
    </td>
    </tr>'
;
}

if (
$torrent['moderated'] == 'yes'){
$allapot '
  <tr>
    <td style="padding-left: 5px;" class="subheader" valign="top" width="147">Állapot</td>
        <td style="padding-left: 5px;" valign="top" width="430">
    <font color="green"><b>Kőszőnjűk a feltőltést</b></font> A torrentet ellenőrizte: <font color="darkred"><b>'
.$torrent['moderator'].'</b></font>!
    </td>
    </tr>'
;
}
if (
$torrent['moderated'] == 'error'){
$allapot '
  <tr>
    <td style="padding-left: 5px;" class="subheader" valign="top" width="147">Állapot</td>
        <td style="padding-left: 5px;" valign="top" width="430">
    <font color="red"><b>Helytelen feltöltés!</b></font> A következőket pótold: <font color="darkred"><b>'
.$torrent['error'].'!</b></font> Ellenőrizte: <font color="darkred"><b>'.$torrent['moderator'].'</b></font>!
    </td>
    </tr>'
;
}

if (
$torrent['moderated'] == 'no'){
$allapot '
  <tr>
    <td style="padding-left: 5px;" class="subheader" valign="top" width="147">Állapot</td>
        <td style="padding-left: 5px;" valign="top" width="430">
    <font color="red">Még nincs moderálva ez a torrent!</font>
    </td>
    </tr>'
;
}

if (
$torrent['moderated'] == 'yes' or $torrent['owner'] == $CURUSER['id']){
$letoltes '
    <tr>
    <td style="padding-left: 5px;" class="subheader" valign="top" width="147">'
.$lang->details['download'].'</td>
    <td style="padding-left: 5px;" valign="top" width="430"><a href="'
.ts_seo($id,$torrent['name'],'d').'" alt="'.$lang->details['dlltorrent'].'" title="'.$lang->details['dlltorrent'].'"><img src="../pic/letoltes.png"></a></td>
  </tr>'
;
}
else{
$letoltes '
    <tr>
    <td style="padding-left: 5px;" class="subheader" valign="top" width="147">'
.$lang->details['download'].'</td>
    <td style="padding-left: 5px;" valign="top" width="430">*** Még nincs moderálva a torrent ***</td>
  </tr>'
;
}



$details '
<table cellspacing="0" border="0" cellpadding="4" width="100%">
    <tr>
        <td colspan="3" class="thead">'
.$isfree.$issilver.$isdoubleupload.' '.htmlspecialchars_uni($torrent['name']).'</td>
    </tr>
    <tr>
        <td rowspan="'
.$rowspan.'" align="center" valign="top" width="175">'.($torrent['t_image'] != '' '<a href="#" onclick="javascript:popImage(\''.$torrent['t_image'].'\',\'Image Preview\')"><img src="'.htmlspecialchars_uni($torrent['t_image']).'" class="glossy" border="0" width="175" height="175">' '<img src="'.$BASEURL.'/'.$pic_base_url.'nopreview.gif" class="glossy" border="0">').'</a>'.($ratingsystem == 'yes' '<br /><br />'.$rating '').'</td>
    '
.$ellenorzes.'
    '
.$allapot.'
    '
.$letoltes.'
    <tr>
        <td style="padding-left: 5px;" class="subheader" valign="top" width="147">'
.$lang->details['added'].'</td>
        <td valign="top" style="padding-left: 5px;">'
.my_datee($dateformat$torrent['added']).' '.my_datee($timeformat$torrent['added']).'</td>
    </tr>
    <tr>
        <td style="padding-left: 5px;" class="subheader" valign="top" width="147">'
.$lang->details['type'].'</td>
        <td valign="top" style="padding-left: 5px;">'
.$torrent['categoryname'].'</td>
    </tr>
    <tr>
        <td style="padding-left: 5px;" class="subheader" valign="top" width="147">'
.$lang->details['size'].'</td>
        <td valign="top" style="padding-left: 5px;">'
.mksize($torrent['size']).' '.sprintf($lang->details['numfiles2'], ts_nf($torrent['numfiles'])).'</td>
    </tr>
    <tr>
        <td style="padding-left: 5px;" class="subheader" valign="top" width="147">'
.$lang->details['hits'].'</td>
        <td valign="top" style="padding-left: 5px;">'
.ts_nf($torrent['hits']).'</td>
    </tr>
    <tr>
        <td style="padding-left: 5px;" class="subheader" valign="top" width="147">'
.$lang->details['snatched'].'</td>
        <td valign="top" style="padding-left: 5px;"><a href="'
.$BASEURL.'/viewsnatches.php?id='.$id.'">'.ts_nf($torrent['times_completed']).'</a> '.$lang->details['snatched2'].'</td>
    </tr>
    <tr>
        <td style="padding-left: 5px;" class="subheader" valign="top" width="147">'
.$lang->details['uppedby'].'</td>
        <td valign="top" style="padding-left: 5px;">'
.$username.'</td>
    </tr>
    <tr>
        <td style="padding-left: 5px;" class="subheader" valign="top" width="147">'
.$lang->details['comments'].'</td>
        <td valign="top" style="padding-left: 5px;">'
.ts_nf($torrent['comments']).' '.$lang->details['comments'].'</td>
    </tr>
    <tr>
        <td style="padding-left: 5px;" class="subheader" valign="top" width="147">'
.$lang->details['peersb'].'</td>
        <td valign="top" style="padding-left: 5px;">'
.sprintf($lang->details['peers2'], '<font color="'.get_slr_color($sratio).'">'.ts_nf($torrent['seeders']).'</font>''<font color="'.get_slr_color($lratio).'">'.ts_nf($torrent['leechers']).'</font>'ts_nf($torrent['seeders']+$torrent['leechers'])).'</td>
    </tr>
    '
.(isset($reseed) ? $reseed '').(isset($isScene) ? $isScene '').'
    <tr>
        <td align="center" valign="top" width="175">
            <table cellpadding="2" cellspacing="0" width="100%" align="center">
                <tr>
                    <td colspan="2" class="subheader">'
.$lang->upload['video'].'</td>
                </tr>
                <tr>
                    <td valign="top" align="right" width="40%">'
.$lang->upload['codec'].'</td><td>'.($video_info[0] ? htmlspecialchars_uni($video_info[0]) : $lang->details['na']).'</td>
                </tr>
                <tr>
                    <td valign="top" align="right" width="40%">'
.$lang->upload['bitrate'].'</td><td>'.($video_info[1] ? htmlspecialchars_uni($video_info[1]).' kbps' $lang->details['na']).'</td>
                </tr>
                <tr>
                    <td valign="top" align="right" width="40%">'
.$lang->upload['resulation'].'</td><td>'.($video_info[2] ? htmlspecialchars_uni($video_info[2]) : $lang->details['na']).'</td>
                </tr>
                <tr>
                    <td valign="top" align="right" width="40%">'
.$lang->upload['length'].'</td><td>'.($video_info[3] ? htmlspecialchars_uni($video_info[3]).' '.$lang->global['minutes'] : $lang->details['na']).'</td>
                </tr>
                <tr>
                    <td valign="top" align="right" width="40%">'
.$lang->upload['quality'].'</td><td>'.($video_info[4] ? htmlspecialchars_uni($video_info[4]).'/10' $lang->details['na']).'</td>
                </tr>
                <tr>
                    <td colspan="2" class="subheader">'
.$lang->upload['audio'].'</td>
                </tr>
                <tr>
                    <td valign="top" align="right" width="40%">'
.$lang->upload['codec'].'</td><td>'.($audio_info[0] ? htmlspecialchars_uni($audio_info[0]) : $lang->details['na']).'</td>
                </tr>
                <tr>
                    <td valign="top" align="right" width="40%">'
.$lang->upload['bitrate'].'</td><td>'.($audio_info[1] ? htmlspecialchars_uni($audio_info[1]).' kbps' $lang->details['na']).'</td>
                </tr>
                <tr>
                    <td valign="top" align="right" width="40%">'
.$lang->upload['frequency'].'</td><td>'.($audio_info[2] ? htmlspecialchars_uni($audio_info[2]).' HZ' $lang->details['na']).'</td>
                </tr>
                <tr>
                    <td valign="top" align="right" width="40%">'
.$lang->upload['language'].'</td><td>'.($audio_info[3] ? htmlspecialchars_uni($audio_info[3]) : $lang->details['na']).'</td>
                </tr>
            </table>
        </td>
        <td colspan="2" valign="top">
            '
.($thankssystem == 'yes' '
            <table width="100%" border="0" cellpadding="5" cellspacing="0">
                <tr>
                    <td class="thead">'
.$lang->details['thanksby'].'</td>
                </tr>
                <tr>
                    <td>
                        <div style="overflow: auto; height: 200px;">'
.$AllThanks.'</div>
                    </td>
                </tr>
            </table>' 
'').'
        </td>
    </tr>
    </table>
    <br />
    '
.$ShowTLINK.'
    <table width="100%" border="0" cellpadding="5" cellspacing="0">
        <tr>
            <td class="thead">'
.sprintf($lang->details['detailsfor'], $torrent['name']).'</td>
        </tr>
        <tr>
            <td>
                '
.format_comment($torrent['descr']).'
            </td>
        </tr>
    </table>
    <br />
    '
.$similair1.'
    <br />  
'
;
$mod $_POST['mod'];
$moderator $CURUSER['username'];
$error $_POST['error'];

if (isset (
$mod))
{
$moderated sql_query("UPDATE torrents SET moderated = '$mod', moderator = '$moderator', error = '$error' WHERE id = ".$_GET['id']."");
header("Location: <a href='.$BASEURL.'/details.php?id=".$_GET['id'].""); /* Átirányít <a href="'.$BASEURL.'/viewsnatches.php?id='.$id.'">' */
exit; /* Biztossá teszi azt, hogy az következo kódrész nem fut le. */
}
echo 
'
<link rel="stylesheet" type="text/css" href="'
.$BASEURL.'/scripts/yui/tabview/assets/skins/sam/tabview.css" />
<script type="text/javascript" src="'
.$BASEURL.'/scripts/yui/yahoo-dom-event/yahoo-dom-event.js"></script>
<script type="text/javascript" src="'
.$BASEURL.'/scripts/yui/element/element-beta-min.js"></script>
<script type="text/javascript" src="'
.$BASEURL.'/scripts/yui/tabview/tabview-min.js"></script>'.($is_mod '
<script type="text/javascript">
    l_updated = "'
.$lang->global['imgupdated'].'";
    l_refresh = "'
.$lang->global['refresh'].'";
</script>
<script type="text/javascript" src="'
.$BASEURL.'/scripts/quick_imdb.js"></script>' '');

$show_manage '';
if (
$CURUSER['id'] === $torrent['owner'] OR $is_mod)
{
    
$show_manage .= '<a href="'.$BASEURL.'/edit.php?id='.$id.'"  onmouseout="window.status=\'\'; return true;" onMouseOver="window.status=\''.$lang->details['editorrent'].'\'; return true;">'.$lang->details['editorrent'].'</a> - ';
}
if (
$is_mod)
{
    
$show_manage .= '<a href="'.$BASEURL.'/admin/index.php?act=fastdelete&amp;id='.$id.'" onmouseout="window.status=\'\'; return true;" onMouseOver="window.status=\'\'; return true;">Delete Torrent</a> -
    <a href="'
.$BASEURL.'/comment.php?tid='.$id.'&action='.($torrent['allowcomments'] != 'yes' 'open' 'close').'"  onmouseout="window.status=\'\'; return true;" onMouseOver="window.status=\''.($torrent['allowcomments'] == 'no' $lang->details['open'] : $lang->details['close']).'\'; return true;">'.($torrent['allowcomments'] != 'yes' $lang->details['open'] : $lang->details['close']).'</a> - 
    <a href="'
.$BASEURL.'/admin/index.php?act=torrent_info&id='.$id.'" onmouseout="window.status=\'\'; return true;" onMouseOver="window.status=\'\'; return true;">Torrent Info</a>';
}

$show_nfo '';
if (!empty(
$torrent['nfo']))
{
    
$show_nfo .= '<img src="'.$BASEURL.'/viewnfo.php?id='.$id.'" border="0" alt="'.$torrent['name'].'" title="'.$torrent['name'].'" />';
}

echo 
'
<div class="yui-skin-sam">
    <div id="details" class="yui-navset">
        <ul class="yui-nav">
            <li'
.($tab == 'details' ' class="selected"' '').'><a href="#details"><em>'.$lang->details['torrentinfo'].'</em></a></li>
            <li'
.($tab == 'comments' ' class="selected"' '').'><a href="#comments"><em>'.$lang->details['comments'].'</em></a></li>
            <li'
.($tab == 'filelist' ' class="selected"' '').'><a href="#filelist"><em>'.$lang->details['numfiles3'].'</em></a></li>
            <li'
.($tab == 'peers' ' class="selected"' '').'><a href="#peers"><em>'.$lang->details['peersb'].'</em></a></li>
            <li'
.($tab == 'report' ' class="selected"' '').'><a href="#report"><em>'.$lang->details['report'].'</em></a></li>
            <li'
.($tab == 'bookmark' ' class="selected"' '').'><a href="#bookmark"><em>'.$lang->details['bookmark'].'</em></a></li>
            '
.($show_nfo != '' '<li'.($tab == 'nfo' ' class="selected"' '').'><a href="#nfo"><em>NFO</em></a></li>' '').'
            '
.($show_manage != '' '<li'.($tab == 'manage' ' class="selected"' '').'><a href="#manage"><em>Manage Torrent</em></a></li>' '').'
        </ul>
        <div class="yui-content">
            <div id="details">'
.$details.'</div>
            <div id="comments">'
.$showcommenttable.'</div>
            <div id="filelist">'
.$s.'</div>
            <div id="peers">'
.$peerstable.'</div>
            <div id="report">'
.$report.'</div>
            <div id="bookmark">'
.$bookmark.'</div>
            '
.($show_nfo != '' '<div id="nfo">'.$show_nfo.'</div>' '').'
            '
.($show_manage != '' '<div id="manage">'.$show_manage.'</div>' '').'
        </div>
    </div>
    <script type="text/javascript">
    (function() {
        var tabView = new YAHOO.widget.TabView("details");
    })();
    </script>
</div>'
;
function 
get_slr_color($ratio)
{
    if (
$ratio 0.025) return "#ff0000";
    if (
$ratio 0.05) return "#ee0000";
    if (
$ratio 0.075) return "#dd0000";
    if (
$ratio 0.1) return "#cc0000";
    if (
$ratio 0.125) return "#bb0000";
    if (
$ratio 0.15) return "#aa0000";
    if (
$ratio 0.175) return "#990000";
    if (
$ratio 0.2) return "#880000";
    if (
$ratio 0.225) return "#770000";
    if (
$ratio 0.25) return "#660000";
    if (
$ratio 0.275) return "#550000";
    if (
$ratio 0.3) return "#440000";
    if (
$ratio 0.325) return "#330000";
    if (
$ratio 0.35) return "#220000";
    if (
$ratio 0.375) return "#110000";
    return 
"#000000";
}
stdfoot();
?>
browse.php

PHP Code:
<?php
/*
************************************************
*==========[TS Special Edition v.5.6]==========*
************************************************
*              Special Thanks To               *
*        DrNet - wWw.SpecialCoders.CoM         *
*          Vinson - wWw.Decode4u.CoM           *
*    MrDecoder - wWw.Fearless-Releases.CoM     *
*           Fynnon - wWw.BvList.CoM            *
*==============================================*
*   Note: Don't Modify Or Delete This Credit   *
*     Next Target: TS Special Edition v5.7     *
*     TS SE WILL BE ALWAYS FREE SOFTWARE !     *
************************************************
*/
require_once('global.php');
gzip();
dbconn(true);
maxsysop();
define('B_VERSION''4.6.3');

if (
$MEMBERSONLY == 'yes')
{
    
loggedinorreturn();
    
parked();
}

$lang->load('browse');
$is_mod is_mod($usergroups);
$special_search = (isset($_GET['special_search']) ? trim($_GET['special_search']) : '');
$do = isset($_POST['do']) ? $_POST['do'] : (isset($_GET['do']) ? $_GET['do'] : '');
$quick_search = isset($_POST['quick_search']) ? trim($_POST['quick_search']) : (isset($_GET['quick_search']) ? trim($_GET['quick_search']) : '');
$search_type $javaalert $from '';
$pagelinks = array();
$showvisible true;
$is_bookmark_page false;
$UseQuickMenu preg_match('#P1#is'$CURUSER['options']);

if (
strtoupper($_SERVER['REQUEST_METHOD']) == 'POST' AND $is_mod AND !empty($_POST['tid']))
{
    if ((
$tid intval($_POST['tid'])) AND is_valid_id($tid) AND ($torrent trim($_POST['subject'])) AND !empty($torrent))
    {
        
$torrent unesc($torrent);
        
$torrent str_replace('_'' '$torrent);
        
sql_query("UPDATE torrents SET name = ".sqlesc($torrent)." WHERE id = ".sqlesc($tid));
    }
}

if (
$special_search == 'myreseeds')
{
    
$extraqueries " AND t.seeders = 0 AND t.leechers > 0 AND t.owner = ".sqlesc($CURUSER['id']);
    
$pagelinks[] = "special_search=myreseeds";
    
$sqfield "&amp;special_search=myreseeds";
    
$showvisible false;
}
elseif (
$special_search == 'mybookmarks')
{
    
$from 'FROM bookmarks b LEFT JOIN torrents t ON (b.torrentid = t.id)';
    
$extraqueries " AND b.userid = ".sqlesc($CURUSER['id']);
    
$pagelinks[] = "special_search=mybookmarks";
    
$sqfield "&amp;special_search=mybookmarks";
    
$showvisible false;
    
$is_bookmark_page true;
}
elseif (
$special_search == 'mytorrents')
{
    
$extraqueries " AND t.owner = ".sqlesc($CURUSER['id']);
    
$pagelinks[] = "special_search=mytorrents";
    
$sqfield "&amp;special_search=mytorrents";
    
$showvisible false;
}
elseif (
$special_search == 'weaktorrents')
{
    
$extraqueries " AND t.visible = 'no' OR (t.leechers > 0 AND t.seeders = 0) OR (t.leechers = 0 AND t.seeders = 0)";
    
$pagelinks[] = "special_search=weaktorrents";
    
$sqfield "&amp;special_search=weaktorrents";
    
$showvisible false;
    
$lang->browse['btitle'] = $lang->global['weaktorrents'];
}
elseif (
$do == 'search')
{
    
$extraquery = array();
    
$keywords = isset($_POST['keywords']) ? $_POST['keywords'] : (isset($_GET['keywords']) ? $_GET['keywords'] : '');
    if (
$_GET['tags'] AND $_GET['tags'] == 'true' AND !empty($keywords))
    {
        
$keywords urldecode($keywords);
    }
    elseif (!empty(
$keywords))
    {
        
$keywords trim($keywords);
    }
    
$category = isset($_POST['category']) ? intval($_POST['category']) : (isset($_GET['category']) ? intval($_GET['category']) : 0);
    
$search_type = isset($_POST['search_type']) ? trim($_POST['search_type']) : (isset($_GET['search_type']) ? trim($_GET['search_type']) : '');

    
$query sql_query("SHOW VARIABLES LIKE 'ft_min_word_len';");
    
$array mysql_fetch_assoc($query);
    
$min_length $array['Value'];
    if(
is_numeric($min_length))
    {
        
$minsearchword $min_length;
    }
    else
    {
        
$minsearchword 3;
    }

    if (
strlen($keywords) >= $minsearchword && !empty($search_type))
    {
        switch (
$search_type)
        {
            case 
't_name':
                
$extraquery[] = "(MATCH (t.name) AGAINST ('".mysql_real_escape_string($keywords)."*' IN BOOLEAN MODE))";
                break;
            case 
't_description':
                
$extraquery[] = "(MATCH (t.descr) AGAINST ('".mysql_real_escape_string($keywords)."*' IN BOOLEAN MODE))";
                break;
            case 
't_both':
                
$extraquery[] = "(MATCH (t.name,t.descr) AGAINST ('".mysql_real_escape_string($keywords)."*' IN BOOLEAN MODE))";
                break;
            case 
't_uploader':
                
$query sql_query("SELECT id FROM users WHERE username = ".sqlesc($keywords)." LIMIT 1");
                if (
mysql_num_rows($query) > 0)
                {
                    
$user mysql_fetch_assoc($query);
                    
$extraquery[] = "t.owner = ".sqlesc($user['id']).(!$is_mod " AND t.anonymous != 'yes'" "");
                }
                else
                    
$extraquery[] = "t.owner = ".sqlesc($keywords);
                break;
            case 
't_genre':
                
$extraquery[] = "(MATCH (t.t_link) AGAINST ('".mysql_real_escape_string($keywords)."*' IN BOOLEAN MODE))";
            break;
        }
    }
    else
    {
        
$javaalert '
        <script type="text/javascript">
            alert("'
.sprintf($lang->browse['serror'], $minsearchword).'");
        </script>
        '
;
    }
    if (
is_valid_id($category) && $category 0)
    {
        
$extraquery[] = "t.category = ".$category;
    }
    if (
count($extraquery) > 0)
    {
        
$extraqueries ' AND ';
        
$extraqueries .= implode(' AND '$extraquery);
        
$pagelinks[] = 'do=search';
        
$pagelinks[] = 'keywords='.urlencode(htmlspecialchars_uni($keywords));
        
$pagelinks[] = 'category='.$category;
        
$pagelinks[] = 'search_type='.urlencode(htmlspecialchars_uni($search_type));
        
$showvisible false;
    }
}
elseif (isset(
$_GET['category']) && is_valid_id($_GET['category']) && empty($quick_search))
{
    
$category intval($_GET['category']);
    
$query sql_query("SELECT id FROM categories WHERE type='s' AND pid = $category");
    if (
mysql_num_rows($query) > 0)
    {
        
$squerycats=array();
        while (
$squery=mysql_fetch_assoc($query))
        {
            
$squerycats[] = $squery['id'];
        }
        
$extraqueries ' AND t.category IN ('.$category.','.implode(','$squerycats).')';
    }
    else
    {
        
$extraqueries ' AND t.category = '.$category;
    }
    
$pagelinks[] = 'category='.$category;
}
elseif (!empty(
$quick_search))
{
    
$category = isset($_POST['category']) ? intval($_POST['category']) : (isset($_GET['category']) ? intval($_GET['category']) : '');
    switch(
$quick_search)
    {
        case 
'show_daily_torrents':
            
$stime TIMENOW-(60*60*24); // daily
            
$extraquery[] = "UNIX_TIMESTAMP(t.added) > '$stime'";
            
$pagelinks[] = 'quick_search=show_daily_torrents';
            break;
        case 
'show_weekly_torrents':
            
$stime TIMENOW-(60*60*(24*7)); // weekly
            
$extraquery[] = "UNIX_TIMESTAMP(t.added) > '$stime'";
            
$pagelinks[] = 'quick_search=show_today_torrents';
            break;
        case 
'show_montly_torrents':
            
$stime TIMENOW-(60*60*(24*28)); // montly
            
$extraquery[] = "UNIX_TIMESTAMP(t.added) > '$stime'";
            
$pagelinks[] = 'quick_search=show_today_torrents';
            break;
        case 
'show_dead_torrents':
            
$showvisible false;
            
$extraquery[] = "t.visible = 'no'";
            
$pagelinks[] = 'quick_search=show_dead_torrents';
            break;
        case 
'show_recommend_torrents':
            
$extraquery[] = "t.sticky = 'yes'";
            
$pagelinks[] = 'quick_search=show_recommend_torrents';
            break;
        case 
'show_free_torrents':
            
$extraquery[] = "t.free = 'yes'";
            
$pagelinks[] = 'quick_search=show_free_torrents';
            break;
        case 
'show_silver_torrents':
            
$extraquery[] = "t.silver = 'yes'";
            
$pagelinks[] = 'quick_search=show_silver_torrents';
            break;
        case 
'show_doubleupload_torrents':
            
$extraquery[] = "t.doubleupload = 'yes'";
            
$pagelinks[] = 'quick_search=show_doubleupload_torrents';
            break;
        case 
'show_external_torrents':
            
$extraquery[] = "t.ts_external = 'yes'";
            
$pagelinks[] = 'quick_search=show_external_torrents';
            break;
        case 
'show_scene_torrents':
            
$extraquery[] = "t.isScene > 0";
            
$pagelinks[] = 'quick_search=show_scene_torrents';
            break;
    }
    if (
$category 0)
    {
        
$extraquery[] = 't.category IN ('.$category.')';
        
$pagelinks[] = 'category='.$category;
    }
    if (
count($extraquery) > 0)
    {
        
$extraqueries ' AND ';
        
$extraqueries .= implode(' AND '$extraquery);
    }
}

if (
$usergroups['isvipgroup'] != 'yes' && !$is_mod && $waitsystem == 'yes')
{
    include_once(
INC_PATH.'/readconfig_waitslot.php');
    
$gigs $CURUSER['uploaded'] / (1024*1024*1024);
    
$ratio = (($CURUSER['downloaded'] > 0) ? ($CURUSER['uploaded'] / $CURUSER['downloaded']) : 0);
    if (
$waitsystemtype == 1)
    {
      if (
$ratio $ratio1 || $gigs $upload1$wait $delay1;
        elseif (
$ratio $ratio2 || $gigs $upload2$wait $delay2;
            elseif (
$ratio $ratio3 || $gigs $upload3$wait $delay3;
                elseif (
$ratio $ratio4 || $gigs $upload4$wait $delay4;
                    else 
$wait 0;
    }
    else
    {
      
$wait $usergroups['waitlimit'];
    }
}
else
{
    
$wait '';
}

stdhead($lang->browse['btitle'],true,'supernote'$javaalert);
$_freelechmod $_silverleechmod $_x2mod false;
include(
TSDIR.'/'.$cache.'/freeleech.php');
include(
INC_PATH.'/readconfig_kps.php');
if (
$__F_START get_date_time() && $__F_END get_date_time())
{
    switch(
$__FLSTYPE)
    {
        case 
'freeleech';
            
$___notice show_notice(sprintf($lang->browse['f_leech'], $__F_START$__F_END),false,$lang->browse['f_leech_h']);
            
$_freelechmod true;
        break;
        case 
'silverleech';
            
$___notice show_notice(sprintf($lang->browse['s_leech'], $__F_START$__F_END),false,$lang->browse['s_leech_h']);
            
$_silverleechmod true;
        break;
        case 
'doubleupload';
            
$___notice show_notice(sprintf($lang->browse['d_leech'], $__F_START$__F_END),false,$lang->browse['d_leech_h']);
            
$_x2mod true;
        break;
    }
}
elseif (
$bdayreward == 'yes' AND $bdayrewardtype)
{
    
$curuserbday explode('-'$CURUSER['birthday']);
    if (
date('j-n') === $curuserbday[0].'-'.$curuserbday[1])
    {
        switch (
$bdayrewardtype)
        {
            case 
'freeleech';
                
$___notice show_notice(sprintf($lang->browse['f_leech'], $curuserbday[0].'-'.$curuserbday[1].'-'.date('Y'), ($curuserbday[0] + 1).'-'.$curuserbday[1].'-'.date('Y')),false,$lang->browse['f_leech_h']);
            break;
            case 
'silverleech';
                
$___notice show_notice(sprintf($lang->browse['s_leech'], $curuserbday[0].'-'.$curuserbday[1].'-'.date('Y'), ($curuserbday[0] + 1).'-'.$curuserbday[1].'-'.date('Y')),false,$lang->browse['s_leech_h']);
            break;
            case 
'doubleupload';
                
$___notice show_notice(sprintf($lang->browse['d_leech'], $curuserbday[0].'-'.$curuserbday[1].'-'.date('Y'), ($curuserbday[0] + 1).'-'.$curuserbday[1].'-'.date('Y')),false,$lang->browse['d_leech_h']);
            break;
        }
    }
}

require(
TSDIR.'/'.$cache.'/categories.php');
$subcategories = array();
$searcincategories = array();
if (
count($_categoriesS) > 0)
{
    foreach (
$_categoriesS as $sc)
    {
        
$sc['name'] = htmlspecialchars_uni($sc['name']);
        
$searcincategories[] = $sc['id'];
        
$seolink ts_seo($sc['id'],$sc['name'],'c');
        
$scdesc htmlspecialchars_uni($sc['cat_desc']);
        
$subcategories[$sc['pid']][] = '<font class="main"><a href="'.$seolink.'" target="_self" alt="'.$scdesc.'" title="'.$scdesc.'" />'.(isset($category) && $category == $sc['id'] || strpos($CURUSER['notifs'], '[cat'.$sc['id'].']') !== FALSE '<span style="background-color: rgb( 149, 206, 145);">'.$sc['name'].'</span>' $sc['name']).'</a></font>';
    }
}

$count 0;
$categories '
<table width="100%" border="1" cellspacing="0" cellpadding="5" align="center">
    <tr>
        <td class="thead">'
.ts_collapse('cats').'
            <div align="center">
                <strong>
                    '
.$lang->browse['tcategory'].'
                </strong>
            </div>
        </td>
    </tr>
        '
.ts_collapse('cats',2).'
    <tr>
        <td align="center">
            <table border="0" cellspacing="0" cellpadding="0" align="center">
                <tr class="none">
'
;

if ((
$rows count($_categoriesC)) > 0)
{
    foreach (
$_categoriesC as $c)
    {
        
$searcincategories[] = $c['id'];
        if (
$count && $count == 0)
        {
            
$categories .= '</tr><tr class="none">';
        }
        
$seolink ts_seo($c['id'],$c['name'],'c');
        
$cname htmlspecialchars_uni($c['name']);
        
$cdesc htmlspecialchars_uni($c['cat_desc']);
        
$categories .= '
        <td class="none">
            <table border="0" cellspacing="0" cellpadding="0">
                <tr>
                    <td width="1" class="none" height="12" valign="top" align="center" style="padding: 3px;">
                        <a href="'
.$seolink.'" target="_self" /></a>
                    </td>
                    <td width="200" class="none" valign="top" align="left" style="padding-left: 7px; padding-top: 3px; padding-right: 3px;">
                        <font class="cat_link" style="font-size: 16px;"><a href="'
.$seolink.'" target="_self" alt="'.$cdesc.'" title="'.$cdesc.'" /><b>'.(isset($category) && $category == $c['id'] || strpos($CURUSER['notifs'], '[cat'.$c['id'].']') !== FALSE '<span style="background-color: rgb( 149, 206, 145);">'.$cname.'</span>' $cname).'</b></a></font><br />
                        '
.($subcategories[$c['id']] ? implode(', '$subcategories[$c['id']]) : '').'
                    </td>
                </tr>
            </table>
        </td>'
;
        
$count++;
    }
}

$categories .= '
    </tr></table></td></tr></table><p></p>'
;

if (
preg_match("#\[cat.+#i"$CURUSER['notifs']) AND count($extraquery) == AND count($pagelinks) == 0)
{
    
$defaultcategories = array();
    foreach (
$searcincategories as $catid)
    {
        if (
strpos($CURUSER['notifs'], '[cat'.$catid.']') !== FALSE)
        {
            
$defaultcategories[] = $catid;
        }
    }
    if (
count($defaultcategories) > 0)
    {
        
$extraqueries ' AND t.category IN ('.implode(','$defaultcategories).')';
    }
}

require_once(
INC_PATH.'/functions_category.php');
$catdropdown ts_category_list('category',(isset($category) ? $category ''),'<option value="0" style="color: gray;">'.$lang->browse['alltypes'].'</option>');

$search '
<script type="text/javascript" src="'
.$BASEURL.'/scripts/prototype.js?v='.O_SCRIPT_VERSION.'"></script>
<script type="text/javascript" src="'
.$BASEURL.'/ratings/js/scriptaculous.js?v='.O_SCRIPT_VERSION.'"></script>
<script type="text/javascript" src="'
.$BASEURL.'/scripts/autocomplete.js?v='.O_SCRIPT_VERSION.'"></script>
<script type="text/javascript" src="'
.$BASEURL.'/scripts/quick_torrents.js?v='.O_SCRIPT_VERSION.'"></script>

<script type="text/javascript">TSShowTorrents(\'new\');</script>
<div id="TSShowLatestTorrents" name="TSShowLatestTorrents"></div>
<table width="100%" border="1" cellspacing="0" cellpadding="5" align="center">
    <tr>
        <td class="thead"><center><b>Newest Torrents</b></center></td></tr><tr>
                <td class=tablea><iframe src="carbrowse.php" frameborder="0" scrolling="no" style="width:100%;" height="100"></iframe></td></tr></table><br>


<table width="100%" border="1" cellspacing="0" cellpadding="5" align="center">    
        <td class="thead">'
.ts_collapse('cats_search').'
            <div align="center">
                <strong>
                    '
.$lang->browse['tsearch'].'
                </strong>
            </div>
        </td>    '
.ts_collapse('cats_search',2).'
    </tr>
    <tr>
        <td align="right">
            <form method="post" action="'
.$_SERVER['SCRIPT_NAME'].'?">
            <input type="hidden" name="do" value="search" />
            '
.$lang->browse['bykeyword'].' <input type="text" id="auto_keywords" autocomplete="off" name="keywords" size="40" value="'.(isset($keywords) ? htmlspecialchars_uni($keywords) : '').'" />
            <script type="text/javascript">
                new AutoComplete(\'auto_keywords\', \'ts_ajax.php?action=autocomplete&type=torrent&field=name&keyword=\', { delay: 0.25, resultFormat: AutoComplete.Options.RESULT_FORMAT_TEXT });
            </script>
            <select name="search_type">
                <option value="t_name"'
.($search_type == 't_name' ' selected="selected"' '').'>'.$lang->browse['t_name'].'</option>
                <option value="t_description"'
.($search_type == 't_description' ' selected="selected"' '').'>'.$lang->browse['t_description'].'</option>
                <option value="t_both"'
.($search_type == 't_both' ' selected="selected"' '').'>'.$lang->browse['t_both'].'</option>
                <option value="t_uploader"'
.($search_type == 't_uploader' ' selected="selected"' '').'>'.$lang->browse['t_uploader'].'</option>
                <option value="t_genre"'
.($search_type == 't_genre' ' selected="selected"' '').'>'.$lang->browse['t_genre'].'</option>
            </select>
            '
.$lang->browse['in'].'
                '
.$catdropdown.'
            <input type="image" class="none" style="vertical-align: middle;" src="'
.$BASEURL.'/'.$pic_base_url.'torrent_search.gif" alt="'.$lang->browse['tsearch'].'" />
            </form>
        <p align="center">
            <form method="post" action="'
.$_SERVER['SCRIPT_NAME'].'?advanced_search">
            '
.$lang->browse['sastype'].'
            <select name="quick_search">
                <option value="show_daily_torrents"'
.($quick_search == 'show_daily_torrents' ' selected="selected"' '').'>'.$lang->browse['show_daily_torrents'].'</option>
                <option value="show_weekly_torrents"'
.($quick_search == 'show_weekly_torrents' ' selected="selected"' '').'>'.$lang->browse['show_weekly_torrents'].'</option>
                <option value="show_montly_torrents"'
.($quick_search == 'show_montly_torrents' ' selected="selected"' '').'>'.$lang->browse['show_montly_torrents'].'</option>
                <option value="show_dead_torrents"'
.($quick_search == 'show_dead_torrents' ' selected="selected"' '').'>'.$lang->browse['show_dead_torrents'].'</option>
                <option value="show_recommend_torrents"'
.($quick_search == 'show_recommend_torrents' ' selected="selected"' '').'>'.$lang->browse['show_recommend_torrents'].'</option>
                <option value="show_free_torrents"'
.($quick_search == 'show_free_torrents' ' selected="selected"' '').'>'.$lang->browse['show_free_torrents'].'</option>
                <option value="show_silver_torrents"'
.($quick_search == 'show_silver_torrents' ' selected="selected"' '').'>'.$lang->browse['show_silver_torrents'].'</option>
                <option value="show_doubleupload_torrents"'
.($quick_search == 'show_doubleupload_torrents' ' selected="selected"' '').'>'.$lang->browse['show_double_upload_torrents'].'</option>
                <option value="show_external_torrents"'
.($quick_search == 'show_external_torrents' ' selected="selected"' '').'>'.$lang->browse['show_external_torrents'].'</option>
                <option value="show_scene_torrents"'
.($quick_search == 'show_scene_torrents' ' selected="selected"' '').'>'.$lang->browse['scene4'].'</option>
            </select>
            '
.$lang->browse['in'].'
                '
.$catdropdown.'
            <input type="image" class="none" style="vertical-align: middle;" src="'
.$BASEURL.'/'.$pic_base_url.'torrent_search.gif" alt="'.$lang->browse['tsearch'].'" />
            </form>
        </p>
        <p align="center"><span style="float: right;"><img src="'
.$BASEURL.'/'.$pic_base_url.'ajax-loader.gif" alt="" title="" border="0" id="loadingimg" class="inlineimg" name="loadingimg" style="display: none" /> [<a href="#TSShowLatestTorrents" onclick="TSShowTorrents(\'new\'); return false;">'.$lang->browse['show_latest'].'</a>] [<a href="#TSShowLatestTorrents" onclick="TSShowTorrents(\'sticky\'); return false;">'.$lang->browse['show_recommend_torrents'].'</a>] [<a href="#TSShowLatestTorrents" onclick="TSShowTorrents(\'free\'); return false;">'.$lang->browse['show_free_torrents'].'</a>] [<a href="#TSShowLatestTorrents" onclick="TSShowTorrents(\'silver\'); return false;">'.$lang->browse['show_silver_torrents'].'</a>]</span></p>
        </td>
    </tr>
</table>
<div id="quickedit" name="quickedit"></div>
'
;

$orderbyvalue 'ORDER by t.sticky, t.added DESC';
if ((isset(
$_POST['sort_order']) AND $_POST['sort_order'] == 'yes') OR (isset($_GET['sort_order']) AND $_GET['sort_order'] == 'yes'))
{
    
$allowedsortbys = array('added','numfiles','comments','seeders','leechers','size','times_completed','owner','sticky');
    if (
$torrentspeed == 'yes')
    {
        
$allowedsortbys array_merge($allowedsortbys, array('totalspeed'));
    }
    
$sortby = isset($_POST['sortby']) && in_array($_POST['sortby'], $allowedsortbys) ? trim($_POST['sortby']) : (isset($_GET['sortby']) && in_array($_GET['sortby'], $allowedsortbys) ? trim($_GET['sortby']) : '');
    
$allowedorderbys = array('DESC''ASC');
    
$orderby = isset($_POST['orderby']) && in_array($_POST['orderby'], $allowedorderbys) ? trim($_POST['orderby']) : (isset($_GET['orderby']) && in_array($_GET['orderby'], $allowedorderbys) ? trim($_GET['orderby']) : '');
    
$orderbyvalue 'ORDER by '.($sortby != 'totalspeed' 't.' '').$sortby.' '.$orderby;

    if (!empty(
$sortby) OR !empty($orderby))
    {
        
$pagelinks2 = array();
        
$pagelinks2[] = 'sort_order=yes';
        
$pagelinks2[] = 'sortby='.htmlspecialchars_uni($sortby);
        
$pagelinks2[] = 'orderby='.htmlspecialchars_uni($orderby);
    }
}

$from = !empty($from) ? $from 'FROM torrents t';
$showtorrents = array();
$query sql_query("SELECT t.id, c.vip {$from} LEFT JOIN categories c ON (t.category=c.id) WHERE ".($showvisible "t.visible = 'yes' AND " "").(preg_match('#E0#is'$CURUSER['options']) ? "t.offensive = 'no' AND " "").($usergroups['canviewviptorrents'] != 'yes' "c.vip = 'no' AND " "")."t.banned = 'no'".(isset($extraqueries) ? $extraqueries '')) or sqlerr(__FILE__,__LINE__);
$count mysql_num_rows($query);
$torrentsperpage = ($CURUSER['torrentsperpage'] <> intval($CURUSER['torrentsperpage']) : $ts_perpage);
list(
$pagertop$pagerbottom$limit) = pager($torrentsperpage$count$_SERVER['SCRIPT_NAME'].'?'.(isset($pagelinks) && count($pagelinks) > implode('&amp;'$pagelinks).'&amp;' '').(isset($pagelinks2) && count($pagelinks2) > implode('&amp;'$pagelinks2).'&amp;' ''));
$groupby $torrentspeed == 'yes' ' GROUP by t.id ' '';

$query sql_query("SELECT ".($torrentspeed == 'yes' '(t.size * t.times_completed + SUM(p.downloaded)) / (UNIX_TIMESTAMP(NOW()) - UNIX_TIMESTAMP(t.added)) AS totalspeed,' '')." t.*, c.id as categoryid, c.image, c.name as categoryname, c.vip as isviptorrent, u.username, g.namestyle {$from} LEFT JOIN categories c ON (t.category=c.id) LEFT JOIN users u ON (t.owner=u.id) LEFT JOIN usergroups g ON (u.usergroup=g.gid) ".($torrentspeed == 'yes' 'LEFT JOIN peers p ON (t.id=p.torrent)' '')." WHERE ".($showvisible "t.visible = 'yes' AND " "")."t.banned = 'no'".(isset($extraqueries) ? $extraqueries '').{$groupby}{$orderbyvalue} $limit") or sqlerr(__FILE__,__LINE__);

if (
$progressbar == 'yes')
{
    include_once(
INC_PATH.'/functions_external.php');
}

$contentheader = ($is_mod '
<script type="text/javascript">
    function check_it(wHAT)
    {
        if (wHAT.value == "move")
        {
            document.getElementById("movetorrent").style.display = "block";
        }
        else
        {
            document.getElementById("movetorrent").style.display = "none";
        }
    }
</script>
<form method="post" action="'
.$BASEURL.'/admin/index.php?act=manage_torrents" name="manage_torrents">
<input type="hidden" name="do" value="update" />
<input type="hidden" name="return" value="yes" />
<input type="hidden" name="return_address" value="'
.$_SERVER['SCRIPT_NAME'].'?page='.intval(isset($_GET['page']) ? $_GET['page'] : 0).'&amp;'.(isset($pagelinks) && count($pagelinks) > implode('&amp;'$pagelinks).'&amp;' '').(isset($pagelinks2) && count($pagelinks2) > implode('&amp;'$pagelinks2) : '').'" />
'').'
<table width="100%" border="0" cellpadding="0" cellspacing="0">
    <tr>
        <td class="thead" align="center" style="padding: 10px 0 0 0;"><b>'
.$lang->browse['type'].'</b></td>
        <td class="thead" align="left" style="padding: 10px 0 0 0;">&nbsp;<b>'
.$lang->browse['t_name'].'</b></td>
        <td class="thead" align="center" style="padding: 10px 0 0 0;"><b>Staff</b></td>
        <td class="thead" align="center" style="padding: 10px 0 0 0;"><img src="'
.$BASEURL.'/'.$pic_base_url.'/files.gif" border="0" class="inlineimg"></td>
        <td class="thead" align="center" style="padding: 10px 0 0 0;"><img src="'
.$BASEURL.'/'.$pic_base_url.'/comments.gif" border="0" class="inlineimg"></td>
        <td class="thead" align="center" style="padding: 10px 0 0 0;"><img src="'
.$BASEURL.'/'.$pic_base_url.'/feltoltok.png" border="0" class="inlineimg"></td>
        <td class="thead" align="center" style="padding: 10px 0 0 0;"><img src="'
.$BASEURL.'/'.$pic_base_url.'/letoltok.png" border="0" class="inlineimg"></td>
        '
.($progressbar == 'yes' '<td class="thead" align="center" style="padding: 10px 0 0 0;"><b>'.$lang->global['avprogress'].'</b></td>' '').'
        '
.($torrentspeed == 'yes' '<td class="thead" align="center" style="padding: 10px 0 0 0;"><b>'.$lang->global['speed'].'</b></td>' '').'
        <td class="thead" align="center" style="padding: 10px 0 0 0;"><b>'
.$lang->global['size'].'</b> / <b>'.$lang->global['snatched'].'</b></td>
        <td class="thead" align="center" style="padding: 10px 0 0 0;"><b>'
.$lang->global['uploader'].'</b></td>
        '
.($is_mod '<td class="thead" align="center" style="padding: 10px 0 0 0;"><input checkall="group1" onclick="javascript: return select_deselectAll (\'manage_torrents\', this, \'group1\');" type="checkbox" /></td>' '').'
    </tr>
'
;

$__colspan 12;
(
$progressbar != 'yes' $__colspan-- : '');
(
$torrentspeed != 'yes' $__colspan-- : '');
(!
$is_mod $__colspan-- : '');
$contentmiddle $menu_nav '';
require_once(
INC_PATH.'/functions_mkprettytime.php');
if (
mysql_num_rows($query) > 0)
{
    require_once(
INC_PATH.'/functions_imdb_rating.php');
    while (
$torrents mysql_fetch_assoc($query))
    {
        if ((
$torrents['offensive'] == 'yes' && preg_match('#E0#is'$CURUSER['options'])) OR ($usergroups['canviewviptorrents'] != 'yes' && $torrents['isviptorrent'] == 'yes'))
        {
            continue;
        }

        
$showupdatebutton=true;

        if (
time() - $torrents['ts_external_lastupdate'] < (TS_TIMEOUT*4))
        {
            
$showupdatebutton=false;
        }

        
$showwait=$elapsed=$color='';

        if (
$wait 0)
        {
            
$elapsed floor((strtotime(date('Y-m-d H:i:s')) - strtotime($torrents['added'])) / 3600);
            if (
$elapsed $wait AND $torrents['ts_external'] != 'yes')
            {
                 
$color dechex(floor(127*($wait $elapsed)/48 128)*65536);
                 
$showwait "<span style='float: right'><a href=\"$BASEURL/faq.php#46\"><font color=\"$color\">" number_format($wait $elapsed) . " h</font></a></span>";
            }
        }

        
$orj_name_ $torrents['name'];
        
$torrents['name'] = htmlspecialchars_uni($torrents['name']);
        
$torrents['genre'] = htmlspecialchars_uni($torrents['genre']);
        
$genre $torrents['genre'];
        
$uploader='<a href="#" id="torrentuser'.$torrents['owner'].$torrents['id'].'">'.get_user_color($torrents['username'], $torrents['namestyle']).'</a>';
        
$disable_user_menu=false;

        if (
$torrents['anonymous'] == 'yes')
        {
            if (
$torrents['owner'] != $CURUSER['id'] && !$is_mod)
            {
                
$uploader $lang->global['anonymous'];
                
$disable_user_menu=true;
            }
            else
            {
                
$uploader $uploader.'<br />'.$lang->global['anonymous'];
            }
        }

        
$isScene '';

        if (
$torrents['isScene'] > 0)
        {
            
$isScene sprintf($lang->browse['scene3'], mkprettytime($torrents['isScene']));
        }

        
$seolink ts_seo($torrents['categoryid'],$torrents['categoryname'],'c');
        
$seolink2 ts_seo($torrents['id'],$torrents['name'],'s');
        
$seolink3 ts_seo($torrents['id'],$torrents['name'],'d');

        
$downloadinfo sprintf($lang->browse['downloadinfo'], $torrents['name']);
        
$categoryinfo sprintf($lang->browse['categoryinfo'], $torrents['categoryname']);
        
$sratio $torrents["leechers"] > $torrents["seeders"] / $torrents["leechers"] : 1;
        
$lratio $torrents["seeders"] > $torrents["leechers"] / $torrents["seeders"] : 1;

        
$torrent_files '<b>'.($torrents['numfiles'] > '<a href="'.$BASEURL.'/details.php?id='.$torrents['id'].'&tab=filelist">' '').ts_nf($torrents['numfiles']).($torrents['numfiles'] > '</a>' '').'</b>';

        
$torrent_seeders = ($torrents['ts_external'] == 'no' '<font color="'.get_slr_color($sratio).'">'.($torrents['seeders'] > && $usergroups['canpeers'] == 'yes' '<a href="'.$BASEURL.'/details.php?id='.$torrents['id'].'&tab=peers">' '').'<b>'.ts_nf($torrents['seeders']).'</b>'.($torrents['seeders'] > && $usergroups['canpeers'] == 'yes' '</a>' '').'</font>' '<b>'.ts_nf($torrents['seeders']).'</b>');

        
$torrent_leechers = ($torrents['ts_external'] == 'no' '<font color="'.get_slr_color($lratio).'">'.($torrents['leechers'] > && $usergroups['canpeers'] == 'yes' '<a href="'.$BASEURL.'/details.php?id='.$torrents['id'].'&tab=peers">' '').'<b>'.ts_nf($torrents['leechers']).'</b>'.($torrents['leechers'] > && $usergroups['canpeers'] == 'yes' '</a>' '').'</font>' '<b>'.ts_nf($torrents['leechers']).'</b>');

        
$torrents['times_completed'] = ($torrents['ts_external'] == 'yes' && $torrents['seeders'] > && $torrents['times_completed'] == $torrents['seeders'] : $torrents['times_completed']);
        
$torrent_snatched = ($torrents['ts_external'] == 'no' && $torrents['times_completed'] > && $usergroups['cansnatch'] == 'yes' sprintf($lang->browse['info3'], '<a href="'.$BASEURL.'/viewsnatches.php?id='.$torrents['id'].'"><b>'.ts_nf($torrents['times_completed']).'</b></a>') : sprintf($lang->browse['info3'], '<b>'.ts_nf($torrents['times_completed']).'</b>'));
        
$torrent_comments = ($torrents['comments']  > '<a href="'.$BASEURL.'/details.php?id='.$torrents ['id'].'&tab=comments">' '').'<b>'.ts_nf($torrents ['comments']).'</b>'.($torrents['comments'] > '</a>' '');

        
    
$q sql_query("SELECT p.ip, s.seedboxip FROM peers p LEFT JOIN seedbox s ON (p.ip=s.seedboxip) WHERE torrent = ".$torrents['id'] );
    while(
$c=mysql_fetch_assoc($q))


    if (
$c['ip'] == $c['seedboxip'])
    {
        
$speed3 '<img src="'.$BASEURL.'/'.$pic_base_url.'webseede.png.gif" class="inlineimg" alt="" title="Torrent Highspeed " />';
        }
        else    
        {   
        
$speed3 ' ';    
    }

    
$arfff mksize($torrents['totalspeed']); 
    if (
$torrents['totalspeed'] >45800 ) {

        
$speed2 '<img src="'.$BASEURL.'/'.$pic_base_url.'webseede.png.gif" width="20" height="20" class="inlineimg" alt="" title="Ce torrent a présentement une vitesse de '.$arfff.'" />';
        }     
        else
        {   
        
$speed2 ' ';   
    }

        
$isnew = ($torrents['added'] > $CURUSER['last_login'] ? '<img src="'.$BASEURL.'/'.$pic_base_url.'new.png" class="inlineimg" alt="'.$lang->browse['newtorrent'].'" title="'.$lang->browse['newtorrent'].'" />' '');
        
$isfree = ($torrents['free'] == 'yes' || ($_freelechmod && $torrents['ts_external'] != 'yes') ? '<img src="'.$BASEURL.'/'.$pic_base_url.'freedownload.gif" class="inlineimg" alt="'.$lang->browse['freedownload'].'" title="'.$lang->browse['freedownload'].'" />' '');
        
$issilver = ($torrents['silver'] == 'yes' || ($_silverleechmod && $torrents['ts_external'] != 'yes') ? '<img src="'.$BASEURL.'/'.$pic_base_url.'silverdownload.gif" class="inlineimg" alt="'.$lang->browse['silverdownload'].'" title="'.$lang->browse['silverdownload'].'" />' '');
        
$isrequest = ($torrents['isrequest'] == 'yes' '<img src="'.$BASEURL.'/'.$pic_base_url.'isrequest.gif" class="inlineimg" alt="'.$lang->browse['requested'].'" title="'.$lang->browse['requested'].'" />' '');
        
$isnuked = ($torrents['isnuked'] == 'yes' '<img src="'.$BASEURL.'/'.$pic_base_url.'isnuked.gif" class="inlineimg" alt="'.sprintf($lang->browse['nuked'], $torrents['WhyNuked']).'" title="'.sprintf($lang->browse['nuked'], $torrents['WhyNuked']).'" />' '');
        
$issticky = ($torrents['sticky'] == 'yes' '<img src="'.$BASEURL.'/'.$pic_base_url.'sticky.gif" alt="'.$lang->browse['sticky'].'" title="'.$lang->browse['sticky'].'" />' '');
        
$isexternal = ($torrents['ts_external'] == 'yes' && $showupdatebutton "<a href=\"#showtorrent".$torrents['id']."\" onclick=\"UpdateExternalTorrent('./include/ts_external_scrape/ts_update.php','id=".$torrents['id']."&ajax_update=true',".$torrents['id'].")\"><img src='".$BASEURL."/".$pic_base_url."external.gif' border='0' alt='".$lang->browse['update']."' title='".$lang->browse['update']."' class='inlineimg' /></a>" : (isset($_GET['tsuid']) && $_GET['tsuid'] == $torrents['id'] ? "<img src='".$BASEURL."/".$pic_base_url."input_true.gif' border='0' alt='".$lang->browse['updated']."' title='".$lang->browse['updated']."' />" ""));
        
$isdoubleupload = ($torrents['doubleupload'] == 'yes' || ($_x2mod && $torrents['ts_external'] != 'yes') ? '<img src="'.$BASEURL.'/'.$pic_base_url.'x2.gif" alt="'.$lang->browse['dupload'].'" title="'.$lang->browse['dupload'].'" class="inlineimg" />' '');
        
$javascript_tname addslashes(htmlspecialchars($torrents['name']));
        
$torrents['name'] = cutename($orj_name_,60);
        
$torrent_image '<a href="'.$seolink.'" target="_self" /><img src="'.$BASEURL.'/'.$pic_base_url.$table_cat.'/'.$torrents['image'].'" border="0" alt="'.$categoryinfo.'" title="'.$categoryinfo.'" /></a>';
        
$name_torrent '<a href="'.($UseQuickMenu '#' $seolink2).'" id="torrentmenu'.$torrents['id'].'" /><b>'.(!empty($keywords) ? highlight(htmlspecialchars_uni($keywords), $torrents['name']) : $torrents['name']).'</b></a> '.$isnew.' '.$issticky.' '.$isfree.' '.$speed2.' '.$speed3.' '.$issilver.' '.$isdoubleupload.' '.$isrequest.' '.$isnuked.' <span id="isexternal_'.$torrents['id'].'">'.$isexternal.'</span>';  
        if (
$torrents['moderated'] == 'yes'){
            
$torrent_download_link = (!$is_bookmarked_page '<a href="'.$seolink3.'" title="'.$downloadinfo.'" alt="'.$downloadinfo.'" '.$warnexternal.'><img src="../pic/yes.png"></a>' '<a href="'.$BASEURL.'/bookmarks.php?torrentid='.$torrents['id'].'&amp;action=delete" title="" alt="" /><img src="'.$BASEURL.'/'.$pic_base_url.'delete.gif"></a>');
            }
        if (
$torrents['moderated'] == 'error'){
            
$torrent_download_link = (!$is_bookmarked_page '<img src="../pic/bad.png" width="20" height="20" title="Hibás feltöltés, javítás alatt!">' '');
            }
        if (
$torrents['moderated'] == 'no'){
            
$torrent_download_link = (!$is_bookmarked_page '<img src="../pic/um.png" width="20" height="20" title="Ez a torrent még nincs moderálva!">' '');
            }
        if (
$progressbar == 'yes')
        {
            
$shareratio = ($torrents['seeders'] == : ($torrents['leechers'] == 100 sprintf("%.2f", ($torrents['seeders'] / $torrents['leechers']) * 100)));
            
$health ts_external_share_ratio($shareratio);
            
$torrent_info '<td align="center">'.$health.'</td>';
        }

        if (
$torrentspeed == 'yes')
        {
            if (
$torrents['ts_external'] == 'yes')
            {
                
$speed $lang->browse['external'];
            }
            else
            {
                if (
$torrents['seeders'] > && $torrents['leechers'] > 0)
                {
                    
$speed mksize($torrents['totalspeed']) . '/s';
                }
                else
                {
                    
$speed $lang->browse['notraffic'];
                }
            }
            
$speed '<td align="center">'.$speed.'</td>';
        }

        
$torrents['size'] = mksize($torrents['size']);

        
$ShowImdb=false;
        if (
$IMDBRating TSSEGetIMDBRatingImage($torrents['t_link']))
        {
            
$ShowImdb=true;
        }

        
$TorrentAdded '<br />&nbsp;<b>'.$lang->global['added'].':</b> '.my_datee($dateformat$torrents['added']).' '.my_datee($timeformat$torrents['added']).($ShowImdb '<br /><font color=#790000><b>IMDb:</b></font>&nbsp;'.$IMDBRating['image'].' '.$IMDBRating['rating'] : '').('&nbsp;&nbsp;<font color=black><b>Műfaj:&nbsp; '.$genre.'</b></font>');

/**
 * @author mmisu120000
 * @copyright 2010
 * @mod name Show torrents by day
 * @version v1.1
 */

/** Make some date varibles **/
$day_added $torrents['added'];
$day_show strtotime($day_added);
$thisdate date('Y-m-d',$day_show);

/** If date already exist, disable $cleandate varible **/
if($thisdate==$prevdate){
$cleandate '';

/** If date does not exist, make some varibles **/
}else{
$TorrentAdded '<br />&nbsp;<b><font color=red>'.$lang->global['added'].':</b> '.my_datee($dateformat$torrents['added']).' '.my_datee($timeformat$torrents['added']).($ShowImdb '</font><br />&nbsp;'.$IMDBRating['image'].' '.$IMDBRating['rating'] : '');  
$day_added 'Torrent feltöltve:  '.my_datee($dateformat$torrents['added']); // You can change this to something else
$cleandate "<tr><td align = 'center' style='background-color: #999999; color: black;' colspan=15><b>$day_added</b></td></tr>\n"// This also...
}
/** Prevent that "torrents added..." wont appear again with the same date **/
$prevdate $thisdate;

/** If torrents not listed by added date **/

if ($torrents["sticky"] == "no")
if(!
$_GET['sort'] && !$_GET['d']){
   
$zzzzzz $cleandate;
}
        
$contentmiddle .= $zzzzzz '
        <tr'
.($torrents['sticky'] == 'yes' ' class="sticky"' '').'>





            <td width="1">'
.$torrent_image.'</td>
            <td align="left">'
.$showwait.'<a name="#showtorrent'.$torrents['id'].'"></a>&nbsp;'.$name_torrent.$TorrentAdded.($isScene '<br />&nbsp;'.$isScene '').'</td>
            <td align="center">'
.$torrent_download_link.'</td>
            <td align="center">'
.$torrent_files.'</td>
            <td align="center">'
.$torrent_comments.'</td>
            <td align="center"><div id="seeders_'
.$torrents['id'].'">'.$torrent_seeders.'</div></td>
            <td align="center"><div id="leechers_'
.$torrents['id'].'">'.$torrent_leechers.'</div></td>
            '
.$torrent_info.'
            '
.$speed.'
            <td align="center">'
.$torrents['size'].'<br />'.$torrent_snatched.'</td>
            <td align="center">'
.$uploader.'</td>
            '
.($is_mod '
            <td align="center"><input type="checkbox" name="torrentid[]" value="'
.$torrents['id'].'" checkme="group1" /></td>' '').'
        </tr>'
;

        
$menu_nav .= ($UseQuickMenu '
        <script type="text/javascript">
            menu_register("torrentmenu'
.$torrents['id'].'", true);
        </script>
        <div id="torrentmenu'
.$torrents['id'].'_menu" class="menu_popup" style="display:none;">
            <table border="1" cellspacing="0" cellpadding="2">
                <tr>
                    <td colspan="2" align="center" class="thead"><b>'
.$lang->global['quickmenu'].'</b></td>
                </tr>
                <tr>
                    <td class="subheader"><a href="'
.$seolink3.'" title="'.$downloadinfo.'" alt="'.$downloadinfo.'"'.$warnexternal.' /><b>'.$lang->browse['download'].'</b></a></td>
                    <td rowspan="'
.($is_mod 3).'" align="center" valign="middle"><div align="center">'.(!empty($torrents['t_image']) ? '<a href="javascript:popImage(\''.htmlspecialchars_uni($torrents['t_image']).'\',\'Image Preview\')"><span class="smalltext">'.$lang->browse['t_image'].'</span></a><br /><img src="'.htmlspecialchars_uni($torrents['t_image']).'" border="0" height="150" width="150" alt="'.strip_tags($torrents['name']).'" title="'.strip_tags($torrents['name']).'" \>' $lang->browse['nopreview']).'</div></td>
                </tr>
                <tr>
                    <td class="subheader"><a href="'
.$seolink2.'"><b>'.$lang->browse['viewtorrent'].'</b></a></td>
                </tr>
                <tr>
                    <td class="subheader"><a href="'
.$BASEURL.'/details.php?id='.$torrents['id'].'&tab=comments"><b>'.$lang->browse['viewcomments'].'</b></a></td>
                </tr>'
.($is_mod '
                <tr>
                    <td class="subheader"><a href="'
.$BASEURL.'/admin/index.php?act=torrent_info&amp;id='.$torrents['id'].'"><b>'.$lang->browse['tinfo'].'</b></a></td>
                </tr>
                <tr>
                    <td class="subheader"><a href="'
.$BASEURL.'/edit.php?id='.$torrents['id'].'"><b>'.$lang->browse['edit'].'</b></a></td>
                </tr>
                <tr>
                    <td class="subheader"><a href="#quickedit" onClick="QuickEditTorrentSubject(\''
.$torrents['id'].'\', \''.$javascript_tname.'\');"><b>'.$lang->browse['quickedit'].'</b></a></td>
                </tr>
                <tr>
                    <td class="subheader"><a href="'
.$BASEURL.'/admin/index.php?act=nuketorrent&amp;id='.$torrents['id'].'"><b>'.$lang->browse['nuke'].'</b></a></td>
                </tr>
                <tr>
                    <td class="subheader"><a href="'
.$BASEURL.'/admin/index.php?act=fastdelete&amp;id='.$torrents['id'].'"><b>'.$lang->browse['delete'].'</b></a></td></td>
                </tr>' 
'').'
            </table>
        </div>' 
'').($disable_user_menu == false '
        <script type="text/javascript">
            menu_register("torrentuser'
.$torrents['owner'].$torrents['id'].'", true);
        </script>
        <div id="torrentuser'
.$torrents['owner'].$torrents['id'].'_menu" class="menu_popup" style="display:none;">
            <table border="1" cellspacing="0" cellpadding="2">
                <tr>
                    <td align="center" class="thead"><b>'
.$lang->global['quickmenu'].' '.$torrents['username'].'</b></td>
                </tr>
                <tr>
                    <td class="subheader"><a href="'
.ts_seo($torrents['owner'], $torrents['username']).'">'.$lang->global['qinfo1'].'</a></td>
                </tr>
                <tr>
                    <td class="subheader"><a href="'
.$BASEURL.'/browse.php?do=search&keywords='.htmlspecialchars_uni($torrents['username']).'&category=0&search_type=t_uploader">'.sprintf($lang->global['qinfo9'], $torrents['username']).'</a></td>
                </tr>
                <tr>
                    <td class="subheader"><a href="'
.$BASEURL.'/sendmessage.php?receiver='.$torrents['owner'].'">'.sprintf($lang->global['qinfo2'], $torrents['username']).'</td>
                </tr>
                <tr>
                    <td class="subheader"><a href="'
.$BASEURL.'/friends.php?action=add_friend&friendid='.$torrents['owner'].'">'.sprintf($lang->global['qinfo5'], $torrents['username']).'</td>
                </tr>
                '
.($is_mod '
                <tr>
                    <td class="subheader"><a href="'
.$BASEURL.'/admin/edituser.php?action=edituser&userid='.$torrents['owner'].'">'.$lang->global['qinfo6'].'</a></td></tr><tr><td class="subheader"><a href="'.$BASEURL.'/admin/edituser.php?action=warnuser&userid='.$torrents['owner'].'">'.$lang->global['qinfo7'].'</td>
                </tr>' 
'').'
            </table>
        </div>' 
'');
    }
}
else
{
    
$contentmiddle '
        <tr>
            <td colspan="'
.$__colspan.'">
                '
.$lang->browse['tryagain'].'
            </td>
        </tr>'
;
}

$contentmiddle .= ($is_mod '
<tr>
    <td colspan="'
.$__colspan.'" align="right">
        <p id="selectaction" style="display:block; margin-top: 5px; margin-right: 5px;">
                Művelet kiválasztása:
            <select name="actiontype" onchange="check_it(this)">
                <option value="0">Művelet választás</option>
                <option value="move">Torrent áthelyezése</option>
                <option value="delete">Torrent törlése</option>
                <option value="sticky">A torrent ajánlott legyen vagy ne</option>
                <option value="free">A torrent ingyenes legyen vagy ne</option>
                <option value="silver">A torrent ezüst legyen vagy ne</option>
                <option value="visible">A torrent látható legyen vagy ne</option>
                <option value="anonymous">A torrent névtelen legyen vagy ne</option>
                <option value="banned">A torrent bannolt legyen vagy ne</option>
                <option value="nuke">Nuke torrent vagy ne</option>
                <option value="doubleupload">Dupla feltöltésű legyen IGEN/NEM</option>
                <option value="openclose">A torrent hozzászólást tilt vagy nem</option>
            </select>
        </p>
        <p id="movetorrent" style="display:none; margin-right: 5px;">
            Select Category: '
.$catdropdown.'
        </p>
        <p id="doaction" style="display:block; margin-right: 5px;">
            <input type="submit" value="mehet"> <input type="reset" value="alaphelyzet" />
        </p>
    </td>
</tr>
</form>
</table>
'</table>').'
'
.$menu_nav.'
<script type="text/javascript">
    menu.activate(true);
</script>
<script type="text/javascript" src="'
.$BASEURL.'/scripts/ts_update.js?v='.O_SCRIPT_VERSION.'"></script>';

if (
count($pagelinks) > 0)
{
    
$hiddenvalues;
    foreach (
$pagelinks as $name)
    {
        
$values explode('='$name);
        
$hiddenvalues .= '
        <input type="hidden" name="'
.$values[0].'" value="'.$values[1].'" />
        '
;
    }
}

if (isset(
$_GET['category']) && is_valid_id($_GET['category']) && empty($quick_search))
{
    
$sqfield "&amp;browse_categories&amp;category=".intval($_GET['category']);
}

$finishcontent '
<table width="100%" cellpadding="5" cellspacing="0" border="0">
    <tr>
        <td class="none" width="40%">
            <fieldset style="text-align: center; line-height: 25px; padding: 5px; border: solid 1px #000;">
                <LEGEND>'
.$lang->browse['b_info'].'</LEGEND>
                '
.str_replace("|link|""$BASEURL/$pic_base_url"$lang->browse['legend_browse']).'
            </fieldset>
        </td>
        <td class="none" width="60%">
            <fieldset style="text-align: center; line-height: 25px; padding: 5px; border: solid 1px #000;">
                <LEGEND>'
.$lang->browse['f_options'].'</LEGEND>
                <span style="float: right;">
                    <form method="post" action="'
.$_SERVER['SCRIPT_NAME'].'?page='.intval(isset($_GET['page']) ? $_GET['page']: 0).(isset($sqfield) ? $sqfield '').'">
                        <input type="hidden" name="sort_order" value="yes" />
                        <input type="hidden" name="page" value="'
.intval(isset($_GET['page']) ? $_GET['page']: 0).'" />
                        '
.(isset($hiddenvalues) ? $hiddenvalues '').'
                        '
.$lang->browse['sortby1'].'
                        <select name="sortby">
                            <option value="added"'
.(isset($sortby) && $sortby == 'added' ' selected="selected"' '').'>'.$lang->global['added'].'</option>
                            <option value="numfiles"'
.(isset($sortby) && $sortby == 'numfiles' ' selected="selected"' '').'>'.$lang->browse['sortby2'].'</option>
                            <option value="comments"'
.(isset($sortby) && $sortby == 'comments' ' selected="selected"' '').'>'.$lang->browse['sortby3'].'</option>
                            <option value="seeders"'
.(isset($sortby) && $sortby == 'seeders' ' selected="selected"' '').'>'.$lang->browse['sortby4'].'</option>
                            <option value="leechers"'
.(isset($sortby) && $sortby == 'leechers' ' selected="selected"' '').'>'.$lang->browse['sortby5'].'</option>
                            <option value="size"'
.(isset($sortby) && $sortby == 'size' ' selected="selected"' '').'>'.$lang->browse['sortby6'].'</option>
                            <option value="times_completed"'
.(isset($sortby) && $sortby == 'times_completed' ' selected="selected"' '').'>'.$lang->browse['sortby7'].'</option>
                            <option value="owner"'
.(isset($sortby) && $sortby == 'owner' ' selected="selected"' '').'>'.$lang->browse['sortby8'].'</option>
                            <option value="sticky"'
.(isset($sortby) && $sortby == 'sticky' ' selected="selected"' '').'>'.$lang->browse['sortby9'].'</option>
                            '
.($torrentspeed == 'yes' '<option value="totalspeed"'.(isset($sortby) && $sortby == 'totalspeed' ' selected="selected"' '').'>'.$lang->browse['speed'].'</option>' '').'
                        </select>
                        '
.$lang->browse['orderby1'].'
                        <select name="orderby">
                            <option value="ASC"'
.(isset($orderby) && $orderby == 'ASC' ' selected="selected"' '').'>'.$lang->browse['orderby3'].'</option>
                            <option value="DESC"'
.(isset($orderby) && $orderby == 'DESC' ' selected="selected"' '').'>'.$lang->browse['orderby2'].'</option>
                        </select>
                        <input type="image" class="none" style="vertical-align: middle;" src="'
.$BASEURL.'/'.$pic_base_url.'torrent_search.gif" alt="'.$lang->browse['tsearch'].'" />&nbsp;&nbsp;
                    </form>
                </span>
            </fieldset>
        </td>
    </tr>
</table>
'
;

$QuickEditTorrentSubject='';
if (
$is_mod)
{
    
$QuickEditTorrentSubject '
    <script type="text/javascript">
        function checkSubject()
        {
            var userEntered = document.getElementById(\'subject\').value;
            if (userEntered == "")
            {
                alert("'
.$lang->global['dontleavefieldsblank'].'");
                document.QuickEditForm.subject.focus();
                return false;
            }
            else
            {
                return true;
            }
        }
        function QuickEditTorrentSubject(TorrentID,TorrentSubject)
        {
            document.getElementById(\'quickedit\').innerHTML = \'<br /><table width="100%" border="0" cellspacing="0" cellpadding="5" align="center"><tr><td class="thead">'
.$lang->browse['quickedit'].'</td></tr><tr><td><form method="post" action="'.$_SERVER['SCRIPT_NAME'].'?page='.intval(isset($_GET['page']) ? $_GET['page'] : 0).'&amp;'.(isset($pagelinks) && count($pagelinks) > implode('&amp;'$pagelinks).'&amp;' '').(isset($pagelinks2) && count($pagelinks2) > implode('&amp;'$pagelinks2) : '').'" onSubmit="return checkSubject()" name="QuickEditForm"><input type="hidden" name="tid" value="\'+TorrentID+\'" /> <input type="text" id="subject" name="subject" value="\'+TorrentSubject+\'" size="100" /> <input type="submit" value="'.$lang->global['buttonsave'].'" class="button" /> <input type="reset" value="'.$lang->global['buttonreset'].'" class="button" /></form></td></tr></table>\';
        }
    </script>
    '
;
}
echo 
$___notice.$categories.$search.($pagertop $pagertop '<p></p>').'<div style="display:block;" id="showcontents">'.$contentheader.$contentmiddle.'</div>'.($pagerbottom $pagerbottom '').$finishcontent.$QuickEditTorrentSubject;
unset(
$categories,$search,$contentheader,$contentmiddle,$finishcontent);
stdfoot();
# Function get_slr_color v.0.1
function get_slr_color($ratio)
{
    if (
$ratio 0.025) return "#ff0000";
    if (
$ratio 0.05) return "#ee0000";
    if (
$ratio 0.075) return "#dd0000";
    if (
$ratio 0.1) return "#cc0000";
    if (
$ratio 0.125) return "#bb0000";
    if (
$ratio 0.15) return "#aa0000";
    if (
$ratio 0.175) return "#990000";
    if (
$ratio 0.2) return "#880000";
    if (
$ratio 0.225) return "#770000";
    if (
$ratio 0.25) return "#660000";
    if (
$ratio 0.275) return "#550000";
    if (
$ratio 0.3) return "#440000";
    if (
$ratio 0.325) return "#330000";
    if (
$ratio 0.35) return "#220000";
    if (
$ratio 0.375) return "#110000";
    return 
"#000000";
}
# Function unesc v.0.1
function unesc($x)
{
    if (
get_magic_quotes_gpc()) return stripslashes($x);
    return 
$x;
}
?>
browse2.php

PHP Code:
<?php

/*

************************************************

*==========[TS Special Edition v.5.6]==========*

************************************************

*              Special Thanks To               *

*        DrNet - wWw.SpecialCoders.CoM         *

*          Vinson - wWw.Decode4u.CoM           *

*    MrDecoder - wWw.Fearless-Releases.CoM     *

*           Fynnon - wWw.BvList.CoM            *

*==============================================*

*   Note: Don't Modify Or Delete This Credit   *

*     Next Target: TS Special Edition v5.7     *

*     TS SE WILL BE ALWAYS FREE SOFTWARE !     *

************************************************

*/

require_once('global.php');

gzip();

dbconn(true);

maxsysop();

define('B_VERSION''4.6.3');
function 
execcommand_pmmessage ($message '<center><img src="/gallery/prohibition-unauth-2.gif"></center><br><br><div style="background: #FFECCE; border: 6px solid #EA5F00; padding-left: 6px;"><center><font size="6">Vous n avez plus acces aux torrents ! vous devez lire vos messages avant (<a href=messages.php target=_top>cliquez ici pour lire vos messages <img src="/pic/pn_inboxnew.gif">
</a>)</font></center></div><br><center><a href=messages.php target=_top><img src="/gallery/Email%20Logo.gif"></a></center>'
$forcemessage false)
  {
    if ((
mysql_affected_rows () OR $forcemessage))
    {
      echo 
$message;
          exit();
    }


  } 


if (
$MEMBERSONLY == 'yes')

{

    
loggedinorreturn();

    
parked();

}
 
$QueryF = @sql_query ('' 'SELECT COUNT(*) FROM messages WHERE receiver=' $CURUSER[id] . ' and unread=\'yes\'') OR sqlerr (__FILE__532);
  
$message mysql_fetch_row ($QueryF);
  
$unreadmail $message[0];
if (
$unreadmail){
        
$unread=execcommand_pmmessage();
        
}else{
$unread='';
}


$lang->load('browse');

$is_mod is_mod($usergroups);

$special_search = (isset($_GET['special_search']) ? trim($_GET['special_search']) : '');

$do = isset($_POST['do']) ? $_POST['do'] : (isset($_GET['do']) ? $_GET['do'] : '');

$quick_search = isset($_POST['quick_search']) ? trim($_POST['quick_search']) : (isset($_GET['quick_search']) ? trim($_GET['quick_search']) : '');

$search_type $javaalert $from '';

$pagelinks = array();

$showvisible true;

$is_bookmark_page false;

$UseQuickMenu preg_match('#P1#is'$CURUSER['options']);



if (
strtoupper($_SERVER['REQUEST_METHOD']) == 'POST' AND $is_mod AND !empty($_POST['tid']))

{

    if ((
$tid intval($_POST['tid'])) AND is_valid_id($tid) AND ($torrent trim($_POST['subject'])) AND !empty($torrent))

    {

        
$torrent unesc($torrent);

        
$torrent str_replace('_'' '$torrent);

        
sql_query("UPDATE torrents SET name = ".sqlesc($torrent)." WHERE id = ".sqlesc($tid));

    }

}



if (
$special_search == 'myreseeds')

{

    
$extraqueries " AND t.seeders = 0 AND t.leechers > 0 AND t.owner = ".sqlesc($CURUSER['id']);

    
$pagelinks[] = "special_search=myreseeds";

    
$sqfield "&amp;special_search=myreseeds";

    
$showvisible false;

}

elseif (
$special_search == 'mybookmarks')

{

    
$from 'FROM bookmarks b LEFT JOIN torrents t ON (b.torrentid = t.id)';

    
$extraqueries " AND b.userid = ".sqlesc($CURUSER['id']);

    
$pagelinks[] = "special_search=mybookmarks";

    
$sqfield "&amp;special_search=mybookmarks";

    
$showvisible false;

    
$is_bookmark_page true;

}

elseif (
$special_search == 'mytorrents')

{

    
$extraqueries " AND t.owner = ".sqlesc($CURUSER['id']);

    
$pagelinks[] = "special_search=mytorrents";

    
$sqfield "&amp;special_search=mytorrents";

    
$showvisible false;

}

elseif (
$special_search == 'weaktorrents')

{

    
$extraqueries " AND t.visible = 'no' OR (t.leechers > 0 AND t.seeders = 0) OR (t.leechers = 0 AND t.seeders = 0)";

    
$pagelinks[] = "special_search=weaktorrents";

    
$sqfield "&amp;special_search=weaktorrents";

    
$showvisible false;

    
$lang->browse['btitle'] = $lang->global['weaktorrents'];

}

elseif (
$do == 'search')

{

    
$extraquery = array();

    
$keywords = isset($_POST['keywords']) ? $_POST['keywords'] : (isset($_GET['keywords']) ? $_GET['keywords'] : '');

    if (
$_GET['tags'] AND $_GET['tags'] == 'true' AND !empty($keywords))

    {

        
$keywords urldecode($keywords);

    }

    elseif (!empty(
$keywords))

    {

        
$keywords trim($keywords);

    }

    
$category = isset($_POST['category']) ? intval($_POST['category']) : (isset($_GET['category']) ? intval($_GET['category']) : 0);

    
$search_type = isset($_POST['search_type']) ? trim($_POST['search_type']) : (isset($_GET['search_type']) ? trim($_GET['search_type']) : '');



    
$query sql_query("SHOW VARIABLES LIKE 'ft_min_word_len';");

    
$array mysql_fetch_assoc($query);

    
$min_length $array['Value'];

    if(
is_numeric($min_length))

    {

        
$minsearchword $min_length;

    }

    else

    {

        
$minsearchword 3;

    }



    if (
strlen($keywords) >= $minsearchword && !empty($search_type))

    {

        switch (
$search_type)

        {

            case 
't_name':

                
$extraquery[] = "(MATCH (t.name) AGAINST ('".mysql_real_escape_string($keywords)."*' IN BOOLEAN MODE))";

                break;

            case 
't_description':

                
$extraquery[] = "(MATCH (t.descr) AGAINST ('".mysql_real_escape_string($keywords)."*' IN BOOLEAN MODE))";

                break;

            case 
't_both':

                
$extraquery[] = "(MATCH (t.name,t.descr) AGAINST ('".mysql_real_escape_string($keywords)."*' IN BOOLEAN MODE))";

                break;

            case 
't_uploader':

                
$query sql_query("SELECT id FROM users WHERE username = ".sqlesc($keywords)." LIMIT 1");

                if (
mysql_num_rows($query) > 0)

                {

                    
$user mysql_fetch_assoc($query);

                    
$extraquery[] = "t.owner = ".sqlesc($user['id']).(!$is_mod " AND t.anonymous != 'yes'" "");

                }

                else

                    
$extraquery[] = "t.owner = ".sqlesc($keywords);

                break;

            case 
't_genre':

                
$extraquery[] = "(MATCH (t.t_link) AGAINST ('".mysql_real_escape_string($keywords)."*' IN BOOLEAN MODE))";

            break;

        }

    }

    else

    {

        
$javaalert '

        <script type="text/javascript">

            alert("'
.sprintf($lang->browse['serror'], $minsearchword).'");

        </script>

        '
;

    }

    if (
is_valid_id($category) && $category 0)

    {

        
$extraquery[] = "t.category = ".$category;

    }

    if (
count($extraquery) > 0)

    {

        
$extraqueries ' AND ';

        
$extraqueries .= implode(' AND '$extraquery);

        
$pagelinks[] = 'do=search';

        
$pagelinks[] = 'keywords='.urlencode(htmlspecialchars_uni($keywords));

        
$pagelinks[] = 'category='.$category;

        
$pagelinks[] = 'search_type='.urlencode(htmlspecialchars_uni($search_type));

        
$showvisible false;

    }

}

elseif (isset(
$_GET['category']) && is_valid_id($_GET['category']) && empty($quick_search))

{

    
$category intval($_GET['category']);

    
$query sql_query("SELECT id FROM categories WHERE type='s' AND pid = $category");

    if (
mysql_num_rows($query) > 0)

    {

        
$squerycats=array();

        while (
$squery=mysql_fetch_assoc($query))

        {

            
$squerycats[] = $squery['id'];

        }

        
$extraqueries ' AND t.category IN ('.$category.','.implode(','$squerycats).')';

    }

    else

    {

        
$extraqueries ' AND t.category = '.$category;

    }

    
$pagelinks[] = 'category='.$category;

}

elseif (!empty(
$quick_search))

{

    
$category = isset($_POST['category']) ? intval($_POST['category']) : (isset($_GET['category']) ? intval($_GET['category']) : '');

    switch(
$quick_search)

    {

        case 
'show_daily_torrents':

            
$stime TIMENOW-(60*60*24); // daily

            
$extraquery[] = "UNIX_TIMESTAMP(t.added) > '$stime'";

            
$pagelinks[] = 'quick_search=show_daily_torrents';

            break;

        case 
'show_weekly_torrents':

            
$stime TIMENOW-(60*60*(24*7)); // weekly

            
$extraquery[] = "UNIX_TIMESTAMP(t.added) > '$stime'";

            
$pagelinks[] = 'quick_search=show_today_torrents';

            break;

        case 
'show_montly_torrents':

            
$stime TIMENOW-(60*60*(24*28)); // montly

            
$extraquery[] = "UNIX_TIMESTAMP(t.added) > '$stime'";

            
$pagelinks[] = 'quick_search=show_today_torrents';

            break;

        case 
'show_dead_torrents':

            
$showvisible false;

            
$extraquery[] = "t.visible = 'no'";

            
$pagelinks[] = 'quick_search=show_dead_torrents';

            break;

        case 
'show_recommend_torrents':

            
$extraquery[] = "t.sticky = 'yes'";

            
$pagelinks[] = 'quick_search=show_recommend_torrents';

            break;

        case 
'show_free_torrents':

            
$extraquery[] = "t.free = 'yes'";

            
$pagelinks[] = 'quick_search=show_free_torrents';

            break;

        case 
'show_silver_torrents':

            
$extraquery[] = "t.silver = 'yes'";

            
$pagelinks[] = 'quick_search=show_silver_torrents';

            break;

        case 
'show_doubleupload_torrents':

            
$extraquery[] = "t.doubleupload = 'yes'";

            
$pagelinks[] = 'quick_search=show_doubleupload_torrents';

            break;

        case 
'show_external_torrents':

            
$extraquery[] = "t.ts_external = 'yes'";

            
$pagelinks[] = 'quick_search=show_external_torrents';

            break;

        case 
'show_scene_torrents':

            
$extraquery[] = "t.isScene > 0";

            
$pagelinks[] = 'quick_search=show_scene_torrents';

            break;

    }

    if (
$category 0)

    {

        
$extraquery[] = 't.category IN ('.$category.')';

        
$pagelinks[] = 'category='.$category;

    }

    if (
count($extraquery) > 0)

    {

        
$extraqueries ' AND ';

        
$extraqueries .= implode(' AND '$extraquery);

    }

}



if (
$usergroups['isvipgroup'] != 'yes' && !$is_mod && $waitsystem == 'yes')

{

    include_once(
INC_PATH.'/readconfig_waitslot.php');

    
$gigs $CURUSER['uploaded'] / (1024*1024*1024);

    
$ratio = (($CURUSER['downloaded'] > 0) ? ($CURUSER['uploaded'] / $CURUSER['downloaded']) : 0);

    if (
$waitsystemtype == 1)

    {

      if (
$ratio $ratio1 || $gigs $upload1$wait $delay1;

        elseif (
$ratio $ratio2 || $gigs $upload2$wait $delay2;

            elseif (
$ratio $ratio3 || $gigs $upload3$wait $delay3;

                elseif (
$ratio $ratio4 || $gigs $upload4$wait $delay4;

                    else 
$wait 0;

    }

    else

    {

      
$wait $usergroups['waitlimit'];

    }

}

else

{

    
$wait '';

}



stdhead($lang->browse['btitle'],true,'supernote'$javaalert);

$_freelechmod $_silverleechmod $_x2mod false;

include(
TSDIR.'/'.$cache.'/freeleech.php');

include(
INC_PATH.'/readconfig_kps.php');

if (
$__F_START get_date_time() && $__F_END get_date_time())

{

    switch(
$__FLSTYPE)

    {

        case 
'freeleech';

            
$___notice show_notice(sprintf($lang->browse['f_leech'], $__F_START$__F_END),false,$lang->browse['f_leech_h']);

            
$_freelechmod true;

        break;

        case 
'silverleech';

            
$___notice show_notice(sprintf($lang->browse['s_leech'], $__F_START$__F_END),false,$lang->browse['s_leech_h']);

            
$_silverleechmod true;

        break;

        case 
'doubleupload';

            
$___notice show_notice(sprintf($lang->browse['d_leech'], $__F_START$__F_END),false,$lang->browse['d_leech_h']);

            
$_x2mod true;

        break;

    }

}

elseif (
$bdayreward == 'yes' AND $bdayrewardtype)

{

    
$curuserbday explode('-'$CURUSER['birthday']);

    if (
date('j-n') === $curuserbday[0].'-'.$curuserbday[1])

    {

        switch (
$bdayrewardtype)

        {

            case 
'freeleech';

                
$___notice show_notice(sprintf($lang->browse['f_leech'], $curuserbday[0].'-'.$curuserbday[1].'-'.date('Y'), ($curuserbday[0] + 1).'-'.$curuserbday[1].'-'.date('Y')),false,$lang->browse['f_leech_h']);

            break;

            case 
'silverleech';

                
$___notice show_notice(sprintf($lang->browse['s_leech'], $curuserbday[0].'-'.$curuserbday[1].'-'.date('Y'), ($curuserbday[0] + 1).'-'.$curuserbday[1].'-'.date('Y')),false,$lang->browse['s_leech_h']);

            break;

            case 
'doubleupload';

                
$___notice show_notice(sprintf($lang->browse['d_leech'], $curuserbday[0].'-'.$curuserbday[1].'-'.date('Y'), ($curuserbday[0] + 1).'-'.$curuserbday[1].'-'.date('Y')),false,$lang->browse['d_leech_h']);

            break;

        }

    }

}



require(
TSDIR.'/'.$cache.'/categories.php');

$subcategories = array();

$searcincategories = array();

if (
count($_categoriesS) > 0)

{

    foreach (
$_categoriesS as $sc)

    {

        
$sc['name'] = htmlspecialchars_uni($sc['name']);

        
$searcincategories[] = $sc['id'];

        
$seolink ts_seo($sc['id'],$sc['name'],'c');

        
$scdesc htmlspecialchars_uni($sc['cat_desc']);

        
$subcategories[$sc['pid']][] = '<font class="main"><a href="'.$seolink.'" target="_self" alt="'.$scdesc.'" title="'.$scdesc.'" />'.(isset($category) && $category == $sc['id'] || strpos($CURUSER['notifs'], '[cat'.$sc['id'].']') !== FALSE '<span style="background-color: rgb( 149, 206, 145);">'.$sc['name'].'</span>' $sc['name']).'</a></font>';

    }

}



$count 0;

$categories '

<table width="100%" border="1" cellspacing="0" cellpadding="5" align="center">

    <tr>

        <td class="thead">'
.ts_collapse('cats').'

            <div align="center">

                <strong>

                    '
.$lang->browse['tcategory'].'

                </strong>

            </div>

        </td>

    </tr>

        '
.ts_collapse('cats',2).'

    <tr>

        <td align="center">

            <table border="0" cellspacing="0" cellpadding="0" align="center">

                <tr class="none">

'
;



if ((
$rows count($_categoriesC)) > 0)
{
    foreach (
$_categoriesC as $c)
    {
        
$searcincategories[] = $c['id'];
        if (
$count && $count == 0)
        {
            
$categories .= '</tr><tr class="none">';
        }
        
$seolink ts_seo($c['id'],$c['name'],'c');
        
$cname htmlspecialchars_uni($c['name']);
        
$cdesc htmlspecialchars_uni($c['cat_desc']);
        
$categories .= '
        <td class="none">
            <table border="0" cellspacing="0" cellpadding="0">
                <tr>
                    <td width="48" class="none" height="36" valign="top" align="center" style="padding: 3px;">
                        <a href="/browse1ModTable.php?category?browse_categories&category=' 
$c['id'] . '"><img src="'.$BASEURL.'/'.$pic_base_url.$table_cat.'/'.$c['image'].'" border="0" alt="'.$cname.'" title="'.$cname.'" /></a>
                    </td>

                </tr>
            </table>
        </td>'
;
        
$count++;
    }
}

$categories .= '
    </tr></table></td></tr></table><p></p>'
;

if (
preg_match("#\[cat.+#i"$CURUSER['notifs']) AND count($extraquery) == AND count($pagelinks) == 0)

{

    
$defaultcategories = array();

    foreach (
$searcincategories as $catid)

    {

        if (
strpos($CURUSER['notifs'], '[cat'.$catid.']') !== FALSE)

        {

            
$defaultcategories[] = $catid;

        }

    }

    if (
count($defaultcategories) > 0)

    {

        
$extraqueries ' AND t.category IN ('.implode(','$defaultcategories).')';

    }

}



require_once(
INC_PATH.'/functions_category.php');

$catdropdown ts_category_list('category',(isset($category) ? $category ''),'<option value="0" style="color: gray;">'.$lang->browse['alltypes'].'</option>');



$search '

<script type="text/javascript" src="'
.$BASEURL.'/scripts/prototype.js?v='.O_SCRIPT_VERSION.'"></script>

<script type="text/javascript" src="'
.$BASEURL.'/ratings/js/scriptaculous.js?v='.O_SCRIPT_VERSION.'"></script>

<script type="text/javascript" src="'
.$BASEURL.'/scripts/autocomplete.js?v='.O_SCRIPT_VERSION.'"></script>

<script type="text/javascript" src="'
.$BASEURL.'/scripts/quick_torrents.js?v='.O_SCRIPT_VERSION.'"></script>

<script type="text/javascript">TSShowTorrents(\'new\');</script>
<div id="TSShowLatestTorrents" name="TSShowLatestTorrents"></div>
<table width="100%" border="1" cellspacing="0" cellpadding="5" align="center">
    <tr>
        <td class="thead"><center><b>Newest Torrents</b></center></td></tr><tr>
                <td class=tablea><iframe src="carbrowse.php" frameborder="0" scrolling="no" style="width:100%;" height="100"></iframe></td></tr></table><br>

<table width="100%" border="1" cellspacing="0" cellpadding="5" align="center">                
        <td class="thead">'
.ts_collapse('cats_search').'

            <div align="center">

                <strong>

                    '
.$lang->browse['tsearch'].'

                </strong>

            </div>

        </td>    '
.ts_collapse('cats_search',2).'

    </tr>

    <tr>

        <td align="right">

            <form method="post" action="'
.$_SERVER['SCRIPT_NAME'].'?">

            <input type="hidden" name="do" value="search" />

            '
.$lang->browse['bykeyword'].' <input type="text" id="auto_keywords" autocomplete="off" name="keywords" size="40" value="'.(isset($keywords) ? htmlspecialchars_uni($keywords) : '').'" />

            <script type="text/javascript">

                new AutoComplete(\'auto_keywords\', \'ts_ajax.php?action=autocomplete&type=torrent&field=name&keyword=\', { delay: 0.25, resultFormat: AutoComplete.Options.RESULT_FORMAT_TEXT });

            </script>

            <select name="search_type">

                <option value="t_name"'
.($search_type == 't_name' ' selected="selected"' '').'>'.$lang->browse['t_name'].'</option>

                <option value="t_description"'
.($search_type == 't_description' ' selected="selected"' '').'>'.$lang->browse['t_description'].'</option>

                <option value="t_both"'
.($search_type == 't_both' ' selected="selected"' '').'>'.$lang->browse['t_both'].'</option>

                <option value="t_uploader"'
.($search_type == 't_uploader' ' selected="selected"' '').'>'.$lang->browse['t_uploader'].'</option>

                <option value="t_genre"'
.($search_type == 't_genre' ' selected="selected"' '').'>'.$lang->browse['t_genre'].'</option>

            </select>

            '
.$lang->browse['in'].'

                '
.$catdropdown.'

            <input type="image" class="none" style="vertical-align: middle;" src="'
.$BASEURL.'/'.$pic_base_url.'torrent_search.gif" alt="'.$lang->browse['tsearch'].'" />

            </form>

        <p align="center">

            <form method="post" action="'
.$_SERVER['SCRIPT_NAME'].'?advanced_search">

            '
.$lang->browse['sastype'].'

            <select name="quick_search">

                <option value="show_daily_torrents"'
.($quick_search == 'show_daily_torrents' ' selected="selected"' '').'>'.$lang->browse['show_daily_torrents'].'</option>

                <option value="show_weekly_torrents"'
.($quick_search == 'show_weekly_torrents' ' selected="selected"' '').'>'.$lang->browse['show_weekly_torrents'].'</option>

                <option value="show_montly_torrents"'
.($quick_search == 'show_montly_torrents' ' selected="selected"' '').'>'.$lang->browse['show_montly_torrents'].'</option>

                <option value="show_dead_torrents"'
.($quick_search == 'show_dead_torrents' ' selected="selected"' '').'>'.$lang->browse['show_dead_torrents'].'</option>

                <option value="show_recommend_torrents"'
.($quick_search == 'show_recommend_torrents' ' selected="selected"' '').'>'.$lang->browse['show_recommend_torrents'].'</option>

                <option value="show_free_torrents"'
.($quick_search == 'show_free_torrents' ' selected="selected"' '').'>'.$lang->browse['show_free_torrents'].'</option>

                <option value="show_silver_torrents"'
.($quick_search == 'show_silver_torrents' ' selected="selected"' '').'>'.$lang->browse['show_silver_torrents'].'</option>

                <option value="show_doubleupload_torrents"'
.($quick_search == 'show_doubleupload_torrents' ' selected="selected"' '').'>'.$lang->browse['show_double_upload_torrents'].'</option>

                <option value="show_external_torrents"'
.($quick_search == 'show_external_torrents' ' selected="selected"' '').'>'.$lang->browse['show_external_torrents'].'</option>

                <option value="show_scene_torrents"'
.($quick_search == 'show_scene_torrents' ' selected="selected"' '').'>'.$lang->browse['scene4'].'</option>

            </select>

            '
.$lang->browse['in'].'

                '
.$catdropdown.'

            <input type="image" class="none" style="vertical-align: middle;" src="'
.$BASEURL.'/'.$pic_base_url.'torrent_search.gif" alt="'.$lang->browse['tsearch'].'" />

            </form>

        </p>



        </td>

    </tr>

</table>

<div id="quickedit" name="quickedit"></div>

'
;



$orderbyvalue 'ORDER by t.sticky, t.added DESC';

if ((isset(
$_POST['sort_order']) AND $_POST['sort_order'] == 'yes') OR (isset($_GET['sort_order']) AND $_GET['sort_order'] == 'yes'))

{

    
$allowedsortbys = array('added','numfiles','comments','seeders','leechers','size','times_completed','owner','sticky');

    if (
$torrentspeed == 'yes')

    {

        
$allowedsortbys array_merge($allowedsortbys, array('totalspeed'));

    }

    
$sortby = isset($_POST['sortby']) && in_array($_POST['sortby'], $allowedsortbys) ? trim($_POST['sortby']) : (isset($_GET['sortby']) && in_array($_GET['sortby'], $allowedsortbys) ? trim($_GET['sortby']) : '');

    
$allowedorderbys = array('DESC''ASC');

    
$orderby = isset($_POST['orderby']) && in_array($_POST['orderby'], $allowedorderbys) ? trim($_POST['orderby']) : (isset($_GET['orderby']) && in_array($_GET['orderby'], $allowedorderbys) ? trim($_GET['orderby']) : '');

    
$orderbyvalue 'ORDER by '.($sortby != 'totalspeed' 't.' '').$sortby.' '.$orderby;



    if (!empty(
$sortby) OR !empty($orderby))

    {

        
$pagelinks2 = array();

        
$pagelinks2[] = 'sort_order=yes';

        
$pagelinks2[] = 'sortby='.htmlspecialchars_uni($sortby);

        
$pagelinks2[] = 'orderby='.htmlspecialchars_uni($orderby);

    }

}



$from = !empty($from) ? $from 'FROM torrents t';

$showtorrents = array();

$query sql_query("SELECT COUNT(t.id) as total_torrents {$from} WHERE ".($showvisible "t.visible = 'yes' AND " "")."t.banned = 'no'".(isset($extraqueries) ? $extraqueries '')." LIMIT 1");

$count mysql_result($query0'total_torrents');

$torrentsperpage = ($CURUSER['torrentsperpage'] <> intval($CURUSER['torrentsperpage']) : $ts_perpage);

list(
$pagertop$pagerbottom$limit) = pager($torrentsperpage$count$_SERVER['SCRIPT_NAME'].'?'.(isset($pagelinks) && count($pagelinks) > implode('&amp;'$pagelinks).'&amp;' '').(isset($pagelinks2) && count($pagelinks2) > implode('&amp;'$pagelinks2).'&amp;' ''));

$groupby $torrentspeed == 'yes' ' GROUP by t.id ' '';



$query sql_query("SELECT ".($torrentspeed == 'yes' '(t.size * t.times_completed + SUM(p.downloaded)) / (UNIX_TIMESTAMP(NOW()) - UNIX_TIMESTAMP(t.added)) AS totalspeed,' '')." t.*, c.id as categoryid, c.image, c.name as categoryname, u.username, g.namestyle {$from} LEFT JOIN categories c ON (t.category=c.id) LEFT JOIN users u ON (t.owner=u.id) LEFT JOIN usergroups g ON (u.usergroup=g.gid) ".($torrentspeed == 'yes' 'LEFT JOIN peers p ON (t.id=p.torrent)' '')." WHERE ".($showvisible "t.visible = 'yes' AND " "")."t.banned = 'no'".(isset($extraqueries) ? $extraqueries '').{$groupby}{$orderbyvalue} $limit") or sqlerr(__FILE__,__LINE__);



if (
$progressbar == 'yes')

{

    include_once(
INC_PATH.'/functions_external.php');

}



$contentheader = ($is_mod '

<script type="text/javascript">

    function check_it(wHAT)

    {

        if (wHAT.value == "move")

        {

            document.getElementById("movetorrent").style.display = "block";

        }

        else

        {

            document.getElementById("movetorrent").style.display = "none";

        }

    }

</script>

<form method="post" action="'
.$BASEURL.'/admin/index.php?act=manage_torrents" name="manage_torrents">

<input type="hidden" name="do" value="update" />

<input type="hidden" name="return" value="yes" />

<input type="hidden" name="return_address" value="'
.$_SERVER['SCRIPT_NAME'].'?page='.intval(isset($_GET['page']) ? $_GET['page'] : 0).'&amp;'.(isset($pagelinks) && count($pagelinks) > implode('&amp;'$pagelinks).'&amp;' '').(isset($pagelinks2) && count($pagelinks2) > implode('&amp;'$pagelinks2) : '').'" />

'').'













<table width="100%" border="0" cellpadding="0" cellspacing="0">

    <tr>
<td class="thead" align="center" style="padding: 10px 0 0 0;"></td>



    
<td class="thead" align="center" style="padding: 10px 0 0 0;"></td>


<td class="thead" align="center" style="padding: 10px 0 0 0;"></td>


    
<td class="thead" align="center" style="padding: 10px 0 0 0;"></td>

</tr>

<tr>






'
;



$__colspan 12;

(
$progressbar != 'yes' $__colspan-- : '');

(
$torrentspeed != 'yes' $__colspan-- : '');

(!
$is_mod $__colspan-- : '');

$contentmiddle $menu_nav '';

require_once(
INC_PATH.'/functions_mkprettytime.php');

if (
mysql_num_rows($query) > 0)

{
$nbImgImprimer 0;

    while (
$torrents mysql_fetch_assoc($query))

    {

        if (
$torrents['offensive'] == 'yes' && preg_match('#E0#is'$CURUSER['options'])) continue;

        
$showupdatebutton=true;

        if (
time() - $torrents['ts_external_lastupdate'] < (TS_TIMEOUT*4))

        {

            
$showupdatebutton=false;

        }

         
$showwait=$elapsed=$color='';

        if (
$wait 0)

        {

            
$elapsed floor((strtotime(date('Y-m-d H:i:s')) - strtotime($torrents['added'])) / 3600);

            if (
$elapsed $wait AND $torrents['ts_external'] != 'yes')

            {

                 
$color dechex(floor(127*($wait $elapsed)/48 128)*65536);

                 
$showwait "<span id=\"ShowWait\"><a href=\"$BASEURL/faq.php#46\"><font color=\"$color\">" number_format($wait $elapsed) . " h</font></a></span>";

            }

        }

        
$orj_name_ $torrents['name'];

        
$torrents['name'] = htmlspecialchars_uni($torrents['name']);

        
$torrents['genre'] = htmlspecialchars_uni($torrents['genre']);

        
$genre $torrents['genre'];

        
$uploader='<a href="#" id="torrentuser'.$torrents['owner'].$torrents['id'].'">'.get_user_color($torrents['username'], $torrents['namestyle']).'</a>';

        
$disable_user_menu=false;



        if (
$torrents['anonymous'] == 'yes')

        {

            if (
$torrents['owner'] != $CURUSER['id'] && !$is_mod)

            {

                
$uploader $lang->global['anonymous'];

                
$disable_user_menu=true;

            }

            else

            {

                
$uploader $uploader.'<br />'.$lang->global['anonymous'];

            }

        }

        
$isScene '';

        if (
$torrents['isScene'] > 0)

        {

            
$isScene '<span class="small" style="float:right;">'.sprintf($lang->browse['scene3'], mkprettytime($torrents['isScene'])).'&nbsp;</span>';

        }

        
$isScene $isScene.'<span class="small" style="float:left;">&nbsp;<b>'.$lang->global['added'].':</b> '.my_datee($dateformat$torrents['added']).' '.my_datee($timeformat$torrents['added']).'</span>';

        
$seolink ts_seo($torrents['categoryid'],$torrents['categoryname'],'c');

        
$seolink2 ts_seo($torrents['id'],$torrents['name'],'s');

        
$seolink3 ts_seo($torrents['id'],$torrents['name'],'d');

        
$seolink4 ts_seo($torrents['id'],$torrents['name'],'dd');        

        
$downloadinfo sprintf($lang->browse['downloadinfo'], $torrents['name']);

        
$categoryinfo sprintf($lang->browse['categoryinfo'], $torrents['categoryname']);

        
$sratio $torrents["leechers"] > $torrents["seeders"] / $torrents["leechers"] : 1;

        
$lratio $torrents["seeders"] > $torrents["leechers"] / $torrents["seeders"] : 1;



        
$torrent_files '<b>'.($torrents['numfiles'] > '<a href="'.$BASEURL.'/details.php?id='.$torrents['id'].'&tab=filelist">' '').ts_nf($torrents['numfiles']).($torrents['numfiles'] > '</a>' '').'</b>';



        
$torrent_seeders = ($torrents['ts_external'] == 'no' '<font color="'.get_slr_color($sratio).'">'.($torrents['seeders'] > && $usergroups['canpeers'] == 'yes' '<a href="'.$BASEURL.'/details.php?id='.$torrents['id'].'&tab=peers">' '').'<b>'.ts_nf($torrents['seeders']).'</b>'.($torrents['seeders'] > && $usergroups['canpeers'] == 'yes' '</a>' '').'</font>' '<b>'.ts_nf($torrents['seeders']).'</b>');



        
$torrent_leechers = ($torrents['ts_external'] == 'no' '<font color="'.get_slr_color($lratio).'">'.($torrents['leechers'] > && $usergroups['canpeers'] == 'yes' '<a href="'.$BASEURL.'/details.php?id='.$torrents['id'].'&tab=peers">' '').'<b>'.ts_nf($torrents['leechers']).'</b>'.($torrents['leechers'] > && $usergroups['canpeers'] == 'yes' '</a>' '').'</font>' '<b>'.ts_nf($torrents['leechers']).'</b>');



        
$torrents['times_completed'] = ($torrents['ts_external'] == 'yes' && $torrents['seeders'] > && $torrents['times_completed'] == $torrents['seeders'] : $torrents['times_completed']);

        
$torrent_snatched = ($torrents['ts_external'] == 'no' && $torrents['times_completed'] > && $usergroups['cansnatch'] == 'yes' sprintf($lang->browse['info3'], '<a href="'.$BASEURL.'/viewsnatches.php?id='.$torrents['id'].'"><b>'.ts_nf($torrents['times_completed']).'</b></a>') : sprintf($lang->browse['info3'], '<b>'.ts_nf($torrents['times_completed']).'</b>'));

        
$torrent_comments = ($torrents['comments']  > '<a href="'.$BASEURL.'/details.php?id='.$torrents ['id'].'&tab=comments">' '').'<b>'.ts_nf($torrents ['comments']).'</b>'.($torrents['comments'] > '</a>' '');

        
    
$q sql_query("SELECT p.ip, s.seedboxip FROM peers p LEFT JOIN seedbox s ON (p.ip=s.seedboxip) WHERE torrent = ".$torrents['id'] );
    while(
$c=mysql_fetch_assoc($q))


    if (
$c['ip'] == $c['seedboxip'])
    {
        
$speed3 '<img src="'.$BASEURL.'/pic/webseede.png.gif" class="inlineimg" alt="" title="Torrent Highspeed " />';
        }
        else    
        {   
        
$speed3 ' ';    
    }

$arfff mksize($torrents['totalspeed']); 
if (
$torrents['totalspeed'] >45800 ) {

        
$speed2 '<img src="'.$BASEURL.'/'.$pic_base_url.'webseede.png.gif" width="20" height="20" class="inlineimg" alt="" title="Ce torrent a présentement une vitesse de '.$arfff.'" />';
        }     
        else
        {   
        
$speed2 ' ';   
    }  

$subres2 sql_query("SELECT ip FROM peers WHERE torrent = ".$torrents['id'] );
    while (
$subrow2 mysql_fetch_array($subres2))    
    


  
if (
$subrow2['ip'] == '94.23.40.30' OR ($subrow2['ip'] == '204.45.71.214' OR ($subrow2['ip'] == '213.186.59.56' OR ($subrow2['ip'] == '91.121.112.162' OR ($subrow2['ip'] == '91.121.172.167' OR ($subrow2['ip'] == '94.23.221.72' OR ($subrow2['ip'] == '88.191.61.81' OR ($subrow2['ip'] == '95.130.9.73' )) )) )))) {
         
$speed3 '<img src="'.$BASEURL.'/'.$pic_base_url.'webseede.png.gif" class="inlineimg" alt="" title=" Akik seedelik a torrentet " />';
           }     else              
           
        {   
$speed3 ' ';    }
  




$arfff mksize($torrents['totalspeed']); 
if (
$torrents['totalspeed'] >45800 ) {

     
$speed2 '<img src="'.$BASEURL.'/'.$pic_base_url.'webseeder.png.gif" width="20" height="20" class="inlineimg" alt="" title="Ez a torrent jelenlegi sebessége'.$arfff.'" />';

           }     else

            {   
$speed2 ' ';    }



        
$isnew = ($torrents['added'] > $CURUSER['last_login'] ? '<img src="'.$BASEURL.'/'.$pic_base_url.'newdownload.gif" class="inlineimg" alt="'.$lang->browse['newtorrent'].'" title="'.$lang->browse['newtorrent'].'" />' '');





$isfree = ($torrents['free'] == 'yes' || ($_freelechmod && $torrents['ts_external'] != 'yes') ? '<img src="'.$BASEURL.'/'.$pic_base_url.'freedownload.gif" class="inlineimg" alt="'.$lang->browse['freedownload'].'" title="'.$lang->browse['freedownload'].'" />' '');

        
$issilver = ($torrents['silver'] == 'yes' || ($_silverleechmod && $torrents['ts_external'] != 'yes') ? '<img src="'.$BASEURL.'/'.$pic_base_url.'silverdownload.gif" class="inlineimg" alt="'.$lang->browse['silverdownload'].'" title="'.$lang->browse['silverdownload'].'" />' '');

        
$isrequest = ($torrents['isrequest'] == 'yes' '<img src="'.$BASEURL.'/'.$pic_base_url.'isrequest.gif" class="inlineimg" alt="'.$lang->browse['requested'].'" title="'.$lang->browse['requested'].'" />' '');

        
$isnuked = ($torrents['isnuked'] == 'yes' '<img src="'.$BASEURL.'/'.$pic_base_url.'isnuked.gif" class="inlineimg" alt="'.sprintf($lang->browse['nuked'], $torrents['WhyNuked']).'" title="'.sprintf($lang->browse['nuked'], $torrents['WhyNuked']).'" />' '');

        
$issticky = ($torrents['sticky'] == 'yes' '<img src="'.$BASEURL.'/'.$pic_base_url.'sticky.gif" alt="'.$lang->browse['sticky'].'" title="'.$lang->browse['sticky'].'" />' '');

        
$isexternal = ($torrents['ts_external'] == 'yes' && $showupdatebutton "<a href=\"#showtorrent".$torrents['id']."\" onclick=\"UpdateExternalTorrent('./include/ts_external_scrape/ts_update.php','id=".$torrents['id']."&ajax_update=true',".$torrents['id'].")\"><img src='".$BASEURL."/".$pic_base_url."external.gif' border='0' alt='".$lang->browse['update']."' title='".$lang->browse['update']."' class='inlineimg' /></a>" : (isset($_GET['tsuid']) && $_GET['tsuid'] == $torrents['id'] ? "<img src='".$BASEURL."/".$pic_base_url."input_true.gif' border='0' alt='".$lang->browse['updated']."' title='".$lang->browse['updated']."' />" ""));

        
$isdoubleupload = ($torrents['doubleupload'] == 'yes' || ($_x2mod && $torrents['ts_external'] != 'yes') ? '<img src="'.$BASEURL.'/'.$pic_base_url.'x2.gif" alt="'.$lang->browse['dupload'].'" title="'.$lang->browse['dupload'].'" class="inlineimg" />' '');

        
$javascript_tname addslashes(htmlspecialchars($torrents['name']));

        
$torrents['name'] = cutename($orj_name_,30);

        
$torrent_image '<img src="'.$BASEURL.'/'.$pic_base_url.$table_cat.'/'.$torrents['image'].'" border="0" alt="'.$categoryinfo.'" title="'.$categoryinfo.'" />';

$name_torrent '<a href="#" id="torrentmenu'.$torrents['id'].'" /><b>'.(!empty($keywords) ? highlight(htmlspecialchars_uni($keywords), $torrents['name']) : $torrents['name']).'</b></a> '.$isnew.' '.$issticky.' '.$isfree.' '.$speed2.' '.$speed3.' '.$issilver.' '.$isdoubleupload.' '.$isrequest.' '.$isnuked.' <span id="isexternal_'.$torrents['id'].'">'.$isexternal.'</span>';
if (
$torrents['moderated'] == 'yes'){
            
$torrent_download_link = (!$is_bookmarked_page '<a href="'.$seolink3.'" title="'.$downloadinfo.'" alt="'.$downloadinfo.'" '.$warnexternal.'><img src="../pic/yes.png"></a>' '<a href="'.$BASEURL.'/bookmarks.php?torrentid='.$torrents['id'].'&amp;action=delete" title="" alt="" /><img src="'.$BASEURL.'/'.$pic_base_url.'delete.gif"></a>');
            }
        if (
$torrents['moderated'] == 'error'){
            
$torrent_download_link = (!$is_bookmarked_page '<img src="../pic/bad.png" width="20" height="20" title="Hibás feltöltés, javítás alatt!">' '');
            }
        if (
$torrents['moderated'] == 'no'){
            
$torrent_download_link = (!$is_bookmarked_page '<img src="../pic/um.png" width="20" height="20" title="Ez a torrent még nincs moderálva!">' '');
            }
        
$torrent_download_link = (!$is_bookmark_page '<a href="'.$seolink3.'" title="'.$downloadinfo.'" alt="'.$downloadinfo.'" /><img src="'.$BASEURL.'/'.$pic_base_url.'dl.gif"></a>' '<a href="'.$BASEURL.'/bookmarks.php?torrentid='.$torrents['id'].'&amp;action=delete" title="" alt="" /><img src="'.$BASEURL.'/'.$pic_base_url.'delete.gif"></a>');

$torrent_download_link2 = (!$is_bookmark_page '<a href="'.$seolink4.'" title="SSL :'.$downloadinfo.'" alt="'.$downloadinfo.'" /><img src="'.$BASEURL.'/'.$pic_base_url.'Download_ssl.png"></a>' '<a href="'.$BASEURL.'/bookmarks.php?torrentid='.$torrents['id'].'&action=delete" title="" alt="" /><img src="'.$BASEURL.'/'.$pic_base_url.'delete.gif"></a>');

        if (
$torrents['moderated'] == 'yes'){
            
$torrent_download_link = (!$is_bookmarked_page '<a href="'.$seolink3.'" title="'.$downloadinfo.'" alt="'.$downloadinfo.'" '.$warnexternal.'><img src="../pic/yes.png"></a>' '<a href="'.$BASEURL.'/bookmarks.php?torrentid='.$torrents['id'].'&amp;action=delete" title="" alt="" /><img src="'.$BASEURL.'/'.$pic_base_url.'delete.gif"></a>');
            }
        if (
$torrents['moderated'] == 'error'){
            
$torrent_download_link = (!$is_bookmarked_page '<img src="../pic/bad.png" width="20" height="20" title="Hibás feltöltés, javítás alatt!">' '');
            }
        if (
$torrents['moderated'] == 'no'){
            
$torrent_download_link = (!$is_bookmarked_page '<img src="../pic/um.png" width="20" height="20" title="Ez a torrent még nincs moderálva!">' '');
            } 
            
        if (
$progressbar == 'yes')

        {

            
$shareratio = ($torrents['seeders'] == : ($torrents['leechers'] == 100 sprintf("%.2f", ($torrents['seeders'] / $torrents['leechers']) * 100)));

            
$health ts_external_share_ratio($shareratio);

            
$torrent_info '<td align="center">      '.$health.'        </td>';

        }

        if (
$torrentspeed == 'yes')

        {

            if (
$torrents['ts_external'] == 'yes')

            {

                
$speed $lang->browse['external'];

            }

            else

            {

                if (
$torrents['seeders'] > && $torrents['leechers'] > 0)

                {

                    
$speed mksize($torrents['totalspeed']) . '/s';

                }

                else

                {

                    
$speed $lang->browse['notraffic'];

                }

            }

            
$speed '<td align="center">'.$speed.'</td>';

        }

        
$torrents['size'] = mksize($torrents['size']);

                if (
$nbImgImprimer 3) {
                   
$contentmiddle .= '        </tr>
        <tr>'
;
                   
$nbImgImprimer 0;
                }
        
$contentmiddle .= '
 

<td '
.($torrents['sticky'] == 'no' ' class="sticky"' '').' align="center">'.(!empty($torrents['t_image']) ? '
    <br />
 '
.$showwait.'<a name="#showtorrent'.$torrents['id'].'"></a>&nbsp;'.$name_torrent.$TorrentAdded.'<br />'.'&nbsp;<font color="red"></font><blink><font color="#00FF00"></b>'.$speed2.' '.$speed3.'<br />'.$torrent_download_link.'</blink></font>
<br /><font color="green">'
.$torrent_seeders.'</font> <font color="green">Seeder /</font> <font color="red">'.$torrent_leechers.'</font> <font color="red">Leecher</font> <br> <font color=red></font>&nbsp;&nbsp;&nbsp;&nbsp;<font color=green>'.$torrents["size"].'</font><br />


              
              <a href="'
.$seolink2.'"><ul class="jaquette"> 
              <li class="film"><img src="'
.htmlspecialchars_uni($torrents['t_image']).'" border="0" height="280" width="220" alt="'.strip_tags($torrents['name']).'" title="'.strip_tags($torrents['name']).'" \></a> </li>
            </ul><br />'
.$torrent_image.'<br /> <font color="green">Letőltőték </font><font color="red">'.$torrents['times_completed'].'</font><font color="green"> eddig</font>
            ' 
$lang->browse['nopreview']).'            


<br />

 </td>



    

        '
;



        
$menu_nav .= '

        <script type="text/javascript">

            menu_register("torrentmenu'
.$torrents['id'].'", true);

        </script>



        <div id="torrentmenu'
.$torrents['id'].'_menu" class="menu_popup" style="display:none;">

            <table border="1" cellspacing="0" cellpadding="2">

                <tr>

                    <td colspan="2" align="center" class="thead"><b>'
.$lang->global['quickmenu'].'</b></td>

                </tr>

                <tr>

                    <td class="subheader"></td>

                    <td rowspan="'
.($is_mod 3).'" align="center" valign="middle"><div align="center">'.(!empty($torrents['t_image']) ? '<a href="javascript:popImage(\''.htmlspecialchars_uni($torrents['t_image']).'\',\'Image Preview\')"><span class="smalltext">'.$lang->browse['t_image'].'</span></a><br /><img src="'.htmlspecialchars_uni($torrents['t_image']).'" border="0" height="220" width="190" alt="'.strip_tags($torrents['name']).'" title="'.strip_tags($torrents['name']).'" \>' $lang->browse['nopreview']).'</div></td>

                </tr>

                <tr>

                    <td class="subheader"><a href="'
.$seolink2.'"><b>'.$lang->browse['viewtorrent'].'</b></a></td>

                </tr>

                <tr>

                    <td class="subheader"><a href="'
.$BASEURL.'/details.php?id='.$torrents['id'].'&tab=comments"><b>'.$lang->browse['viewcomments'].'</b></a></td>

                </tr>'
.($is_mod '

                <tr>

                    <td class="subheader"><a href="'
.$BASEURL.'/admin/index.php?act=torrent_info&amp;id='.$torrents['id'].'"><b>'.$lang->browse['tinfo'].'</b></a></td>

                </tr>

                <tr>

                    <td class="subheader"><a href="'
.$BASEURL.'/edit.php?id='.$torrents['id'].'"><b>'.$lang->browse['edit'].'</b></a></td>

                </tr>

                <tr>

                    <td class="subheader"><a href="'
.$BASEURL.'/admin/index.php?act=nuketorrent&amp;id='.$torrents['id'].'"><b>'.$lang->browse['nuke'].'</b></a></td>

                </tr>

                <tr>

                    <td class="subheader"><a href="'
.$BASEURL.'/admin/index.php?act=fastdelete&amp;id='.$torrents['id'].'"><b>'.$lang->browse['delete'].'</b></a></td></td>

                </tr>' 
'').'

            </table>

        </div>

        '
.($disable_user_menu == false '

        <script type="text/javascript">

            menu_register("torrentuser'
.$torrents['owner'].$torrents['id'].'", true);

        </script>

        <div id="torrentuser'
.$torrents['owner'].$torrents['id'].'_menu" class="menu_popup" style="display:none;">

            <table border="1" cellspacing="0" cellpadding="2">

                <tr>

                    <td align="center" class="thead"><b>'
.$lang->global['quickmenu'].' '.$torrents['username'].'</b></td>

                </tr>

                <tr>

                    <td class="subheader"><a href="'
.$BASEURL.'/userdetails.php?id='.$torrents['owner'].'">'.$lang->global['qinfo1'].'</a></td>

                </tr>

                <tr>

                    <td class="subheader"><a href="'
.$BASEURL.'/browse.php?do=search&keywords='.htmlspecialchars_uni($torrents['username']).'&category=0&search_type=t_uploader">'.sprintf($lang->global['qinfo9'], $torrents['username']).'</a></td>

                </tr>

                <tr>

                    <td class="subheader"><a href="'
.$BASEURL.'/sendmessage.php?receiver='.$torrents['owner'].'">'.sprintf($lang->global['qinfo2'], $torrents['username']).'</td>

                </tr>

                <tr>

                    <td class="subheader"><a href="'
.$BASEURL.'/friends.php?action=add_friend&friendid='.$torrents['owner'].'">'.sprintf($lang->global['qinfo5'], $torrents['username']).'</td>

                </tr>

                '
.($is_mod '

                <tr>

                    <td class="subheader"><a href="'
.$BASEURL.'/admin/edituser.php?action=edituser&userid='.$torrents['owner'].'">'.$lang->global['qinfo6'].'</a></td></tr><tr><td class="subheader"><a href="'.$BASEURL.'/admin/edituser.php?action=warnuser&userid='.$torrents['owner'].'">'.$lang->global['qinfo7'].'</td>

                </tr>' 
'').'

            </table>

        </div>' 
'');

        
$nbImgImprimer++;
    } 
// while ($torrents = mysql_fetch_assoc($query))

}

else

{

    
$contentmiddle '

        <tr>

            <td colspan="'
.$__colspan.'">

                '
.$lang->browse['tryagain'].'

            </td>

        </tr>'
;

}



$contentmiddle .= ($is_mod '

<tr>

    <td colspan="'
.$__colspan.'" align="right">

        <p id="selectaction" style="display:block; margin-top: 5px; margin-right: 5px;">

            Select Action:

            <select name="actiontype" onchange="check_it(this)">

                <option value="0">Select action</option>

                <option value="move">Move selected torrents</option>

                <option value="delete">Delete selected torrents</option>

                <option value="sticky">Sticky/Unsticky selected torrents</option>

                <option value="free">Set Free/NonFree selected torrents</option>

                <option value="isstreaming">Set seedbox/No seedbox selected torrents</option>

                                       <option value="silver">Set Silver/NonSilver selected torrents</option>

                <option value="visible">Set Visible/Unvisible selected torrents</option>

                <option value="anonymous">Anonymize/Non Anonymize selected torrents</option>

                <option value="banned">Ban/UnBan selected torrents</option>

                <option value="nuke">Nuke/UnNuke selected torrents</option>

                <option value="doubleupload">Set Double Upload YES/NO</option>

                <option value="openclose">Open/Close for Comment Posting</option>

            </select>

        </p>

        <p id="movetorrent" style="display:none; margin-right: 5px;">

            Select Category: '
.$catdropdown.'

        </p>

        <p id="doaction" style="display:block; margin-right: 5px;">

            <input type="submit" value="do it"> <input type="reset" value="reset fields" />

        </p>

    </td>

</tr>

</form>

</table>

'</table>').'

'
.$menu_nav.'

<script type="text/javascript">

    menu.activate(true);

</script>

<script type="text/javascript" src="'
.$BASEURL.'/scripts/ts_update.js?v='.O_SCRIPT_VERSION.'"></script>';



if (
count($pagelinks) > 0)

{

    
$hiddenvalues;

    foreach (
$pagelinks as $name)

    {

        
$values explode('='$name);

        
$hiddenvalues .= '

        <input type="hidden" name="'
.$values[0].'" value="'.$values[1].'" />

        '
;

    }

}



if (isset(
$_GET['category']) && is_valid_id($_GET['category']) && empty($quick_search))

{

    
$sqfield "&amp;browse_categories&amp;category=".intval($_GET['category']);

}



$finishcontent '

<table width="100%" cellpadding="5" cellspacing="5" border="0">

    <tr>

        <td class="none" width="40%">

            <fieldset style="text-align: center; line-height: 25px; padding: 5px; border: solid 1px #000;">

                <LEGEND>'
.$lang->browse['b_info'].'</LEGEND>

                '
.str_replace("|link|""$BASEURL/$pic_base_url"$lang->browse['legend_browse']).'

            </fieldset>

        </td>

        <td class="none" width="60%">

            <fieldset style="text-align: center; line-height: 25px; padding: 5px; border: solid 1px #000;">

                <LEGEND>'
.$lang->browse['f_options'].'</LEGEND>

                <span style="float: right;">

                    <form method="post" action="'
.$_SERVER['SCRIPT_NAME'].'?page='.intval(isset($_GET['page']) ? $_GET['page']: 0).(isset($sqfield) ? $sqfield '').'">

                        <input type="hidden" name="sort_order" value="yes" />

                        <input type="hidden" name="page" value="'
.intval(isset($_GET['page']) ? $_GET['page']: 0).'" />

                        '
.(isset($hiddenvalues) ? $hiddenvalues '').'

                        '
.$lang->browse['sortby1'].'

                        <select name="sortby">

                            <option value="added"'
.(isset($sortby) && $sortby == 'added' ' selected="selected"' '').'>'.$lang->global['added'].'</option>

                            <option value="numfiles"'
.(isset($sortby) && $sortby == 'numfiles' ' selected="selected"' '').'>'.$lang->browse['sortby2'].'</option>

                            <option value="comments"'
.(isset($sortby) && $sortby == 'comments' ' selected="selected"' '').'>'.$lang->browse['sortby3'].'</option>

                            <option value="seeders"'
.(isset($sortby) && $sortby == 'seeders' ' selected="selected"' '').'>'.$lang->browse['sortby4'].'</option>

                            <option value="leechers"'
.(isset($sortby) && $sortby == 'leechers' ' selected="selected"' '').'>'.$lang->browse['sortby5'].'</option>

                            <option value="size"'
.(isset($sortby) && $sortby == 'size' ' selected="selected"' '').'>'.$lang->browse['sortby6'].'</option>

                            <option value="times_completed"'
.(isset($sortby) && $sortby == 'times_completed' ' selected="selected"' '').'>'.$lang->browse['sortby7'].'</option>

                            <option value="owner"'
.(isset($sortby) && $sortby == 'owner' ' selected="selected"' '').'>'.$lang->browse['sortby8'].'</option>

                            <option value="sticky"'
.(isset($sortby) && $sortby == 'sticky' ' selected="selected"' '').'>'.$lang->browse['sortby9'].'</option>

                            '
.($torrentspeed == 'yes' '<option value="totalspeed"'.(isset($sortby) && $sortby == 'totalspeed' ' selected="selected"' '').'>'.$lang->browse['speed'].'</option>' '').'

                        </select>

                        '
.$lang->browse['orderby1'].'

                        <select name="orderby">

                            <option value="ASC"'
.(isset($orderby) && $orderby == 'ASC' ' selected="selected"' '').'>'.$lang->browse['orderby3'].'</option>

                            <option value="DESC"'
.(isset($orderby) && $orderby == 'DESC' ' selected="selected"' '').'>'.$lang->browse['orderby2'].'</option>

                        </select>

                        <input type="image" class="none" style="vertical-align: middle;" src="'
.$BASEURL.'/'.$pic_base_url.'torrent_search.gif" alt="'.$lang->browse['tsearch'].'" />&nbsp;&nbsp;

                    </form>

                </span>

            </fieldset>

        </td>

    </tr>

</table>

'
;



$QuickEditTorrentSubject='';

if (
$is_mod)

{

    
$QuickEditTorrentSubject '

    <script type="text/javascript">

        function checkSubject()

        {

            var userEntered = document.getElementById(\'subject\').value;

            if (userEntered == "")

            {

                alert("'
.$lang->global['dontleavefieldsblank'].'");

                document.QuickEditForm.subject.focus();

                return false;

            }

            else

            {

                return true;

            }

        }

        function QuickEditTorrentSubject(TorrentID,TorrentSubject)

        {

            document.getElementById(\'quickedit\').innerHTML = \'<br /><table width="100%" border="0" cellspacing="0" cellpadding="5" align="center"><tr><td class="thead">'
.$lang->browse['quickedit'].'</td></tr><tr><td><form method="post" action="'.$_SERVER['SCRIPT_NAME'].'?page='.intval(isset($_GET['page']) ? $_GET['page'] : 0).'&amp;'.(isset($pagelinks) && count($pagelinks) > implode('&amp;'$pagelinks).'&amp;' '').(isset($pagelinks2) && count($pagelinks2) > implode('&amp;'$pagelinks2) : '').'" onSubmit="return checkSubject()" name="QuickEditForm"><input type="hidden" name="tid" value="\'+TorrentID+\'" /> <input type="text" id="subject" name="subject" value="\'+TorrentSubject+\'" size="100" /> <input type="submit" value="'.$lang->global['buttonsave'].'" class="button" /> <input type="reset" value="'.$lang->global['buttonreset'].'" class="button" /></form></td></tr></table>\';

        }

    </script>

    '
;

}

echo 
$___notice.$categories.$search.($pagertop $pagertop '<p></p>').'<div style="display:block;" id="showcontents">'.$contentheader.$contentmiddle.'</div>'.($pagerbottom $pagerbottom '').$finishcontent.$QuickEditTorrentSubject;

unset(
$categories,$search,$contentheader,$contentmiddle,$finishcontent);

stdfoot();

# Function get_slr_color v.0.1

function get_slr_color($ratio)

{

    if (
$ratio 0.025) return "#ff0000";

    if (
$ratio 0.05) return "#ee0000";

    if (
$ratio 0.075) return "#dd0000";

    if (
$ratio 0.1) return "#cc0000";

    if (
$ratio 0.125) return "#bb0000";

    if (
$ratio 0.15) return "#aa0000";

    if (
$ratio 0.175) return "#990000";

    if (
$ratio 0.2) return "#880000";

    if (
$ratio 0.225) return "#770000";

    if (
$ratio 0.25) return "#660000";

    if (
$ratio 0.275) return "#550000";

    if (
$ratio 0.3) return "#440000";

    if (
$ratio 0.325) return "#330000";

    if (
$ratio 0.35) return "#220000";

    if (
$ratio 0.375) return "#110000";

    return 
"#000000";

}

# Function unesc v.0.1

function unesc($x)

{

    if (
get_magic_quotes_gpc()) return stripslashes($x);

    return 
$x;

}

?>
__________________
Sky-Tech Developer Team Hungary


Last edited by smoky28; 7th May 2011 at 18:42.
Reply With Quote
The Following 2 Users Say Thank You to smoky28 For This Useful Post:
peiratikos (11th November 2011), szotyi66 (2nd December 2011)
  #10  
Old 7th May 2011, 16:30
Titya Titya is offline
Banned
 
Join Date: Dec 2010
Belgium
Posts: 30
Default
Quote:
Originally Posted by Omenke View Post
Az rendben van csak nem biztos hogy az nemi úgy jó is :D

Pld nekem nem lenne jó a te details és bwrosed php d.

Ezért jobb postolni mit hova tegyen.

This also is not possible to download and even upload their own do not be checked.
Reply With Quote
The Following User Says Thank You to Titya For This Useful Post:
peiratikos (11th November 2011)
Reply

Tags
56 , control , sytem , torrent , tsse

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump



All times are GMT +2. The time now is 10:50. vBulletin skin by ForumMonkeys. Powered by vBulletin® Version 3.8.11 Beta 3
Copyright ©2000 - 2024, vBulletin Solutions Inc.