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
0c935a8600
commit
562d4e3f49
@ -102,12 +102,12 @@ public function get_value($Key, $NoCache = false) {
|
||||
if (!$this->InternalCache) {
|
||||
$NoCache = true;
|
||||
}
|
||||
$StartTime=microtime(true);
|
||||
$StartTime = microtime(true);
|
||||
if (empty($Key)) {
|
||||
trigger_error('Cache retrieval failed for empty key');
|
||||
}
|
||||
|
||||
if (isset($_GET['clearcache']) && $this->CanClear && !Misc::in_array_partial($Key, $this->PersistentKeys)) {
|
||||
if (!empty($_GET['clearcache']) && $this->CanClear && !isset($this->ClearedKeys[$Key]) && !Misc::in_array_partial($Key, $this->PersistentKeys)) {
|
||||
if ($_GET['clearcache'] === '1') {
|
||||
// Because check_perms() isn't true until LoggedUser is pulled from the cache, we have to remove the entries loaded before the LoggedUser data
|
||||
// Because of this, not user cache data will require a secondary pageload following the clearcache to update
|
||||
@ -120,15 +120,7 @@ public function get_value($Key, $NoCache = false) {
|
||||
}
|
||||
}
|
||||
}
|
||||
if (!isset($this->ClearedKeys[$Key])) {
|
||||
$this->delete($Key);
|
||||
$this->ClearedKeys[$Key] = true;
|
||||
$this->Time += (microtime(true) - $StartTime) * 1000;
|
||||
return false;
|
||||
}
|
||||
} elseif (!isset($this->ClearedKeys[$Key]) && $_GET['clearcache'] == $Key) {
|
||||
$this->delete($Key);
|
||||
$this->ClearedKeys[$Key] = true;
|
||||
$this->Time += (microtime(true) - $StartTime) * 1000;
|
||||
return false;
|
||||
} elseif ($_GET['clearcache'] == $Key) {
|
||||
@ -137,16 +129,13 @@ public function get_value($Key, $NoCache = false) {
|
||||
return false;
|
||||
} elseif (substr($_GET['clearcache'], -1) === '*') {
|
||||
$Prefix = substr($_GET['clearcache'], 0, -1);
|
||||
if ($Prefix == substr($Key, 0, strlen($Prefix))) {
|
||||
if ($Prefix === '' || $Prefix === substr($Key, 0, strlen($Prefix))) {
|
||||
$this->delete($Key);
|
||||
$this->Time += (microtime(true) - $StartTime) * 1000;
|
||||
return false;
|
||||
}
|
||||
} elseif (!isset($this->ClearedKeys[$_GET['clearcache']]) && isset($this->CacheHits[$_GET['clearcache']])) {
|
||||
unset($this->CacheHits[$_GET['clearcache']]);
|
||||
$this->ClearedKeys[$_GET['clearcache']] = true;
|
||||
$this->delete($_GET['clearcache']);
|
||||
}
|
||||
$this->ClearedKeys[$Key] = true;
|
||||
}
|
||||
|
||||
// For cases like the forums, if a key is already loaded, grab the existing pointer
|
||||
|
@ -3,6 +3,21 @@
|
||||
define('LASTFM_API_URL', 'http://ws.audioscrobbler.com/2.0/?method=');
|
||||
class LastFM {
|
||||
|
||||
public static function get_lastfm_username($UserID) {
|
||||
$Username = G::$Cache->get_value("lastfm_username_$UserID");
|
||||
if ($Username === false) {
|
||||
$QueryID = G::$DB->get_query_id();
|
||||
G::$DB->query("
|
||||
SELECT Username
|
||||
FROM lastfm_users
|
||||
WHERE ID = $UserID");
|
||||
list($Username) = G::$DB->next_record();
|
||||
G::$DB->set_query_id($QueryID);
|
||||
G::$Cache->cache_value("lastfm_username_$UserID", $Username, 0);
|
||||
}
|
||||
return $Username;
|
||||
}
|
||||
|
||||
public static function get_artist_events($ArtistID, $Artist, $Limit = 15) {
|
||||
$ArtistEvents = G::$Cache->get_value("artist_events_$ArtistID");
|
||||
if (empty($ArtistEvents)) {
|
||||
|
30
classes/lastfmview.class.php
Normal file
30
classes/lastfmview.class.php
Normal file
@ -0,0 +1,30 @@
|
||||
<?
|
||||
|
||||
class LastFMView {
|
||||
|
||||
public static function render_sidebar($LastFMUsername, $UserID, $OwnProfile) {
|
||||
$LastFMInfo = LastFM::get_user_info($LastFMUsername);
|
||||
?>
|
||||
<div class="box box_info box_lastfm">
|
||||
<div class="head colhead_dark">Last.fm</div>
|
||||
<ul class="stats nobullet">
|
||||
<li>
|
||||
Username: <a id="lastfm_username" href="<?=$LastFMInfo['user']['url']?>" target="_blank" title="<?=$LastFMInfo['user']['name']?> on Last.fm: <?=number_format($LastFMInfo['user']['playcount'])?> plays, <?=number_format($LastFMInfo['user']['playlists'])?> playlists."><?=$LastFMUsername?></a>
|
||||
</li>
|
||||
<div id="lastfm_stats"<?=$OwnProfile ? ' data-uid="1"' : ''?>>
|
||||
</div>
|
||||
<li>
|
||||
<a href="#" id="lastfm_expand" onclick="return false" class="brackets">Show more info</a>
|
||||
<? //Append the reload stats button only if allowed on the current user page.
|
||||
$Response = G::$Cache->get_value("lastfm_clear_cache_$UserID");
|
||||
if (empty($Response)) { ?>
|
||||
<span id="lastfm_reload_container">
|
||||
<a href="#" id="lastfm_reload" onclick="return false" class="brackets">Reload stats</a>
|
||||
</span>
|
||||
<? } ?>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
<?
|
||||
}
|
||||
}
|
@ -167,9 +167,9 @@ public static function create_thread($ForumID, $AuthorID, $Title, $PostBody) {
|
||||
|
||||
G::$DB->query("
|
||||
INSERT INTO forums_topics
|
||||
(Title, AuthorID, ForumID, LastPostTime, LastPostAuthorID)
|
||||
(Title, AuthorID, ForumID, LastPostTime, LastPostAuthorID, CreatedTime)
|
||||
VALUES
|
||||
('$Title', '$AuthorID', '$ForumID', '".sqltime()."', '$AuthorID')");
|
||||
('$Title', '$AuthorID', '$ForumID', '".sqltime()."', '$AuthorID', '".sqltime()."')");
|
||||
$TopicID = G::$DB->inserted_id();
|
||||
$Posts = 1;
|
||||
|
||||
|
@ -54,7 +54,7 @@ private static function render_tile($Url, $Name, $Image) {
|
||||
if (!empty($Image)) { ?>
|
||||
<li>
|
||||
<a href="<?=$Url?><?=$Name?>">
|
||||
<img class="tooltip large_tile" title="<?=$Name?>" src="<?=$Image?>" />
|
||||
<img class="tooltip large_tile" title="<?=$Name?>" src="<?=ImageTools::process($Image)?>" />
|
||||
</a>
|
||||
</li>
|
||||
<? }
|
||||
@ -76,6 +76,7 @@ public static function render_artist_list($Artist, $Category) {
|
||||
private static function render_list($Url, $Name, $Image) {
|
||||
if (!empty($Image)) {
|
||||
$UseTooltipster = !isset(G::$LoggedUser['Tooltipster']) || G::$LoggedUser['Tooltipster'];
|
||||
$Image = ImageTools::process($Image);
|
||||
$Title = "title=\"<img class='large_tile' src='$Image'/>\"";
|
||||
?>
|
||||
<li>
|
||||
|
143
gazelle.sql
143
gazelle.sql
@ -23,19 +23,6 @@ CREATE TABLE `api_users` (
|
||||
KEY `UserID` (`UserID`)
|
||||
) ENGINE=InnoDB CHARSET utf8;
|
||||
|
||||
CREATE TABLE `artist_comments` (
|
||||
`ID` int(10) NOT NULL AUTO_INCREMENT,
|
||||
`ArtistID` int(10) NOT NULL,
|
||||
`AuthorID` int(10) NOT NULL,
|
||||
`AddedTime` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
|
||||
`Body` mediumtext,
|
||||
`EditedUserID` int(10) DEFAULT NULL,
|
||||
`EditedTime` datetime DEFAULT NULL,
|
||||
PRIMARY KEY (`ID`),
|
||||
KEY `TopicID` (`ArtistID`),
|
||||
KEY `AuthorID` (`AuthorID`)
|
||||
) ENGINE=InnoDB CHARSET utf8;
|
||||
|
||||
CREATE TABLE `artists_alias` (
|
||||
`AliasID` int(10) NOT NULL AUTO_INCREMENT,
|
||||
`ArtistID` int(10) NOT NULL,
|
||||
@ -58,14 +45,6 @@ CREATE TABLE `artists_group` (
|
||||
KEY `RevisionID` (`RevisionID`)
|
||||
) ENGINE=InnoDB CHARSET utf8;
|
||||
|
||||
CREATE TABLE `artists_last_read_comments` (
|
||||
`UserID` int(10) NOT NULL,
|
||||
`ArtistID` int(10) NOT NULL,
|
||||
`CommentID` int(10) NOT NULL,
|
||||
PRIMARY KEY (`UserID`,`ArtistID`),
|
||||
KEY `ArtistID` (`ArtistID`)
|
||||
) ENGINE=InnoDB CHARSET utf8;
|
||||
|
||||
CREATE TABLE `artists_similar` (
|
||||
`ArtistID` int(10) NOT NULL DEFAULT '0',
|
||||
`SimilarID` int(12) NOT NULL DEFAULT '0',
|
||||
@ -207,17 +186,6 @@ CREATE TABLE `collages_artists` (
|
||||
KEY `Sort` (`Sort`)
|
||||
) ENGINE=InnoDB CHARSET utf8;
|
||||
|
||||
CREATE TABLE `collages_comments` (
|
||||
`ID` int(10) NOT NULL AUTO_INCREMENT,
|
||||
`CollageID` int(10) NOT NULL,
|
||||
`Body` mediumtext NOT NULL,
|
||||
`UserID` int(10) NOT NULL DEFAULT '0',
|
||||
`Time` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
|
||||
PRIMARY KEY (`ID`),
|
||||
KEY `CollageID` (`CollageID`),
|
||||
KEY `UserID` (`UserID`)
|
||||
) ENGINE=InnoDB CHARSET utf8;
|
||||
|
||||
CREATE TABLE `collages_torrents` (
|
||||
`CollageID` int(10) NOT NULL,
|
||||
`GroupID` int(10) NOT NULL,
|
||||
@ -667,19 +635,6 @@ CREATE TABLE `pm_messages` (
|
||||
KEY `ConvID` (`ConvID`)
|
||||
) ENGINE=InnoDB CHARSET utf8;
|
||||
|
||||
CREATE TABLE `pre_log` (
|
||||
`Hash` varchar(32) NOT NULL,
|
||||
`Category` varchar(12) NOT NULL,
|
||||
`Name` varchar(255) NOT NULL,
|
||||
`Group` varchar(50) NOT NULL,
|
||||
`Time` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
|
||||
`Nuke` enum('0','1') NOT NULL DEFAULT '0',
|
||||
`Genre` varchar(50) DEFAULT NULL,
|
||||
`Files` int(4) NOT NULL DEFAULT '0',
|
||||
`Size` bigint(12) NOT NULL DEFAULT '0',
|
||||
PRIMARY KEY (`Hash`)
|
||||
) ENGINE=InnoDB CHARSET utf8;
|
||||
|
||||
CREATE TABLE `push_notifications_usage` (
|
||||
`PushService` varchar(10) NOT NULL,
|
||||
`TimesUsed` int(10) NOT NULL DEFAULT '0',
|
||||
@ -786,17 +741,6 @@ CREATE TABLE `requests_artists` (
|
||||
PRIMARY KEY (`RequestID`,`AliasID`)
|
||||
) ENGINE=InnoDB CHARSET utf8;
|
||||
|
||||
CREATE TABLE `requests_comments` (
|
||||
`ID` int(10) NOT NULL AUTO_INCREMENT,
|
||||
`RequestID` int(10) NOT NULL,
|
||||
`AuthorID` int(10) NOT NULL,
|
||||
`AddedTime` datetime DEFAULT NULL,
|
||||
`Body` mediumtext,
|
||||
`EditedUserID` int(10) DEFAULT NULL,
|
||||
`EditedTime` datetime DEFAULT NULL,
|
||||
PRIMARY KEY (`ID`)
|
||||
) ENGINE=InnoDB CHARSET utf8;
|
||||
|
||||
CREATE TABLE `requests_tags` (
|
||||
`TagID` int(10) NOT NULL DEFAULT '0',
|
||||
`RequestID` int(10) NOT NULL DEFAULT '0',
|
||||
@ -1074,18 +1018,6 @@ CREATE TABLE `stylesheets` (
|
||||
PRIMARY KEY (`ID`)
|
||||
) ENGINE=InnoDB CHARSET utf8;
|
||||
|
||||
CREATE TABLE `subscribed_forums` (
|
||||
`ForumID` int(10) NOT NULL,
|
||||
`UserID` int(10) NOT NULL,
|
||||
PRIMARY KEY (`ForumID`,`UserID`)
|
||||
) ENGINE=InnoDB CHARSET utf8;
|
||||
|
||||
CREATE TABLE `subscribed_users` (
|
||||
`UserID` int(10) NOT NULL,
|
||||
`SubscriberID` int(10) NOT NULL,
|
||||
PRIMARY KEY (`UserID`,`SubscriberID`)
|
||||
) ENGINE=InnoDB CHARSET utf8;
|
||||
|
||||
CREATE TABLE `tag_aliases` (
|
||||
`ID` int(10) NOT NULL AUTO_INCREMENT,
|
||||
`BadTag` varchar(30) DEFAULT NULL,
|
||||
@ -1151,7 +1083,6 @@ CREATE TABLE `torrents` (
|
||||
`HasCue` enum('0','1') NOT NULL DEFAULT '0',
|
||||
`LogScore` int(6) NOT NULL DEFAULT '0',
|
||||
`info_hash` blob NOT NULL,
|
||||
`InfoHash` char(40) NOT NULL DEFAULT '',
|
||||
`FileCount` int(6) NOT NULL,
|
||||
`FileList` mediumtext NOT NULL,
|
||||
`FilePath` varchar(255) NOT NULL DEFAULT '',
|
||||
@ -1161,28 +1092,11 @@ CREATE TABLE `torrents` (
|
||||
`last_action` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
|
||||
`FreeTorrent` enum('0','1','2') NOT NULL DEFAULT '0',
|
||||
`FreeLeechType` enum('0','1','2','3') NOT NULL DEFAULT '0',
|
||||
`Dupable` enum('0','1') NOT NULL DEFAULT '0',
|
||||
`DupeReason` varchar(40) DEFAULT NULL,
|
||||
`Time` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
|
||||
`Anonymous` enum('0','1') NOT NULL DEFAULT '0',
|
||||
`Description` text,
|
||||
`Snatched` int(10) unsigned NOT NULL DEFAULT '0',
|
||||
`completed` int(11) NOT NULL,
|
||||
`announced_http` int(11) NOT NULL,
|
||||
`announced_http_compact` int(11) NOT NULL,
|
||||
`announced_http_no_peer_id` int(11) NOT NULL,
|
||||
`announced_udp` int(11) NOT NULL,
|
||||
`scraped_http` int(11) NOT NULL,
|
||||
`scraped_udp` int(11) NOT NULL,
|
||||
`started` int(11) NOT NULL,
|
||||
`stopped` int(11) NOT NULL,
|
||||
`flags` int(11) NOT NULL,
|
||||
`mtime` int(11) NOT NULL,
|
||||
`ctime` int(11) NOT NULL,
|
||||
`balance` bigint(20) NOT NULL DEFAULT '0',
|
||||
`pid` int(5) NOT NULL DEFAULT '0',
|
||||
`LastReseedRequest` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
|
||||
`ExtendedGrace` enum('0','1') NOT NULL DEFAULT '0',
|
||||
`TranscodedFrom` int(10) NOT NULL DEFAULT '0',
|
||||
PRIMARY KEY (`ID`),
|
||||
UNIQUE KEY `InfoHash` (`info_hash`(40)),
|
||||
@ -1199,7 +1113,6 @@ CREATE TABLE `torrents` (
|
||||
KEY `Snatched` (`Snatched`),
|
||||
KEY `last_action` (`last_action`),
|
||||
KEY `Time` (`Time`),
|
||||
KEY `flags` (`flags`),
|
||||
KEY `FreeTorrent` (`FreeTorrent`)
|
||||
) ENGINE=InnoDB CHARSET utf8;
|
||||
|
||||
@ -1256,20 +1169,6 @@ CREATE TABLE `torrents_cassette_approved` (
|
||||
KEY `TimeAdded` (`TimeAdded`)
|
||||
) ENGINE=InnoDB CHARSET utf8;
|
||||
|
||||
CREATE TABLE `torrents_comments` (
|
||||
`ID` int(10) NOT NULL AUTO_INCREMENT,
|
||||
`GroupID` int(10) NOT NULL,
|
||||
`TorrentID` int(10) unsigned NOT NULL,
|
||||
`AuthorID` int(10) NOT NULL,
|
||||
`AddedTime` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
|
||||
`Body` mediumtext,
|
||||
`EditedUserID` int(10) DEFAULT NULL,
|
||||
`EditedTime` datetime DEFAULT NULL,
|
||||
PRIMARY KEY (`ID`),
|
||||
KEY `TopicID` (`GroupID`),
|
||||
KEY `AuthorID` (`AuthorID`)
|
||||
) ENGINE=InnoDB CHARSET utf8;
|
||||
|
||||
CREATE TABLE `torrents_files` (
|
||||
`TorrentID` int(10) NOT NULL,
|
||||
`File` mediumblob NOT NULL,
|
||||
@ -1303,14 +1202,6 @@ CREATE TABLE `torrents_group` (
|
||||
KEY `RevisionID` (`RevisionID`)
|
||||
) ENGINE=InnoDB CHARSET utf8;
|
||||
|
||||
CREATE TABLE `torrents_last_read_comments` (
|
||||
`UserID` int(10) NOT NULL,
|
||||
`GroupID` int(10) NOT NULL,
|
||||
`CommentID` int(10) NOT NULL,
|
||||
PRIMARY KEY (`UserID`,`GroupID`),
|
||||
KEY `GroupID` (`GroupID`)
|
||||
) ENGINE=InnoDB CHARSET utf8;
|
||||
|
||||
CREATE TABLE `torrents_logs_new` (
|
||||
`LogID` int(10) NOT NULL AUTO_INCREMENT,
|
||||
`TorrentID` int(10) NOT NULL DEFAULT '0',
|
||||
@ -1402,13 +1293,6 @@ CREATE TABLE `torrents_votes` (
|
||||
CONSTRAINT `torrents_votes_ibfk_1` FOREIGN KEY (`GroupID`) REFERENCES `torrents_group` (`ID`) ON DELETE CASCADE
|
||||
) ENGINE=InnoDB CHARSET utf8;
|
||||
|
||||
CREATE TABLE `users_artists_comments_subscriptions` (
|
||||
`UserID` int(10) NOT NULL,
|
||||
`ArtistID` int(10) NOT NULL,
|
||||
PRIMARY KEY (`UserID`,`ArtistID`),
|
||||
KEY `ArtistID` (`ArtistID`)
|
||||
) ENGINE=InnoDB CHARSET utf8;
|
||||
|
||||
CREATE TABLE `users_collage_subs` (
|
||||
`UserID` int(10) NOT NULL,
|
||||
`CollageID` int(10) NOT NULL,
|
||||
@ -1426,13 +1310,6 @@ CREATE TABLE `users_comments_last_read` (
|
||||
KEY `Page` (`Page`,`PageID`)
|
||||
) ENGINE=InnoDB CHARSET utf8;
|
||||
|
||||
CREATE TABLE `users_comments_subscriptions` (
|
||||
`UserID` int(10) NOT NULL,
|
||||
`GroupID` int(10) NOT NULL,
|
||||
PRIMARY KEY (`UserID`,`GroupID`),
|
||||
KEY `GroupID` (`GroupID`)
|
||||
) ENGINE=InnoDB CHARSET utf8;
|
||||
|
||||
CREATE TABLE `users_donor_ranks` (
|
||||
`UserID` int(10) NOT NULL DEFAULT '0',
|
||||
`Rank` tinyint(2) NOT NULL DEFAULT '0',
|
||||
@ -1529,7 +1406,6 @@ CREATE TABLE `users_info` (
|
||||
`StyleURL` varchar(255) DEFAULT NULL,
|
||||
`Info` text NOT NULL,
|
||||
`Avatar` varchar(255) NOT NULL,
|
||||
`Country` int(10) unsigned NOT NULL,
|
||||
`AdminComment` text NOT NULL,
|
||||
`SiteOptions` text NOT NULL,
|
||||
`ViewAvatars` enum('0','1') NOT NULL DEFAULT '1',
|
||||
@ -1537,9 +1413,6 @@ CREATE TABLE `users_info` (
|
||||
`Artist` enum('0','1') NOT NULL DEFAULT '0',
|
||||
`DownloadAlt` enum('0','1') NOT NULL DEFAULT '0',
|
||||
`Warned` datetime NOT NULL,
|
||||
`MessagesPerPage` tinyint(3) unsigned NOT NULL DEFAULT '0',
|
||||
`DeletePMs` enum('0','1') NOT NULL DEFAULT '1',
|
||||
`SaveSentPMs` enum('0','1') NOT NULL DEFAULT '0',
|
||||
`SupportFor` varchar(255) NOT NULL,
|
||||
`TorrentGrouping` enum('0','1','2') NOT NULL COMMENT '0=Open,1=Closed,2=Off',
|
||||
`ShowTags` enum('0','1') NOT NULL DEFAULT '1',
|
||||
@ -1573,8 +1446,6 @@ CREATE TABLE `users_info` (
|
||||
`PermittedForums` varchar(150) NOT NULL DEFAULT '',
|
||||
`UnseededAlerts` enum('0','1') NOT NULL DEFAULT '0',
|
||||
`LastReadBlog` int(10) NOT NULL DEFAULT '0',
|
||||
`TorrentsCommentsCatchupTime` datetime DEFAULT NULL,
|
||||
`ArtistsCommentsCatchupTime` datetime DEFAULT NULL,
|
||||
`InfoTitle` varchar(255) NOT NULL,
|
||||
UNIQUE KEY `UserID` (`UserID`),
|
||||
KEY `SupportFor` (`SupportFor`),
|
||||
@ -1734,7 +1605,6 @@ CREATE TABLE `users_main` (
|
||||
`Email` varchar(255) NOT NULL,
|
||||
`PassHash` varchar(60) NOT NULL,
|
||||
`Secret` char(32) NOT NULL,
|
||||
`TorrentKey` char(32) NOT NULL,
|
||||
`IRCKey` char(32) DEFAULT NULL,
|
||||
`LastLogin` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
|
||||
`LastAccess` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
|
||||
@ -1749,22 +1619,10 @@ CREATE TABLE `users_main` (
|
||||
`Invites` int(10) unsigned NOT NULL DEFAULT '0',
|
||||
`PermissionID` int(10) unsigned NOT NULL,
|
||||
`CustomPermissions` text,
|
||||
`LastSeed` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
|
||||
`pass` blob NOT NULL COMMENT 'useless column',
|
||||
`can_leech` tinyint(4) NOT NULL DEFAULT '1',
|
||||
`wait_time` int(11) NOT NULL,
|
||||
`peers_limit` int(11) DEFAULT '1000',
|
||||
`torrents_limit` int(11) DEFAULT '1000',
|
||||
`torrent_pass` char(32) NOT NULL,
|
||||
`torrent_pass_secret` bigint(20) NOT NULL COMMENT 'useless column',
|
||||
`fid_end` int(11) NOT NULL COMMENT 'useless column',
|
||||
`name` char(8) NOT NULL COMMENT 'useless column',
|
||||
`OldPassHash` char(32) DEFAULT NULL,
|
||||
`Cursed` enum('1','0') NOT NULL DEFAULT '0',
|
||||
`CookieID` varchar(32) DEFAULT NULL,
|
||||
`RequiredRatio` double(10,8) NOT NULL DEFAULT '0.00000000',
|
||||
`RequiredRatioWork` double(10,8) NOT NULL DEFAULT '0.00000000',
|
||||
`Language` char(2) NOT NULL DEFAULT '',
|
||||
`ipcc` varchar(2) NOT NULL DEFAULT '',
|
||||
`FLTokens` int(10) NOT NULL DEFAULT '0',
|
||||
PRIMARY KEY (`ID`),
|
||||
@ -1778,7 +1636,6 @@ CREATE TABLE `users_main` (
|
||||
KEY `Downloaded` (`Downloaded`),
|
||||
KEY `Enabled` (`Enabled`),
|
||||
KEY `Invites` (`Invites`),
|
||||
KEY `Cursed` (`Cursed`),
|
||||
KEY `torrent_pass` (`torrent_pass`),
|
||||
KEY `RequiredRatio` (`RequiredRatio`),
|
||||
KEY `cc_index` (`ipcc`)
|
||||
|
@ -391,7 +391,7 @@ function header_link($SortKey, $DefaultWay = 'desc') {
|
||||
}
|
||||
}
|
||||
|
||||
if (isset($_GET['freetorrent'])) {
|
||||
if (isset($_GET['freetorrent']) && $_GET['freetorrent'] !== '') {
|
||||
switch ($_GET['freetorrent']) {
|
||||
case 0: // Only normal freeleech
|
||||
$SphQL->where('freetorrent', 0);
|
||||
|
@ -495,7 +495,7 @@ function header_link($SortKey, $DefaultWay = 'desc') {
|
||||
}
|
||||
}
|
||||
|
||||
if (isset($_GET['freetorrent'])) {
|
||||
if (isset($_GET['freetorrent']) && $_GET['freetorrent'] !== '') {
|
||||
switch ($_GET['freetorrent']) {
|
||||
case 0: // Only normal freeleech
|
||||
$SphQL->where('freetorrent', 0);
|
||||
|
@ -67,7 +67,7 @@
|
||||
$UploadForm = $Categories[$Properties['CategoryID'] - 1];
|
||||
$Properties['CategoryName'] = $Categories[$Properties['CategoryID'] - 1];
|
||||
$Properties['Artists'] = Requests::get_artists($_GET['requestid']);
|
||||
$Properties['TagList'] = implode(', ', Requests::get_tags($_GET['requestid']));
|
||||
$Properties['TagList'] = implode(', ', Requests::get_tags($_GET['requestid'])[$_GET['requestid']]);
|
||||
}
|
||||
|
||||
if (!empty($ArtistForm)) {
|
||||
|
@ -1,35 +1,2 @@
|
||||
<?
|
||||
//Include Last.fm in the user sidebar only if a Last.fm username is specified.
|
||||
$DB->query("
|
||||
SELECT username
|
||||
FROM lastfm_users
|
||||
WHERE ID = $UserID");
|
||||
if ($DB->has_results()) {
|
||||
list($LastFMUsername) = $DB->next_record();
|
||||
$LastFMInfo = LastFM::get_user_info($LastFMUsername);
|
||||
//Hand everything else over to JS (gets data via the username in an id-d div) to allow faster page loading.
|
||||
?>
|
||||
<div class="box box_info box_lastfm">
|
||||
<div class="head colhead_dark">Last.fm</div>
|
||||
<ul class="stats nobullet">
|
||||
<li>
|
||||
Username: <a id="lastfm_username" href="<?=$LastFMInfo['user']['url']?>" target="_blank" title="<?=$LastFMInfo['user']['name']?> on Last.fm: <?=number_format($LastFMInfo['user']['playcount'])?> plays, <?=number_format($LastFMInfo['user']['playlists'])?> playlists."><?=$LastFMUsername?></a>
|
||||
</li>
|
||||
<div id="lastfm_stats"<?=$OwnProfile ? ' data-uid="1"' : ''?>>
|
||||
</div>
|
||||
<li>
|
||||
<a href="#" id="lastfm_expand" onclick="return false" class="brackets">Show more info</a>
|
||||
<?
|
||||
//Append the reload stats button only if allowed on the current user page.
|
||||
$Response = $Cache->get_value("lastfm_clear_cache_$UserID");
|
||||
if (empty($Response)) {
|
||||
?>
|
||||
<span id="lastfm_reload_container">
|
||||
<a href="#" id="lastfm_reload" onclick="return false" class="brackets">Reload stats</a>
|
||||
</span>
|
||||
<? } ?>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
<?
|
||||
} ?>
|
||||
|
||||
|
@ -287,7 +287,7 @@
|
||||
INSERT INTO lastfm_users (ID, Username)
|
||||
VALUES ('$UserID', '$LastFMUsername')");
|
||||
}
|
||||
|
||||
G::$Cache->delete_value("lastfm_username_$UserID");
|
||||
|
||||
Donations::update_rewards($UserID);
|
||||
NotificationsManager::save_settings($UserID);
|
||||
|
@ -276,7 +276,10 @@ function check_paranoia_here($Setting) {
|
||||
</div>
|
||||
<?
|
||||
// Last.fm statistics and comparability
|
||||
include(SERVER_ROOT.'/sections/user/lastfm.php');
|
||||
$LastFMUsername = LastFM::get_lastfm_username($UserID);
|
||||
if ($LastFMUsername) {
|
||||
LastFMView::render_sidebar($LastFMUsername, $UserID, $OwnProfile);
|
||||
}
|
||||
|
||||
if (check_paranoia_here('requestsfilled_count') || check_paranoia_here('requestsfilled_bounty')) {
|
||||
$DB->query("
|
||||
|
@ -446,7 +446,7 @@ source better_transcode : connect {
|
||||
group_concat(distinct encoding separator ' ') \
|
||||
encoding \
|
||||
from sphinx_t t \
|
||||
where format in ('mp3', 'flac') \
|
||||
where format in ('MP3', 'FLAC') \
|
||||
group by gid, remident) t \
|
||||
join sphinx_tg g on g.id = groupid \
|
||||
where catid = 1
|
||||
|
Loading…
Reference in New Issue
Block a user