Example #1
0
    if ($lmaID && !$Properties['LossymasterApproved']) {
        $DB->query("\n\t\t\tDELETE FROM torrents_lossymaster_approved\n\t\t\tWHERE TorrentID = '{$TorrentID}'");
    }
    $DB->query("\n\t\tSELECT TorrentID\n\t\tFROM torrents_lossyweb_approved\n\t\tWHERE TorrentID = '{$TorrentID}'");
    list($lwID) = $DB->next_record();
    if (!$lwID && $Properties['LossywebApproved']) {
        $DB->query("\n\t\t\tINSERT INTO torrents_lossyweb_approved\n\t\t\tVALUES ({$TorrentID}, {$LoggedUser['ID']}, '" . sqltime() . "')");
    }
    if ($lwID && !$Properties['LossywebApproved']) {
        $DB->query("\n\t\t\tDELETE FROM torrents_lossyweb_approved\n\t\t\tWHERE TorrentID = '{$TorrentID}'");
    }
}
$SQL .= "\n\t\tDescription = {$T['TorrentDescription']}\n\tWHERE ID = {$TorrentID}";
$DB->query($SQL);
if (check_perms('torrents_freeleech') && $Properties['FreeLeech'] != $CurFreeLeech) {
    Torrents::freeleech_torrents($TorrentID, $Properties['FreeLeech'], $Properties['FreeLeechType']);
}
$DB->query("\n\tSELECT GroupID, Time\n\tFROM torrents\n\tWHERE ID = '{$TorrentID}'");
list($GroupID, $Time) = $DB->next_record();
// Competition
if (strtotime($Time) > 1241352173) {
    if ($_POST['log_score'] == '100') {
        $DB->query("\n\t\t\tINSERT IGNORE into users_points (GroupID, UserID, Points)\n\t\t\tVALUES ('{$GroupID}', '{$UserID}', '1')");
    }
}
// End competiton
$DB->query("\n\tSELECT LogScore\n\tFROM torrents\n\tWHERE ID = {$TorrentID}");
list($LogScore) = $DB->next_record();
if ($Properties['Trumpable'] == 1 && $LogScore == 100) {
    $DB->query("\n\t\tUPDATE torrents\n\t\tSET LogScore = 99\n\t\tWHERE ID = {$TorrentID}");
    $Results = array();
Example #2
0
    /**
     * Convenience function to allow for passing groups to Torrents::freeleech_torrents()
     *
     * @param array $GroupIDs the groups in question
     * @param int $FreeNeutral see Torrents::freeleech_torrents()
     * @param int $FreeLeechType see Torrents::freeleech_torrents()
     */
    public static function freeleech_groups($GroupIDs, $FreeNeutral = 1, $FreeLeechType = 0)
    {
        $QueryID = G::$DB->get_query_id();
        if (!is_array($GroupIDs)) {
            $GroupIDs = array($GroupIDs);
        }
        G::$DB->query('
			SELECT ID
			FROM torrents
			WHERE GroupID IN (' . implode(', ', $GroupIDs) . ')');
        if (G::$DB->has_results()) {
            $TorrentIDs = G::$DB->collect('ID');
            Torrents::freeleech_torrents($TorrentIDs, $FreeNeutral, $FreeLeechType);
        }
        G::$DB->set_query_id($QueryID);
    }
Example #3
0
                    $Size = (int) $_POST['size'];
                    $Units = db_string($_POST['scale']);
                    if (empty($Size) || !in_array($Units, array('k', 'm', 'g'))) {
                        $Err = 'Invalid size or units';
                    } else {
                        $Bytes = Format::get_bytes($Size . $Units);
                        $DB->query("\n                            SELECT ID\n                            FROM torrents\n                            WHERE ID IN (" . implode(', ', $TorrentIDs) . ")\n                              AND Size > '{$Bytes}'");
                        $LargeTorrents = $DB->collect('ID');
                        $TorrentIDs = array_diff($TorrentIDs, $LargeTorrents);
                    }
                }
                if (sizeof($TorrentIDs) > 0) {
                    Torrents::freeleech_torrents($TorrentIDs, $FreeLeechType, $FreeLeechReason);
                }
                if (isset($LargeTorrents) && sizeof($LargeTorrents) > 0) {
                    Torrents::freeleech_torrents($LargeTorrents, 2, $FreeLeechReason);
                }
                $Err = 'Done!';
            }
        }
    }
}
?>
<div class="thin">
    <div class="box pad box2">
<?php 
if (isset($Err)) {
    ?>
        <strong class="important_text"><?php 
    echo $Err;
    ?>