TorrentFlux.com Hey, OppTupacShakur, you have 11 messages, 0 are new.
05-07-2007, 12:36:46
Home Help Search Profile Logout donate chat
News:


+  TorrentFlux Forums
|-+  Code Hacks and Tools
| |-+  TorrentFlux 2.1 Hacks
| | |-+  xfer bandwidth/transfer statistics hack 2.3.0
« previous next »
Pages: 1 ... 6 7 [8] Go Down Reply Notify of replies Send this topic Print
Author Topic: xfer bandwidth/transfer statistics hack 2.3.0  (Read 14714 times)
ridewitme
Newbie
*
Offline Offline

Posts: 27


God of English





View Profile Personal Message (Offline)
« Reply #105 on: 12-21-2006, 18:07:35 » Reply with quote

seems to work but i have barely tested it



Nope, tried that and still didn't work. Blackwidow, any hints/fix to get it to stop reporting negative values when torrents are deleted?
Report to moderator   Logged
blackwidow
Newbie
*
Offline Offline

Posts: 44



View Profile Personal Message (Offline)
« Reply #106 on: 12-22-2006, 09:59:23 » Reply with quote

what version of TF are you running? it sure sounds like the saveXfer() command isn't being called from index.php upon torrent deletion. search for $delfile. you should see a line about 9 lines down from $delfile that looks like this:
Code:
if ($af->downtotal || $af->uptotal) saveXfer($af->torrentowner,$af->downtotal,$af->uptotal);

let me know what you see and we'll go from there.
Report to moderator   Logged
ridewitme
Newbie
*
Offline Offline

Posts: 27


God of English





View Profile Personal Message (Offline)
« Reply #107 on: 12-25-2006, 06:20:57 » Reply with quote

This is the next section of code under the line you posted above:

        @unlink($cfg["torrent_file_path"].$delfile);
        @unlink($cfg["torrent_file_path"].$alias_file);
        // try to remove the QInfo if in case it was queued.
        @unlink($cfg["torrent_file_path"]."queue/".$alias_file.".Qinfo");

        // try to remove the pid file
        @unlink($cfg["torrent_file_path"].$alias_file.".pid");
        @unlink($cfg["torrent_file_path"].getAliasName($delfile).".prio");

        AuditAction($cfg["constants"]["delete_torrent"], $delfile);

        header("location: index.php");
        exit();
Report to moderator   Logged
blackwidow
Newbie
*
Offline Offline

Posts: 44



View Profile Personal Message (Offline)
« Reply #108 on: 12-26-2006, 09:05:20 » Reply with quote

yup, missing the saveXfer() command. your code should look like this:

Code:
@unlink($cfg["torrent_file_path"].$delfile);
include_once("AliasFile.php");
$af = new AliasFile($cfg['torrent_file_path'].$alias_file, 0);
if ($af->downtotal || $af->uptotal) saveXfer($af->torrentowner,$af->downtotal,$af->uptotal);
@unlink($cfg["torrent_file_path"].$alias_file);

what versions of TF are you using, and how did you add the xfer code? I hope you're not missing other necessary tidpits...
Report to moderator   Logged
blackwidow
Newbie
*
Offline Offline

Posts: 44



View Profile Personal Message (Offline)
« Reply #109 on: 12-26-2006, 10:54:34 » Reply with quote

I updated the patch for TorrentFlux 2.3. I did not change the code except for taking out some debugging echo statement that had been accidentally left in the xfer 2.1.1 version.

To make this version, I simply patched TF 2.3 with the xfer 2.1.1 patch. That applied fine with a few notices and one error, which I corrected manually. I then updated the documentation and credated xfer 2.3.0 patch and patched files.

please let me know if you find any errors or omissions!
Report to moderator   Logged
thenoob
Newbie
*
Offline Offline

Posts: 1



View Profile Email Personal Message (Offline)
« Reply #110 on: 12-29-2006, 07:13:02 » Reply with quote

ok sorry i am noob!

im under debian, running torrentflux 2.2

i downloaded and made the patch , after it i cant start a torrent ,while the old torrents are running . i have problem with edit config.php , when i add my password i get an error "acces denied to SQL database (password enabled). if i remove the passw, works fine but download failed on all new torrent.

i didnt find nothing about what i have to write into the config.php to make it work(the first time i had help---old config file lost)



pls help me!

problem solved, i added a command to btornado(--read_buffer=0) and that caused. damn

why torrentflux doesnt use utorrent as client?
« Last Edit: 12-29-2006, 16:26:11 by thenoob » Report to moderator   Logged
ridewitme
Newbie
*
Offline Offline

Posts: 27


God of English





View Profile Personal Message (Offline)
« Reply #111 on: 01-09-2007, 23:54:46 » Reply with quote

