Empty commit

This commit is contained in:
Git 2013-01-09 08:00:34 +00:00
parent f784d42038
commit ba15532e94
4 changed files with 67 additions and 155 deletions

View File

@ -1,70 +0,0 @@
<?php
if (!check_perms('users_mod')) { error(403);
}
View::show_header('Common Snatches');
?>
<div class="header">
<h2>Common Snatches</h2>
</div>
<table width="100%">
<tr class="colhead">
<td>User A</td>
<td>User B</td>
<td>Limit</td>
</tr>
<tr/>
<tr>
<form class="manage_form" name="common_snatches" method="post">
<input type="hidden" name="compare" value="1" />
<td>
<input type="text" name="userida" />
</td>
<td>
<input type="text" name="useridb" />
</td>
<td>
<input type="text" name="limit" value="50" />
</td>
<td>
<input type="submit" value="Compare" />
</td>
</form>
</tr>
</table>
<?
if(isset($_POST['compare'])) {
if (isset($_POST['userida']) && is_numeric($_POST['userida']) && isset($_POST['useridb']) && is_numeric($_POST['useridb'])) {
$UserIDA = (int) $_POST['userida'];
$UserIDB = (int) $_POST['useridb'];
if(isset($_POST['limit']) && is_numeric($_POST['limit'])) {
$Limit = 'LIMIT ' . $_POST['limit'];
}
$DB->query("SELECT g.ID, g.Name FROM torrents AS t INNER JOIN torrents_group AS g ON g.ID = t.GroupID JOIN xbt_snatched AS xs ON xs.fid=t.ID WHERE xs.uid IN ($UserIDA,$UserIDB) HAVING COUNT(xs.fid) > 1 ORDER BY xs.tstamp DESC $LIMIT");
?>
<table width="80%">
<tr class="colhead">
<td>Torrent</td>
</tr>
<tr/>
<?
while(list($GroupID, $GroupName) = $DB->next_record()) {
?>
<tr>
<td>
<a href="torrents.php?id=<?=$GroupID?>"><?=$GroupName?></a>
</td>
</tr>
<?
}
?>
</table>
<?
}
}
View::show_footer();
?>

View File

