mirror of
https://github.com/WhatCD/Gazelle.git
synced 2024-12-12 18:36:29 +00:00
Empty commit
This commit is contained in:
parent
3d8a5aa2f5
commit
947a3ddab4
@ -83,7 +83,7 @@ public function cache_value($Key, $Value, $Duration = 2592000) {
|
|||||||
if (!$this->set($Key, $Value, 0, $Duration)) {
|
if (!$this->set($Key, $Value, 0, $Duration)) {
|
||||||
trigger_error("Cache insert failed for key $Key");
|
trigger_error("Cache insert failed for key $Key");
|
||||||
}
|
}
|
||||||
if (array_key_exists($Key, $this->CacheHits)) {
|
if ($this->InternalCache && array_key_exists($Key, $this->CacheHits)) {
|
||||||
$this->CacheHits[$Key] = $Value;
|
$this->CacheHits[$Key] = $Value;
|
||||||
}
|
}
|
||||||
$this->Time += (microtime(true) - $StartTime) * 1000;
|
$this->Time += (microtime(true) - $StartTime) * 1000;
|
||||||
@ -100,7 +100,7 @@ public function add_value($Key, $Value, $Duration = 2592000) {
|
|||||||
public function replace_value($Key, $Value, $Duration = 2592000) {
|
public function replace_value($Key, $Value, $Duration = 2592000) {
|
||||||
$StartTime = microtime(true);
|
$StartTime = microtime(true);
|
||||||
$this->replace($Key, $Value, false, $Duration);
|
$this->replace($Key, $Value, false, $Duration);
|
||||||
if (array_key_exists($Key, $this->CacheHits)) {
|
if ($this->InternalCache && array_key_exists($Key, $this->CacheHits)) {
|
||||||
$this->CacheHits[$Key] = $Value;
|
$this->CacheHits[$Key] = $Value;
|
||||||
}
|
}
|
||||||
$this->Time += (microtime(true) - $StartTime) * 1000;
|
$this->Time += (microtime(true) - $StartTime) * 1000;
|
||||||
|
@ -828,6 +828,7 @@ CREATE TABLE `sphinx_delta` (
|
|||||||
`FileList` mediumtext,
|
`FileList` mediumtext,
|
||||||
`Description` text,
|
`Description` text,
|
||||||
`VoteScore` float NOT NULL DEFAULT '0',
|
`VoteScore` float NOT NULL DEFAULT '0',
|
||||||
|
`LastChanged` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
|
||||||
PRIMARY KEY (`ID`),
|
PRIMARY KEY (`ID`),
|
||||||
KEY `GroupID` (`GroupID`)
|
KEY `GroupID` (`GroupID`)
|
||||||
) ENGINE=MyISAM CHARSET utf8;
|
) ENGINE=MyISAM CHARSET utf8;
|
||||||
|
@ -1,31 +1,30 @@
|
|||||||
<?
|
<?
|
||||||
if (($GroupIDs = $Cache->get_value('better_single_groupids')) === false) {
|
if (($Results = $Cache->get_value('better_single_groupids')) === false) {
|
||||||
$DB->query("
|
$DB->query("
|
||||||
SELECT
|
SELECT
|
||||||
t.ID AS TorrentID,
|
t.ID AS TorrentID,
|
||||||
t.GroupID AS GroupID
|
t.GroupID AS GroupID
|
||||||
FROM xbt_files_users AS x
|
FROM xbt_files_users AS x
|
||||||
JOIN torrents AS t ON t.ID = x.fid
|
JOIN torrents AS t ON t.ID=x.fid
|
||||||
WHERE t.Format = 'FLAC'
|
WHERE t.Format='FLAC'
|
||||||
GROUP BY x.fid
|
GROUP BY x.fid
|
||||||
HAVING COUNT(x.uid) = 1
|
HAVING COUNT(x.uid) = 1
|
||||||
ORDER BY t.LogScore DESC, t.Time ASC
|
ORDER BY t.LogScore DESC, t.Time ASC
|
||||||
LIMIT 30");
|
LIMIT 30");
|
||||||
|
|
||||||
$GroupIDs = $DB->to_array('GroupID');
|
$Results = $DB->to_pair('GroupID', 'TorrentID', false);
|
||||||
$Cache->cache_value('better_single_groupids', $GroupIDs, 30 * 60);
|
$Cache->cache_value('better_single_groupids', $Results, 30 * 60);
|
||||||
}
|
}
|
||||||
|
|
||||||
$Results = Torrents::get_groups(array_keys($GroupIDs));
|
$Groups = Torrents::get_groups(array_keys($Results));
|
||||||
|
|
||||||
$JsonResults = array();
|
$JsonResults = array();
|
||||||
foreach ($GroupIDs as $GroupID) {
|
foreach ($Results as $GroupID => $FlacID) {
|
||||||
if (!isset($Results[$GroupID])) {
|
if (!isset($Groups[$GroupID])) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
$Group = $Results[$GroupIDs];
|
$Group = $Groups[$GroupID];
|
||||||
extract(Torrents::array_group($Group));
|
extract(Torrents::array_group($Group));
|
||||||
$FlacID = $GroupIDs[$GroupID]['TorrentID'];
|
|
||||||
|
|
||||||
$JsonArtists = array();
|
$JsonArtists = array();
|
||||||
if (count($Artists) > 0) {
|
if (count($Artists) > 0) {
|
||||||
|
@ -1,10 +1,10 @@
|
|||||||
<?
|
<?
|
||||||
if (($GroupIDs = $Cache->get_value('better_single_groupids')) === false) {
|
if (($Results = $Cache->get_value('better_single_groupids')) === false) {
|
||||||
$DB->query("
|
$DB->query("
|
||||||
SELECT
|
SELECT
|
||||||
t.ID AS TorrentID,
|
t.ID AS TorrentID,
|
||||||
t.GroupID AS GroupID
|
t.GroupID AS GroupID
|
||||||
FROM xbt_files_users AS x
|
FROM xbt_files_users AS x
|
||||||
JOIN torrents AS t ON t.ID=x.fid
|
JOIN torrents AS t ON t.ID=x.fid
|
||||||
WHERE t.Format='FLAC'
|
WHERE t.Format='FLAC'
|
||||||
GROUP BY x.fid
|
GROUP BY x.fid
|
||||||
@ -12,11 +12,11 @@
|
|||||||
ORDER BY t.LogScore DESC, t.Time ASC
|
ORDER BY t.LogScore DESC, t.Time ASC
|
||||||
LIMIT 30");
|
LIMIT 30");
|
||||||
|
|
||||||
$GroupIDs = $DB->to_array('GroupID');
|
$Results = $DB->to_pair('GroupID', 'TorrentID', false);
|
||||||
$Cache->cache_value('better_single_groupids', $GroupIDs, 30 * 60);
|
$Cache->cache_value('better_single_groupids', $Results, 30 * 60);
|
||||||
}
|
}
|
||||||
|
|
||||||
$Results = Torrents::get_groups(array_keys($GroupIDs));
|
$Groups = Torrents::get_groups(array_keys($Results));
|
||||||
|
|
||||||
View::show_header('Single seeder FLACs');
|
View::show_header('Single seeder FLACs');
|
||||||
?>
|
?>
|
||||||
@ -29,11 +29,11 @@
|
|||||||
<td>Torrent</td>
|
<td>Torrent</td>
|
||||||
</tr>
|
</tr>
|
||||||
<?
|
<?
|
||||||
foreach ($GroupIDs as $GroupID) {
|
foreach ($Results as $GroupID => $FlacID) {
|
||||||
if (!isset($Results[$GroupID])) {
|
if (!isset($Groups[$GroupID])) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
$Group = $Results[$GroupID];
|
$Group = $Groups[$GroupID];
|
||||||
extract(Torrents::array_group($Group));
|
extract(Torrents::array_group($Group));
|
||||||
$TorrentTags = new Tags($TagList);
|
$TorrentTags = new Tags($TagList);
|
||||||
|
|
||||||
@ -44,7 +44,6 @@
|
|||||||
} else {
|
} else {
|
||||||
$DisplayName = '';
|
$DisplayName = '';
|
||||||
}
|
}
|
||||||
$FlacID = $GroupIDs[$GroupID]['TorrentID'];
|
|
||||||
|
|
||||||
$DisplayName .= "<a href=\"torrents.php?id=$GroupID&torrentid=$FlacID\" class=\"tooltip\" title=\"View torrent\" dir=\"ltr\">$GroupName</a>";
|
$DisplayName .= "<a href=\"torrents.php?id=$GroupID&torrentid=$FlacID\" class=\"tooltip\" title=\"View torrent\" dir=\"ltr\">$GroupName</a>";
|
||||||
if ($GroupYear > 0) {
|
if ($GroupYear > 0) {
|
||||||
|
@ -28,6 +28,10 @@
|
|||||||
)
|
)
|
||||||
GROUP BY t.ID");
|
GROUP BY t.ID");
|
||||||
list($TopicID, $ForumID, $Pages, $Page, $StickyPostID) = $DB->next_record();
|
list($TopicID, $ForumID, $Pages, $Page, $StickyPostID) = $DB->next_record();
|
||||||
|
if (!$TopicID) {
|
||||||
|
// Post is deleted or thread doesn't exist
|
||||||
|
error(0); // This is evil, but the ajax call doesn't check the response
|
||||||
|
}
|
||||||
|
|
||||||
// $Pages = number of pages in the thread
|
// $Pages = number of pages in the thread
|
||||||
// $Page = which page the post is on
|
// $Page = which page the post is on
|
||||||
|
@ -1275,6 +1275,7 @@ function next_hour() {
|
|||||||
($HistoryID, $i, $TorrentID, '" . db_string($TitleString) . "', '" . db_string($TagString) . "')");
|
($HistoryID, $i, $TorrentID, '" . db_string($TitleString) . "', '" . db_string($TagString) . "')");
|
||||||
$i++;
|
$i++;
|
||||||
} //foreach ($Top10 as $Torrent)
|
} //foreach ($Top10 as $Torrent)
|
||||||
|
|
||||||
// Send warnings to uploaders of torrents that will be deleted this week
|
// Send warnings to uploaders of torrents that will be deleted this week
|
||||||
$DB->query("
|
$DB->query("
|
||||||
SELECT
|
SELECT
|
||||||
|
@ -1,85 +1,11 @@
|
|||||||
<?
|
<?
|
||||||
//TODO: Move to somewhere more appropriate, doesn't really belong under users, tools maybe but we don't have that page publicly accessible.
|
|
||||||
|
|
||||||
if (isset($_GET['ip']) && isset($_GET['port'])) {
|
|
||||||
$Octets = explode('.', $_GET['ip']);
|
|
||||||
if (
|
|
||||||
empty($_GET['ip'])
|
|
||||||
|| !preg_match('/'.IP_REGEX.'/', $_GET['ip'])
|
|
||||||
|| $Octets[0] < 0
|
|
||||||
|| $Octets[0] > 255
|
|
||||||
|| $Octets[1] < 0
|
|
||||||
|| $Octets[1] > 255
|
|
||||||
|| $Octets[2] < 0
|
|
||||||
|| $Octets[2] > 255
|
|
||||||
|| $Octets[3] < 0
|
|
||||||
|| $Octets[3] > 255
|
|
||||||
/*
|
|
||||||
* Per RFC 1918, the following CIDR blocks should never be found on the public Internet.
|
|
||||||
* 10.0.0.0/8
|
|
||||||
* 172.16.0.0/12
|
|
||||||
* 192.168.0.0/16
|
|
||||||
*
|
|
||||||
* Per RFC 3330, the block 127.0.0.0/8 should never appear on any network.
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
|| $Octets[0] == 127
|
|
||||||
|| $Octets[0] == 10
|
|
||||||
|| ($Octets[0] == 172 && ((16 <= $Octets[1]) && ($Octets[1] <= 31)))
|
|
||||||
|| ($Octets[0] == 192 && $Octets[1] == 168)
|
|
||||||
) {
|
|
||||||
die('Invalid IPv4 address');
|
|
||||||
}
|
|
||||||
|
|
||||||
// Valid port numbers are defined in RFC 1700
|
|
||||||
if (empty($_GET['port']) || !is_number($_GET['port']) || $_GET['port'] < 1 || $_GET['port'] > 65535) {
|
|
||||||
die('Invalid port');
|
|
||||||
}
|
|
||||||
|
|
||||||
// Error suppression, ugh.
|
|
||||||
if (@fsockopen($_GET['ip'], $_GET['port'], $Errno, $Errstr, 20)) {
|
|
||||||
die('Port '.$_GET['port'].' on '.$_GET['ip'].' connected successfully.');
|
|
||||||
} else {
|
|
||||||
die('Port '.$_GET['port'].' on '.$_GET['ip'].' failed to connect.');
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
View::show_header('Connectability Checker');
|
View::show_header('Connectability Checker');
|
||||||
?>
|
?>
|
||||||
<div class="thin">
|
<div class="thin">
|
||||||
<div class="header">
|
<div class="header">
|
||||||
<h2><a href="user.php?id=<?=$LoggedUser['ID']?>"><?=$LoggedUser['Username']?></a> > Connectability Checker</h2>
|
<h2><a href="user.php?id=<?=$LoggedUser['ID']?>"><?=$LoggedUser['Username']?></a> > Connectability Checker</h2>
|
||||||
</div>
|
</div>
|
||||||
<form class="manage_form" name="connections" action="javascript:check_ip();" method="get">
|
<div class="linkbox"></div>
|
||||||
<table class="layout">
|
<div class="box pad">This page has been disabled because the results have been inaccurate. Try a smarter and more reliable service, like <a href="http://www.canyouseeme.org">http://www.canyouseeme.org</a>.</div>
|
||||||
<tr>
|
|
||||||
<td class="label">IP address</td>
|
|
||||||
<td>
|
|
||||||
<input type="text" id="ip" name="ip" value="<?=$_SERVER['REMOTE_ADDR']?>" size="20" />
|
|
||||||
</td>
|
|
||||||
<td class="label">Port</td>
|
|
||||||
<td>
|
|
||||||
<input type="text" id="port" name="port" size="10" />
|
|
||||||
</td>
|
|
||||||
<td>
|
|
||||||
<input type="submit" value="Check" />
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
</table>
|
|
||||||
</form>
|
|
||||||
<div id="result" class="box pad"></div>
|
|
||||||
</div>
|
</div>
|
||||||
<script type="text/javascript">//<![CDATA[
|
|
||||||
var result = $('#result').raw();
|
|
||||||
|
|
||||||
function check_ip() {
|
|
||||||
var intervalid = setInterval("result.innerHTML += '.';",999);
|
|
||||||
result.innerHTML = 'Checking.';
|
|
||||||
ajax.get('user.php?action=connchecker&ip=' + $('#ip').raw().value + '&port=' + $('#port').raw().value, function (response) {
|
|
||||||
clearInterval(intervalid);
|
|
||||||
result.innerHTML = response;
|
|
||||||
});
|
|
||||||
}
|
|
||||||
//]]>
|
|
||||||
</script>
|
|
||||||
<? View::show_footer(); ?>
|
<? View::show_footer(); ?>
|
||||||
|
Loading…
Reference in New Issue
Block a user