From e03aa41d03c829f2dd87e78c31ac279ecf4dae40 Mon Sep 17 00:00:00 2001 From: Git Date: Fri, 1 Feb 2013 08:00:18 +0000 Subject: [PATCH] Empty commit --- sections/reportsv2/ajax_new_report.php | 2 +- sections/reportsv2/static.php | 2 +- sections/schedule/index.php | 6 +++++ sections/tools/managers/ocelot.php | 36 +++++++++++++++++++++----- static/functions/lastfm.js | 6 ++--- static/styles/dark_mono_v2/style.css | 2 +- 6 files changed, 41 insertions(+), 13 deletions(-) diff --git a/sections/reportsv2/ajax_new_report.php b/sections/reportsv2/ajax_new_report.php index 1ba6d19c..5f7d0f91 100644 --- a/sections/reportsv2/ajax_new_report.php +++ b/sections/reportsv2/ajax_new_report.php @@ -202,7 +202,7 @@ while(list($RequestID, $FillerID, $FillerName, $FilledTime) = $DB->next_record()) { ?>
- used this torrent to fill this request + used this torrent to fill this request
next_record()) { ?>
- used this torrent to fill this request + used this torrent to fill this request
= 0) { + die(); +} + //TODO: make it awesome, make it flexible! //INSERT INTO users_geodistribution (Code, Users) SELECT g.Code, COUNT(u.ID) AS Users FROM geoip_country AS g JOIN users_main AS u ON INET_ATON(u.IP) BETWEEN g.StartIP AND g.EndIP WHERE u.Enabled='1' GROUP BY g.Code ORDER BY Users DESC /*************************************************************************\ diff --git a/sections/tools/managers/ocelot.php b/sections/tools/managers/ocelot.php index b5327cd0..cbf4a75c 100644 --- a/sections/tools/managers/ocelot.php +++ b/sections/tools/managers/ocelot.php @@ -8,14 +8,36 @@ switch ($Type) { case 'expiretoken': - $TorrentID = $_REQUEST['torrentid']; - $UserID = $_REQUEST['userid']; - if (!is_number($TorrentID) || !is_number($UserID)) { - error(403); + if (isset($_GET['tokens'])) { + $Tokens = explode(',', $_GET['tokens']); + if (empty($Tokens)) { + error(0); + } + $Cond = $UserIDs = array(); + foreach ($Tokens as $Key => $Token) { + list($UserID, $TorrentID) = explode(':', $Token); + if (!is_number($UserID) || !is_number($TorrentID)) { + continue; + } + $Cond[] = "(UserID=$UserID AND TorrentID=$TorrentID)"; + $UserIDs[] = $UserID; + } + if (!empty($Cond)) { + $Query = "UPDATE users_freeleeches SET Expired=TRUE WHERE ".implode(" OR ", $Cond); + $DB->query($Query); + foreach($UserIDs as $UserID) { + $Cache->delete_value('users_tokens_'.$UserID); + } + } + } else { + $TorrentID = $_REQUEST['torrentid']; + $UserID = $_REQUEST['userid']; + if (!is_number($TorrentID) || !is_number($UserID)) { + error(403); + } + $DB->query("UPDATE users_freeleeches SET Expired=TRUE WHERE UserID=$UserID AND TorrentID=$TorrentID"); + $Cache->delete_value('users_tokens_'.$UserID); } - - $DB->query("UPDATE users_freeleeches SET Expired=TRUE WHERE UserID=$UserID AND TorrentID=$TorrentID"); - $Cache->delete_value('users_tokens_'.$UserID); break; } ?> diff --git a/static/functions/lastfm.js b/static/functions/lastfm.js index abc9ad8e..76ed4f5e 100644 --- a/static/functions/lastfm.js +++ b/static/functions/lastfm.js @@ -215,7 +215,7 @@ // Fix Last.fm API returning more than one entry despite limit on certain conditions. if ( typeof(json[0]) === "object" ) json = json[0]; html += '
  • Last played: '; - html += '' + escapeHtml(json['artist']['#text']) + ' - ' + escapeHtml(json['name']) + ''; + html += '' + escapeHtml(json['artist']['#text']) + ' - ' + escapeHtml(json['name']) + ''; html += "
  • "; lastPlayedTrack = html; } @@ -336,11 +336,11 @@ var k = initialCount; if (j.length < 3) k = j.length; for (var i = 0; i < k; i++) { - html += '
  • ' + escapeHtml(j[i]['artist']['name']) + ' - ' + escapeHtml(j[i]['name']) + '
  • ' + html += '
  • ' + escapeHtml(j[i]['artist']['name']) + ' - ' + escapeHtml(j[i]['name']) + '
  • ' } if ( j.length>3 ){ for (i = 3; i < j.length; i++) { - html += '' + html += '' } html+= '
  • [Expand]
  • ' } diff --git a/static/styles/dark_mono_v2/style.css b/static/styles/dark_mono_v2/style.css index 03389824..a1addf7d 100644 --- a/static/styles/dark_mono_v2/style.css +++ b/static/styles/dark_mono_v2/style.css @@ -1 +1 @@ -@import url('https://whatimg.com/htrd/darkmono2/darkmono2.css'); +@import url('https://www.htrd.info/darkmono2/darkmono2.css');