Gazelle/sections/requests/request.php

474 lines
16 KiB
PHP
Raw Normal View History

2013-05-28 08:01:02 +00:00
<?php
2011-03-28 14:21:28 +00:00
/*
* This is the page that displays the request to the end user after being created.
*/
2013-04-15 08:00:54 +00:00
if (empty($_GET['id']) || !is_number($_GET['id'])) {
2011-03-28 14:21:28 +00:00
error(0);
}
$RequestID = $_GET['id'];
//First things first, lets get the data for the request.
2013-09-13 08:00:53 +00:00
$Request = Requests::get_request($RequestID);
if ($Request === false) {
2011-03-28 14:21:28 +00:00
error(404);
}
//Convenience variables
2013-09-13 08:00:53 +00:00
$IsFilled = !empty($Request['TorrentID']);
$CanVote = !$IsFilled && check_perms('site_vote');
2011-03-28 14:21:28 +00:00
2013-09-13 08:00:53 +00:00
if ($Request['CategoryID'] === '0') {
2013-04-15 08:00:54 +00:00
$CategoryName = 'Unknown';
2011-03-28 14:21:28 +00:00
} else {
2013-09-13 08:00:53 +00:00
$CategoryName = $Categories[$Request['CategoryID'] - 1];
2011-03-28 14:21:28 +00:00
}
//Do we need to get artists?
2013-07-11 08:00:55 +00:00
if ($CategoryName === 'Music') {
2013-05-13 08:00:33 +00:00
$ArtistForm = Requests::get_artists($RequestID);
2012-10-11 08:00:15 +00:00
$ArtistName = Artists::display_artists($ArtistForm, false, true);
$ArtistLink = Artists::display_artists($ArtistForm, true, true);
2013-02-10 08:00:29 +00:00
2013-04-15 08:00:54 +00:00
if ($IsFilled) {
2013-09-13 08:00:53 +00:00
$DisplayLink = "$ArtistLink<a href=\"torrents.php?torrentid=$Request[TorrentID]\">$Request[Title]</a> [$Request[Year]]";
2011-03-28 14:21:28 +00:00
} else {
2013-09-13 08:00:53 +00:00
$DisplayLink = $ArtistLink.$Request['Title']." [$Request[Year]]";
2011-03-28 14:21:28 +00:00
}
2013-09-13 08:00:53 +00:00
$FullName = $ArtistName.$Request['Title']." [$Request[Year]]";
2013-02-10 08:00:29 +00:00
2013-09-13 08:00:53 +00:00
if ($Request['BitrateList'] != '') {
$BitrateString = implode(', ', explode('|', $Request['BitrateList']));
$FormatString = implode(', ', explode('|', $Request['FormatList']));
$MediaString = implode(', ', explode('|', $Request['MediaList']));
2011-03-28 14:21:28 +00:00
} else {
2013-04-15 08:00:54 +00:00
$BitrateString = 'Unknown, please read the description.';
$FormatString = 'Unknown, please read the description.';
$MediaString = 'Unknown, please read the description.';
2011-03-28 14:21:28 +00:00
}
2013-02-10 08:00:29 +00:00
2013-09-13 08:00:53 +00:00
if (empty($Request['ReleaseType'])) {
2013-04-15 08:00:54 +00:00
$ReleaseName = 'Unknown';
2011-03-28 14:21:28 +00:00
} else {
2013-09-13 08:00:53 +00:00
$ReleaseName = $ReleaseTypes[$Request['ReleaseType']];
2011-03-28 14:21:28 +00:00
}
2013-02-10 08:00:29 +00:00
2013-07-11 08:00:55 +00:00
} elseif ($CategoryName === 'Audiobooks' || $CategoryName === 'Comedy') {
2013-09-13 08:00:53 +00:00
$FullName = "$Request[Title] [$Request[Year]]";
$DisplayLink = "$Request[Title] [$Request[Year]]";
2011-03-28 14:21:28 +00:00
} else {
2013-09-13 08:00:53 +00:00
$FullName = $DisplayLink = $Request['Title'];
2011-03-28 14:21:28 +00:00
}
//Votes time
2013-05-13 08:00:33 +00:00
$RequestVotes = Requests::get_votes_array($RequestID);
2011-03-28 14:21:28 +00:00
$VoteCount = count($RequestVotes['Voters']);
2013-09-13 08:00:53 +00:00
$ProjectCanEdit = (check_perms('project_team') && !$IsFilled && ($Request['CategoryID'] === '0' || ($CategoryName === 'Music' && $Request['Year'] === '0')));
$UserCanEdit = (!$IsFilled && $LoggedUser['ID'] === $Request['UserID'] && $VoteCount < 2);
2011-03-28 14:21:28 +00:00
$CanEdit = ($UserCanEdit || $ProjectCanEdit || check_perms('site_moderate_requests'));
2013-08-28 23:08:41 +00:00
View::show_header("View request: $FullName", 'comments,requests,bbcode,subscriptions');
2011-03-28 14:21:28 +00:00
?>
<div class="thin">
2012-08-19 08:00:19 +00:00
<div class="header">
<h2><a href="requests.php">Requests</a> &gt; <?=$CategoryName?> &gt; <?=$DisplayLink?></h2>
<div class="linkbox">
2013-04-15 08:00:54 +00:00
<? if ($CanEdit) { ?>
2013-02-09 08:01:01 +00:00
<a href="requests.php?action=edit&amp;id=<?=$RequestID?>" class="brackets">Edit</a>
2013-04-15 08:00:54 +00:00
<? }
if ($UserCanEdit || check_perms('users_mod')) { //check_perms('site_moderate_requests')) { ?>
2013-02-09 08:01:01 +00:00
<a href="requests.php?action=delete&amp;id=<?=$RequestID?>" class="brackets">Delete</a>
2013-04-15 08:00:54 +00:00
<? }
if (Bookmarks::has_bookmarked('request', $RequestID)) { ?>
2013-06-23 08:00:54 +00:00
<a href="#" id="bookmarklink_request_<?=$RequestID?>" onclick="Unbookmark('request', <?=$RequestID?>, 'Bookmark'); return false;" class="brackets">Remove bookmark</a>
<? } else { ?>
2013-06-23 08:00:54 +00:00
<a href="#" id="bookmarklink_request_<?=$RequestID?>" onclick="Bookmark('request', <?=$RequestID?>, 'Remove bookmark'); return false;" class="brackets">Bookmark</a>
<? } ?>
2013-08-28 23:08:41 +00:00
<a href="#" id="subscribelink_requests<?=$RequestID?>" class="brackets" onclick="SubscribeComments('requests',<?=$RequestID?>);return false;"><?=Subscriptions::has_subscribed_comments('requests', $RequestID) !== false ? 'Unsubscribe' : 'Subscribe'?></a>
2013-02-09 08:01:01 +00:00
<a href="reports.php?action=report&amp;type=request&amp;id=<?=$RequestID?>" class="brackets">Report request</a>
2013-04-15 08:00:54 +00:00
<? if (!$IsFilled) { ?>
2013-09-13 08:00:53 +00:00
<a href="upload.php?requestid=<?=$RequestID?><?=($Request['GroupID'] ? "&amp;groupid=$Request[GroupID]" : '')?>" class="brackets">Upload request</a>
2012-04-22 08:00:26 +00:00
<? }
2013-09-13 08:00:53 +00:00
if (!$IsFilled && ($Request['CategoryID'] === '0' || ($CategoryName === 'Music' && $Request['Year'] === '0'))) { ?>
2013-02-09 08:01:01 +00:00
<a href="reports.php?action=report&amp;type=request_update&amp;id=<?=$RequestID?>" class="brackets">Request update</a>
2011-03-28 14:21:28 +00:00
<? } ?>
2012-06-23 08:00:13 +00:00
<?
2013-06-23 08:00:54 +00:00
// Create a search URL to WorldCat and Google based on title
2013-09-13 08:00:53 +00:00
$encoded_title = urlencode(preg_replace("/\([^\)]+\)/", '', $Request['Title']));
2013-05-21 08:01:09 +00:00
$encoded_artist = substr(str_replace('&amp;', 'and', $ArtistName), 0, -3);
$encoded_artist = str_ireplace('Performed By', '', $encoded_artist);
$encoded_artist = preg_replace("/\([^\)]+\)/", '', $encoded_artist);
2012-06-23 08:00:13 +00:00
$encoded_artist = urlencode($encoded_artist);
2013-06-23 08:00:54 +00:00
$worldcat_url = 'https://www.worldcat.org/search?qt=worldcat_org_all&amp;q=' . "$encoded_artist%20$encoded_title";
$google_url = 'https://www.google.com/search?tbm=shop&amp;q=' . "$encoded_artist%20$encoded_title";
2012-06-23 08:00:13 +00:00
?>
2013-02-09 08:01:01 +00:00
<a href="<? echo $worldcat_url; ?>" class="brackets">Find in library</a>
<a href="<? echo $google_url; ?>" class="brackets">Find in stores</a>
2012-08-19 08:00:19 +00:00
</div>
</div>
2011-03-28 14:21:28 +00:00
<div class="sidebar">
2013-09-13 08:00:53 +00:00
<? if ($Request['CategoryID'] !== '0') { ?>
2012-08-17 08:00:13 +00:00
<div class="box box_image box_image_albumart box_albumart"><!-- .box_albumart deprecated -->
2011-03-28 14:21:28 +00:00
<div class="head"><strong>Cover</strong></div>
2013-11-02 08:01:09 +00:00
<div id="covers">
<div class="pad">
2012-05-04 08:00:14 +00:00
<?
2013-09-13 08:00:53 +00:00
if (!empty($Request['Image'])) {
2012-05-04 08:00:14 +00:00
?>
2013-11-02 08:01:09 +00:00
<p align="center"><img style="width: 100%;" src="<?=ImageTools::process($Request['Image'], true)?>" alt="<?=$FullName?>" onclick="lightbox.init('<?=ImageTools::process($Request['Image'])?>', 220);" /></p>
2013-07-11 08:00:55 +00:00
<? } else { ?>
2013-11-05 08:01:12 +00:00
<p align="center"><img style="width: 100%;" src="<?=STATIC_SERVER?>common/noartwork/<?=$CategoryIcons[$Request['CategoryID'] - 1]?>" alt="<?=$CategoryName?>" class="tooltip" title="<?=$CategoryName?>" height="220" border="0" /></p>
2013-07-11 08:00:55 +00:00
<? } ?>
2013-11-02 08:01:09 +00:00
</div>
</div>
2011-03-28 14:21:28 +00:00
</div>
2013-07-11 08:00:55 +00:00
<?
}
if ($CategoryName === 'Music') { ?>
2011-03-28 14:21:28 +00:00
<div class="box box_artists">
<div class="head"><strong>Artists</strong></div>
<ul class="stats nobullet">
2013-07-11 08:00:55 +00:00
<? if (!empty($ArtistForm[4]) && count($ArtistForm[4]) > 0) { ?>
2011-11-20 08:00:18 +00:00
<li class="artists_composer"><strong>Composers:</strong></li>
2013-07-11 08:00:55 +00:00
<? foreach ($ArtistForm[4] as $Artist) { ?>
2011-11-20 08:00:18 +00:00
<li class="artists_composer">
2012-10-11 08:00:15 +00:00
<?=Artists::display_artist($Artist)?>
2011-11-20 08:00:18 +00:00
</li>
2013-07-11 08:00:55 +00:00
<?
}
2011-11-20 08:00:18 +00:00
}
2013-04-15 08:00:54 +00:00
if (!empty($ArtistForm[6]) && count($ArtistForm[6]) > 0) {
2011-11-20 08:00:18 +00:00
?>
<li class="artists_dj"><strong>DJ / Compiler:</strong></li>
2013-07-11 08:00:55 +00:00
<? foreach ($ArtistForm[6] as $Artist) { ?>
2011-11-20 08:00:18 +00:00
<li class="artists_dj">
2012-10-11 08:00:15 +00:00
<?=Artists::display_artist($Artist)?>
2011-03-28 14:21:28 +00:00
</li>
<?
2011-11-20 08:00:18 +00:00
}
2011-03-28 14:21:28 +00:00
}
2011-11-20 08:00:18 +00:00
if ((count($ArtistForm[6]) > 0) && (count($ArtistForm[1]) > 0)) {
print ' <li class="artists_main"><strong>Artists:</strong></li>';
} elseif ((count($ArtistForm[4]) > 0) && (count($ArtistForm[1]) > 0)) {
print ' <li class="artists_main"><strong>Performers:</strong></li>';
}
2013-04-15 08:00:54 +00:00
foreach ($ArtistForm[1] as $Artist) {
2011-11-20 08:00:18 +00:00
?>
<li class="artists_main">
2012-10-11 08:00:15 +00:00
<?=Artists::display_artist($Artist)?>
2011-11-20 08:00:18 +00:00
</li>
2013-07-11 08:00:55 +00:00
<?
}
2013-04-15 08:00:54 +00:00
if (!empty($ArtistForm[2]) && count($ArtistForm[2]) > 0) {
2011-03-28 14:21:28 +00:00
?>
<li class="artists_with"><strong>With:</strong></li>
2013-07-11 08:00:55 +00:00
<? foreach ($ArtistForm[2] as $Artist) { ?>
2011-11-20 08:00:18 +00:00
<li class="artists_with">
2012-10-11 08:00:15 +00:00
<?=Artists::display_artist($Artist)?>
2011-11-20 08:00:18 +00:00
</li>
2013-07-11 08:00:55 +00:00
<?
}
2011-11-20 08:00:18 +00:00
}
2013-04-15 08:00:54 +00:00
if (!empty($ArtistForm[5]) && count($ArtistForm[5]) > 0) {
2011-11-20 08:00:18 +00:00
?>
<li class="artists_conductor"><strong>Conducted by:</strong></li>
2013-07-11 08:00:55 +00:00
<? foreach ($ArtistForm[5] as $Artist) { ?>
2011-03-28 14:21:28 +00:00
<li class="artist_guest">
2012-10-11 08:00:15 +00:00
<?=Artists::display_artist($Artist)?>
2011-03-28 14:21:28 +00:00
</li>
2013-07-11 08:00:55 +00:00
<?
}
2011-03-28 14:21:28 +00:00
}
2013-04-15 08:00:54 +00:00
if (!empty($ArtistForm[3]) && count($ArtistForm[3]) > 0) {
2011-03-28 14:21:28 +00:00
?>
<li class="artists_remix"><strong>Remixed by:</strong></li>
2013-07-11 08:00:55 +00:00
<? foreach ($ArtistForm[3] as $Artist) { ?>
2012-02-19 08:00:19 +00:00
<li class="artists_remix">
2012-10-11 08:00:15 +00:00
<?=Artists::display_artist($Artist)?>
2012-02-19 08:00:19 +00:00
</li>
<?
}
}
2013-04-15 08:00:54 +00:00
if (!empty($ArtistForm[7]) && count($ArtistForm[7]) > 0) {
2012-02-19 08:00:19 +00:00
?>
<li class="artists_producer"><strong>Produced by:</strong></li>
2013-07-11 08:00:55 +00:00
<? foreach ($ArtistForm[7] as $Artist) { ?>
2011-11-20 08:00:18 +00:00
<li class="artists_remix">
2012-10-11 08:00:15 +00:00
<?=Artists::display_artist($Artist)?>
2011-03-28 14:21:28 +00:00
</li>
<?
}
}
?>
</ul>
</div>
<? } ?>
<div class="box box_tags">
<div class="head"><strong>Tags</strong></div>
<ul class="stats nobullet">
2013-04-15 08:00:54 +00:00
<? foreach ($Request['Tags'] as $TagID => $TagName) { ?>
2011-03-28 14:21:28 +00:00
<li>
<a href="torrents.php?taglist=<?=$TagName?>"><?=display_str($TagName)?></a>
2013-05-21 08:01:09 +00:00
<br style="clear: both;" />
2011-03-28 14:21:28 +00:00
</li>
<? } ?>
</ul>
</div>
<div class="box box_votes">
2013-08-28 23:08:41 +00:00
<div class="head"><strong>Top Contributors</strong></div>
2013-10-24 08:01:05 +00:00
<table class="layout" id="request_top_contrib">
2013-07-11 08:00:55 +00:00
<?
$VoteMax = ($VoteCount < 5 ? $VoteCount : 5);
2011-11-13 08:00:16 +00:00
$ViewerVote = false;
2013-04-19 08:00:55 +00:00
for ($i = 0; $i < $VoteMax; $i++) {
2011-03-28 14:21:28 +00:00
$User = array_shift($RequestVotes['Voters']);
2011-11-13 08:00:16 +00:00
$Boldify = false;
2013-07-11 08:00:55 +00:00
if ($User['UserID'] === $LoggedUser['ID']) {
2011-11-13 08:00:16 +00:00
$ViewerVote = true;
$Boldify = true;
}
2011-03-28 14:21:28 +00:00
?>
<tr>
<td>
2013-10-19 08:01:09 +00:00
<a href="user.php?id=<?=$User['UserID']?>"><?=($Boldify ? '<strong>' : '') . display_str($User['Username']) . ($Boldify ? '</strong>' : '')?></a>
2011-03-28 14:21:28 +00:00
</td>
2013-08-28 23:08:41 +00:00
<td class="number_column">
2013-10-19 08:01:09 +00:00
<?=($Boldify ? '<strong>' : '') . Format::get_size($User['Bounty']) . ($Boldify ? "</strong>\n" : "\n")?>
2011-03-28 14:21:28 +00:00
</td>
</tr>
2013-02-10 08:00:29 +00:00
<? }
2011-03-28 14:21:28 +00:00
reset($RequestVotes['Voters']);
2011-11-13 08:00:16 +00:00
if (!$ViewerVote) {
foreach ($RequestVotes['Voters'] as $User) {
2013-07-11 08:00:55 +00:00
if ($User['UserID'] === $LoggedUser['ID']) { ?>
2011-11-13 08:00:16 +00:00
<tr>
<td>
<a href="user.php?id=<?=$User['UserID']?>"><strong><?=display_str($User['Username'])?></strong></a>
</td>
2013-08-28 23:08:41 +00:00
<td class="number_column">
2012-10-11 08:00:15 +00:00
<strong><?=Format::get_size($User['Bounty'])?></strong>
2011-11-13 08:00:16 +00:00
</td>
</tr>
<? }
}
}
2011-03-28 14:21:28 +00:00
?>
</table>
</div>
</div>
<div class="main_column">
2012-09-01 08:00:24 +00:00
<table class="layout">
2011-03-28 14:21:28 +00:00
<tr>
<td class="label">Created</td>
<td>
2013-09-13 08:00:53 +00:00
<?=time_diff($Request['TimeAdded'])?> by <strong><?=Users::format_username($Request['UserID'], false, false, false)?></strong>
2011-03-28 14:21:28 +00:00
</td>
2013-02-10 08:00:29 +00:00
</tr>
2013-07-11 08:00:55 +00:00
<? if ($CategoryName === 'Music') {
2013-09-13 08:00:53 +00:00
if (!empty($Request['RecordLabel'])) { ?>
2012-02-03 08:00:22 +00:00
<tr>
2013-02-15 08:00:35 +00:00
<td class="label">Record label</td>
2013-10-19 08:01:09 +00:00
<td><?=$Request['RecordLabel']?></td>
2012-02-03 08:00:22 +00:00
</tr>
2013-02-10 08:00:29 +00:00
<? }
2013-09-13 08:00:53 +00:00
if (!empty($Request['CatalogueNumber'])) { ?>
2011-03-28 14:21:28 +00:00
<tr>
2013-02-15 08:00:35 +00:00
<td class="label">Catalogue number</td>
2013-10-19 08:01:09 +00:00
<td><?=$Request['CatalogueNumber']?></td>
2011-03-28 14:21:28 +00:00
</tr>
<? } ?>
<tr>
2013-02-15 08:00:35 +00:00
<td class="label">Release type</td>
2013-10-19 08:01:09 +00:00
<td><?=$ReleaseName?></td>
2011-03-28 14:21:28 +00:00
</tr>
<tr>
2013-02-15 08:00:35 +00:00
<td class="label">Acceptable bitrates</td>
2013-10-19 08:01:09 +00:00
<td><?=$BitrateString?></td>
2011-03-28 14:21:28 +00:00
</tr>
<tr>
2013-02-15 08:00:35 +00:00
<td class="label">Acceptable formats</td>
2013-10-19 08:01:09 +00:00
<td><?=$FormatString?></td>
2011-03-28 14:21:28 +00:00
</tr>
<tr>
2013-02-15 08:00:35 +00:00
<td class="label">Acceptable media</td>
2013-10-19 08:01:09 +00:00
<td><?=$MediaString?></td>
2011-03-28 14:21:28 +00:00
</tr>
2013-09-13 08:00:53 +00:00
<? if (!empty($Request['LogCue'])) { ?>
2011-03-28 14:21:28 +00:00
<tr>
2013-02-15 08:00:35 +00:00
<td class="label">Required CD FLAC only extras</td>
2013-10-19 08:01:09 +00:00
<td><?=$Request['LogCue']?></td>
2011-03-28 14:21:28 +00:00
</tr>
2013-10-19 08:01:09 +00:00
<?
}
2012-06-02 08:00:16 +00:00
}
2013-05-21 08:01:09 +00:00
$Worldcat = '';
2013-09-13 08:00:53 +00:00
$OCLC = str_replace(' ', '', $Request['OCLC']);
2013-07-11 08:00:55 +00:00
if ($OCLC !== '') {
2013-05-21 08:01:09 +00:00
$OCLCs = explode(',', $OCLC);
2012-06-02 08:00:16 +00:00
for ($i = 0; $i < count($OCLCs); $i++) {
if (!empty($Worldcat)) {
2013-06-23 08:00:54 +00:00
$Worldcat .= ', <a href="https://www.worldcat.org/oclc/'.$OCLCs[$i].'">'.$OCLCs[$i].'</a>';
2012-06-02 08:00:16 +00:00
} else {
2013-06-23 08:00:54 +00:00
$Worldcat = '<a href="https://www.worldcat.org/oclc/'.$OCLCs[$i].'">'.$OCLCs[$i].'</a>';
2012-06-02 08:00:16 +00:00
}
}
}
2013-10-19 08:01:09 +00:00
if (!empty($Worldcat)) {
?>
2012-06-02 08:00:16 +00:00
<tr>
<td class="label">WorldCat (OCLC) ID</td>
2013-10-19 08:01:09 +00:00
<td><?=$Worldcat?></td>
2012-06-02 08:00:16 +00:00
</tr>
2013-10-19 08:01:09 +00:00
<?
}
2013-09-13 08:00:53 +00:00
if ($Request['GroupID']) {
2012-02-20 08:00:22 +00:00
?>
<tr>
2013-02-15 08:00:35 +00:00
<td class="label">Torrent group</td>
2013-09-13 08:00:53 +00:00
<td><a href="torrents.php?id=<?=$Request['GroupID']?>">torrents.php?id=<?=$Request['GroupID']?></a></td>
2012-02-20 08:00:22 +00:00
</tr>
<? } ?>
2011-03-28 14:21:28 +00:00
<tr>
<td class="label">Votes</td>
<td>
2013-02-15 08:00:35 +00:00
<span id="votecount"><?=number_format($VoteCount)?></span>
2013-04-15 08:00:54 +00:00
<? if ($CanVote) { ?>
2013-02-15 08:00:35 +00:00
&nbsp;&nbsp;<a href="javascript:Vote(0)" class="brackets"><strong>+</strong></a>
2012-10-11 08:00:15 +00:00
<strong>Costs <?=Format::get_size($MinimumVote, 0)?></strong>
2013-02-10 08:00:29 +00:00
<? } ?>
2011-03-28 14:21:28 +00:00
</td>
</tr>
2013-09-13 08:00:53 +00:00
<? if ($Request['LastVote'] > $Request['TimeAdded']) { ?>
2012-07-08 08:00:09 +00:00
<tr>
2013-02-15 08:00:35 +00:00
<td class="label">Last voted</td>
2013-10-19 08:01:09 +00:00
<td><?=time_diff($Request['LastVote'])?></td>
2012-07-08 08:00:09 +00:00
</tr>
2013-10-19 08:01:09 +00:00
<?
}
if ($CanVote) {
?>
2011-03-28 14:21:28 +00:00
<tr id="voting">
2013-08-28 23:08:41 +00:00
<td class="label tooltip" title="These units are in base 2, not base 10. For example, there are 1,024 MB in 1 GB.">Custom vote (MB)</td>
2011-03-28 14:21:28 +00:00
<td>
<input type="text" id="amount_box" size="8" onchange="Calculate();" />
<select id="unit" name="unit" onchange="Calculate();">
2013-06-23 08:00:54 +00:00
<option value="mb">MB</option>
<option value="gb">GB</option>
2011-03-28 14:21:28 +00:00
</select>
2012-09-19 08:00:35 +00:00
<input type="button" value="Preview" onclick="Calculate();" />
2011-03-28 14:21:28 +00:00
<strong><?=($RequestTax * 100)?>% of this is deducted as tax by the system.</strong>
</td>
</tr>
<tr>
<td class="label">Post vote information</td>
<td>
2012-09-15 08:00:25 +00:00
<form class="add_form" name="request" action="requests.php" method="get" id="request_form">
2011-03-28 14:21:28 +00:00
<input type="hidden" name="action" value="vote" />
<input type="hidden" name="auth" value="<?=$LoggedUser['AuthKey']?>" />
<input type="hidden" id="request_tax" value="<?=$RequestTax?>" />
<input type="hidden" id="requestid" name="id" value="<?=$RequestID?>" />
<input type="hidden" id="auth" name="auth" value="<?=$LoggedUser['AuthKey']?>" />
2012-09-19 08:00:35 +00:00
<input type="hidden" id="amount" name="amount" value="0" />
2011-03-28 14:21:28 +00:00
<input type="hidden" id="current_uploaded" value="<?=$LoggedUser['BytesUploaded']?>" />
<input type="hidden" id="current_downloaded" value="<?=$LoggedUser['BytesDownloaded']?>" />
2012-04-10 08:00:20 +00:00
<input type="hidden" id="current_rr" value="<?=(float)$LoggedUser['RequiredRatio']?>" />
2011-03-28 14:21:28 +00:00
<input id="total_bounty" type="hidden" value="<?=$RequestVotes['TotalBounty']?>" />
2013-07-10 00:08:53 +00:00
Bounty after tax: <strong><span id="bounty_after_tax">0.00 MB</span></strong><br />
2013-01-15 08:00:37 +00:00
If you add the entered <strong><span id="new_bounty">0.00 MB</span></strong> of bounty, your new stats will be: <br />
2013-07-10 00:08:53 +00:00
Uploaded: <span id="new_uploaded"><?=Format::get_size($LoggedUser['BytesUploaded'])?></span><br />
2012-10-11 08:00:15 +00:00
Ratio: <span id="new_ratio"><?=Format::get_ratio_html($LoggedUser['BytesUploaded'],$LoggedUser['BytesDownloaded'])?></span>
2012-09-19 08:00:35 +00:00
<input type="button" id="button" value="Vote!" disabled="disabled" onclick="Vote();" />
2011-03-28 14:21:28 +00:00
</form>
</td>
</tr>
2013-07-11 08:00:55 +00:00
<? } ?>
2011-03-28 14:21:28 +00:00
<tr id="bounty">
<td class="label">Bounty</td>
2012-10-11 08:00:15 +00:00
<td id="formatted_bounty"><?=Format::get_size($RequestVotes['TotalBounty'])?></td>
2011-03-28 14:21:28 +00:00
</tr>
<?
2013-04-15 08:00:54 +00:00
if ($IsFilled) {
2011-03-28 14:21:28 +00:00
$TimeCompare = 1267643718; // Requests v2 was implemented 2010-03-03 20:15:18
?>
<tr>
<td class="label">Filled</td>
<td>
2013-09-13 08:00:53 +00:00
<strong><a href="torrents.php?<?=(strtotime($Request['TimeFilled']) < $TimeCompare ? 'id=' : 'torrentid=') . $Request['TorrentID']?>">Yes</a></strong>,
by user <?=Users::format_username($Request['FillerID'], false, false, false)?>
<? if ($LoggedUser['ID'] == $Request['UserID'] || $LoggedUser['ID'] == $Request['FillerID'] || check_perms('site_moderate_requests')) { ?>
2013-02-15 08:00:35 +00:00
<strong><a href="requests.php?action=unfill&amp;id=<?=$RequestID?>" class="brackets">Unfill</a></strong> Unfilling a request without a valid, nontrivial reason will result in a warning.
2011-03-28 14:21:28 +00:00
<? } ?>
</td>
</tr>
<? } else { ?>
<tr>
<td class="label" valign="top">Fill request</td>
<td>
2012-09-15 08:00:25 +00:00
<form class="edit_form" name="request" action="" method="post">
2013-07-17 08:00:52 +00:00
<div class="field_div">
2011-03-28 14:21:28 +00:00
<input type="hidden" name="action" value="takefill" />
<input type="hidden" name="auth" value="<?=$LoggedUser['AuthKey']?>" />
<input type="hidden" name="requestid" value="<?=$RequestID?>" />
2013-06-23 08:00:54 +00:00
<input type="text" size="50" name="link"<?=(!empty($Link) ? " value=\"$Link\"" : '')?> />
2011-03-28 14:21:28 +00:00
<br />
2013-07-17 08:00:52 +00:00
<strong>Should be the permalink (PL) to the torrent (e.g. https://<?=SSL_SITE_URL?>/torrents.php?torrentid=xxxx).</strong>
</div>
2013-10-19 08:01:09 +00:00
<? if (check_perms('site_moderate_requests')) { ?>
2013-07-17 08:00:52 +00:00
<div class="field_div">
2013-04-15 08:00:54 +00:00
For user: <input type="text" size="25" name="user"<?=(!empty($FillerUsername) ? " value=\"$FillerUsername\"" : '')?> />
2013-07-17 08:00:52 +00:00
</div>
2013-10-19 08:01:09 +00:00
<? } ?>
2013-07-17 08:00:52 +00:00
<div class="submit_div">
2011-03-28 14:21:28 +00:00
<input type="submit" value="Fill request" />
</div>
</form>
</td>
</tr>
<? } ?>
</table>
2013-10-26 08:00:58 +00:00
<div class="box box2 box_request_desc">
2013-10-24 08:01:05 +00:00
<div class="head"><strong>Description</strong></div>
<div class="pad">
2013-12-12 08:01:01 +00:00
<?= Text::full_format($Request['Description']);?>
2013-10-24 08:01:05 +00:00
</div>
</div>
2011-03-28 14:21:28 +00:00
<?
2013-08-28 23:08:41 +00:00
list($NumComments, $Page, $Thread, $LastRead) = Comments::load('requests', $RequestID);
2011-03-28 14:21:28 +00:00
?>
2013-11-10 08:00:49 +00:00
<div id="request_comments">
2013-10-24 08:01:05 +00:00
<div class="linkbox">
<a name="comments"></a>
2011-03-28 14:21:28 +00:00
<?
2013-08-28 23:08:41 +00:00
$Pages = Format::get_pages($Page, $NumComments, TORRENT_COMMENTS_PER_PAGE, 9, '#comments');
2011-03-28 14:21:28 +00:00
echo $Pages;
?>
2013-10-24 08:01:05 +00:00
</div>
2011-03-28 14:21:28 +00:00
<?
//---------- Begin printing
2013-10-19 08:01:09 +00:00
CommentsView::render_comments($Thread, $LastRead, "requests.php?action=view&amp;id=$RequestID");
2013-05-21 08:01:09 +00:00
if ($Pages) { ?>
2013-10-24 08:01:05 +00:00
<div class="linkbox pager"><?=$Pages?></div>
2013-01-23 08:00:38 +00:00
<?
2013-05-21 08:01:09 +00:00
}
2013-10-19 08:01:09 +00:00
View::parse('generic/reply/quickreply.php', array(
'InputName' => 'pageid',
'InputID' => $RequestID,
'Action' => 'comments.php?page=requests',
'InputAction' => 'take_post',
'SubscribeBox' => true
));
2013-01-23 08:00:38 +00:00
?>
2013-11-10 08:00:49 +00:00
</div>
2011-03-28 14:21:28 +00:00
</div>
</div>
2012-10-11 08:00:15 +00:00
<? View::show_footer(); ?>