Exemplo n.º 1
0
        }
        $FLTokens = $UInfo['FLTokens'];
    }
    // First make sure this isn't already FL, and if it is, do nothing
    if (!Torrents::has_token($TorrentID)) {
        if ($FLTokens <= 0) {
            error('You do not have any freeleech tokens left. Please use the regular DL link.');
        }
        if ($Size >= 1073741824) {
            error('This torrent is too large. Please use the regular DL link.');
        }
        // Let the tracker know about this
        if (!Tracker::update_tracker('add_token', array('info_hash' => rawurlencode($InfoHash), 'userid' => $UserID))) {
            error('Sorry! An error occurred while trying to register your token. Most often, this is due to the tracker being down or under heavy load. Please try again later.');
        }
        if (!Torrents::has_token($TorrentID)) {
            $DB->query("\n\t\t\t\tINSERT INTO users_freeleeches (UserID, TorrentID, Time)\n\t\t\t\tVALUES ({$UserID}, {$TorrentID}, NOW())\n\t\t\t\tON DUPLICATE KEY UPDATE\n\t\t\t\t\tTime = VALUES(Time),\n\t\t\t\t\tExpired = FALSE,\n\t\t\t\t\tUses = Uses + 1");
            $DB->query("\n\t\t\t\tUPDATE users_main\n\t\t\t\tSET FLTokens = FLTokens - 1\n\t\t\t\tWHERE ID = {$UserID}");
            // Fix for downloadthemall messing with the cached token count
            $UInfo = Users::user_heavy_info($UserID);
            $FLTokens = $UInfo['FLTokens'];
            $Cache->begin_transaction("user_info_heavy_{$UserID}");
            $Cache->update_row(false, array('FLTokens' => $FLTokens - 1));
            $Cache->commit_transaction(0);
            $Cache->delete_value("users_tokens_{$UserID}");
        }
    }
}
//Stupid Recent Snatches On User Page
if ($CategoryID == '1' && $Image != '') {
    $RecentSnatches = $Cache->get_value("recent_snatches_{$UserID}");
Exemplo n.º 2
0
<?php 
        }
    } else {
        //if (count($Torrents) > 1 || $GroupCategoryID == 1)
        // Viewing a type that does not require grouping
        list($TorrentID, $Torrent) = each($Torrents);
        $Torrent['IsSnatched'] = Torrents::has_snatched($TorrentID);
        $DisplayName = $Number . ' - <a href="torrents.php?id=' . $GroupID . '" class="tooltip" title="View torrent group" dir="ltr">' . $GroupName . '</a>';
        if ($Torrent['IsSnatched']) {
            $DisplayName .= ' ' . Format::torrent_label('Snatched!');
        }
        if ($Torrent['FreeTorrent'] == '1') {
            $DisplayName .= ' ' . Format::torrent_label('Freeleech!');
        } elseif ($Torrent['FreeTorrent'] == '2') {
            $DisplayName .= ' ' . Format::torrent_label('Neutral leech!');
        } elseif (Torrents::has_token($TorrentID)) {
            $DisplayName .= ' ' . Format::torrent_label('Personal freeleech!');
        }
        $SnatchedTorrentClass = $Torrent['IsSnatched'] ? ' snatched_torrent' : '';
        ?>
		<tr class="torrent torrent_row<?php 
        echo $SnatchedTorrentClass . $SnatchedGroupClass;
        ?>
" id="group_<?php 
        echo $GroupID;
        ?>
">
			<td></td>
			<td class="center cats_col">
				<div title="<?php 
        echo $TorrentTags->title();