Empty commit

This commit is contained in:
Git 2012-06-05 08:00:11 +00:00
parent 546ef00e5e
commit 69455d2763
5 changed files with 37 additions and 2 deletions

View File

@ -0,0 +1,24 @@
<?
require(SERVER_ROOT.'/classes/class_torrent.php');
$TorrentID = $_GET['torrentid'];
if (!is_number($TorrentID)) {
echo('Invalid TorrentID');
die();
}
$DB->query("SELECT File FROM torrents_files WHERE TorrentID='$TorrentID'");
if($DB->record_count() == 0) {
echo('Torrent not found.');
die();
}
list($Contents) = $DB->next_record(MYSQLI_NUM, array(0));
$Contents = unserialize(base64_decode($Contents));
$Tor = new TORRENT($Contents, true); // New TORRENT object
$Private = $Tor->make_private();
if ($Private) {
echo '<span style="color: #0c0; font-weight: bold;">Private</span>';
} else {
echo '<span style="color: #c00; font-weight: bold;">Public</span>';
}
?>

View File

@ -34,6 +34,9 @@
require(SERVER_ROOT.'/sections/ajax/stats.php');
break;
case 'checkprivate':
include('checkprivate.php');
break;
// things not yet used on the site
case 'torrentgroup':
require('torrentgroup.php');

View File

@ -571,6 +571,7 @@ function filelist($Str) {
<? if(check_perms('site_view_torrent_snatchlist')) { ?>
<a href="#" onclick="show_downloads('<?=$TorrentID?>', 0);return false;">(View Downloadlist)</a>
<a href="#" onclick="show_snatches('<?=$TorrentID?>', 0);return false;">(View Snatchlist)</a>
<a href="#" id="checkprivate-<?=$TorrentID?>" onclick="check_private('<?=$TorrentID?>'); return false;">(Check Private Flag)</a>
<? } ?>
<a href="#" onclick="show_files('<?=$TorrentID?>');return false;">(View Filelist)</a>
<? if($Reported) { ?>

View File

@ -186,3 +186,10 @@ function ToggleEditionRows() {
$('#edition_label').toggle();
$('#edition_catalogue').toggle();
}
function check_private(TorrentID) {
$('#checkprivate-'+TorrentID).raw().innerHTML = "Checking...";
ajax.get('ajax.php?action=checkprivate&torrentid=' + TorrentID,function(response){
$('#checkprivate-'+TorrentID).raw().innerHTML = response;
});
}

View File

@ -36,8 +36,8 @@ $(document).ready(function() {
jQuery('#results1').show();
jQuery('#results2').show();
$searched = true;
var $artist_encoded = encodeURI($artist);
var $album_encoded = encodeURI($album);
var $artist_encoded = encodeURIComponent($artist);
var $album_encoded = encodeURIComponent($album);
$.ajax({
type: "GET",
url : "http://www.musicbrainz.org/ws/2/release-group/?query=artist:%22" + $artist_encoded + "%22%20AND%20releasegroup:%22" + $album_encoded + "%22",