mirror of
https://github.com/WhatCD/Gazelle.git
synced 2025-01-18 12:11:36 +00:00
Empty commit
This commit is contained in:
parent
54148e5f2b
commit
4b7153b7c9
@ -14,17 +14,19 @@
|
||||
e.g. array(5,10) = 5 requests every 10 seconds */
|
||||
$AJAX_LIMIT = array(5,10);
|
||||
$LimitedPages = array('tcomments','user','forum','top10','browse','usersearch','requests','artist','inbox','subscriptions','bookmarks','announcements','notifications','request','better','similar_artists','userhistory','votefavorite','wiki','torrentgroup','news_ajax');
|
||||
|
||||
// These users aren't rate limited.
|
||||
// This array should contain user IDs.
|
||||
$UserExceptions = array(
|
||||
|
||||
|
||||
);
|
||||
$UserID = $LoggedUser['ID'];
|
||||
header('Content-Type: application/json; charset=utf-8');
|
||||
// Enforce rate limiting everywhere except info.php
|
||||
if (!in_array($UserID, $UserExceptions) && isset($_GET['action']) && in_array($_GET['action'],$LimitedPages)) {
|
||||
if (!in_array($UserID, $UserExceptions) && isset($_GET['action']) && in_array($_GET['action'], $LimitedPages)) {
|
||||
if (!$userrequests = $Cache->get_value('ajax_requests_'.$UserID)) {
|
||||
$userrequests = 0;
|
||||
$Cache->cache_value('ajax_requests_'.$UserID,'0',$AJAX_LIMIT[1]);
|
||||
$Cache->cache_value('ajax_requests_'.$UserID, '0', $AJAX_LIMIT[1]);
|
||||
}
|
||||
if ($userrequests > $AJAX_LIMIT[0]) {
|
||||
print json_encode(
|
||||
|
@ -22,7 +22,7 @@
|
||||
Time
|
||||
FROM news
|
||||
ORDER BY Time DESC
|
||||
LIMIT " . $Offset . "," . $Count);
|
||||
LIMIT $Offset, $Count");
|
||||
$News = $DB->to_array(false, MYSQLI_NUM, false);
|
||||
|
||||
$NewsResponse = array();
|
||||
@ -39,4 +39,4 @@
|
||||
);
|
||||
}
|
||||
|
||||
json_die('success', json_encode($NewsResponse));
|
||||
json_die('success', json_encode($NewsResponse));
|
||||
|
@ -47,33 +47,33 @@
|
||||
$JsonMusicInfo = array();
|
||||
if ($CategoryName == 'Music') {
|
||||
$JsonMusicInfo = array(
|
||||
'composers' => $ArtistForm[4] == null ? array() : pullmediainfo($ArtistForm[4]),
|
||||
'dj' => $ArtistForm[6] == null ? array() : pullmediainfo($ArtistForm[6]),
|
||||
'artists' => $ArtistForm[1] == null ? array() : pullmediainfo($ArtistForm[1]),
|
||||
'with' => $ArtistForm[2] == null ? array() : pullmediainfo($ArtistForm[2]),
|
||||
'conductor' => $ArtistForm[5] == null ? array() : pullmediainfo($ArtistForm[5]),
|
||||
'remixedBy' => $ArtistForm[3] == null ? array() : pullmediainfo($ArtistForm[3]),
|
||||
'producer' => $ArtistForm[7] == null ? array() : pullmediainfo($ArtistForm[7])
|
||||
'composers' => ($ArtistForm[4] == null) ? array() : pullmediainfo($ArtistForm[4]),
|
||||
'dj' => ($ArtistForm[6] == null) ? array() : pullmediainfo($ArtistForm[6]),
|
||||
'artists' => ($ArtistForm[1] == null) ? array() : pullmediainfo($ArtistForm[1]),
|
||||
'with' => ($ArtistForm[2] == null) ? array() : pullmediainfo($ArtistForm[2]),
|
||||
'conductor' => ($ArtistForm[5] == null) ? array() : pullmediainfo($ArtistForm[5]),
|
||||
'remixedBy' => ($ArtistForm[3] == null) ? array() : pullmediainfo($ArtistForm[3]),
|
||||
'producer' => ($ArtistForm[7] == null) ? array() : pullmediainfo($ArtistForm[7])
|
||||
);
|
||||
} else {
|
||||
$JsonMusicInfo = NULL;
|
||||
}
|
||||
|
||||
$JsonTorrentDetails = array(
|
||||
'wikiBody' => $Text->full_format($TorrentDetails['WikiBody']),
|
||||
'wikiImage' => $TorrentDetails['WikiImage'],
|
||||
'id' => (int) $TorrentDetails['ID'],
|
||||
'name' => $TorrentDetails['Name'],
|
||||
'year' => (int) $TorrentDetails['Year'],
|
||||
'recordLabel' => $TorrentDetails['RecordLabel'],
|
||||
'wikiBody' => $Text->full_format($TorrentDetails['WikiBody']),
|
||||
'wikiImage' => $TorrentDetails['WikiImage'],
|
||||
'id' => (int) $TorrentDetails['ID'],
|
||||
'name' => $TorrentDetails['Name'],
|
||||
'year' => (int) $TorrentDetails['Year'],
|
||||
'recordLabel' => $TorrentDetails['RecordLabel'],
|
||||
'catalogueNumber' => $TorrentDetails['CatalogueNumber'],
|
||||
'releaseType' => (int) $TorrentDetails['ReleaseType'],
|
||||
'categoryId' => (int) $TorrentDetails['CategoryID'],
|
||||
'categoryName' => $CategoryName,
|
||||
'time' => $TorrentDetails['Time'],
|
||||
'vanityHouse' => $TorrentDetails['VanityHouse'] == 1,
|
||||
'isBookmarked' => Bookmarks::has_bookmarked('torrent', $GroupID),
|
||||
'musicInfo' => $JsonMusicInfo
|
||||
'releaseType' => (int) $TorrentDetails['ReleaseType'],
|
||||
'categoryId' => (int) $TorrentDetails['CategoryID'],
|
||||
'categoryName' => $CategoryName,
|
||||
'time' => $TorrentDetails['Time'],
|
||||
'vanityHouse' => ($TorrentDetails['VanityHouse'] == 1),
|
||||
'isBookmarked' => Bookmarks::has_bookmarked('torrent', $GroupID),
|
||||
'musicInfo' => $JsonMusicInfo
|
||||
);
|
||||
|
||||
$JsonTorrentList = array();
|
||||
@ -93,32 +93,32 @@
|
||||
$Torrent['Reported'] = false;
|
||||
}
|
||||
$JsonTorrentList[] = array(
|
||||
'id' => (int) $Torrent['ID'],
|
||||
'media' => $Torrent['Media'],
|
||||
'format' => $Torrent['Format'],
|
||||
'encoding' => $Torrent['Encoding'],
|
||||
'remastered' => $Torrent['Remastered'] == 1,
|
||||
'remasterYear' => (int) $Torrent['RemasterYear'],
|
||||
'remasterTitle' => $Torrent['RemasterTitle'],
|
||||
'remasterRecordLabel' => $Torrent['RemasterRecordLabel'],
|
||||
'id' => (int) $Torrent['ID'],
|
||||
'media' => $Torrent['Media'],
|
||||
'format' => $Torrent['Format'],
|
||||
'encoding' => $Torrent['Encoding'],
|
||||
'remastered' => ($Torrent['Remastered'] == 1),
|
||||
'remasterYear' => (int) $Torrent['RemasterYear'],
|
||||
'remasterTitle' => $Torrent['RemasterTitle'],
|
||||
'remasterRecordLabel' => $Torrent['RemasterRecordLabel'],
|
||||
'remasterCatalogueNumber' => $Torrent['RemasterCatalogueNumber'],
|
||||
'scene' => $Torrent['Scene'] == 1,
|
||||
'hasLog' => $Torrent['HasLog'] == 1,
|
||||
'hasCue' => $Torrent['HasCue'] == 1,
|
||||
'logScore' => (int) $Torrent['LogScore'],
|
||||
'fileCount' => (int) $Torrent['FileCount'],
|
||||
'size' => (int) $Torrent['Size'],
|
||||
'seeders' => (int) $Torrent['Seeders'],
|
||||
'leechers' => (int) $Torrent['Leechers'],
|
||||
'snatched' => (int) $Torrent['Snatched'],
|
||||
'freeTorrent' => $Torrent['FreeTorrent'] == 1,
|
||||
'reported' => $Torrent['Reported'],
|
||||
'time' => $Torrent['Time'],
|
||||
'scene' => ($Torrent['Scene'] == 1),
|
||||
'hasLog' => ($Torrent['HasLog'] == 1),
|
||||
'hasCue' => ($Torrent['HasCue'] == 1),
|
||||
'logScore' => (int) $Torrent['LogScore'],
|
||||
'fileCount' => (int) $Torrent['FileCount'],
|
||||
'size' => (int) $Torrent['Size'],
|
||||
'seeders' => (int) $Torrent['Seeders'],
|
||||
'leechers' => (int) $Torrent['Leechers'],
|
||||
'snatched' => (int) $Torrent['Snatched'],
|
||||
'freeTorrent' => ($Torrent['FreeTorrent'] == 1),
|
||||
'reported' => $Torrent['Reported'],
|
||||
'time' => $Torrent['Time'],
|
||||
'description' => $Torrent['Description'],
|
||||
'fileList' => $FileList,
|
||||
'filePath' => $Torrent['FilePath'],
|
||||
'userId' => (int) $Torrent['UserID'],
|
||||
'username' => $Userinfo['Username']
|
||||
'fileList' => $FileList,
|
||||
'filePath' => $Torrent['FilePath'],
|
||||
'userId' => (int) $Torrent['UserID'],
|
||||
'username' => $Userinfo['Username']
|
||||
);
|
||||
}
|
||||
|
||||
|
@ -127,9 +127,8 @@
|
||||
<div class="head"><strong>Cover</strong></div>
|
||||
<?
|
||||
if (!empty($Image)) {
|
||||
$Image = ImageTools::process($Image, true);
|
||||
?>
|
||||
<p align="center"><img style="max-width: 220px;" src="<?=$Image?>" alt="<?=$FullName?>" onclick="lightbox.init('<?=$Image?>',220);" /></p>
|
||||
<p align="center"><img style="max-width: 220px;" src="<?=ImageTools::process($Image, true)?>" alt="<?=$FullName?>" onclick="lightbox.init('<?=ImageTools::process($Image)?>',220);" /></p>
|
||||
<? } else { ?>
|
||||
<p align="center"><img src="<?=STATIC_SERVER?>common/noartwork/<?=$CategoryIcons[$CategoryID - 1]?>" alt="<?=$CategoryName?>" title="<?=$CategoryName?>" width="220" height="220" border="0" /></p>
|
||||
<? } ?>
|
||||
|
Loading…
Reference in New Issue
Block a user