Login
Username: Password:
Remember me

[Sign Up] / [Recover Password]

Theme / Language

Popular
New Torrents
new name
Size: 18.40 MB
Most active
new name
S: 74 L: 3
New Posters
User Posts

Go to Profile

If you have instaled the Snatchlist mod ([url="http://devscorner.xyz/index.php?/topic/18257-snatchlist/"]http://devscorner.xyz/index.php?/topic/18257-snatchlist/[/url]) you can use a more complex 'torrents-completed' page:


<?php
require_once("backend/functions.php");
dbconn();
    if ($site_config["MEMBERSONLY"])
    {
        loggedinonly();
        if ($CURUSER["view_torrents"] == "no")
            show_error_msg(T_("ERROR"), T_("NO_TORRENT_VIEW"), 1);
    }
    $id = (int) $_GET["id"];
    $res = SQL_Query_exec("SELECT name, external, banned FROM torrents WHERE id = $id");
    $row = mysql_fetch_assoc($res);
    if ((!$row) || ($row["banned"] == "yes" && $CURUSER["edit_torrents"] == "no"))
        show_error_msg(T_("ERROR"), T_("TORRENT_NOT_FOUND"), 1);
    if ($row["external"] == "yes")
        show_error_msg(T_("ERROR"), T_("THIS_TORRENT_IS_EXTERNALLY_TRACKED"), 1);
    $res = SQL_Query_exec("SELECT users.id, users.username, users.uploaded, users.downloaded, users.privacy, completed.date FROM users LEFT JOIN completed ON users.id = completed.userid WHERE users.enabled = 'yes' AND completed.torrentid = '$id'");
    if (mysql_num_rows($res) == 0)
        show_error_msg(T_("ERROR"), T_("NO_DOWNLOADS_YET"), 1);
    $title = sprintf(T_("COMPLETED_DOWNLOADS"), CutName($row["name"], 70));
stdhead($title);
begin_frame($title);
?>
    <br />
    <table cellpadding="5" cellspacing="0" align="center" class="table_table" width="99%">
        <tr>
            <td class="table_head"> <b><?php echo T_("USERNAME"); ?></b> | <b><?php echo T_("RATIO"); ?></b> </td>
            <td class="table_head" align="center"> <b><?php echo T_("STARTED"); ?></b> </td>
            <td class="table_head" align="center"> <b><?php echo T_("COMPLETED"); ?></b> </td>
            <td class="table_head" align="center"> <b><?php echo T_("LAST_ACTION"); ?></b> </td>
            <td class="table_head" align="center"> <b><?php echo T_("UPLOADED"); ?></b> </td>
            <td class="table_head" align="center"> <b><?php echo T_("DOWNLOADED"); ?></b> </td>
            <td class="table_head" align="center"> <b><?php echo T_("RATIO"); ?></b> </td>
            <td class="table_head" align="center"> <b><?php echo T_("SEED_TIME"); ?></b> </td>
            <td class="table_head" align="center"> <b><?php echo T_("SEEDING"); ?></b> </td>
            <td class="table_head" align="center"> <font color="#FF1200"><b>H</b><small>&</small><b>R</b></font> </td>
        </tr>
        <?php
        while ($row = mysql_fetch_assoc($res))
        {
            if (($row["privacy"] == "strong") && ($CURUSER["edit_users"] == "no"))
            continue;
            if ($row['downloaded'] > 0)
            {
                $ratio = $row['uploaded'] / $row['downloaded'];
                $ratio = number_format($ratio, 2);
                $color = get_ratio_color($ratio);
                if ($color)
                    $ratio = "<font color=$color>$ratio</font>";
            } else if ($row['uploaded'] > 0)
                $ratio = 'Inf.';
            else
                $ratio = '---';
            $comdate = date("d.M.Y<\\b\\r><\\s\\m\\a\\l\\l>H:i</\\s\\m\\a\\l\\l>", utc_to_tz_time($row["date"]));
            $peers = (get_row_count("peers", "WHERE torrent = '$id' AND userid = '$row[id]'")) ? "<font color='#27B500'><b>".T_("YES")."</b></font>" : "<font color='#FF1200'><b>".T_("NO")."</b></font>";
            $res2 = SQL_Query_exec("SELECT uload, dload, stime, utime, ltime, hnr FROM snatched WHERE tid = '$id' AND uid = '$row[id]'");
            $row2 = mysql_fetch_assoc($res2);
            if ($row2['dload'] > 0)
            {
                $tratio = $row2['uload'] / $row2['dload'];
                $tratio = number_format($tratio, 2);
                $color = get_ratio_color($tratio);
                if ($color)
                    $tratio = "<font color=$color>$tratio</font>";
            } else if ($row2['uload'] > 0)
                $tratio = 'Inf.';
            else
                $tratio = '---';
            $startdate = utc_to_tz(get_date_time($row2['stime']));
            $lastaction = utc_to_tz(get_date_time($row2['utime']));
            $upload = "<font color='#27B500'><b>".mksize($row2["uload"])."</b></font>";
            $download = "<font color='#FF1200'><b>".mksize($row2["dload"])."</b></font>";
            $seedtime = $row2['ltime'] ? mkprettytime($row2['ltime']) : '---';
            if ($row2['hnr'] != "yes") { $hnr = "<font color='#27B500'><b>".T_("NO")."</b></font>";  } else { $hnr = "<font color='#FF1200'><b>".T_("YES")."</b></font>"; }
            ?>
            <tr>
                <td class="table_col1"><a href="account-details.php?id=<?php echo $row["id"]; ?>"><b><?php echo $row["username"]; ?></b></a> | <b><?php echo $ratio; ?></b></td>
                <td class="table_col2" align="center"><?php echo date('d.M.Y<\\b\\r>H:i', sql_timestamp_to_unix_timestamp($startdate));?></td>
                <td class="table_col1" align="center"><?php echo $comdate; ?></td>
                <td class="table_col2" align="center"><?php echo date('d.M.Y<\\b\\r>H:i', sql_timestamp_to_unix_timestamp($lastaction));?></td>
                <td class="table_col1" align="center"><?php echo $upload; ?></td>
                <td class="table_col2" align="center"><?php echo $download; ?></td>
                <td class="table_col1" align="center"><b><?php echo $tratio; ?></b></td>
                <td class="table_col2" align="center"><?php echo $seedtime; ?></td>
                <td class="table_col1" align="center"><?php echo $peers; ?></td>
                <td class="table_col2" align="center"><b><?php echo $hnr; ?></b></td>
            </tr>
            <?php
        }
        ?>
    </table>
    <div style="margin-top:10px; margin-bottom:10px" align="center">
        <a href="torrents-details.php?id=<?php echo $id; ?>"><?php echo "<input type='submit' value='".T_("BACK_TO_DETAILS")."'>"; ?></a>
    </div>
<?php
end_frame();
stdfoot();
?>
Snatchlist — 2015-04-05 16:02:37 in v2.08 Mods Completed
This mod is ready for "Anti Hit & Run System", so Snatchlist must be installed first.
[size=14px]I included this code in top of login_block, before avatar image.[/size]

[size=14px][color=rgb(34,34,34)]So[/color][color=rgb(34,34,34)] [/color][/size][color=rgb(34,34,34)]I made[/color][color=rgb(34,34,34)] [/color][color=rgb(34,34,34)]a block[/color][color=rgb(34,34,34)] [/color][color=rgb(34,34,34)]economy[/color]  :D
[size=14px]Changes: The "Submit" button was removed.[/size]

<?php
   if ($CURUSER)
   {
       begin_block(T_("THEME")." / ".T_("LANGUAGE"));

           $ss_r = SQL_Query_exec("SELECT * from stylesheets");
           $ss_sa = array();

           while ($ss_a = mysql_fetch_assoc($ss_r))
           {
               $ss_id = $ss_a["id"];
               $ss_name = $ss_a["name"];
               $ss_sa[$ss_name] = $ss_id;
           }
           
           ksort($ss_sa);
           reset($ss_sa);
           
           while (list($ss_name, $ss_id) = each($ss_sa))
           {
               if ($ss_id == $CURUSER["stylesheet"]) $ss = " selected='selected'"; else $ss = "";
               $stylesheets .= "<option value='$ss_id'$ss>$ss_name</option>n";
           }

           $lang_r = SQL_Query_exec("SELECT * from languages");
           $lang_sa = array();

           while ($lang_a = mysql_fetch_assoc($lang_r))
           {
               $lang_id = $lang_a["id"];
               $lang_name = $lang_a["name"];
               $lang_sa[$lang_name] = $lang_id;
           }
           
           ksort($lang_sa);
           reset($lang_sa);

           while (list($lang_name, $lang_id) = each($lang_sa))
           {
               if ($lang_id == $CURUSER["language"]) $lang = " selected='selected'"; else $lang = "";
               $languages .= "<option value='$lang_id'$lang>$lang_name</option>n";
           }
           ?>
           
           <div style="font:normal 11px Tahoma" align="center">
               <form method="post" action="take-theme.php">
                   <table>
                       <tr>
                           <td><?php echo T_("LANGUAGE"); ?>:</td>
                           <td><select name="language" onchange="this.form.submit();"><?=$languages?></select><input type="hidden" name="Submit" value="ok"></td>
                       </tr>
                       <tr>
                           <td><?php echo T_("THEME"); ?>:</td>
                           <td><select name="stylesheet" onchange="this.form.submit();"><?=$stylesheets?></select><input type="hidden" name="Submit" value="ok"></td>
                       </tr>
                   </table>
               </form>
           </div>
           <?php
       end_block();
   }
?>

[ATTACH]2423._xfImport[/ATTACH]
[size=18px]The old Snatchlist mod was lost and you do not can install this mod without it...[/size]

[size=18px]So I added Snatchlist again, fully optimized.[/size]

[size=18px]The link is:[/size] [size=18px][url="http://devscorner.xyz/topic/18257-snatchlist"]http://devscorner.xyz/topic/18257-snatchlist[/url][/size]
Anti-Flood — 2015-03-27 14:28:53 in v2.08 Mods Completed
[size=14px]This is another very useful mod that unfortunately now missing...[/size]

Open backend/config.php
Add:

// Anti-Flood Settings
$site_config['floodsize']  = 1000;  // Maximum size of messages, forumposts, comments
$site_config['floodlimit'] = 10;    // Amount of sources before to be considered flood
$site_config['floodtime']  = 10;    // Time between messages, forumposts, comments
Open comments.php

After:

    if (!$body)
        show_error_msg(T_("ERROR"), T_("YOU_DID_NOT_ENTER_ANYTHING"), 1);
Add:

    //===| Anti-Flood
    if ( strlen($body) > $site_config['floodsize'] )
        show_error_msg("Error", "Your comment is too big, only $site_config['floodsize'] characters are allowed.", 1);

    $res = SQL_Query_exec("SELECT COUNT(*) FROM `comments` WHERE user = $CURUSER[id] AND added > '" . get_date_time(gmtime() - ($site_config['floodtime'] * 60)) . "'");
    $row = mysql_fetch_row($res);
    if ($row[0] > $site_config['floodlimit'])
        show_error_msg("Error", "You are only prohibited $site_config[floodlimit] comments in $site_config[floodtime] minutes.", 1);
    //===| End
Open forums.php
Replace:

    //Insert the new post
    $added = "'" . get_date_time() . "'";
    $body = sqlesc($body);
With:

    //===| Anti-Flood
    if ( strlen($body) > $site_config['floodsize'] )
        show_error_msg("Error", "Your post is too big, only $site_config['floodsize'] characters are allowed.", 1);
    //===| End

    //Insert the new post
    $added = "'" . get_date_time() . "'";
    $body = sqlesc($body);

    //===| Anti-Flood
    $res = SQL_Query_exec("SELECT COUNT(*) FROM `forum_posts` WHERE userid = $CURUSER[id] AND added > '" . get_date_time(gmtime() - ($site_config['floodtime'] * 60)) . "'");
    $row = mysql_fetch_row($res);
    if ($row[0] > $site_config['floodlimit'])
        show_error_msg("Error", "You are only prohibited $site_config[floodlimit] forumposts in $site_config[floodtime] minutes.", 1);
    //===| End
Open mailbox.php
After:

        $status = (@$_POST['send'] ? 'yes' : 'no');
Add:


    //===| Anti-Flood
    if ( strlen($msg) > $site_config['floodsize'] )
        show_error_msg("Error", "Your message is too big, only $site_config['floodsize'] characters are allowed.", 1);

    $res = SQL_Query_exec("SELECT COUNT(*) FROM `messages` WHERE sender = $CURUSER[id] AND added > '" . get_date_time(gmtime() - ($site_config['floodtime'] * 60)) . "'");
    $row = mysql_fetch_row($res);
    if ($row[0] > $site_config['floodlimit'])
        show_error_msg("Error", "You are only prohibited $site_config[floodlimit] messages in $site_config[floodtime] minutes.", 1);
    //===| End
Snatchlist — 2015-03-26 12:27:12 in v2.08 Mods Completed
[size=14px]This is the original mod created by mostvotedplaya, improved by ArcticWolf and easy modified by me.
I added again this mod because now unfortunately is missing.
[/size]


Add to your database:

CREATE TABLE IF NOT EXISTS `snatched` (
  `sid` int(11) unsigned NOT NULL auto_increment,
  `tid` int(11) unsigned NOT NULL default '0',
  `uid` int(11) unsigned NOT NULL default '0',
  `stime` int(11) unsigned NOT NULL default '0',
  `utime` int(11) unsigned NOT NULL default '0',
  `ltime` int(11) unsigned NOT NULL default '0',
  `uload` bigint(20) unsigned NOT NULL default '0',
  `dload` bigint(20) unsigned NOT NULL default '0',
  `completed` enum('0','1') NOT NULL default '0',
  `hnr` enum('no','yes') NOT NULL default 'no',
  PRIMARY KEY  (`sid`),
  UNIQUE KEY `tid_uid` (`tid`,`uid`),
  KEY `completed` (`completed`),
  KEY `tid` (`tid`),
  KEY `uid` (`uid`)
) ENGINE=MyISAM  DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;

Open backend/functions.php

After:
SQL_Query_exec("DELETE FROM reports WHERE votedfor = $id AND type = 'torrent'");

Add:
SQL_Query_exec("DELETE FROM `snatched` WHERE `tid` = '$id'");

After:
SQL_Query_exec("DELETE FROM pollanswers WHERE userid = $userid");

Add:
SQL_Query_exec("DELETE FROM `snatched` WHERE `uid` = '$userid'");

In the most bottom place, before ?> add:
function seedtime($ts = 0)
{                                                                                                    
    $days = floor($ts / 86400);
    $hours = floor($ts / 3600 ) % 24;    
    $mins = floor($ts / 60) % 60;
    $secs = $ts % 60;
    return sprintf( '%d days, %d hours, %d minutes, %d seconds...', $days, $hours, $mins, $secs);
}

Open announce.php

Find:
$ret = SQL_Query_exec("INSERT INTO peers (connectable, torrent, peer_id, ip, passkey, port, uploaded, downloaded, to_go, started, last_action, seeder, userid, client) VALUES ('$connectable', $torrentid, " . sqlesc($peer_id) . ", " . sqlesc($ip) . ", " . sqlesc($passkey) . ", $port, $uploaded, $downloaded, $left, '".get_date_time()."', '".get_date_time()."', '$seeder', '$userid', " . sqlesc($agent) . ")");

Underneath add:
if ( ($MEMBERSONLY) && (($seeder == 'no' && $torrent['freeleech'] == 0)) ) {
    SQL_Query_exec("INSERT INTO `snatched` (`uid`, `tid`, `stime`, `utime`) VALUES ('$userid', '$torrentid', '".gmtime()."', '".gmtime()."') ON DUPLICATE KEY UPDATE `utime` = '" . gmtime() . "'");
}

Find:
if ( $MEMBERSONLY )
SQL_Query_exec("INSERT INTO completed (userid, torrentid, date) VALUES ($userid, $torrentid, '".get_date_time()."')");

Replace with:
if ( $MEMBERSONLY )
{
    SQL_Query_exec("INSERT INTO completed (userid, torrentid, date) VALUES ($userid, $torrentid, '".get_date_time()."')");
    SQL_Query_exec("UPDATE LOW_PRIORITY `snatched` SET `completed` = '1' WHERE `tid` = '$torrentid' AND `uid` = '$userid' AND `utime` = '" . gmtime() . "'");
}

Find:
$upthis = max(0, $uploaded - $self["uploaded"]);

Above add:
$elapsed = ($self['seeder'] == 'yes') ? $site_config['announce_interval'] - floor(($self['ez'] - time()) / 60) : 0;

Find:
if (($upthis > 0 || $downthis > 0) && is_valid_id($userid))

Replace with:
if (($upthis > 0 || $downthis > 0 || $elapsed > 0) && is_valid_id($userid))

Find:
SQL_Query_exec("UPDATE users SET uploaded = uploaded + $upthis, downloaded = downloaded + $downthis WHERE id=$userid") or err("Tracker error: Unable to update stats");

Underneath add:
SQL_Query_exec("UPDATE LOW_PRIORITY `snatched` SET `uload` = `uload` + '$upthis', `dload` = `dload` + '$downthis', `utime` = '".gmtime()."', `ltime` = `ltime` + '$elapsed' WHERE `tid` = '$torrentid' AND `uid` = '$userid'");

Open account.php

Under:
<?php print("<a href='mailbox.php'><b>".T_("YOUR_MESSAGES")."</b></a>");?>

Add:
&nbsp;|&nbsp;
<?php print("<a href='snatched.php'><b>".T_("YOUR_SNATCHLIST")."</b></a>");?>

Open account-details.php

Before:
<?php echo T_("AGE"); ?>: <?php echo htmlspecialchars($user["age"])?><br />

Add:
<?php if ($CURUSER["edit_users"]=="yes" && $CURUSER["class"] > $user["class"]) { ?>
  <div style="margin-bottom:3px"><a href="snatched.php?uid=<?php echo $user["id"]?>"><?php echo "<input type='submit' value='".T_("SNATCHLIST")."'>"; ?></a></div>
<?php } ?>

Open torrents-details.php

Under:
echo "[<a href='torrents-edit.php?id=$row[id]&amp;returnto=" . urlencode($_SERVER["REQUEST_URI"]) . "'><b>".T_("EDIT_TORRENT")."</b></a>]";

Add:
echo "&nbsp;<a href=snatched.php?tid=$row[id]><input type='submit' value='".T_("SNATCHLIST")."'></a>&nbsp;";

Open languages/english.php

Add:
//===| Snatchlist
$LANG["SNATCHLIST"] = "Snatchlist";
$LANG["YOUR_SNATCHLIST"] = "Your Snatchlist";
$LANG["SNATCHLIST_FOR"] = "Snatchlist For:";
$LANG["LAST_ACTION"] = "Last Action";
$LANG["SEED_TIME"] = "Seed Time";
$LANG["GO_TO_YOUR_PROFILE"] = "Go to Your Profile";
$LANG["GO_TO_USER_ACCOUNT"] = "Go to User Account";
$LANG["HNR"] = "<font color=#FF1200><b>H</b><small>&</small><b>R</b></font>";
$LANG["SNATCHED_MESSAGE"] = "This page displays the details to all downloaded torrents, completed or not.";
$LANG["NO_USER_WITH_ID"] = "There is no user with ID: ";
$LANG["NO_TORRENT_WITH_ID"] = "There is no torrent with ID: ";
$LANG["REGISTERED_MEMBERS_TO_TORRENT"] = "Registered Members To Torrent:";
$LANG["NO_PERMISSION"] = "You don't have permission for this action!";
$LANG["T_L_OR_E"] = "Local or External";
$LANG["LOCAL_TORRENT"] = "Local Torrent";
$LANG["EXTERNAL_TORRENT"] = "External Torrent";
$LANG["FREE"] = "Free";

[size=14px]Finally, extracts the atached archive "snatched.zip" and upload the images and snatched.php into your root.[/size]
[url="http://devscorner.xyz/applications/core/interface/file/attachment.php?id=7186"]snatched.zip[/url]
I don't know exactly, before used this mod I have canceled the function 'fsockopen' in 'functions.php' because it is not supported by the newest PHP versions.

In that moment I have do that from other reasons...
First, the torrents are scraped in torrents-details.php, is the first line in that the stats are updated with UDP trackers.
I tested this mod on a tracker with 12.000 of external torrents and after a while almost all these torrents have been updated by users.
You can also use mega_scrape.php but you need to set a cronjob to your server for this file. In this mode will work permanently.
If you run this file from your PC, you have to keep the browser open until this task is ready.

First of all extracts the attached arhive udpscraper.zip and upload all included files in your root.

In torrents-details.php under this line:

require_once("backend/BDecode.php");



Add these:

require_once("backend/parse.php");
require_once"backend/udptscraper.php";



And somewhere below, replace the entire "scrape" code:

if ($row["external"]=='yes'){
        if ($scrape =='1'){
            print("<td valign='top' align='right'><b>Tracked: </b>EXTERNAL<br /><br />");
            $seeders1 = $leechers1 = $downloaded1 = null;

            $tres = SQL_Query_exec("SELECT url FROM announce WHERE torrent=$id");
            while ($trow = mysql_fetch_assoc($tres)) {
                $ann = $trow["url"];
                $tracker = explode("/", $ann);
                $path = array_pop($tracker);
                $oldpath = $path;
                $path = preg_replace("/^announce/", "scrape", $path);
                $tracker = implode("/", $tracker)."/".$path;

                if ($oldpath == $path) {
                    continue; // Scrape not supported, ignored
                }

                // TPB's tracker is dead. Use openbittorrent instead
                if (preg_match("/thepiratebay.org/i", $tracker) || preg_match("/prq.to/", $tracker)) {
                    $tracker = "http://tracker.openbittorrent.com/scrape";
                }

                $stats = torrent_scrape_url($tracker, $row["info_hash"]);
                if ($stats['seeds'] != -1) {
                    $seeders1 += $stats['seeds'];
                    $leechers1 += $stats['peers'];
                    $downloaded1 += $stats['downloaded'];
                    SQL_Query_exec("UPDATE `announce` SET `online` = 'yes', `seeders` = $stats[seeds], `leechers` = $stats[peers], `times_completed` = $stats[downloaded] WHERE `url` = ".sqlesc($ann)." AND `torrent` = $id");
                } else {
                    SQL_Query_exec("UPDATE `announce` SET `online` = 'no' WHERE `url` = ".sqlesc($ann)." AND `torrent` = $id");

                }
            }

            if ($seeders1 !== null){ //only update stats if data is received
                print ("<b>".T_("LIVE_STATS").": </b><br />");
                print ("Seeders: ".number_format($seeders1)."<br />");
                print ("Leechers: ".number_format($leechers1)."<br />");
                print (T_("COMPLETED").": ".number_format($downloaded1)."<br />");

                SQL_Query_exec("UPDATE torrents SET leechers='".$leechers1."', seeders='".$seeders1."', times_completed='".$downloaded1."',last_action= '".get_date_time()."',visible='yes' WHERE id='".$row['id']."'");
            }else{
                print ("<b>".T_("LIVE_STATS").": </b><br />");
                print ("<font color='#ff0000'>Tracker Timeout<br />Please retry later</font><br />");
            }

            print ("<form action='torrents-details.php?id=$id&amp;scrape=1' method='post'><input type="submit" name="submit" value="Update Stats" /></form></td>");
        }else{
            print ("<td valign='top' align='right'><b>Tracked:</b> EXTERNAL<br /><br /><form action='torrents-details.php?id=$id&amp;scrape=1' method='post'><input type="submit" name="submit" value="Update Stats" /></form></td>");
        }
    }


With this one:

//===| Scrape External Torrents
   if ($row["external"]=='yes')
   {
       print ("<td width='160' align='right' valign='top'><table><tr>");
       if ($scrape =='1')
       {
           print("<td class='table_col1' width='150' valign='middle'>
           <div style='margin-top:5px; margin-bottom:10px; font:bold 16px Times' align='center'><font color='#FF2000'>".T_("EXTERNAL_TORRENT")."</font></div>");

           //===| UDP Scraper
           $resu = SQL_Query_exec("SELECT id, info_hash FROM torrents WHERE external = 'yes' AND id = $id");
           while ($rowu = mysql_fetch_array($resu))
           {
               $TorrentInfo = ParseTorrent("$site_config[torrent_dir]/$rowu[id].torrent");
               $ann = $TorrentInfo[0];
               $annlist = array();

               if ($TorrentInfo[6])
               {
                   foreach ($TorrentInfo[6] as $ann)
                   {
                       $annlist[] = $ann[0];
                   }
               }
               else
                   $annlist = array($ann);

               $seeders = $leechers = $downloaded = null;
               foreach ($annlist as $ann)
               {
                   $tracker = explode("/", $ann);
                   $path = array_pop($tracker);
                   $oldpath = $path;
                   $path = str_replace("announce", "scrape", $path);
                   $tracker = implode("/", $tracker)."/".$path;

                   if ($oldpath == $path)
                   {
                       continue;
                   }
                   if ($openbittorrent_done)
                       continue;

                   if (preg_match("/thepiratebay.org/i", $tracker) || preg_match("/prq.to/", $tracker))
                   {
                       $tracker = "http://tracker.openbittorrent.com/scrape";
                       $openbittorrent_done = 1;
                   }
                   if(preg_match('/udp:\/\//', $tracker))
                   {
                       $udp=true;
                       try
                       {
                           $timeout = 5;
                           $udp= new udptscraper($timeout);
                           $stats=$udp->scrape($tracker,$rowu["info_hash"]);
                           //print_r($stats); exit();
                           foreach ($stats as $idu=>$scrape)
                           {
                               $seeders += $scrape['seeders'];
                               $leechers += $scrape['leechers'];
                               $downloaded    += $scrape['completed'];
                           }
                       }
                       catch(ScraperException $e)
                       {
                           $e->isConnectionError();
                       }
                   }
                   else
                   {
                       $stats = torrent_scrape_url($tracker, $rowu["info_hash"]);
                   }

                   if ($stats['seeds'] != -1)
                   {
                       $seeders += $stats['seeds'];
                       $leechers += $stats['peers'];
                       $downloaded += $stats['downloaded'];

                       SQL_Query_exec("UPDATE `announce` SET `online` = 'yes', `seeders` = '".$stats[seeds]."', `leechers` = '".$stats[peers]."', `times_completed` = '".$stats[downloaded]."' WHERE `url` = ".sqlesc($ann)." AND `torrent` = $rowu[id]");
                   }
                   else
                   {
                       SQL_Query_exec("UPDATE `announce` SET `online` = 'no' WHERE `url` = ".sqlesc($ann)." AND `torrent` = $rowu[id]");
                   }
               }

               if ($seeders !== null)
               {
                   SQL_Query_exec("UPDATE torrents SET leechers = '".$leechers."', seeders = '".$seeders."', times_completed = '".$downloaded."', last_action = '".get_date_time()."', visible = 'yes' WHERE id = '".$rowu['id']."'");
               }
               else
               {
                   SQL_Query_exec("UPDATE torrents SET last_action = '".get_date_time()."' WHERE id='".$rowu['id']."'");
               }
           }
           //===| End UDP Scraper
                   
           if ($seeders !== null)
           {
               print ("<div style='margin-bottom:5px; margin-left:20px'><b>".T_("LIVE_STATS")."</b>: </div>");
               print ("<div style='margin-left:20px'>".T_("SEEDERS").": <font color='limegreen'>".$seeders."</font></div>");
               print ("<div style='margin-left:20px'>".T_("LEECHERS").": <font color='#FF2000'>".$leechers."</font></div>");
               print ("<div style='margin-left:20px'>".T_("COMPLETED").": <font color='#0080FF'>".$downloaded."</font></div>");
           }
           else
           {
               print ("<div style='margin-top:10px; margin-bottom:5px' align='center'><b>".T_("LIVE_STATS")."</b>: </div>");
               print ("<div style='font:italic 14px Times' align='center'><font color='#FF2000'>".T_("TRACKERS_OFFLINE")."!</font></div>");
           }
           print ("<div style='margin-top:10px; margin-bottom:10px' align='center'>
               <a href='torrents-details.php?id=".$id."'><input type='submit' name='submit' value=".T_("SUBMIT")."></a>
           </div>");
           print ("</td>");
       }
       else
       {
           print ("<td class='table_col1' width='150' valign='middle' align='center'>
               <div style='margin-top:5px; margin-bottom:10px; font:bold 16px Times' align='center'><font color='#FF2000'>".T_("EXTERNAL_TORRENT")."</font></div>
               <div style='font:normal 12px Times' align='center'>".T_("UPDATE_STATS")."</div></div>
                   <form action='torrents-details.php?id=$id&amp;scrape=1' method='post'>
                       <div style='margin-top:5px; margin-bottom:10px' align='center'><input type='submit' name='submit' value=".T_("UPDATE")." /></div>
                   </form>
               </td>");
       }
       print ("</tr></table></td>");
   }
   //===| End Scrape External Torrents


[ATTACH]2449._xfImport[/ATTACH]

Add to languages/english.php:

$LANG["UPDATE"] = "Update";
$LANG["EXTERNAL_TORRENT"] = "External Torrent";
$LANG["TRACKERS_OFFLINE"] = "All Trackers<br />are <b>Offline</b>";



And if you want to use mega_scrape.php manually, add this code wherever you want to see it:

echo "[<a href='mega_scrape.php'><b>Run Mega Scrape</b></a>]";







[ATTACH]2347._xfImport[/ATTACH]

EDITED and FIXED by leoncoder
This mod works very well, but if you write a wrong name, you get an SQL error.
So you can do this:

Before:

SQL_Query_exec("UPDATE users SET uploaded = uploaded + $credit, modcomment = ".sqlesc($modcomment1)." WHERE id = '$receiver'");


Put this:

if (!$receiver) autolink("uptransfer.php", T_("USER_NOT_FOUND"));


languages/english.php:

$LANG["USER_NOT_FOUND"] = "Not found any member with this name into database!";
[color=rgb(34,34,34)]I think[/color][color=rgb(34,34,34)] [/color][color=rgb(34,34,34)]I[/color][color=rgb(34,34,34)] [/color][color=rgb(34,34,34)]managed to[/color][color=rgb(34,34,34)] [/color][color=rgb(34,34,34)]solve[/color][color=rgb(34,34,34)] [/color][color=rgb(34,34,34)]the problem of[/color][color=rgb(34,34,34)] [/color][color=rgb(34,34,34)]logging[/color][color=rgb(34,34,34)] [/color][color=rgb(34,34,34)]on[/color][color=rgb(34,34,34)] [/color][color=rgb(34,34,34)]all types of[/color][color=rgb(34,34,34)] [/color][color=rgb(34,34,34)]touch[/color][color=rgb(34,34,34)]-based[/color][color=rgb(34,34,34)] [/color][color=rgb(34,34,34)]devices.[/color]

Upload the attached files: jquery.ui.touch.js and jquery.ui.touch-punch.js in jquery folder.

jquery.ui.touch-punch.js simulates a mouse but also needs the previous jquery.ui files.

The code for account-login.php becomes:

<script type="text/javascript" src="js/jquery.js"></script>
<script type="text/javascript" src="js/jquery-ui.js"></script>
<script type="text/javascript" src="js/jquery.ui.touch.js"></script>
<script type="text/javascript" src="js/jquery.ui.touch-punch.js"></script>
<script type="text/javascript" src="js/QapTcha.jquery.js"></script>
<script type="text/javascript"> $(document).ready(function(){ $('#QapTcha').QapTcha({disabledSubmit:true}); });</script>



Also can be used on account-signup.php and contact.php, if you have this page.

[url="http://51.15.8.36/applications/core/interface/file/attachment.php?id=7059"]jquery.ui.touch.js[/url]

[url="http://51.15.8.36/applications/core/interface/file/attachment.php?id=7060"]jquery.ui.touch-punch.js[/url]
VPS host for trackers — 2014-07-04 14:35:48 in General Chat
A VPS from here is realy amazing but you have to install alone all you need. Works perfectly and have a huge space for an ordinary VPS:

[url="http://dediseedbox.com/"]http://dediseedbox.com/[/url]
This mod actually works properly to my tracker. My VPS runs PHP 5.2 but I think that will not be problems with the 5.3 and 5.4 versions.
The members that are inactive for over 90 days will be disabled, but before that happen they will receive 3 warning emails at 7 days interval.
These values can easily be changed in the Config section to fit your needs.

Run into database:

ALTER TABLE `users` ADD `averted1` enum('yes','no') NOT NULL default 'no';
ALTER TABLE `users` ADD `averted2` enum('yes','no') NOT NULL default 'no';
ALTER TABLE `users` ADD `averted3` enum('yes','no') NOT NULL default 'no';

Add into backend/cleanup.php the next code:
    //===| Start Disable Inactive Accounts |===//
   //===| Config
   $dw1 = 69; //===| Days until the first warning: three weeks to finish
   $dw2 = 76; //===| Days until the second warning: two weeks to finish
   $dw3 = 83; //===| Days until the third warning: one week to finish
   $dtd = 90; //===| Days until the inactive accounts are disabled
   
   $warning1 = sqlesc(get_date_time(gmtime() - ($dw1 * 86400)));
   $warning2 = sqlesc(get_date_time(gmtime() - ($dw2 * 86400)));
   $warning3 = sqlesc(get_date_time(gmtime() - ($dw3 * 86400)));
   $disabled = sqlesc(get_date_time(gmtime() - ($dtd * 86400)));
   
   //===| Reset emails averted if the user has been logged
   $res0 = SQL_Query_exec("SELECT id, averted1, averted2, averted3 FROM users WHERE enabled = 'yes' AND averted1 = 'yes' || averted2 = 'yes' || averted3 = 'yes' AND last_access > $warning1");
   while ($arr0 = mysql_fetch_assoc($res0))
   {
       SQL_Query_exec("UPDATE users SET averted1 = 'no', averted2 = 'no', averted3 = 'no' WHERE id = $arr0[id]");
   }
   
   //===| First warning
   $res1 = SQL_Query_exec("SELECT id, username, email, averted1 FROM users WHERE enabled = 'yes' AND averted1 = 'no' AND last_access > $warning2 AND last_access < $warning1");
   while ($arr1 = mysql_fetch_assoc($res1))
   {
       // Send first email
       $subject = "Warning for inactivity";
       $body = "You have received this email for the following reason:n------------------------------nYour account '".$arr1["username"]."' to ".$site_config['SITENAME']." has been marked as inactive and will be disabled after a few days!nTo delete this entry is enough to make us a visit and say hello: ".$site_config['SITEURL']."n------------------------------nnRegards, ".$site_config['SITENAME']." Staff";
       sendmail($arr1["email"], "$subject", "$body", "From $site_config[SITEEMAIL]", "-f$site_config[SITEEMAIL]");
       
       SQL_Query_exec("UPDATE users SET averted1 = 'yes' WHERE id = $arr1[id]");
   }
   
   //===| Second warning
   $res2 = SQL_Query_exec("SELECT id, username, email, averted2 FROM users WHERE enabled = 'yes' AND averted2 = 'no' AND last_access > $warning3 AND last_access < $warning2");
   while ($arr2 = mysql_fetch_assoc($res2))
   {
       // Send second email
       $subject = "Warning for inactivity";
       $body = "You have received this email for the following reason:n------------------------------nYour account '".$arr2["username"]."' to ".$site_config['SITENAME']." has been marked as inactive and will be disabled after a few days!nTo delete this entry is enough to make us a visit and say hello: ".$site_config['SITEURL']."n------------------------------nnRegards, ".$site_config['SITENAME']." Staff";
       sendmail($arr2["email"], "$subject", "$body", "From $site_config[SITEEMAIL]", "-f$site_config[SITEEMAIL]");
   
       SQL_Query_exec("UPDATE users SET averted2 = 'yes' WHERE id = $arr2[id]");
   }
   
   //===| Third Warning
   $res3 = SQL_Query_exec("SELECT id, username, email, averted3 FROM users WHERE enabled = 'yes' AND averted3 = 'no' AND last_access > $disabled AND last_access < $warning3");
   while ($arr3 = mysql_fetch_assoc($res3))
   {
       // Send third email
       $subject = "Warning for inactivity";
       $body = "You have received this email for the following reason:n------------------------------nYour account '".$arr3["username"]."' to ".$site_config['SITENAME']." has been marked as inactive and will be disabled after a few days!nTo delete this entry is enough to make us a visit and say hello: ".$site_config['SITEURL']."n------------------------------nnRegards, ".$site_config['SITENAME']." Staff";
       sendmail($arr3["email"], "$subject", "$body", "From $site_config[SITEEMAIL]", "-f$site_config[SITEEMAIL]");
   
       SQL_Query_exec("UPDATE users SET averted3 = 'yes' WHERE id = $arr3[id]");
   }
   
   //===| Disable accounts
   $res4 = SQL_Query_exec("SELECT id, username, modcomment FROM users WHERE enabled = 'yes' AND last_access != '0000-00-00 00:00:00' AND last_access < $disabled");
   while ($arr4 = mysql_fetch_assoc($res4))
   {
       $modcomment = htmlspecialchars($arr4["modcomment"]);
       $modcomment = gmdate("d-M-Y") . " - Disabled for inactivity by Systemn". $modcomment;
       $modcom = sqlesc($modcomment);
       SQL_Query_exec("UPDATE users SET enabled = 'no', modcomment = $modcom WHERE id = $arr4[id]");
       write_log("<a href=account-details.php?id=$arr4[id]><b>$arr4[username]</b></a> account has been disabled for inactivity by System");
   }
   //===| End Disable Inactive Accounts |===//
Online Radio — 2013-08-27 11:12:15 in v2.08 Mods Completed
This is an multi-station radio that is open into a pop-up window.

So you can navigate anywhere with your browser without affecting in any way the radio window.

Even if you close your browser, the radio will still work.

online-radio.php:

<?php
require_once("backend/functions.php");
dbconn(false);
loggedinonly();

$th = @mysql_fetch_array(@sql_query_exec("select uri from stylesheets where id=".$CURUSER["stylesheet"]));
if ($th)
$THEME = $th[uri];
?>
<link rel="stylesheet" type="text/css" href="<?php echo $site_config['SITEURL'];?>/themes/<?php echo $THEME;?>/theme.css" />
<script type="text/javascript" src="backend/java_klappe.js"></script>

<div style="margin-top:15px; margin-bottom:10px" align="center">
<script type="text/javascript">
<!--
function song(){ document.getElementById('music1').innerHTML="<embed type='application/x-mplayer2' id='music2' pluginspage='http://www.microsoft.com/Windows/MediaPlayer/' src='"+document.getElementById('cancion').value+"' name='MediaPlayer1' width='400' height='64' controltype='1' showcontrols='1' showstatusbar='1' AutoStart='true'></embed>"; }
//-->
</script>

<div id="jukebox" style="margin-top:10px">
<select id="cancion" onchange="song()" size="1">
<option value="none">&nbsp; Select Station &nbsp;</option>
<option value="http://asculta.radiomafia.ro:8000">&nbsp; Radio Mafia &nbsp;</option>
<option value="http://stream.radiozu.ro:8020">&nbsp; Radio ZU &nbsp;</option>
<option value="http://live.radio-hit.ro:8585">&nbsp; Radio HIT &nbsp;</option>
<option value="http://radiobeat.ro:8000">&nbsp; Radio BEAT &nbsp;</option>
<option value="http://80.86.106.136:80">&nbsp; Kiss FM &nbsp;</option>
</select>

<div style="margin-top:15px">
<span id="music1">
<embed type="application/x-mplayer2" id="music1"
pluginspage="http://www.microsoft.com/Windows/MediaPlayer/"
src=""
name="MediaPlayer1"
width="400"
height="64"
controltype="1"
showcontrols="1"
showstatusbar="1"
AutoStart="0">
</embed>
</span>
</div>
</div>
</div>



online-radio_block.php:

<?
begin_block("Online Radio");

print ("<div style="margin-top:5px" align="center">");

print ("<table>
<tr>
<td>
<a href="javascript:void(0);" onclick="window.open('/online-radio.php', 'mywindow5', 'width=450, height=130, menubar=no, toolbar=no, scrollbars=no');">
<img src="images/online-radio.png" border="0">
</a>
</td>
</tr>
</table>");

print ("</div>");

end_block();
?>


However, these files are already included in the online-radio.zip archive.

All you need to do is to upload all files included in this archive into your root (public_html).

[url="http://devscorner.xyz/applications/core/interface/file/attachment.php?id=6920"]online-radio.zip[/url]



VPS host for trackers — 2013-08-16 06:11:36 in General Chat
I'm looking for some time after a good VPS for my tracker. Offers are many on the net, but times are picky when it comes to trackers, or have bad servers.

My request is to post here the hosting companies at that you are sure he accept trackers. Thanks   :rolleyes:
Create a new php file called moresmiles

<?php
require_once("backend/smilies.php");
require_once("backend/functions.php");
require_once("backend/config.php");
dbconn();

//===| GET CURRENT USERS THEME AND LANGUAGE
if ($CURUSER)
{
$ss_a = @mysql_fetch_array(@sql_query_exec("select uri from stylesheets where id=" . $CURUSER["stylesheet"]));
if ($ss_a)
$THEME = $ss_a["uri"];
$lng_a = @mysql_fetch_array(@sql_query_exec("select uri from languages where id=" . $CURUSER["language"]));
if ($lng_a)
$LANGUAGE = $lng_a["uri"];
}
else
{ //===| Not logged in so get default theme/language
$ss_a = mysql_fetch_array(sql_query_exec("select uri from stylesheets where id='" . $site_config['default_theme'] . "'"));
if ($ss_a)
$THEME = $ss_a["uri"];
$lng_a = mysql_fetch_array(sql_query_exec("select uri from languages where id='" . $site_config['default_language'] . "'"));
if ($lng_a)
$LANGUAGE = $lng_a["uri"];
}

echo'<link rel="stylesheet" type="text/css" href="'.$site_config['SITEURL'].'/themes/'.$THEME.'/theme.css" />';

if (!isset($_GET["form"])||!isset($_GET["text"]))
{
err_msg("Error!","Missing parameter!");
print("</body></html>");
die();
}

$parentform=htmlentities(urldecode($_GET["form"]));
$parentarea=htmlentities(urldecode($_GET["text"]));
?>

<script language=javascript>
function SmileIT(smile,textarea)
{
//===| Attempt to create a text range (IE)
if (typeof(textarea.caretPos) != "undefined" && textarea.createTextRange)
{
var caretPos = textarea.caretPos;
caretPos.text = caretPos.text.charAt(caretPos.text.length - 1) == ' ' ? smile + ' ' : smile
caretPos.select();
}
//===| Mozilla text range replace
else if (typeof(textarea.selectionStart) != "undefined")
{
var begin = textarea.value.substr(0, textarea.selectionStart);
var end = textarea.value.substr(textarea.selectionEnd);
var scrollPos = textarea.scrollTop;

textarea.value = begin + smile + end;

if (textarea.setSelectionRange)
{
textarea.focus();
textarea.setSelectionRange(begin.length + smile.length, begin.length + smile.length);
}
textarea.scrollTop = scrollPos;
}
//===| Just put it on the end
else
{
textarea.value += smile;
textarea.focus(textarea.value.length - 1);
}
}
</script>

<body class="shoutbox_body">
<table class="table_table" width="100%" cellpadding="1" cellspacing="1">
<tr>
<?php
global $count;
while ((list($code, $url) = each($smilies)))
{
if ($count % 3==0)
print("n<tr>");
print("nt<td class="table_table" align="center"><a href="javascript: SmileIT('".str_replace("'","'",$code)."',window.opener.document.forms.$parentform.$parentarea);"><img border=0 src=images/smilies/".$url."></a></td>");
$count++;

if ($count % 3==0)
print("n</tr>");
}
?>
</tr>
</table>

<div align="center">
<a href="javascript: window.close()"><?php echo CLOSE; ?></a>
</div>
<br />
</body>

?>

and upload it into your root.

Into backend/java_klappe.js copy this new function:

function PopSmiles(form,name)
{
link = 'moresmiles.php?action=display&form='+form+'&text='+name
newWin=window.open('moresmiles.php?form='+form+'&text='+name,'moresmile','height=450,width=400,resizable=no,scrollbars=yes,location=no');
if (window.focus) {newWin.focus()}
}



Into shoutbox.php and backend/bbcode.php replace:

javascript:popMoreSmiles

with:

javascript:popSmiles




Upload Manager — 2013-08-06 17:36:47 in v2.08 Mods Completed
You must to replace class_user($CURUSER["username"]) with $CURUSER["username"] because you haven't installed class_user function.

Or you can install this mod from here: [url="https://www.torrenttrader.org/topic/17452-class-colors-function-for-208"]https://www.torrenttrader.org/topic/17452-class-colors-function-for-208[/url]
Upload Activity — 2013-06-17 09:33:48 in v2.08 Mods Completed
Create a new file called upload-stats.php:

<?php
require_once("backend/functions.php");
dbconn(true);
loggedinonly();

stdhead("Upload Activity");

   if ($CURUSER["control_panel"] == "yes")
   {
       begin_frame("Upload Activity");
       
       $catorder = $_GET['order'];
       $n_tor = get_row_count("torrents");
       $n_peers = get_row_count("peers");

       $upclass = 4; //===| Set your minimum class that can upload torrents
       $query = "SELECT id, username, added, uploaded, downloaded, class FROM users WHERE class >= $upclass ORDER BY class DESC";
       $result = SQL_Query_exec($query);
       $num = mysql_num_rows($result);

       echo "<div style='margin-top:10px' align=center><font size=2>We have <font color=#0080FF><b>" . $num . "</b></font> members with upload rights</font></div>";

       $zerofix = $num - 1;

       echo "<table class=table_table cellpadding=4 align=center border=0>";

       for ($i = 0; $i <= $zerofix; $i++)
       {
           if ($num > 0)
           {
               $class = mysql_result($result, $i, "class");
               if ($i > 0)
               $class2 = mysql_result($result, $i-1, "class");

               if ($class != $class2) {
                   echo("<tr><td style=border:none colspan=8 height=15></td></tr>");
                   echo("<tr><td style=border:none colspan=8><b>Class</b>: <b>".get_user_class_name($class)."</b></td></tr>
                   <tr>
                       <td class=table_head align=center><b>Num</b></td>
                       <td class=table_head><b>Username</b></td>
                       <td class=table_head><b>Uploaded</b></td>
                       <td class=table_head><b>Downloaded</b></td>
                       <td class=table_head><b>Ratio</b></td>
                       <td class=table_head><b>Uploaded Torrents</b></td>
                       <td class=table_head><b>Last Upload</b></td>
                       <td class=table_head align=center><b>Contact</b></td>
                   </tr>");
               }

               $id = mysql_result($result, $i, "id");
               $username = mysql_result($result, $i, "username");
               $added = mysql_result($result, $i, "added");
               $uploaded = mksize(mysql_result($result, $i, "uploaded"));
               $downloaded = mksize(mysql_result($result, $i, "downloaded"));
               $uploadedratio = mysql_result($result, $i, "uploaded");
               $downloadedratio = mysql_result($result, $i, "downloaded");

               $res = SQL_Query_exec("SELECT COUNT(*) FROM users WHERE class = $class");
               $arr = mysql_fetch_row($res);
               $liczclass = $arr[0];

               $upperquery = "SELECT added FROM torrents WHERE owner = $id";
               $upperresult = SQL_Query_exec($upperquery);
               $torrentinfo = mysql_fetch_array($upperresult);
               $numtorrents = mysql_num_rows($upperresult);

               if ($downloaded > 0)
               {
                   $ratio = $uploadedratio / $downloadedratio;
                   $ratio = number_format($ratio, 2);
                   $color = get_ratio_color($ratio);
                   if ($color)
                   $ratio = "<font color=$color>$ratio</font>";
               }
               else
                   if ($uploaded > 0)
                   $ratio = "Inf.";
                   else
                   $ratio = "---";

               if ($class != $class2)
               $counter = 0;
               $counter = $counter + 1;

               if ($numtorrents > 0)
               {
                   $lastadded = mysql_result($upperresult, $numtorrents - 1, "added");
                   $add = "<td class=table_col1>" . get_elapsed_time(sql_timestamp_to_unix_timestamp($lastadded)) . " ago (" . gmdate("d.M.Y",strtotime($lastadded)) . ")</td>";
               }
               else
               $add = "<td class=table_col1><font color=#FF2000><b>Nothing!</b></font></td>";

               echo "<tr>";
                   echo "<td class=table_col1 align=center><b>$counter</b></td>";
                   echo "<td class=table_col2><a href=/account-details.php?id=$id><b>".$username."</b></a></td>";
                   echo "<td class=table_col1><font color=limegreen><b>$uploaded</b></font></td>";
                   echo "<td class=table_col2><font color=#FF2000><b>$downloaded</b></font></td>";
                   echo "<td class=table_col1><b>$ratio</b></td>";
                   echo "<td class=table_col2><b><font color=#0080FF>$numtorrents</font> torrents</b> / total</td>n";
                   echo $add;
                   echo "<td class=table_col2 align=center><a href=mailbox.php?compose&id=$id><img src=images/button_pm.gif border=0></a></td>";
               echo "</tr>";
           }
       }
       echo "</table>";

       echo "<div style='margin-top:25px; margin-bottom:15px' align=center><font size=2><b>Torrents Stats</b></font></div>";

       echo "<table class=table_table cellpadding=4 align=center border=0>";
       if ($n_tor == 0)
       stdmsg("Sorry", "There's no category!");
       else
       {
           if ($catorder == "category")
               $orderby = "c.id";
           else if ($catorder == "lastul")
               $orderby = "last DESC, c.id";
           elseif ($catorder == "torrents")
               $orderby = "n_t DESC, c.id";
           elseif ($catorder == "peers")
               $orderby = "n_p DESC, name";
           else
               $orderby = "c.id";

           $res = SQL_Query_exec("SELECT c.name, c.parent_cat, MAX(t.added) AS last, COUNT(DISTINCT t.id) AS n_t, COUNT(p.id) AS n_p
           FROM categories as c LEFT JOIN torrents as t ON t.category = c.id LEFT JOIN peers as p
           ON t.id = p.torrent GROUP BY c.id ORDER BY $orderby");

           print("<tr>
               <td class=table_head><a href=upload-stats.php?order=category><b>Category</b></a></td>
               <td class=table_head><a href=upload-stats.php?order=lastul><b>Last Upload</b></a></td>
               <td class=table_head align=center><a href=upload-stats.php?order=torrents><b>Total Torrents</b></a></td>
               <td class=table_head align=center><a href=upload-stats.php?order=torrents><b>Torrents Rate</b></td>
               <td class=table_head align=center><a href=upload-stats.php?order=peers><b>Total Peers</b></a></td>
               <td class=table_head align=center><a href=upload-stats.php?order=peers><b>Peers Rate</b></a></td>
           </tr>n");

           while ($cat = mysql_fetch_array($res)) {
           $caty[] = " <tr>
               <td class=table_col1><b><font color=#FF2000>" . $cat['parent_cat'] . "</font> " . $cat['name'] . "</b></a></td>
               <td class=table_col2 " . ($cat['last']?(">".date("<b>d-M-Y</b> H:i", utc_to_tz_time($cat['last']))." (".get_elapsed_time(sql_timestamp_to_unix_timestamp($cat['last']))." ago)"):"><font color=#FF2000><b>Nothing!</b></font>") ."</td>
               <td class=table_col1 align=center>" . $cat['n_t'] . "</td>
               <td class=table_col2 align=center>" . number_format(100 * $cat['n_t']/$n_tor,1) . "%</td>
               <td class=table_col1 align=center>" . $cat['n_p'] . "</td>
               <td class=table_col2 align=center>" . ($n_peers > 0 ? number_format(100 * $cat['n_p']/$n_peers,1)."%":"---") . "</td>
           </tr>n";
           }

           echo implode("n",$caty);
           $torrents = number_format($n_tor);

           print(" <td colspan=2 class=table_head align=right><b>Total Results</b>:&nbsp;</td>
           <td class=table_head align=center>".$torrents."</td>
           <td class=table_head align=center>".number_format(100 * $torrents/$n_tor,1) . "%</td>
           <td class=table_head align=center>".$n_peers."</td>
           <td class=table_head align=center>".number_format(100 * $n_peers/$n_peers,1)."%</td>");
       }
       echo "</table><br />";
       end_frame();
   }
   else
   show_error_msg(T_("ERROR"), T_("SORRY_NO_RIGHTS_TO_ACCESS"), 1);

stdfoot();
?>



Of course, only members who have at least one 'Hit and Run' can see this warning.
I see you use the default theme. The code:


if ($site_config["MIDDLENAV"]){
   middleblocks();

is into footer.php, not in header.php, so put the necessary code there.
Users online

No users online

Search



Statistics

    Torrents

  • Tracking: 3
  • Todays torrents: 0
  • Seeders: 0
  • Leechers: 0
  • Peers: 0
  • Downloaded: 89.96 GB
  • Uploaded: 9.86 GB

  • Members

  • We have: 838
  • New today: 0
  • Guest today: 9

  • Online

  • Total online: 3
  • Members: 0
  • Guests online: 3
  • Comments: 3
  • Messages: 1,728