Empty commit

This commit is contained in:
Git 2013-03-05 08:00:26 +00:00
parent 5db8f33eaa
commit ef45b77859
20 changed files with 256 additions and 248 deletions

View File

@ -1,5 +1,7 @@
<?
if (!empty($_GET['action']) && $_GET['action'] === 'autocomplete') {
require('sections/artist/autocomplete.php');
} else {
define('ERROR_EXCEPTION', true);
require('classes/script_start.php');
}

View File

@ -115,7 +115,7 @@ public static function get_stored($Link) {
}
/**
* Turns link into thumbnail (if posible) or default group image (if missing)
* Turns link into thumbnail (if possible) or default group image (if missing)
* Automatically applies proxy when appropriate
*
* @global array $CategoryIcons
@ -192,8 +192,8 @@ public static function cover_thumb($Source, $Category = 0, $Size = 90, $Title =
/**
* Create image proxy URL
* @param string $Url Image url
* @return image peoxy URL
* @param string $Url image URL
* @return image proxy URL
*/
public static function proxy_url($Url) {
global $SSL;
@ -203,7 +203,7 @@ public static function proxy_url($Url) {
}
/**
* This non-class determines the thumbnail equivalent of an image's url after being passed the original
* This non-class determines the thumbnail equivalent of an image's URL after being passed the original
*
**/
@ -220,14 +220,14 @@ function contains($Substring, $String) {
}
/**
* Checks if url points to a whatimg thumbnail.
* Checks if URL points to a whatimg thumbnail.
*/
function has_whatimg_thumb($Url){
return contains("_thumb", $Url);
}
/**
* Cleans up imgur url if it already has a modifier attached to the end of it.
* Cleans up imgur URL if it already has a modifier attached to the end of it.
*/
function clean_imgur_url($Url){
$Extension = pathinfo($Url, PATHINFO_EXTENSION);

View File

@ -411,5 +411,24 @@ public static function display_array($Array, $Escape = array()) {
public static function is_new_torrent(&$Data) {
return strpos(substr($Data, 0, 10), ':') !== false;
}
public static function display_recommend($ID, $Type, $Hide = true) {
global $DB, $LoggedUser;
if($Hide) {
$Hide = 'style="display: none;"';
}
?>
<div id="recommendation_div" data-id="<?=$ID?>" data-type="<?=$Type?>" <?=$Hide?> class="center">
<div style="display: inline-block;" >
<strong>Recommend to: </strong><select id="friend" name="friend">
<option value="0" selected="selected">Choose Friend</option>
</select>
<input type="text" id="recommendation_note" placeholder="Add note..."/>
<button id="send_recommendation" disabled>Send</button>
</div>
<div class="new" id="recommendation_status"><br/></div>
</div>
<?
}
}
?>

View File

@ -1214,6 +1214,13 @@ CREATE TABLE `users_dupes` (
CONSTRAINT `users_dupes_ibfk_2` FOREIGN KEY (`GroupID`) REFERENCES `dupe_groups` (`ID`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin;
CREATE TABLE `users_enable_recommendations` (
`ID` int(10) NOT NULL,
`Enable` tinyint(1) DEFAULT NULL,
PRIMARY KEY (`ID`),
KEY `Enable` (`Enable`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE TABLE `users_freeleeches` (
`UserID` int(10) NOT NULL,
`TorrentID` int(10) NOT NULL,

View File

@ -0,0 +1,13 @@
<?php
$DB->query("SELECT
f.FriendID, u.Username
FROM friends AS f
RIGHT JOIN users_enable_recommendations AS r
ON r.ID = f.FriendID AND r.Enable = 1
RIGHT JOIN users_main AS u
ON u.ID = f.FriendID
WHERE f.UserID = '$LoggedUser[ID]'
ORDER BY u.Username ASC");
echo json_encode($DB->to_array(false, MYSQLI_ASSOC));
die();

View File

@ -135,6 +135,12 @@
case 'wiki':
require(SERVER_ROOT . '/sections/ajax/wiki.php');
break;
case 'send_recommendation':
require(SERVER_ROOT . '/sections/ajax/send_recommendation.php');
break;
case 'get_friends':
require(SERVER_ROOT . '/sections/ajax/get_friends.php');
break;
default:
// If they're screwing around with the query string
print json_encode(array('status' => 'failure'));

View File

@ -0,0 +1,56 @@
<?php
$FriendID = (int) $_POST['friend'];
$Type = $_POST['type'];
$ID = (int) $_POST['id'];
$Note = $_POST['note'];
if(empty($FriendID) || empty($Type) || empty($ID)) {
echo json_encode(array("status" => "error", "response" => "Error."));
die();
}
// Make sure the recipient is on your friends list and not some random dude.
$DB->query("SELECT
f.FriendID, u.Username
FROM friends AS f
JOIN users_enable_recommendations AS r
ON r.ID = f.FriendID AND r.Enable = 1
LEFT JOIN users_main AS u
ON u.ID = f.FriendID
WHERE f.UserID = '$LoggedUser[ID]' AND f.FriendID = '$FriendID'");
if($DB->record_count() == 0) {
echo json_encode(array("status" => "error", "response" => "Not on friend list."));
die();
}
$Type = strtolower($Type);
$Link = "";
// "a" vs "an", english language is so confusing.
// http://en.wikipedia.org/wiki/English_articles#Distinction_between_a_and_an
$Article = "a";
switch($Type) {
case 'torrent':
$Link = "torrents.php?id=".$ID;
$DB->query("SELECT Name FROM torrents_group WHERE ID = '$ID'");
break;
case 'artist':
$Article = "an";
$Link = "artist.php?id=".$ID;
$DB->query("SELECT Name FROM artists_group WHERE ArtistID = '$ID'");
break;
case 'collage':
$Link = "collages.php?id=".$ID;
$DB->query("SELECT Name FROM collages WHERE ID = '$ID'");
break;
}
list($Name) = $DB->next_record();
$Subject = $LoggedUser['Username'] . " recommended you $Article " . $Type . "!";
$Body = $LoggedUser['Username'] . " recommended you the ".$Type." [url=https://".NONSSL_SITE_URL."/".$Link."]".$Name."[/url].";
if(!empty($Note)) {
$Body = $Body . "\n\n". $Note;
}
Misc::send_pm($FriendID, $LoggedUser['ID'], $Subject, $Body);
echo json_encode(array("status" => "success", "response" => "Sent!"));
die();

View File

@ -472,7 +472,7 @@ function compare($X, $Y){
//----------------- End building list and getting stats
View::show_header($Name, 'browse,requests,bbcode,comments,voting,jquery');
View::show_header($Name, 'browse,requests,bbcode,comments,voting,jquery,recommend');
?>
<div class="thin">
<div class="header">
@ -509,7 +509,9 @@ function compare($X, $Y){
<a href="#" id="bookmarklink_artist_<?=$ArtistID?>" onclick="Bookmark('artist', <?=$ArtistID?>,'Remove bookmark');return false;" class="brackets">Bookmark</a>
<?
}
?>
<a href="#" id="recommend" class="brackets">Recommend</a>
<?
if (check_perms('site_edit_wiki')) {
?>
<a href="artist.php?action=edit&amp;artistid=<?=$ArtistID?>" class="brackets">Edit</a>
@ -531,8 +533,9 @@ function compare($X, $Y){
</a>
<? } ?>
</div>
</div>
<div class="sidebar">
</div>
<? Misc::display_recommend($ArtistID, "artist"); ?>
<div class="sidebar">
<? if($Image) { ?>
<div class="box box_image">
<div class="head"><strong><?=$Name?></strong></div>

View File

@ -345,7 +345,7 @@ function compare($X, $Y){
$CollagePages[] = $CollagePage;
}
View::show_header($Name,'browse,collage,bbcode,voting');
View::show_header($Name,'browse,collage,bbcode,voting,jquery,recommend');
?>
<div class="thin">
<div class="header">
@ -370,7 +370,9 @@ function compare($X, $Y){
<? } else { ?>
<a href="#" id="bookmarklink_collage_<?=$CollageID?>" class="brackets" onclick="Bookmark('collage', <?=$CollageID?>,'Remove bookmark');return false;">Bookmark</a>
<? }
?>
<a href="#" id="recommend" class="brackets">Recommend</a>
<?
if (check_perms('site_collages_manage') && !$Locked) { ?>
<a href="collages.php?action=manage&amp;collageid=<?=$CollageID?>" class="brackets">Manage torrents</a>
<? } ?>
@ -379,8 +381,9 @@ function compare($X, $Y){
<a href="collages.php?action=delete&amp;collageid=<?=$CollageID?>&amp;auth=<?=$LoggedUser['AuthKey']?>" class="brackets" onclick="return confirm('Are you sure you want to delete this collage?');">Delete</a>
<? } ?>
</div>
</div>
<div class="sidebar">
</div>
<? Misc::display_recommend($CollageID, "collage"); ?>
<div class="sidebar">
<div class="box box_category">
<div class="head"><strong>Category</strong></div>
<div class="pad"><a href="collages.php?action=search&amp;cats[<?=(int)$CollageCategoryID?>]=1"><?=$CollageCats[(int)$CollageCategoryID]?></a></div>

View File

@ -1,7 +1,7 @@
<?
/*
* This page simply assings a report to the person clicking on
* the Grab / Grab All button.
* the Claim / Claim all button.
*/
if(!check_perms('admin_reports')){
//error(403);

View File

@ -349,7 +349,7 @@
</tr>
<tr>
<td class="label">
<a href="javascript:Load('<?=$ReportID?>')">Resolve</a>
<a href="javascript:Load('<?=$ReportID?>')" title="Click here to reset the resolution options to their default values.">Resolve</a>
</td>
<td colspan="3">
<select name="resolve_type" id="resolve_type<?=$ReportID?>" onchange="ChangeResolve(<?=$ReportID?>)">
@ -369,7 +369,7 @@
<span id="options<?=$ReportID?>">
<? if(check_perms('users_mod')) { ?>
<span title="Delete torrent?">
<strong>Delete</strong>
<label for="delete<?=$ReportID?>"><strong>Delete</strong></label>
<input type="checkbox" name="delete" id="delete<?=$ReportID?>" />
</span>
<? } ?>
@ -386,7 +386,7 @@
</select>
</span>
<span title="Remove upload privileges?">
<strong>Upload</strong>
<label for="upload<?=$ReportID?>"><strong>Remove upload privileges</strong></label>
<input type="checkbox" name="upload" id="upload<?=$ReportID?>" />
</span>
&nbsp;&nbsp;
@ -431,9 +431,9 @@
<tr>
<td colspan="4" style="text-align: center;">
<input type="button" value="Invalidate report" onclick="Dismiss(<?=$ReportID?>);" />
<input type="button" value="Report resolved manually" onclick="ManualResolve(<?=$ReportID?>);" />
<input type="button" value="Resolve report manually" onclick="ManualResolve(<?=$ReportID?>);" />
| <input type="button" value="Give back" onclick="GiveBack(<?=$ReportID?>);" />
| <input id="grab<?=$ReportID?>" type="button" value="Grab!" onclick="Grab(<?=$ReportID?>);" />
| <input id="grab<?=$ReportID?>" type="button" value="Claim" onclick="Grab(<?=$ReportID?>);" />
| Multi-resolve <input type="checkbox" name="multi" id="multi<?=$ReportID?>" checked="checked" />
| <input type="button" value="Submit" onclick="TakeResolve(<?=$ReportID?>);" />
</td>

View File

@ -196,7 +196,7 @@
<div class="buttonbox thin center">
<? if($View != "resolved") { ?>
<span title="Resolves *all* checked reports with their respective resolutions"><input type="button" onclick="MultiResolve();" value="Multi-resolve" /></span>
<span title="Assigns all of the reports on the page to you!"><input type="button" onclick="Grab();" value="Grab all" /></span>
<span title="Assigns all of the reports on the page to you!"><input type="button" onclick="Grab();" value="Claim all" /></span>
<? } ?>
<? if($View == "staff" && $LoggedUser['ID'] == $ID) { ?>| <span title="Un-'in progress' all the reports currently displayed"><input type="button" onclick="GiveBack();" value="Give back all" /></span><? } ?>
</div>
@ -508,7 +508,7 @@
</tr>
<tr>
<td class="label">
<a href="javascript:Load('<?=$ReportID?>')">Resolve</a>
<a href="javascript:Load('<?=$ReportID?>')" title="Click here to reset the resolution options to their default values.">Resolve</a>
</td>
<td colspan="3">
<select name="resolve_type" id="resolve_type<?=$ReportID?>" onchange="ChangeResolve(<?=$ReportID?>)">
@ -528,7 +528,7 @@
<span id="options<?=$ReportID?>">
<? if(check_perms('users_mod')) { ?>
<span title="Delete torrent?">
<strong>Delete</strong>
<label for="delete<?=$ReportID?>"><strong>Delete</strong></label>
<input type="checkbox" name="delete" id="delete<?=$ReportID?>" />
</span>
<? } ?>
@ -545,7 +545,7 @@
</select>
</span>
<span title="Remove upload privileges?">
<strong>Upload</strong>
<label for="upload<?=$ReportID?>"><strong>Remove upload privileges</strong></label>
<input type="checkbox" name="upload" id="upload<?=$ReportID?>" />
</span>
&nbsp;&nbsp;
@ -590,11 +590,11 @@
<tr>
<td colspan="4" style="text-align: center;">
<input type="button" value="Invalidate report" onclick="Dismiss(<?=$ReportID?>);" />
<input type="button" value="Report resolved manually" onclick="ManualResolve(<?=$ReportID?>);" />
<input type="button" value="Resolve report manually" onclick="ManualResolve(<?=$ReportID?>);" />
<? if($Status == "InProgress" && $LoggedUser['ID'] == $ResolverID) { ?>
| <input type="button" value="Give back" onclick="GiveBack(<?=$ReportID?>);" />
<? } else { ?>
| <input id="grab<?=$ReportID?>" type="button" value="Grab!" onclick="Grab(<?=$ReportID?>);" />
| <input id="grab<?=$ReportID?>" type="button" value="Claim" onclick="Grab(<?=$ReportID?>);" />
<? } ?>
| Multi-resolve <input type="checkbox" name="multi" id="multi<?=$ReportID?>" checked="checked" />
| <input type="button" id="submit_<?=$ReportID?>" value="Submit" onclick="TakeResolve(<?=$ReportID?>);" />
@ -630,7 +630,7 @@
<? if($GroupID) { ?>
<tr>
<td colspan="4" style="text-align: center;">
<input id="grab<?=$ReportID?>" type="button" value="Grab!" onclick="Grab(<?=$ReportID?>);" />
<input id="grab<?=$ReportID?>" type="button" value="Claim" onclick="Grab(<?=$ReportID?>);" />
</td>
</tr>
<? }

View File

@ -12,7 +12,7 @@
View::show_header('Reports V2!', 'reportsv2');
//Grab owners ID, just for examples
//Grab owner's ID, just for examples
$DB->query("SELECT ID, Username FROM users_main ORDER BY ID ASC LIMIT 1");
list($OwnerID, $Owner) = $DB->next_record();
$Owner = display_str($Owner);

View File

@ -41,7 +41,7 @@
<!-- Uploading Rules -->
<div class="thin">
<div class="header">
<h2>Uploading</h2>
<h2>Uploading Rules</h2>
</div>
<!-- Uploading Rules Index Links -->
<br />
@ -211,7 +211,7 @@
</ul>
</li>
<li id="r2.1.17"><a href="#h2.1"><strong>&uarr;_</strong></a> <a href="#r2.1.17">2.1.17.</a> <strong>No comedy, audiobook, or spoken word releases may be uploaded as music.</strong> These torrents must not be grouped with other formats from the same release (i.e., they need to have individual torrent pages). See <a href="#r3.2">3.2</a> and <a href="wiki.php?action=article&amp;id=955">this wiki</a> for more information.</li>
<li id="r2.1.18"><a href="#h2.1"><strong>&uarr;_</strong></a> <a href="#r2.1.18">2.1.18.</a> <strong>Sound Sample Packs must be uploaded as applications.</strong> See <a href="#r4.1.9">4.1.9</a> for more information.</li>
<li id="r2.1.18"><a href="#h2.1"><strong>&uarr;_</strong></a> <a href="#r2.1.18">2.1.18.</a> <strong>Sound sample packs must be uploaded as applications.</strong> See <a href="#r4.1.9">4.1.9</a> for more information.</li>
<li id="r2.1.19"><a href="#h2.1"><strong>&uarr;_</strong></a> <a href="#r2.1.19">2.1.19.</a> <strong>All music torrents must represent a complete release, and may not be missing tracks (or discs in the case of a multi-disc release).</strong>
<ul>
<li id="r2.1.19.1"><a href="#r2.1.19"><strong>&uarr;_</strong></a> <a href="#r2.1.19.1">2.1.19.1.</a> <strong>If an album is released as a multi-disc set (or box set) of CDs or vinyl discs, then it must be uploaded as a single torrent.</strong> Preferably, each individual CD rip in a multi-disc set should be organized in its own folder (see <a href="#r2.3.15">2.3.15</a>).</li>
@ -222,11 +222,11 @@
<li id="r2.1.20"><a href="#h2.1"><strong>&uarr;_</strong></a> <a href="#r2.1.20">2.1.20.</a> <strong>User made discographies may not be uploaded.</strong> Multi-album torrents are not allowed on the site under any circumstances. That means no discographies, Pitchfork compilations, etc. If releases (e.g., CD singles) were never released as a bundled set, do not upload them together. Live Soundboard material should be uploaded as one torrent per night, per show, or per venue. Including more than one show in a torrent results in a multi-album torrent. Exceptions: Only official boxsets and official compilation collections can contain multiple albums.</li>
<li id="r2.1.21"><a href="#h2.1"><strong>&uarr;_</strong></a> <a href="#r2.1.21">2.1.21.</a> <strong><a href="wiki.php?action=article&amp;id=386">Pre-emphasis</a> is allowed in lossless torrents only.</strong> Lossless FLAC torrents with pre-emphasis are allowed on the site. They are allowed to coexist with lossless de-emphasized torrents (both in their separate album edition groups). In contrast, lossy formats may not have pre-emphasis and will be deleted if uploaded.</li>
<li id="r2.1.22"><a href="#h2.1"><strong>&uarr;_</strong></a> <a href="#r2.1.22">2.1.22.</a> <strong>Edition Information must be provided for digitally-sourced torrents.</strong> Digitally-sourced (including CD-sourced) rips of albums that were first released before the availability of their source medium must have accurate edition information. For example, if a CD rip is of an album whose original release date was 1957, predating the creation and distribution of CDs, then the uploader must make note of the correct year in which the CD was pressed, and preferably note the catalog identification as well. Rips for which Edition Information cannot be provided must be marked as an "Unknown Release." Under no circumstances may you guess or feign knowledge of the Edition Information. See <a href="wiki.php?action=article&amp;id=367">this wiki</a> for more information on album editions.</li>
<li id="r2.1.23"><a href="#h2.1"><strong>&uarr;_</strong></a> <a href="#r2.1.23">2.1.23.</a> <strong>This audio layer must comply with the Redbook standard for audio data. If there is no Redbook audio on the game disc, you may not upload a rip of the disc. Be prepared to provide extensive information on any audio that is ripped from a gaming disc (see <a href="wiki.php?action=article&amp;id=953">this wiki</a> for information about providing proofs).</strong>
<li id="r2.1.23"><a href="#h2.1"><strong>&uarr;_</strong></a> <a href="#r2.1.23">2.1.23.</a> <strong>Audio can only be ripped from a video game CD under very specific circumstances. Audio ripped from a video game DVD is not allowed on site.</strong>
<ul>
<li id="r2.1.23.1"><a href="#r2.1.23"><strong>&uarr;_</strong></a> <a href="#r2.1.23.1">2.1.23.1.</a> <strong>This audio layer must comply with the Redbook standard for audio data. </strong>f there is no Redbook audio on the game disc, you may not upload a rip of the disc. Be prepared to provide extensive information on any audio that is ripped from a gaming disc (see <a href="wiki.php?action=article&amp;id=953">this wiki</a> for information about providing proofs).</li>
<li id="r2.1.23.1"><a href="#r2.1.23"><strong>&uarr;_</strong></a> <a href="#r2.1.23.1">2.1.23.1.</a> <strong>This audio layer must comply with the Red Book standard for audio data.</strong> If there is no Red Book audio on the game disc, you may not upload a rip of the disc. Be prepared to provide extensive information on any audio that is ripped from a gaming disc (see <a href="wiki.php?action=article&amp;id=953">this wiki</a> for information about providing proof).</li>
<li id="r2.1.23.2"><a href="#r2.1.23"><strong>&uarr;_</strong></a> <a href="#r2.1.23.2">2.1.23.2.</a> <strong>The audio must meet the minimum requirements for music on the site (see <a href="#r2.1.3">2.1.3</a> and <a href="#r2.1.6">2.1.6</a>).</strong> </li>
<li id="r2.1.23.3"><a href="#r2.1.23"><strong>&uarr;_</strong></a> <a href="#r2.1.23.3">2.1.23.3.</a> <strong>Officially-released game soundtracks, which adhere to Redbook standards, are always allowed.</strong> </li>
<li id="r2.1.23.3"><a href="#r2.1.23"><strong>&uarr;_</strong></a> <a href="#r2.1.23.3">2.1.23.3.</a> <strong>Officially-released game soundtracks, which adhere to Red Book standards, are always allowed.</strong> </li>
</ul>
</li>
<li id="r2.1.24"><a href="#h2.1"><strong>&uarr;_</strong></a> <a href="#r2.1.24">2.1.24.</a> <strong>Lossy AAC torrents may only be uploaded when they represent exclusive content not currently available in any other format (e.g., an iTunes WEB exclusive release).</strong> </li>
@ -301,7 +301,7 @@
</ul>
</li>
<li id="r2.2.10.10"><a href="#r2.2.10"><strong>&uarr;_</strong></a> <a href="#r2.2.10.10">2.2.10.10.</a> <strong>FLAC files must be compressed.</strong> We strongly recommend that FLAC files be compressed to Level 8. Lack of compression can increase the torrent size by 5% or more. Any torrents that have uncompressed FLAC files may be reported and trumped.</li>
<li id="r2.2.10.11"><a href="#r2.2.10"><strong>&uarr;_</strong></a> <a href="#r2.2.10.11">2.2.10.11.</a> <strong>Any lossless formats must be encoded at the same sampling rate as their lossless source material.</strong> Lossless files from a Redbook-compliant CD rip (sampled at 44.1 kHz) can only be encoded to 44.1 kHz FLAC files for uploading in lossless torrents. Any 48 kHz lossless torrents for the same release are considered dupes. FLAC files from a WEB FLAC (sampled at 48 kHz) can only be uploaded as 48 kHz FLAC torrents. Any 44.1 kHz torrents for the same release are considered dupes. When albums are available in a number of different lossless formats (44.1 kHz, 48, kHz, 96 kHz, etc.) the first lossless torrent that is uploaded to the site may remain while all subsequent versions are considered dupes. See <a href="#r2.2.2">2.2.2</a> and <a href="#r2.2.9.13">2.2.9.13</a> for more information.</li>
<li id="r2.2.10.11"><a href="#r2.2.10"><strong>&uarr;_</strong></a> <a href="#r2.2.10.11">2.2.10.11.</a> <strong>Any lossless formats must be encoded at the same sampling rate as their lossless source material.</strong> Lossless files from a Red Book-compliant CD rip (sampled at 44.1 kHz) can only be encoded to 44.1 kHz FLAC files for uploading in lossless torrents. Any 48 kHz lossless torrents for the same release are considered dupes. FLAC files from a WEB FLAC (sampled at 48 kHz) can only be uploaded as 48 kHz FLAC torrents. Any 44.1 kHz torrents for the same release are considered dupes. When albums are available in a number of different lossless formats (44.1 kHz, 48, kHz, 96 kHz, etc.) the first lossless torrent that is uploaded to the site may remain while all subsequent versions are considered dupes. See <a href="#r2.2.2">2.2.2</a> and <a href="#r2.2.9.13">2.2.9.13</a> for more information.</li>
</ul>
</li>
<li id="r2.2.11"><a href="#h2.2"><strong>&uarr;_</strong></a> <a href="#r2.2.11">2.2.11.</a> <strong>Editions and Releases rules</strong>
@ -500,7 +500,7 @@
<ul>
<li id="r2.8.5.1"><a href="#r2.8.5"><strong>&uarr;_</strong></a> <a href="#r2.8.5.1">2.8.5.1.</a> <strong> A multichannel lossless rip must have the same number of and arrangement of channels as the source media.</strong> In addition, the rip must be encoded at the same bit depth and sampling rate as the original stream. Downsampled versions of the original source material may be trumped by a torrent containing audio files ripped directly from the disc at the bit depth and sampling rate originally found on disc. For example, there is a 192 kHz track and a 44.1 kHz track on the SACD. A user uploads only the 192 kHz track and that source is subsequently downsampled to 44.1 kHz. Another user who rips the actual 44.1 kHz track from the original disc may trump the downsampled torrent.</li>
<li id="r2.8.5.2"><a href="#r2.8.5"><strong>&uarr;_</strong></a> <a href="#r2.8.5.2">2.8.5.2.</a> <strong>Downmixing of SACD sources is prohibited.</strong> Do not downmix a 5.1 (or higher) channel mix to stereo and upload the resulting audio files. You may still downconvert lossless audio sources from 24-bit to 16-bit.</li>
<li id="r2.8.5.3"><a href="#r2.8.5"><strong>&uarr;_</strong></a> <a href="#r2.8.5.3">2.8.5.3.</a> <strong> All lossy SACD torrents must be uploaded in a Redbook-compliant form.</strong> Any stereo lossless sources must be downconverted to 16 bits and downsampled to 44.1 kHz before they are transcoded to lossy MP3 formats. No other bit depth or sampling rate is allowed for lossy SACD torrents.</li>
<li id="r2.8.5.3"><a href="#r2.8.5"><strong>&uarr;_</strong></a> <a href="#r2.8.5.3">2.8.5.3.</a> <strong> All lossy SACD torrents must be uploaded in a Red Book-compliant form.</strong> Any stereo lossless sources must be downconverted to 16 bits and downsampled to 44.1 kHz before they are transcoded to lossy MP3 formats. No other bit depth or sampling rate is allowed for lossy SACD torrents.</li>
</ul>
</li>
</ul>
@ -526,7 +526,7 @@
<ul>
<li id="r2.9.5.1"><a href="#r2.9.5"><strong>&uarr;_</strong></a> <a href="#r2.9.5.1">2.9.5.1.</a> <strong> A multichannel lossless rip must have the same number of and arrangement of channels as the source media.</strong> In addition, the rip must be encoded at the same bit depth and sampling rate as the original stream. Downsampled versions of the original source material may be trumped by a torrent containing audio files ripped directly from the disc at the bit depth and sampling rate originally found on disc. For example, there is a 96 kHz track and a 44.1 kHz track on the Blu-ray disc. A user uploads only the 96 kHz track and that source is subsequently downsampled to 44.1 kHz. Another user who rips the actual 44.1 kHz track from the original disc may trump the downsampled torrent.</li>
<li id="r2.9.5.2"><a href="#r2.9.5"><strong>&uarr;_</strong></a> <a href="#r2.9.5.2">2.9.5.2.</a> <strong> Downmixing of Blu-ray sources is prohibited.</strong> Do not downmix a 5.1 (or higher) channel mix to stereo and upload the resulting audio files. You may still downconvert lossless audio sources from 24-bit to 16-bit.</li>
<li id="r2.9.5.3"><a href="#r2.9.5"><strong>&uarr;_</strong></a> <a href="#r2.9.5.3">2.9.5.3.</a> <strong> All lossy Blu-ray torrents must be uploaded in a Redbook-compliant form.</strong> Any stereo lossless sources must be downconverted to 16 bits and downsampled to 44.1 kHz before they are transcoded to lossy MP3 formats. No other bit depth or sampling rate is allowed for lossy Blu-ray torrents.</li>
<li id="r2.9.5.3"><a href="#r2.9.5"><strong>&uarr;_</strong></a> <a href="#r2.9.5.3">2.9.5.3.</a> <strong> All lossy Blu-ray torrents must be uploaded in a Red Book-compliant form.</strong> Any stereo lossless sources must be downconverted to 16 bits and downsampled to 44.1 kHz before they are transcoded to lossy MP3 formats. No other bit depth or sampling rate is allowed for lossy Blu-ray torrents.</li>
<li id="r2.9.5.4"><a href="#r2.9.5"><strong>&uarr;_</strong></a> <a href="#r2.9.5.4">2.9.5.4.</a> <strong> Do not downsample, downmix, transcode or otherwise manipulate any lossy Blu-ray format (e.g., Dolby Digital (AC3), DTS, Dolby Digital Plus (AC3), and DTS-HD).</strong> </li>
</ul>
</li>

View File

@ -1,149 +0,0 @@
<?
// skipfile
if (!check_perms('users_mod') && !check_perms("site_mark_suggestions")) {
error(403);
}
View::show_header('Suggestions');
$Categories = array(
"Dupe Suggestion",
"Already Implemented",
"Already Rejected Suggestion/Against The Rules",
"Awful Suggestion",
"Suggestion",
"Approved Suggestion"
)?>
<h2>Suggestions</h2>
<div class="linkbox">
<a href="tools.php?action=suggestions&amp;view=scoreboard" class="brackets">Scoreboard</a>
<a href="tools.php?action=suggestions&amp;view=marked" class="brackets">Open suggestions</a>
<a href="tools.php?action=suggestions&amp;view=marked&amp;closed=1" class="brackets">Closed suggestions</a>
<a href="tools.php?action=suggestions&amp;view=marked&amp;all=1" class="brackets">All suggestions</a>
</div>
<?if($_GET['view'] == "scoreboard" || empty($_GET['view'])) { ?>
<div id="marked_suggestion">
<h3>Marked</h3>
<table>
<tr class="colhead">
<td>Username</td>
<td>Count</td>
</tr>
<?
$DB->query("SELECT
s.UserID, count(s.ThreadID) AS C
FROM marked_suggestions AS s
GROUP BY s.UserID ORDER BY c DESC LIMIT 15");
$Row = 'b';
while ( list ($UserID, $Count) = $DB->next_record() ) {
$Row = ($Row == 'a') ? 'b' : 'a';
?>
<tr class="row<?=$Row?>">
<td><?=Users::format_username($UserID)?></td>
<td><?=number_format($Count)?></td>
</tr>
<? }?>
</table>
</div>
<div id="implemented_suggestion">
<h3>Implemented</h3>
<table>
<tr class="colhead">
<td>Username</td>
<td>Count</td>
</tr>
<?
$DB->query("SELECT
LastPostAuthorID, count(LastPostAuthorID) AS C
FROM forums_topics AS f
WHERE ForumID = 63 AND f.Title LIKE '[implemented]%'
GROUP BY LastPostAuthorID ORDER BY c DESC LIMIT 15");
$Row = 'b';
while ( list ($UserID, $Count) = $DB->next_record() ) {
$Row = ($Row == 'a') ? 'b' : 'a';
?>
<tr class="row<?=$Row?>">
<td><?=Users::format_username($UserID)?></td>
<td><?=number_format($Count)?></td>
</tr>
<? }?>
</table>
</div>
<div id="rejected_suggestion">
<h3>Rejected</h3>
<table>
<tr class="colhead">
<td>Username</td>
<td>Count</td>
</tr>
<?
$DB->query("SELECT
LastPostAuthorID, count(LastPostAuthorID) AS C
FROM forums_topics AS f
WHERE ForumID = 63 AND f.Title LIKE '[rejected]%'
GROUP BY LastPostAuthorID ORDER BY c DESC LIMIT 15");
$Row = 'b';
while ( list ($UserID, $Count) = $DB->next_record() ) {
$Row = ($Row == 'a') ? 'b' : 'a';
?>
<tr class="row<?=$Row?>">
<td><?=Users::format_username($UserID)?></td>
<td><?=number_format($Count)?></td>
</tr>
<? }?>
</table>
</div>
<?
}
elseif ($_GET['view'] == "marked") {
if(((int) $_GET['all']) == 1) {
$Forums = "9, 63, 13";
} elseif(((int) $_GET['closed']) == 1) {
$Forums = "63, 13";
}
else {
$Forums = 9;
}
foreach ($Categories as $Key => $Value) {
$DB->query("SELECT
f.Title, s.ThreadID, s.URL, s.UserID, s.Notes
FROM marked_suggestions AS s
LEFT JOIN forums_topics AS f ON s.ThreadID = f.ID
WHERE f.ForumID IN ($Forums) AND s.Category = $Key
ORDER BY f.Title ASC");
?>
<h3><a href="#" onclick="$('#category_<?=$Key?>').toggle();"><?=$Value?></a> (<?=$DB->record_count()?>)</h3>
<div class="hidden" id="category_<?=$Key?>">
<table>
<tr class="colhead">
<td>Thread title</td>
<td>Username</td>
<td>Links</td>
<td>Notes</td>
</tr>
<?
$Row = 'b';
while ( list ($Title, $ThreadID, $URL, $UserID, $Notes) = $DB->next_record() ) {
$Row = ($Row == 'a') ? 'b' : 'a';
?>
<tr class="row<?=$Row?>">
<td><a href="forums.php?action=viewthread&amp;threadid=<?=$ThreadID?>"><?=$Title?></a></td>
<td><?=Users::format_username($UserID)?></td>
<td><a href="<?=$URL?>"><?=$URL?></a></td>
<td><?=$Notes?></td>
</tr>
<? }?>
</table>
</div>
<?
}
}
?>
<?
View::show_footer();
?>

View File

@ -80,7 +80,7 @@ function compare($X, $Y){
}*/
// Start output
View::show_header($Title,'jquery,browse,comments,torrent,bbcode');
View::show_header($Title,'jquery,browse,comments,torrent,bbcode,recommend');
?>
<div class="thin">
<div class="header">
@ -99,6 +99,9 @@ function compare($X, $Y){
<? } else { ?>
<a href="#" id="bookmarklink_torrent_<?=$GroupID?>" class="add_bookmark brackets" title="Add bookmark" onclick="Bookmark('torrent',<?=$GroupID?>,'Unbookmark');return false;">Bookmark</a>
<? }
?>
<a href="#" id="recommend" class="brackets">Recommend</a>
<?
if($Categories[$GroupCategoryID-1] == 'Music') { ?>
<a href="upload.php?groupid=<?=$GroupID?>" class="brackets">Add format</a>
<? }
@ -108,6 +111,7 @@ function compare($X, $Y){
<a href="torrents.php?action=grouplog&amp;groupid=<?=$GroupID?>" class="brackets">View log</a>
</div>
</div>
<? Misc::display_recommend($GroupID, "torrent"); ?>
<div class="sidebar">
<div class="box box_image box_image_albumart box_albumart"><!-- .box_albumart deprecated -->
<div class="head"><strong>Cover</strong></div>

View File

@ -66,6 +66,12 @@ function checked($Checked) {
$LastFMUsername = "";
list($LastFMUsername) = $DB->next_record();
$DB->query("SELECT Enable FROM users_enable_recommendations WHERE ID = '$UserID' AND Enable = 1");
if($DB->record_count() > 0) {
$RecommendationsEnabled = "value='1' checked='checked'";
}
echo $Val->GenerateJS('userform');
?>
<div class="thin">
@ -258,6 +264,13 @@ function checked($Checked) {
</td>
</tr>
<!-- -->
<tr>
<td class="label"><strong>Torrent Recommendations</strong></td>
<td>
<input type="checkbox" name="torrent_recommendations" id="torrent_recommendations" <?=$RecommendationsEnabled?> />
<label for="torrent_recommendations">Allow people to send you torrent recommendations.</label>
</td>
</tr>
<tr>
<td class="label"><strong>Auto-save text</strong></td>
<td>

View File

@ -248,6 +248,24 @@
$DB->query("INSERT INTO lastfm_users (ID, Username) VALUES ('$UserID', '$LastFMUsername')");
}
$RecommendationsEnabled = $_POST['torrent_recommendations'];
// Make sure user has recommentations enabled before removing them.
if($RecommendationsEnabled == 'on') {
$DB->query("INSERT INTO
users_enable_recommendations
(ID, Enable) VALUES ('$UserID', '1')
ON DUPLICATE KEY UPDATE Enable = '1'");
} else {
$DB->query("SELECT Enable FROM users_enable_recommendations WHERE ID = '$UserID' AND Enable = 1");
if($DB->record_count() > 0) {
$DB->query("INSERT INTO
users_enable_recommendations
(ID, Enable) VALUES ('$UserID', '0')
ON DUPLICATE KEY UPDATE Enable = '0'");
}
}
// Information on how the user likes to download torrents is stored in cache
if($DownloadAlt != $LoggedUser['DownloadAlt']) {
$Cache->delete_value('user_'.$LoggedUser['torrent_pass']);

View File

@ -1,60 +0,0 @@
//skipfile
function SetDate() {
var amount = $('#amount').raw().value;
var denom = $('#denomination').raw().value;
switch(denom) {
case 'months' :
amount *= 4.33333;
case 'weeks' :
amount *= 7;
case 'days' :
amount *= 24;
case 'hours' :
amount *= 60;
case 'minutes' :
amount *= 60;
amount *= 1000; //millis
break;
}
var d = new Date;
d.setTime(d.getTime() + amount + (d.getTimezoneOffset() * 60 * 1000));
//YYYY-MM-DD HH:MM:SS
var out = d.getFullYear() + "-" + (d.getMonth() + 1) + "-" + d.getDate() + " " + d.getHours() + ":" + d.getMinutes() + ":" + d.getSeconds();
$('#date').raw().value = out;
}
function AddOption() {
var list = document.createElement("li");
var effects = document.createElement("select");
effects.name = "delay_effect[]";
var enable = document.createElement("option");
enable.value = "1";
enable.innerHTML = "Enable";
effects.appendChild(enable);
var disable = document.createElement("option");
disable.value = "0";
disable.innerHTML = "Disable";
effects.appendChild(disable);
list.appendChild(effects);
list.innerHTML += " ";
var options = json.decode($('#delays_json').raw().value);
var delays = document.createElement("select");
delays.name = "delay[]";
for(var option in options) {
var delay = document.createElement("option");
delay.value = option;
delay.innerHTML = options[option][0].long;
delays.appendChild(delay);
}
list.appendChild(delays);
$('#delays_list').raw().appendChild(list);
}

View File

@ -0,0 +1,73 @@
(function($) {
var sent = new Array();
var loaded = false;
var type;
var id;
$(document).ready(function() {
type = $("#recommendation_div").data('type');
id = $("#recommendation_div").data('id');
$("#recommend").click(function() {
$("#recommendation_div").slideToggle(150);
if(!loaded) {
$("#recommendation_status").html("Loading...");
$.ajax({
type : "POST",
url : "ajax.php?action=get_friends",
dataType : "json",
success : function(response) {
$.each(response, function(key, value) {
var id = value['FriendID'];
var friend = value['Username'];
$("#friend").append($("<option></option>").attr("value", id).text(friend));
});
loaded = true;
$("#recommendation_status").html("<br />");
}
});
}
});
$("#friend").change(function() {
var friend = $("select#friend").val();
if (friend == 0) {
$("#send_recommendation").attr("disabled", "disabled");
} else if ($.inArray(friend, sent) == -1) {
$("#send_recommendation").removeAttr("disabled");
}
$("#recommendation_status").html("<br />");
});
$("#send_recommendation").click(function() {
send_recommendation();
});
$("#recommendation_note").keypress(function(e) {
state = $("#send_recommendation").attr("disabled");
if (typeof state === 'undefined' && e.keyCode == 13)
{
e.preventDefault();
send_recommendation();
}
});
});
function send_recommendation() {
var friend = $("select#friend").val();
var note = $("#recommendation_note").val();
if (friend != 0) {
$.ajax({
type : "POST",
dataType : "json",
url : "ajax.php?action=send_recommendation",
data : {
"friend" : friend,
"note" : note,
"type" : type,
"id" : id
}
}).done(function(response) {
$("#recommendation_status").html("<strong>" + response['response'] + "</strong>");
$("#send_recommendation").attr("disabled", "disabled");
$("#recommendation_note").val("");
sent.push(friend);
});
}
}
}(jQuery));