Fixed the problem I had with negative values. Two things happened:

The first version I tried was when I used your files to patch 2.2 when they were only meant for 2.1, I fixed it to get it working with my other hacks but still had negative values. I tried again once 2.3 came out, that worked really well, but still had negative values.

I looked at the index again and noticed that you file had the saveXfer command in a difference sequence to the code that you had posted. I changed that around and it worked for me. However, I was still getting negative values for my other users. It seems that my multi.php file didn't have the commands needed for your hack to work, so I've placed those in there and now going to give it a shot.



Will report back soon, stuff up on my part with all these hacks I have installed =)




Andrew.
Report to moderator   Logged
adrock2021
Newbie
*
Offline Offline

Posts: 2



View Profile Personal Message (Offline)
« Reply #112 on: 02-01-2007, 07:04:43 » Reply with quote

i just recently installed this and absolutely love it!!!  heres a pic of what my torrentflux page looks like now:



i tweaked the transfer bars a bit and of course played around with the themes i found in the themes thread. 

i changed a bit of the code to get the bars to look like the old bars from the matrix theme.

both changes i made are done in the functions.php

look for:
Code:
//XFER:****************************************************
//XFER: displayXferBar(max_bytes, used_bytes, title)
//XFER: displays xfer percentage bar
function displayXferBar($total, $used, $title)

then after that erase whats in there and put in this instead:
Code:
{
    global $cfg;
    $remaining = max(0,$total-$used/(1024*1024));
    $percent = round($remaining/$total*100,0);
    $freeSpace = "";

    if ($percent > 20)
    {
        $freeSpace = " (".formatFreeSpace($remaining)." Remaining)";
    }
?>
    <tr>
        <td width="2%" align="left"><div class="tiny"><?php echo $title ?></div></td>
        <td width="80%">
            <table width="100%" border="0" cellpadding="0" cellspacing="0" style="margin-top:1px;margin-bottom:1px;">
            <tr>
                <td background="themes/<?php echo $cfg["theme"] ?>/images/proglass2.gif" width="<?php echo $percent ?>%"><div class="tinypercent" align="center"><?php echo $percent."%".$freeSpace ?></div></td>
                <td background="themes/<?php echo $cfg["theme"] ?>/images/noglass.gif" width="<?php echo (100 - $percent) ?>%"><img src="images/blank.gif" width="1" height="3" border="0"></td>
            </tr>
            </table>
        </td>
     </tr>
<?php
}

where proglass2.gif is basically the proglass.gif found in the matrix theme rotated 180 degrees.

the next change is found by looking for this:
Code:
// ***************************************************************************
// ***************************************************************************
// Display the Drive Space Graphical Bar
function displayDriveSpaceBar($drivespace)

and then erasing whats in there and putting in this:
Code:
{
    global $cfg;
    $freeSpace = "";

    if ($drivespace > 20)
    {
        $freeSpace = " (".formatFreeSpace($cfg["free_space"])." Free)";
    }
?>
    <table width="100%" border="0" cellpadding="0" cellspacing="0">
    <tr nowrap>
        <td width="2%"><div class="tiny"><?php echo _STORAGE ?>:</div></td>
        <td width="80%">
            <table width="100%" border="0" cellpadding="0" cellspacing="0">
            <tr>
                <td background="themes/<?php echo $cfg["theme"] ?>/images/proglass.gif" width="<?php echo $drivespace ?>%"><div class="tinypercent" align="center"><?php echo $drivespace."%".$freeSpace ?></div></td>
                <td background="themes/<?php echo $cfg["theme"] ?>/images/noglass.gif" width="<?php echo (100 - $drivespace) ?>%"><img src="images/blank.gif" width="1" height="3" border="0"></td>
            </tr>
            </table>
        </td>
    </tr>
    </table>
<?php
}

where again proglass.gif is the proglass.gif found in the matrix theme.

thx again for this amazing hack and i hope to see your todo list finished up sometime soon!!   Grin
Report to moderator   Logged
Settler
Newbie
*
Offline Offline

Posts: 3



View Profile Email Personal Message (Offline)
« Reply #113 on: 04-06-2007, 08:12:45 » Reply with quote

Hello,

I installed these hack on my tf 2.3 installation, and since then I wasn't able to download anything. Instead I'm getting the error "Download failed" even the download did not begin. So I switched back to the original files and everything works fine... Did I miss something? Any solutions for this problem?

kind regards
Settler
Report to moderator   Logged
Pages: 1 ... 6 7 [8] Go Up Reply Notify of replies Send this topic Print 
« previous next »
Jump to:  


Powered by MySQL Powered by SMF 1.1.1 | SMF © 2006, Simple Machines LLC Powered by PHP