@ -1,67 +1,81 @@
<?
if (!check_perms('users_view_email')) { error(403);
define('EMAILS_PER_PAGE', 25);
if (!check_perms('users_view_email')) {
error(403);
}
list($Page, $Limit) = Format::page_limit(EMAILS_PER_PAGE);
View::show_header('Manage email blacklist');
$DB -> query("SELECT
$DB->query("SELECT
SQL_CALC_FOUND_ROWS
eb.ID,
eb.UserID,
eb.Time,
eb.Email,
eb.Comment
FROM email_blacklist AS eb
ORDER BY eb.Time DESC");
ORDER BY eb.Time DESC LIMIT $Limit");
$Results = $DB->to_array(false, MYSQLI_ASSOC, false);
$DB->query("SELECT FOUND_ROWS()");
list($NumResults) = $DB->next_record();
?>
<div class="header">
<h2>Email Blacklist</h2>
<h2>Email Blacklist</h2>
</div>
<div class="linkbox pager">
<br />
<?
$Pages = Format::get_pages($Page, $NumResults, TOPICS_PER_PAGE, 9);
echo $Pages;
?>
</div>
<table>
<tr class="colhead">
<td>Email</td>
<td>Comment</td>
<td>Added</td>
<td>Submit</td>
</tr>
<tr class="colhead">
<td colspan="4">Add Email or Domain to Blacklist</td>
</tr>
<tr class="rowa">
<form class="add_form" name="email_blacklist" action="tools.php" method="post">
<input type="hidden" name="action" value="eb_alter" />
<input type="hidden" name="auth" value="<?=$LoggedUser['AuthKey']?>" />
<td>
<input type="text" name="email" size="30" />
</td>
<td colspan="2">
<input type="text" name="comment" size="60" />
</td>
<td>
<input type="submit" value="Create" />
</td>
</form>
</tr>
<? while(list($ID, $UserID, $Time, $Email, $Comment) = $DB->next_record()) {
<tr class="colhead">
<td>Email</td>
<td>Comment</td>
<td>Added</td>
<td>Submit</td>
</tr>
<tr class="colhead">
<td colspan="4">Add Email or Domain to Blacklist</td>
</tr>
<tr class="rowa">
<form class="add_form" name="email_blacklist" action="tools.php" method="post">
<input type="hidden" name="action" value="eb_alter"/>
<input type="hidden" name="auth" value="<?=$LoggedUser['AuthKey']?>"/>
<td>
<input type="text" name="email" size="30"/>
</td>
<td colspan="2">
<input type="text" name="comment" size="60"/>
</td>
<td>
<input type="submit" value="Create"/>
</td>
</form>
</tr>
<? foreach($Results as $Result) {
?>
<tr>
<form class="manage_form" name="email_blacklist" action="tools.php" method="post">
<td>
<input type="hidden" name="action" value="eb_alter" />
<input type="hidden" name="auth" value="<?=$LoggedUser['AuthKey']?>" />
<input type="hidden" name="id" value="<?=$ID?>" />
<input type="text" name="email" value="<?=display_str($Email)?>" size="30" />
</td>
<td>
<input type="text" name="comment" value="<?=display_str($Comment)?>" size="60" />
</td>
<td><?=Users::format_username($UserID, false, false, false)
?><br /><?=time_diff($Time, 1)
?></td>
<td>
<input type="submit" name="submit" value="Edit" />
<input type="submit" name="submit" value="Delete" />
</td>
</form>
</tr>
<? }?>
<tr>
<form class="manage_form" name="email_blacklist" action="tools.php" method="post">
<td>
<input type="hidden" name="action" value="eb_alter"/>
<input type="hidden" name="auth" value="<?=$LoggedUser['AuthKey']?>"/>
<input type="hidden" name="id" value="<?=$Result['ID']?>"/>
<input type="text" name="email" value="<?=display_str($Result['Email'])?>" size="30"/>
</td>
<td>
<input type="text" name="comment" value="<?=display_str($Result['Comment'])?>" size="60"/>
</td>
<td><?=Users::format_username($Result['$UserID'], false, false, false)
?><br/><?=time_diff($Result['Time'], 1)
?></td>
<td>
<input type="submit" name="submit" value="Edit"/>
<input type="submit" name="submit" value="Delete"/>
</td>
</form>
</tr>
<? }?>
</table>
<? View::show_footer();?>
<? View::show_footer(); ?>

View File

@ -585,7 +585,7 @@ function filelist($Str) {
<a href="#" onclick="show_snatches('<?=$TorrentID?>', 0);return false;" title="View the list of users that have reported a snatch to the tracker.">(View snatch list)</a>
<? } ?>
<a href="#" onclick="show_files('<?=$TorrentID?>');return false;">(View file list)</a>
<? if($Reported) { ?>
<? if($Reported) { ?>
<a href="#" onclick="show_reported('<?=$TorrentID?>');return false;">(View report information)</a>
<? } ?>
</div>
@ -593,8 +593,7 @@ function filelist($Str) {
<div id="downloads_<?=$TorrentID?>" class="hidden"></div>
<div id="snatches_<?=$TorrentID?>" class="hidden"></div>
<div id="files_<?=$TorrentID?>" class="hidden"><?=$FileList?></div>
<div id="spectrals_<?=$TorrentID?>" class="hidden"></div>
<? if($Reported) { ?>
<? if($Reported) { ?>
<div id="reported_<?=$TorrentID?>" class="hidden"><?=$ReportInfo?></div>
<? } ?>
<? if(!empty($Description)) {

View File

@ -17,7 +17,6 @@ function show_peers (TorrentID, Page) {
$('#downloads_' + TorrentID).hide();
$('#files_' + TorrentID).hide();
$('#reported_' + TorrentID).hide();
$('#spectrals_' + TorrentID).hide();
}
function show_snatches (TorrentID, Page){
@ -39,7 +38,6 @@ function show_snatches (TorrentID, Page){
$('#downloads_' + TorrentID).hide();
$('#files_' + TorrentID).hide();
$('#reported_' + TorrentID).hide();
$('#spectrals_' + TorrentID).hide();
}
function show_downloads (TorrentID, Page){
@ -61,7 +59,6 @@ function show_downloads (TorrentID, Page){
$('#snatches_' + TorrentID).hide();
$('#files_' + TorrentID).hide();
$('#reported_' + TorrentID).hide();
$('#spectrals_' + TorrentID).hide();
}
function show_files(TorrentID){
@ -70,7 +67,6 @@ function show_files(TorrentID){
$('#snatches_' + TorrentID).hide();
$('#downloads_' + TorrentID).hide();
$('#reported_' + TorrentID).hide();
$('#spectrals_' + TorrentID).hide();
}
function show_reported(TorrentID){
@ -79,33 +75,6 @@ function show_reported(TorrentID){
$('#snatches_' + TorrentID).hide();
$('#downloads_' + TorrentID).hide();
$('#reported_' + TorrentID).toggle();
$('#spectrals_' + TorrentID).hide();
}
function show_spectrals (TorrentID){
$('#snatches_' + TorrentID).hide();
$('#peers_' + TorrentID).hide();
$('#downloads_' + TorrentID).hide();
$('#files_' + TorrentID).hide();
$('#reported_' + TorrentID).hide();
$('#spectrals_' + TorrentID).toggle();
ajax.get('http://archive.org/~abuie/spectral.php?q=' + TorrentID,function(response){
var json = JSON.parse(response);
html = "<br /> <strong>Loading...</strong>"
$('#spectrals_' + TorrentID).show().raw().innerHTML=html;
if(json['status']['state'] == 'success') {
for (var i = 0; i < json['count']; i++) {
html += "<img src='" + json['files'][i] + "' alt='" + json['files'][i] + "' style='max-width:440px;' onclick='lightbox.init(\""+json['files'][i] + "\", 440);'></a>";
html += "<br /> <br />";
}
}
else {
html = "<br /> <strong>Error: " + json['status']['reason'] + "</strong>"
}
$('#spectrals_' + TorrentID).show().raw().innerHTML=html;
});
}
function add_tag(tag) {