Beispiel #1
0
			<div class="head">
				<span style="font-weight: bold;">Requests (<?php 
    echo number_format(count($Requests));
    ?>
)</span>
				<a href="#" style="float: right;" onclick="$('#requests').gtoggle(); this.innerHTML = (this.innerHTML == 'Hide' ? 'Show' : 'Hide'); return false;" class="brackets">Show</a>
			</div>
			<table id="requests" class="request_table hidden">
				<tr class="colhead">
					<td>Format / Bitrate / Media</td>
					<td>Votes</td>
					<td>Bounty</td>
				</tr>
<?php 
    foreach ($Requests as $Request) {
        $RequestVotes = Requests::get_votes_array($Request['ID']);
        if ($Request['BitrateList'] != '') {
            $BitrateString = implode(', ', explode('|', $Request['BitrateList']));
            $FormatString = implode(', ', explode('|', $Request['FormatList']));
            $MediaString = implode(', ', explode('|', $Request['MediaList']));
            if ($Request['LogCue']) {
                $FormatString .= ' - ' . $Request['LogCue'];
            }
        } else {
            $BitrateString = 'Unknown';
            $FormatString = 'Unknown';
            $MediaString = 'Unknown';
        }
        ?>
				<tr class="requestrows <?php 
        echo ++$i % 2 ? 'rowa' : 'rowb';
Beispiel #2
0
//We're all good! Fill!
$DB->query("\n\tUPDATE requests\n\tSET FillerID = {$FillerID},\n\t\tTorrentID = {$TorrentID},\n\t\tTimeFilled = '" . sqltime() . "'\n\tWHERE ID = {$RequestID}");
if ($CategoryName === 'Music') {
    $ArtistForm = Requests::get_artists($RequestID);
    $ArtistName = Artists::display_artists($ArtistForm, false, true);
    $FullName = $ArtistName . $Title;
} else {
    $FullName = $Title;
}
$DB->query("\n\tSELECT UserID\n\tFROM requests_votes\n\tWHERE RequestID = {$RequestID}");
$UserIDs = $DB->to_array();
foreach ($UserIDs as $User) {
    list($VoterID) = $User;
    Misc::send_pm($VoterID, 0, "The request \"{$FullName}\" has been filled", 'One of your requests&#8202;&mdash;&#8202;[url=' . site_url() . "requests.php?action=view&amp;id={$RequestID}]{$FullName}" . '[/url]&#8202;&mdash;&#8202;has been filled. You can view it here: [url]' . site_url() . "torrents.php?torrentid={$TorrentID}" . '[/url]');
}
$RequestVotes = Requests::get_votes_array($RequestID);
Misc::write_log("Request {$RequestID} ({$FullName}) was filled by user {$FillerID} ({$FillerUsername}) with the torrent {$TorrentID} for a " . Format::get_size($RequestVotes['TotalBounty']) . ' bounty.');
// Give bounty
$DB->query("\n\tUPDATE users_main\n\tSET Uploaded = (Uploaded + " . $RequestVotes['TotalBounty'] . ")\n\tWHERE ID = {$FillerID}");
$Cache->delete_value("user_stats_{$FillerID}");
$Cache->delete_value("request_{$RequestID}");
if ($GroupID) {
    $Cache->delete_value("requests_group_{$GroupID}");
}
$DB->query("\n\tSELECT ArtistID\n\tFROM requests_artists\n\tWHERE RequestID = {$RequestID}");
$ArtistIDs = $DB->to_array();
foreach ($ArtistIDs as $ArtistID) {
    $Cache->delete_value("artists_requests_{$ArtistID}");
}
Requests::update_sphinx_requests($RequestID);
$SphQL = new SphinxqlQuery();
Beispiel #3
0
    error('You do not have enough uploaded to make a request.');
}
if (!$NewRequest) {
    if (empty($ReturnEdit)) {
        $Request = Requests::get_request($RequestID);
        if ($Request === false) {
            error(404);
        }
        // Define these variables to simplify _GET['groupid'] requests later on
        $CategoryID = $Request['CategoryID'];
        $Title = $Request['Title'];
        $Year = $Request['Year'];
        $Image = $Request['Image'];
        $ReleaseType = $Request['ReleaseType'];
        $GroupID = $Request['GroupID'];
        $VoteArray = Requests::get_votes_array($RequestID);
        $VoteCount = count($VoteArray['Voters']);
        $LogCue = $Request['LogCue'];
        $NeedCue = strpos($LogCue, 'Cue') !== false;
        $NeedLog = strpos($LogCue, 'Log') !== false;
        if ($NeedLog) {
            if (strpos($LogCue, '%') !== false) {
                preg_match('/\\d+/', $LogCue, $Matches);
                $MinLogScore = (int) $Matches[0];
            }
        }
        $IsFilled = !empty($Request['TorrentID']);
        $CategoryName = $Categories[$CategoryID - 1];
        $ProjectCanEdit = check_perms('project_team') && !$IsFilled && ($CategoryID === '0' || $CategoryName === 'Music' && $Request['Year'] === '0');
        $CanEdit = !$IsFilled && $LoggedUser['ID'] === $Request['UserID'] && $VoteCount < 2 || $ProjectCanEdit || check_perms('site_moderate_requests');
        if (!$CanEdit) {