コード例 #1
0
ファイル: announce.php プロジェクト: l3oncoder/TorrentTrader
            err("Connection limit exceeded! You may only leech from one location at a time.");
        }
        if ($valid[0] >= 3 && $seeder == 'yes') {
            err("Connection limit exceeded!");
        }
    }
    $res = SQL_Query_exec("SELECT {$peerfields} FROM peers WHERE {$selfwhere}");
    $row = mysql_fetch_assoc($res);
    if ($row) {
        $self = $row;
    }
}
// END $SELF FILL
if ($MEMBERSONLY && $seeder != "yes") {
    $query = @mysql_fetch_row(@SQL_Query_exec("SELECT COUNT(DISTINCT torrent) FROM `peers` WHERE `userid` = '{$userid}' AND `seeder`='no'"));
    $maxslot = avail_slots($userid, $user["class"]);
    if ($query[0] >= $maxslot) {
        err("Maximum {$maxslot} Slot exceeded! You dont have any more download slots available, wait for 1 or more to finish then you can download this.");
    }
}
if (!isset($self)) {
    //IF PEER IS NOT IN PEERS TABLE DO THE WAIT TIME CHECK
    if ($MEMBERSONLY_WAIT && $MEMBERSONLY) {
        //wait time check
        if ($left > 0 && in_array($user["class"], explode(",", $site_config["WAIT_CLASS"]))) {
            //check only leechers and lowest user class
            $gigs = $user["uploaded"] / (1024 * 1024 * 1024);
            $elapsed = floor((gmtime() - $torrent["ts"]) / 3600);
            $ratio = $user["downloaded"] > 0 ? $user["uploaded"] / $user["downloaded"] : 1;
            if ($ratio == 0 && $gigs == 0) {
                $wait = $site_config["WAITA"];
コード例 #2
0
ファイル: header.php プロジェクト: Fadheler/TorrentTrader-3.0
    <?php 
if (!$CURUSER) {
    echo "";
} else {
    print T_("<font color='white'>Howdy!</font>") . "&nbsp;&nbsp;" . class_user($CURUSER[username]) . "";
    $userdownloaded = mksize($CURUSER["downloaded"]);
    $useruploaded = mksize($CURUSER["uploaded"]);
    if ($CURUSER["uploaded"] > 0 && $CURUSER["downloaded"] == 0) {
        $userratio = "Inf.";
    } elseif ($CURUSER["downloaded"] > 0) {
        $userratio = number_format($CURUSER["uploaded"] / $CURUSER["downloaded"], 2);
    } else {
        $userratio = "---";
    }
    $query_slots = @mysql_fetch_row(@SQL_Query_exec("SELECT COUNT(DISTINCT torrent) FROM peers WHERE userid = {$CURUSER['id']} AND seeder='no'"));
    $maxslot = avail_slots($CURUSER["id"], $CURUSER["class"]);
    $slots = number_format($maxslot) . "/" . number_format($query_slots[0]);
    $invites = $CURUSER["invites"];
    $seedbonus = $CURUSER["seedbonus"];
    print ",  &nbsp;&nbsp;<img src='../images/download.png' border='none' height='20' width='20' alt='Downloaded' title='Downloaded'> <font color='#CC0000'><b>{$userdownloaded}</b> </font>&nbsp;&nbsp; <img src='../images/upload.png' border='none' height='20' width='20' alt='Uploaded' title='Uploaded'> <font color='#009900'><b>{$useruploaded}</b></font>&nbsp;&nbsp; <img src='../images/ratio.png' border='none' height='20' width='20' alt='Ratio' title='Ratio'> <font color='blue'><b>{$userratio}</b></font> &nbsp;&nbsp;<img src='../images/invite.png' border='none' height='20' width='20' alt='Invites' title='invites'>&nbsp;&nbsp;<b><font color='white'>Invites</font></b>&nbsp;:&nbsp;<a href='" . $site_config["SITEURL"] . "../invite.php'><b><font color='purple'>{$invites}</font></b></a>&nbsp;&nbsp;&nbsp;&nbsp;<font color='white'><b>Download Slots:</b></font> <b><font color='yellow'>{$slots}</b></font>";
    echo " <a class='profile' href='" . $site_config["SITEURL"] . "/account/'><img src='/images/setting.png' border='none' height='20' width='20' alt='Account Setting' title='Account Setting'></a> <a class='account' href='../user/?id={$CURUSER['id']}'><img src='../images/profile.png' border='none' height='20' width='20' alt='Profile' title='Profile'></a> <a class='logout' href=\"" . $site_config["SITEURL"] . "/account-logout.php\"><img src='../images/logout.png' border='none' height='20' width='20' alt='Logout' title='Logout'></a>";
    //check for new pm's
    $res = mysql_query("SELECT COUNT(*) FROM messages WHERE receiver=" . $CURUSER["id"] . " and unread='yes' AND location IN ('in','both')") or print mysql_error();
    $arr = mysql_fetch_row($res);
    $unreadmail = $arr[0];
    if ($unreadmail) {
        print "<embed src='../mail.mp3' autostart='true' width='0' height='0' hidden='true'><a class='mail_n' href=" . $site_config["SITEURL"] . "/message/?inbox><img src='../images/mails.png' border='none' height='20' width='20' alt='New PM' title='({$unreadmail}) New PM'S'><font color='red'>({$unreadmail})</font><p></a>&nbsp;&nbsp;";
    } else {
        print "<a class='mail' href=" . $site_config["SITEURL"] . "/message/><img src='../images/mail.png' border='none' height='20' width='20' alt='My Messages' title='My Messages'></a>&nbsp;";
    }
    //end check for pm's