mirror of
https://github.com/WhatCD/Gazelle.git
synced 2024-12-13 02:46:30 +00:00
Empty commit
This commit is contained in:
parent
c05d706ce2
commit
0b71f53227
@ -63,7 +63,6 @@
|
||||
require(SERVER_ROOT.'/classes/mysql.class.php'); //Require the database wrapper
|
||||
require(SERVER_ROOT.'/classes/cache.class.php'); //Require the caching class
|
||||
require(SERVER_ROOT.'/classes/encrypt.class.php'); //Require the encryption class
|
||||
require(SERVER_ROOT.'/classes/useragent.class.php'); //Require the useragent class
|
||||
require(SERVER_ROOT.'/classes/time.class.php'); //Require the time class
|
||||
require(SERVER_ROOT.'/classes/search.class.php'); //Require the searching class
|
||||
require(SERVER_ROOT.'/classes/paranoia.class.php'); //Require the paranoia check_paranoia function
|
||||
@ -77,13 +76,12 @@
|
||||
$DB = new DB_MYSQL;
|
||||
$Cache = new CACHE($MemcachedServers);
|
||||
$Enc = new CRYPT;
|
||||
$UA = new USER_AGENT;
|
||||
$SS = new SPHINX_SEARCH;
|
||||
|
||||
// Autoload classes.
|
||||
|
||||
spl_autoload_register(function ($ClassName) {
|
||||
$FileName='';
|
||||
$FileName = '';
|
||||
switch ($ClassName) {
|
||||
case 'Artists':
|
||||
$FileName = 'artists.class';
|
||||
@ -174,6 +172,9 @@
|
||||
case 'Tracker':
|
||||
$FileName = 'tracker.class';
|
||||
break;
|
||||
case 'UserAgent':
|
||||
$FileName = 'useragent.class';
|
||||
break;
|
||||
case 'UserRank':
|
||||
$FileName = 'user_rank.class';
|
||||
break;
|
||||
@ -186,6 +187,9 @@
|
||||
case 'Votes':
|
||||
$FileName = 'votes.class';
|
||||
break;
|
||||
case 'Wiki':
|
||||
$FileName = 'wiki.class';
|
||||
break;
|
||||
case 'Zip':
|
||||
$FileName = 'zip.class';
|
||||
break;
|
||||
@ -198,9 +202,9 @@
|
||||
|
||||
//Begin browser identification
|
||||
|
||||
$Browser = $UA->browser($_SERVER['HTTP_USER_AGENT']);
|
||||
$OperatingSystem = $UA->operating_system($_SERVER['HTTP_USER_AGENT']);
|
||||
//$Mobile = $UA->mobile($_SERVER['HTTP_USER_AGENT']);
|
||||
$Browser = UserAgent::browser($_SERVER['HTTP_USER_AGENT']);
|
||||
$OperatingSystem = UserAgent::operating_system($_SERVER['HTTP_USER_AGENT']);
|
||||
//$Mobile = UserAgent::mobile($_SERVER['HTTP_USER_AGENT']);
|
||||
$Mobile = in_array($_SERVER['HTTP_HOST'], array('m.'.NONSSL_SITE_URL, 'm.'.NONSSL_SITE_URL));
|
||||
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
<?
|
||||
class USER_AGENT {
|
||||
class UserAgent {
|
||||
var $Browsers = array(
|
||||
//Less popular
|
||||
'Shiira' => 'Shiira',
|
||||
@ -110,11 +110,11 @@ class USER_AGENT {
|
||||
'mac' => 'Mac OS X'
|
||||
);
|
||||
|
||||
public function operating_system(&$UserAgentString) {
|
||||
public static function operating_system(&$UserAgentString) {
|
||||
if (empty($UserAgentString)) {
|
||||
return 'Hidden';
|
||||
}
|
||||
foreach ($this->OperatingSystems as $String => $OperatingSystem) {
|
||||
foreach ($OperatingSystems as $String => $OperatingSystem) {
|
||||
if (stripos($UserAgentString, $String) !== false) {
|
||||
return $OperatingSystem;
|
||||
}
|
||||
@ -122,7 +122,7 @@ public function operating_system(&$UserAgentString) {
|
||||
return 'Unknown';
|
||||
}
|
||||
|
||||
public function mobile(&$UserAgentString) {
|
||||
public static function mobile(&$UserAgentString) {
|
||||
if (strpos($UserAgentString, 'iPad')) {
|
||||
return false;
|
||||
}
|
||||
@ -134,18 +134,18 @@ public function mobile(&$UserAgentString) {
|
||||
return false;
|
||||
}
|
||||
|
||||
public function browser(&$UserAgentString) {
|
||||
public static function browser(&$UserAgentString) {
|
||||
if (empty($UserAgentString)) {
|
||||
return 'Hidden';
|
||||
}
|
||||
$Return = 'Unknown';
|
||||
foreach ($this->Browsers as $String => $Browser) {
|
||||
foreach ($Browsers as $String => $Browser) {
|
||||
if (strpos($UserAgentString, $String) !== false) {
|
||||
$Return = $Browser;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if ($this->mobile($UserAgentString)) {
|
||||
if (self::mobile($UserAgentString)) {
|
||||
$Return .= ' Mobile';
|
||||
}
|
||||
return $Return;
|
||||
|
@ -30,30 +30,21 @@
|
||||
|
||||
########################################################################*/
|
||||
|
||||
class WIKI {
|
||||
var $Table = '';
|
||||
var $PageID = 0;
|
||||
var $BaseURL = '';
|
||||
function WIKI($Table, $PageID, $BaseURL = '') {
|
||||
$this->Table = $Table;
|
||||
$this->PageID = $PageID;
|
||||
$this->BaseURL = $BaseURL;
|
||||
}
|
||||
class Wiki {
|
||||
|
||||
function revision_history() {
|
||||
public static function revision_history($Table = '', $PageID = 0, $BaseURL = '') {
|
||||
global $DB;
|
||||
|
||||
$BaseURL = $this->BaseURL;
|
||||
$DB->query("
|
||||
SELECT
|
||||
RevisionID,
|
||||
Summary,
|
||||
Time,
|
||||
UserID
|
||||
FROM ".$this->Table." AS wiki
|
||||
WHERE wiki.PageID = ".$this->PageID."
|
||||
FROM $Table AS wiki
|
||||
WHERE wiki.PageID = $PageID
|
||||
ORDER BY RevisionID DESC");
|
||||
//----------------------------------------------- ?>
|
||||
?>
|
||||
<table cellpadding="6" cellspacing="1" border="0" width="100%" class="border">
|
||||
<tr class="colhead">
|
||||
<td>Revision</td>
|
||||
@ -61,11 +52,11 @@ function revision_history() {
|
||||
<td>User</td>
|
||||
<td>Summary</td>
|
||||
</tr>
|
||||
<? //-----------------------------------------
|
||||
<?
|
||||
$Row = 'a';
|
||||
while (list($RevisionID, $Summary, $Time, $UserID, $Username) = $DB->next_record()) {
|
||||
$Row = (($Row == 'a') ? 'b' : 'a');
|
||||
//------------------------------------------------------ ?>
|
||||
?>
|
||||
<tr class="row<?=$Row?>">
|
||||
<td>
|
||||
<?= "<a href=\"$BaseURL&revisionid=$RevisionID\">#$RevisionID</a>" ?>
|
||||
@ -80,12 +71,9 @@ function revision_history() {
|
||||
<?=($Summary ? $Summary : '(empty)')?>
|
||||
</td>
|
||||
</tr>
|
||||
<? //---------------------------------------------------
|
||||
}
|
||||
//-------------------------------------------- ?>
|
||||
<? } // while ?>
|
||||
</table>
|
||||
<?
|
||||
|
||||
}
|
||||
} // function
|
||||
} // class
|
||||
?>
|
||||
|
@ -1,5 +1,8 @@
|
||||
CHANGELOG
|
||||
|
||||
2013-06-19 by alderaan
|
||||
UI revisions on the artist and torrent group edit pages, with the most significant changes occurring in the artist aliases section%
|
||||
|
||||
2013-06-16 by porkpie
|
||||
Require a click and an ajax call to view some of the stats on profile pages
|
||||
|
||||
|
@ -31,10 +31,11 @@ function check_paranoia_here($Setting) {
|
||||
GROUP BY Type");
|
||||
$PeerCount = $DB->to_array(0, MYSQLI_NUM, false);
|
||||
if (check_paranoia('seeding+')) {
|
||||
$CommStats['seeding'] = isset($PeerCount['Seeding']) ? $PeerCount['Seeding'][1] : 0;
|
||||
$Seeding = isset($PeerCount['Seeding']) ? $PeerCount['Seeding'][1] : 0;
|
||||
$CommStats['seeding'] = number_format($Seeding);
|
||||
}
|
||||
if (check_paranoia('leeching+')) {
|
||||
$CommStats['leeching'] = isset($PeerCount['Leeching']) ? $PeerCount['Leeching'][1] : 0;
|
||||
$CommStats['leeching'] = isset($PeerCount['Leeching']) ? number_format($PeerCount['Leeching'][1]) : 0;
|
||||
}
|
||||
}
|
||||
if (check_paranoia_here('snatched+')) {
|
||||
@ -44,12 +45,12 @@ function check_paranoia_here($Setting) {
|
||||
INNER JOIN torrents AS t ON t.ID=x.fid
|
||||
WHERE x.uid = '$UserID'");
|
||||
list($Snatched, $UniqueSnatched) = $DB->next_record(MYSQLI_NUM, false);
|
||||
$CommStats['snatched'] = $Snatched;
|
||||
$CommStats['snatched'] = number_format($Snatched);
|
||||
if (check_perms('site_view_torrent_snatchlist', $User['Class'])) {
|
||||
$CommStats['usnatched'] = $UniqueSnatched;
|
||||
$CommStats['usnatched'] = number_format($UniqueSnatched);
|
||||
}
|
||||
if (check_paranoia_here('seeding') && check_paranoia_here('snatched')) {
|
||||
$CommStats['seedingperc'] = $UniqueSnatched > 0 ? 100 * min(1, round($CommStats['seeding'] / $UniqueSnatched, 2)) : -1;
|
||||
if (check_paranoia_here('seeding') && check_paranoia_here('snatched') && $UniqueSnatched > 0) {
|
||||
$CommStats['seedingperc'] = 100 * min(1, round($Seeding / $UniqueSnatched, 2));
|
||||
}
|
||||
}
|
||||
if (check_perms('site_view_torrent_snatchlist', $Class)) {
|
||||
@ -59,16 +60,8 @@ function check_paranoia_here($Setting) {
|
||||
JOIN torrents AS t ON t.ID=ud.TorrentID
|
||||
WHERE ud.UserID='$UserID'");
|
||||
list($NumDownloads, $UniqueDownloads) = $DB->next_record(MYSQLI_NUM, false);
|
||||
$CommStats['downloaded'] = $NumDownloads;
|
||||
$CommStats['udownloaded'] = $UniqueDownloads;
|
||||
$CommStats['downloaded'] = number_format($NumDownloads);
|
||||
$CommStats['udownloaded'] = number_format($UniqueDownloads);
|
||||
}
|
||||
|
||||
$CommStats['leeching'] = number_format($CommStats['leeching']);
|
||||
$CommStats['seeding'] = number_format($CommStats['seeding']);
|
||||
$CommStats['snatched'] = number_format($CommStats['snatched']);
|
||||
$CommStats['usnatched'] = number_format($CommStats['usnatched']);
|
||||
$CommStats['downloaded'] = number_format($CommStats['downloaded']);
|
||||
$CommStats['udownloaded'] = number_format($CommStats['udownloaded']);
|
||||
$CommStats['seedingperc'] = number_format($CommStats['seedingperc']);
|
||||
|
||||
json_die('success', $CommStats);
|
||||
|
@ -13,12 +13,15 @@
|
||||
/* AJAX_LIMIT = array(x,y) = 'x' requests every 'y' seconds.
|
||||
e.g. array(5,10) = 5 requests every 10 seconds */
|
||||
$AJAX_LIMIT = array(5,10);
|
||||
$Limited_Pages = array('tcomments','user','forum','top10','browse','usersearch','requests','artist','inbox','subscriptions','bookmarks','announcements','notifications','request','better','similar_artists','userhistory','votefavorite','wiki','torrentgroup','news_ajax');
|
||||
|
||||
$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.
|
||||
$UserExceptions = array(
|
||||
|
||||
);
|
||||
$UserID = $LoggedUser['ID'];
|
||||
header('Content-Type: application/json; charset=utf-8');
|
||||
|
||||
// Enforce rate limiting everywhere except info.php
|
||||
if (isset($_GET['action']) && in_array($_GET['action'],$Limited_Pages)) {
|
||||
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]);
|
||||
|
@ -21,13 +21,13 @@ function compare($X, $Y) {
|
||||
|
||||
|
||||
if (!empty($_GET['revisionid'])) { // if they're viewing an old revision
|
||||
$RevisionID=$_GET['revisionid'];
|
||||
$RevisionID = $_GET['revisionid'];
|
||||
if (!is_number($RevisionID)) {
|
||||
error(0);
|
||||
}
|
||||
$Data = $Cache->get_value("artist_$ArtistID"."_revision_$RevisionID", true);
|
||||
$Data = $Cache->get_value("artist_{$ArtistID}_revision_$RevisionID", true);
|
||||
} else { // viewing the live version
|
||||
$Data = $Cache->get_value('artist_'.$ArtistID, true);
|
||||
$Data = $Cache->get_value("artist_$ArtistID", true);
|
||||
$RevisionID = false;
|
||||
}
|
||||
|
||||
@ -42,8 +42,8 @@ function compare($X, $Y) {
|
||||
wiki.body,
|
||||
a.VanityHouse
|
||||
FROM wiki_artists AS wiki
|
||||
LEFT JOIN artists_group AS a ON wiki.RevisionID=a.RevisionID
|
||||
WHERE wiki.RevisionID='$RevisionID' ";
|
||||
LEFT JOIN artists_group AS a ON wiki.RevisionID = a.RevisionID
|
||||
WHERE wiki.RevisionID = '$RevisionID' ";
|
||||
} else {
|
||||
$sql = "
|
||||
SELECT
|
||||
@ -52,10 +52,11 @@ function compare($X, $Y) {
|
||||
wiki.body,
|
||||
a.VanityHouse
|
||||
FROM artists_group AS a
|
||||
LEFT JOIN wiki_artists AS wiki ON wiki.RevisionID=a.RevisionID
|
||||
WHERE a.ArtistID='$ArtistID' ";
|
||||
LEFT JOIN wiki_artists AS wiki ON wiki.RevisionID = a.RevisionID
|
||||
WHERE a.ArtistID = '$ArtistID' ";
|
||||
}
|
||||
$sql .= " GROUP BY a.ArtistID";
|
||||
$sql .= "
|
||||
GROUP BY a.ArtistID";
|
||||
$DB->query($sql);
|
||||
|
||||
if ($DB->record_count() == 0) {
|
||||
@ -73,7 +74,7 @@ function compare($X, $Y) {
|
||||
// Requests
|
||||
$Requests = array();
|
||||
if (empty($LoggedUser['DisableRequests'])) {
|
||||
$Requests = $Cache->get_value('artists_requests_'.$ArtistID);
|
||||
$Requests = $Cache->get_value("artists_requests_$ArtistID");
|
||||
if (!is_array($Requests)) {
|
||||
$DB->query("
|
||||
SELECT
|
||||
@ -85,9 +86,9 @@ function compare($X, $Y) {
|
||||
COUNT(rv.UserID) AS Votes,
|
||||
SUM(rv.Bounty) AS Bounty
|
||||
FROM requests AS r
|
||||
LEFT JOIN requests_votes AS rv ON rv.RequestID=r.ID
|
||||
LEFT JOIN requests_artists AS ra ON r.ID=ra.RequestID
|
||||
WHERE ra.ArtistID = ".$ArtistID."
|
||||
LEFT JOIN requests_votes AS rv ON rv.RequestID = r.ID
|
||||
LEFT JOIN requests_artists AS ra ON r.ID = ra.RequestID
|
||||
WHERE ra.ArtistID = $ArtistID
|
||||
AND r.TorrentID = 0
|
||||
GROUP BY r.ID
|
||||
ORDER BY Votes DESC");
|
||||
@ -97,23 +98,23 @@ function compare($X, $Y) {
|
||||
} else {
|
||||
$Requests = array();
|
||||
}
|
||||
$Cache->cache_value('artists_requests_'.$ArtistID, $Requests);
|
||||
$Cache->cache_value("artists_requests_$ArtistID", $Requests);
|
||||
}
|
||||
}
|
||||
$NumRequests = count($Requests);
|
||||
|
||||
|
||||
if (($Importances = $Cache->get_value('artist_groups_'.$ArtistID)) === false) {
|
||||
if (($Importances = $Cache->get_value("artist_groups_$ArtistID")) === false) {
|
||||
$DB->query("
|
||||
SELECT
|
||||
DISTINCTROW ta.GroupID, ta.Importance, tg.VanityHouse, tg.Year
|
||||
FROM torrents_artists AS ta
|
||||
JOIN torrents_group AS tg ON tg.ID=ta.GroupID
|
||||
WHERE ta.ArtistID='$ArtistID'
|
||||
JOIN torrents_group AS tg ON tg.ID = ta.GroupID
|
||||
WHERE ta.ArtistID = '$ArtistID'
|
||||
ORDER BY tg.Year DESC, tg.Name DESC");
|
||||
$GroupIDs = $DB->collect('GroupID');
|
||||
$Importances = $DB->to_array(false, MYSQLI_BOTH, false);
|
||||
$Cache->cache_value('artist_groups_'.$ArtistID, $Importances, 0);
|
||||
$Cache->cache_value("artist_groups_$ArtistID", $Importances, 0);
|
||||
} else {
|
||||
$GroupIDs = array();
|
||||
foreach ($Importances as $Group) {
|
||||
@ -173,16 +174,16 @@ function compare($X, $Y) {
|
||||
}
|
||||
|
||||
if (!empty($GuestAlbums)) {
|
||||
$ReleaseTypes[1024] = "Guest Appearance";
|
||||
$ReleaseTypes[1024] = 'Guest Appearance';
|
||||
}
|
||||
if (!empty($RemixerAlbums)) {
|
||||
$ReleaseTypes[1023] = "Remixed By";
|
||||
$ReleaseTypes[1023] = 'Remixed By';
|
||||
}
|
||||
if (!empty($ComposerAlbums)) {
|
||||
$ReleaseTypes[1022] = "Composition";
|
||||
$ReleaseTypes[1022] = 'Composition';
|
||||
}
|
||||
if (!empty($ProducerAlbums)) {
|
||||
$ReleaseTypes[1021] = "Produced By";
|
||||
$ReleaseTypes[1021] = 'Produced By';
|
||||
}
|
||||
|
||||
//Custom sorting for releases
|
||||
@ -200,9 +201,9 @@ function compare($X, $Y) {
|
||||
}
|
||||
uasort($Importances, function ($A, $B) use ($SortOrder) {
|
||||
if ($SortOrder[$A['ReleaseType']] == $SortOrder[$B['ReleaseType']]) {
|
||||
return $A['Sort'] < $B['Sort'] ? -1 : 1;
|
||||
return (($A['Sort'] < $B['Sort']) ? -1 : 1);
|
||||
}
|
||||
return $SortOrder[$A['ReleaseType']] < $SortOrder[$B['ReleaseType']] ? -1 : 1;
|
||||
return (($SortOrder[$A['ReleaseType']] < $SortOrder[$B['ReleaseType']]) ? -1 : 1);
|
||||
});
|
||||
// Sort the anchors at the top of the page the same way as release types
|
||||
$UsedReleases = array_flip(array_intersect_key($SortOrder, $UsedReleases));
|
||||
@ -213,17 +214,17 @@ function compare($X, $Y) {
|
||||
<?
|
||||
foreach ($UsedReleases as $ReleaseID) {
|
||||
switch ($ReleaseTypes[$ReleaseID]) {
|
||||
case "Remix" :
|
||||
$DisplayName = "Remixes";
|
||||
case 'Remix':
|
||||
$DisplayName = 'Remixes';
|
||||
break;
|
||||
case "Anthology" :
|
||||
$DisplayName = "Anthologies";
|
||||
case 'Anthology':
|
||||
$DisplayName = 'Anthologies';
|
||||
break;
|
||||
case "DJ Mix" :
|
||||
$DisplayName = "DJ Mixes";
|
||||
case 'DJ Mix':
|
||||
$DisplayName = 'DJ Mixes';
|
||||
break;
|
||||
default :
|
||||
$DisplayName = $ReleaseTypes[$ReleaseID]."s";
|
||||
default:
|
||||
$DisplayName = $ReleaseTypes[$ReleaseID].'s';
|
||||
break;
|
||||
}
|
||||
|
||||
@ -262,9 +263,9 @@ function compare($X, $Y) {
|
||||
$Torrent['Leechers'] = (int)$Torrent['Leechers'];
|
||||
$Torrent['Snatched'] = (int)$Torrent['Snatched'];
|
||||
|
||||
$NumSeeders+=$Torrent['Seeders'];
|
||||
$NumLeechers+=$Torrent['Leechers'];
|
||||
$NumSnatches+=$Torrent['Snatched'];
|
||||
$NumSeeders += $Torrent['Seeders'];
|
||||
$NumLeechers += $Torrent['Leechers'];
|
||||
$NumSnatches += $Torrent['Snatched'];
|
||||
}
|
||||
}
|
||||
|
||||
@ -302,21 +303,21 @@ function compare($X, $Y) {
|
||||
|
||||
if ($ReleaseType != $LastReleaseType) {
|
||||
switch ($ReleaseTypes[$ReleaseType]) {
|
||||
case "Remix" :
|
||||
$DisplayName = "Remixes";
|
||||
case 'Remix':
|
||||
$DisplayName = 'Remixes';
|
||||
break;
|
||||
case "Anthology" :
|
||||
$DisplayName = "Anthologies";
|
||||
case 'Anthology':
|
||||
$DisplayName = 'Anthologies';
|
||||
break;
|
||||
case "DJ Mix" :
|
||||
$DisplayName = "DJ Mixes";
|
||||
case 'DJ Mix':
|
||||
$DisplayName = 'DJ Mixes';
|
||||
break;
|
||||
default :
|
||||
$DisplayName = $ReleaseTypes[$ReleaseType]."s";
|
||||
default:
|
||||
$DisplayName = $ReleaseTypes[$ReleaseType].'s';
|
||||
break;
|
||||
}
|
||||
|
||||
$ReleaseTypeLabel = strtolower(str_replace(' ','_',$ReleaseTypes[$ReleaseType]));
|
||||
$ReleaseTypeLabel = strtolower(str_replace(' ', '_', $ReleaseTypes[$ReleaseType]));
|
||||
if ($OpenTable) { ?>
|
||||
</table>
|
||||
<? } ?>
|
||||
@ -334,7 +335,7 @@ function compare($X, $Y) {
|
||||
}
|
||||
|
||||
|
||||
$DisplayName ='<a href="torrents.php?id='.$GroupID.'" title="View Torrent">'.$GroupName.'</a>';
|
||||
$DisplayName = "<a href=\"torrents.php?id=$GroupID\" title=\"View Torrent\">$GroupName</a>";
|
||||
if (check_perms('users_mod') || check_perms('torrents_fix_ghosts')) {
|
||||
$DisplayName .= ' <a href="torrents.php?action=fix_group&groupid='.$GroupID.'&artistid='.$ArtistID.'&auth='.$LoggedUser['AuthKey'].'" class="brackets" title="Fix ghost DB entry">Fix</a>';
|
||||
}
|
||||
@ -370,14 +371,14 @@ function compare($X, $Y) {
|
||||
}
|
||||
|
||||
if ($GroupYear > 0) {
|
||||
$DisplayName = $GroupYear. ' - '.$DisplayName;
|
||||
$DisplayName = "$GroupYear - $DisplayName";
|
||||
}
|
||||
|
||||
if ($GroupVanityHouse) {
|
||||
$DisplayName .= ' [<abbr title="This is a Vanity House release">VH</abbr>]';
|
||||
}
|
||||
|
||||
$SnatchedGroupClass = $GroupFlags['IsSnatched'] ? ' snatched_group' : '';
|
||||
$SnatchedGroupClass = ($GroupFlags['IsSnatched'] ? ' snatched_group' : '');
|
||||
?>
|
||||
<tr class="releases_<?=$ReleaseType?> group discog<?=$SnatchedGroupClass . $HideDiscog?>">
|
||||
<td class="center">
|
||||
@ -386,19 +387,19 @@ function compare($X, $Y) {
|
||||
</div>
|
||||
</td>
|
||||
<td colspan="5" class="big_info">
|
||||
<? if ($LoggedUser['CoverArt']) : ?>
|
||||
<? if ($LoggedUser['CoverArt']) : ?>
|
||||
<div class="group_image float_left clear">
|
||||
<? ImageTools::cover_thumb($WikiImage, $GroupCategoryID) ?>
|
||||
</div>
|
||||
<? endif; ?>
|
||||
<? endif; ?>
|
||||
<div class="group_info clear">
|
||||
<strong><?=$DisplayName?></strong>
|
||||
<? if (Bookmarks::has_bookmarked('torrent', $GroupID)) {
|
||||
echo " <a style = \"float: right;\" href=\"#\" id=\"bookmarklink_torrent_$GroupID\" class=\"remove_bookmark brackets\" title=\"Unbookmark\" onclick=\"Unbookmark('torrent',$GroupID,'Bookmark');return false;\">Unbookmark</a>";
|
||||
echo "<a style=\"float: right;\" href=\"#\" id=\"bookmarklink_torrent_$GroupID\" class=\"remove_bookmark brackets\" title=\"Unbookmark\" onclick=\"Unbookmark('torrent', $GroupID, 'Bookmark'); return false;\">Unbookmark</a>";
|
||||
} else {
|
||||
echo " <a style = \"float: right;\" href=\"#\" id=\"bookmarklink_torrent_$GroupID\" class=\"add_bookmark brackets\" title=\"Bookmark\" onclick=\"Bookmark('torrent',$GroupID,'Unbookmark');return false;\">Bookmark</a>";
|
||||
echo "<a style=\"float: right;\" href=\"#\" id=\"bookmarklink_torrent_$GroupID\" class=\"add_bookmark brackets\" title=\"Bookmark\" onclick=\"Bookmark('torrent', $GroupID, 'Unbookmark'); return false;\">Bookmark</a>";
|
||||
} ?>
|
||||
<?Votes::vote_link($GroupID,$UserVotes[$GroupID]['Type']);?>
|
||||
<?Votes::vote_link($GroupID, $UserVotes[$GroupID]['Type']);?>
|
||||
<div class="tags"><?=$TorrentTags->format('torrents.php?taglist=', $Name)?></div>
|
||||
</div>
|
||||
</td>
|
||||
@ -417,11 +418,12 @@ function compare($X, $Y) {
|
||||
if ($Torrent['Remastered'] && !$Torrent['RemasterYear']) {
|
||||
$FirstUnknown = !isset($FirstUnknown);
|
||||
}
|
||||
$SnatchedTorrentClass = $Torrent['IsSnatched'] ? ' snatched_torrent' : '';
|
||||
$SnatchedTorrentClass = ($Torrent['IsSnatched'] ? ' snatched_torrent' : '');
|
||||
|
||||
if ($Torrent['RemasterTitle'] != $LastRemasterTitle || $Torrent['RemasterYear'] != $LastRemasterYear ||
|
||||
$Torrent['RemasterRecordLabel'] != $LastRemasterRecordLabel || $Torrent['RemasterCatalogueNumber'] !=
|
||||
$LastRemasterCatalogueNumber || $FirstUnknown || $Torrent['Media'] != $LastMedia) {
|
||||
$LastRemasterCatalogueNumber || $FirstUnknown || $Torrent['Media'] != $LastMedia
|
||||
) {
|
||||
|
||||
$EditionID++;
|
||||
|
||||
@ -458,7 +460,8 @@ function compare($X, $Y) {
|
||||
if (!empty($TorrentList)) { ?>
|
||||
</table>
|
||||
</div>
|
||||
<? }
|
||||
<?
|
||||
}
|
||||
|
||||
$TorrentDisplayList = ob_get_clean();
|
||||
|
||||
@ -470,22 +473,26 @@ function compare($X, $Y) {
|
||||
<div class="header">
|
||||
<h2><?=display_str($Name)?><? if ($RevisionID) { ?> (Revision #<?=$RevisionID?>)<? } if ($VanityHouseArtist) { ?> [Vanity House] <? } ?></h2>
|
||||
<div class="linkbox">
|
||||
<? if (check_perms('site_submit_requests')) { ?>
|
||||
<? if (check_perms('site_submit_requests')) { ?>
|
||||
<a href="requests.php?action=new&artistid=<?=$ArtistID?>" class="brackets">Add request</a>
|
||||
<? }
|
||||
<?
|
||||
}
|
||||
|
||||
if (check_perms('site_torrents_notify')) {
|
||||
if (($Notify = $Cache->get_value('notify_artists_'.$LoggedUser['ID'])) === false) {
|
||||
$DB->query("SELECT ID, Artists FROM users_notify_filters WHERE UserID='$LoggedUser[ID]' AND Label='Artist notifications' LIMIT 1");
|
||||
$DB->query("
|
||||
SELECT ID, Artists
|
||||
FROM users_notify_filters
|
||||
WHERE UserID = '$LoggedUser[ID]'
|
||||
AND Label = 'Artist notifications'
|
||||
LIMIT 1");
|
||||
$Notify = $DB->next_record(MYSQLI_ASSOC, false);
|
||||
$Cache->cache_value('notify_artists_'.$LoggedUser['ID'], $Notify, 0);
|
||||
}
|
||||
if (stripos($Notify['Artists'], '|'.$Name.'|') === false) {
|
||||
?>
|
||||
<a href="artist.php?action=notify&artistid=<?=$ArtistID?>&auth=<?=$LoggedUser['AuthKey']?>" class="brackets">Notify of new uploads</a>
|
||||
<?
|
||||
} else {
|
||||
?>
|
||||
<? } else { ?>
|
||||
<a href="artist.php?action=notifyremove&artistid=<?=$ArtistID?>&auth=<?=$LoggedUser['AuthKey']?>" class="brackets">Do not notify of new uploads</a>
|
||||
<?
|
||||
}
|
||||
@ -493,15 +500,10 @@ function compare($X, $Y) {
|
||||
|
||||
if (Bookmarks::has_bookmarked('artist', $ArtistID)) {
|
||||
?>
|
||||
<a href="#" id="bookmarklink_artist_<?=$ArtistID?>" onclick="Unbookmark('artist', <?=$ArtistID?>,'Bookmark');return false;" class="brackets">Remove bookmark</a>
|
||||
|
||||
<?
|
||||
} else {
|
||||
?>
|
||||
<a href="#" id="bookmarklink_artist_<?=$ArtistID?>" onclick="Bookmark('artist', <?=$ArtistID?>,'Remove bookmark');return false;" class="brackets">Bookmark</a>
|
||||
<?
|
||||
}
|
||||
?>
|
||||
<a href="#" id="bookmarklink_artist_<?=$ArtistID?>" onclick="Unbookmark('artist', <?=$ArtistID?>, 'Bookmark'); return false;" class="brackets">Remove bookmark</a>
|
||||
<? } else { ?>
|
||||
<a href="#" id="bookmarklink_artist_<?=$ArtistID?>" onclick="Bookmark('artist', <?=$ArtistID?>, 'Remove bookmark'); return false;" class="brackets">Bookmark</a>
|
||||
<? } ?>
|
||||
<!-- <a href="#" id="recommend" class="brackets">Recommend</a> -->
|
||||
<?
|
||||
if (check_perms('site_edit_wiki')) {
|
||||
@ -509,6 +511,9 @@ function compare($X, $Y) {
|
||||
<a href="artist.php?action=edit&artistid=<?=$ArtistID?>" class="brackets">Edit</a>
|
||||
<? } ?>
|
||||
<a href="artist.php?action=history&artistid=<?=$ArtistID?>" class="brackets">View history</a>
|
||||
<? if ($RevisionID && check_perms('site_edit_wiki')) { ?>
|
||||
<a href="artist.php?action=revert&artistid=<?=$ArtistID?>&revisionid=<?=$RevisionID?>&auth=<?=$LoggedUser['AuthKey']?>" class="brackets">Revert to this revision</a>
|
||||
<? } ?>
|
||||
<a href="artist.php?id=<?=$ArtistID?>#info" class="brackets">Info</a>
|
||||
<? if (defined('LASTFM_API_KEY')) { ?>
|
||||
<a href="artist.php?id=<?=$ArtistID?>#concerts" class="brackets">Concerts</a>
|
||||
@ -516,11 +521,6 @@ function compare($X, $Y) {
|
||||
<a href="artist.php?id=<?=$ArtistID?>#artistcomments" class="brackets">Comments</a>
|
||||
<? if (check_perms('site_delete_artist') && check_perms('torrents_delete')) { ?>
|
||||
<a href="artist.php?action=delete&artistid=<?=$ArtistID?>&auth=<?=$LoggedUser['AuthKey']?>" class="brackets">Delete</a>
|
||||
<? }
|
||||
|
||||
if ($RevisionID && check_perms('site_edit_wiki')) {
|
||||
?>
|
||||
<a href="artist.php?action=revert&artistid=<?=$ArtistID?>&revisionid=<?=$RevisionID?>&auth=<?=$LoggedUser['AuthKey']?>" class="brackets">Revert to this revision</a>
|
||||
<? } ?>
|
||||
</div>
|
||||
</div>
|
||||
@ -530,7 +530,7 @@ function compare($X, $Y) {
|
||||
<div class="box box_image">
|
||||
<div class="head"><strong><?=$Name?></strong></div>
|
||||
<div style="text-align: center; padding: 10px 0px;">
|
||||
<img style="max-width: 220px;" src="<?=ImageTools::process($Image, true)?>" alt="<?=$Name?>" onclick="lightbox.init('<?=ImageTools::process($Image)?>',220);" />
|
||||
<img style="max-width: 220px;" src="<?=ImageTools::process($Image, true)?>" alt="<?=$Name?>" onclick="lightbox.init('<?=ImageTools::process($Image)?>', 220);" />
|
||||
</div>
|
||||
</div>
|
||||
<? } ?>
|
||||
|
@ -23,11 +23,11 @@
|
||||
Body,
|
||||
VanityHouse
|
||||
FROM artists_group AS a
|
||||
LEFT JOIN wiki_artists ON wiki_artists.RevisionID=a.RevisionID
|
||||
WHERE a.ArtistID='$ArtistID'");
|
||||
LEFT JOIN wiki_artists ON wiki_artists.RevisionID = a.RevisionID
|
||||
WHERE a.ArtistID = '$ArtistID'");
|
||||
|
||||
if ($DB->record_count() < 1) {
|
||||
error("Cannot find the artist with the ID ".$ArtistID.': See the <a href="log.php?search=Artist+'.$ArtistID.'">log</a>.');
|
||||
error("Cannot find an artist with the ID {$ArtistID}: See the <a href=\"log.php?search=Artist+$ArtistID\">site log</a>.");
|
||||
}
|
||||
|
||||
list($Name, $Image, $Body, $VanityHouse) = $DB->next_record(MYSQLI_NUM, true);
|
||||
@ -45,12 +45,14 @@
|
||||
<input type="hidden" name="auth" value="<?=$LoggedUser['AuthKey']?>" />
|
||||
<input type="hidden" name="artistid" value="<?=$ArtistID?>" />
|
||||
<div>
|
||||
<h3>Image</h3>
|
||||
<h3>Image:</h3>
|
||||
<input type="text" name="image" size="92" value="<?=$Image?>" /><br />
|
||||
<h3>Artist info</h3>
|
||||
<h3>Artist information:</h3>
|
||||
<textarea name="body" cols="91" rows="20"><?=$Body?></textarea> <br />
|
||||
<h3>Vanity House <input type="checkbox" name="vanity_house" value="1"<?=(check_perms('artist_edit_vanityhouse') ? '' : ' disabled="disabled"' )?><?=($VanityHouse ? ' checked="checked"' : '')?> /></h3>
|
||||
<h3>Edit summary</h3>
|
||||
<h3>
|
||||
<label>Vanity House: <input type="checkbox" name="vanity_house" value="1"<?=(check_perms('artist_edit_vanityhouse') ? '' : ' disabled="disabled"' )?><?=($VanityHouse ? ' checked="checked"' : '')?> /></label>
|
||||
</h3>
|
||||
<h3>Edit summary:</h3>
|
||||
<input type="text" name="summary" size="92" /><br />
|
||||
<div style="text-align: center;">
|
||||
<input type="submit" value="Submit" />
|
||||
@ -59,7 +61,7 @@
|
||||
</form>
|
||||
</div>
|
||||
<? if (check_perms('torrents_edit')) { ?>
|
||||
<h2>Rename</h2>
|
||||
<h2>Rename this artist</h2>
|
||||
<div class="box pad">
|
||||
<form class="rename_form" name="artist" action="artist.php" method="post">
|
||||
<input type="hidden" name="action" value="rename" />
|
||||
@ -70,7 +72,6 @@
|
||||
<div style="text-align: center;">
|
||||
<input type="submit" value="Rename" />
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
@ -82,7 +83,7 @@
|
||||
<input type="hidden" name="auth" value="<?=$LoggedUser['AuthKey']?>" />
|
||||
<input type="hidden" name="artistid" value="<?=$ArtistID?>" />
|
||||
<div>
|
||||
<em>Merges this artist (<?=$Name?>) into the artist specified below (without redirection), so that "<?=$Name?>" (and its aliases) will appear as a non-redirecting alias of the artist entered in the text box below.</em><br /><br />
|
||||
<p>Merges this artist ("<?=$Name?>") into the artist specified below (without redirection), so that ("<?=$Name?>") and its aliases will appear as a non-redirecting alias of the artist entered in the text box below.</p><br />
|
||||
<div style="text-align: center;">
|
||||
<label for="newartistid">Artist ID:</label> <input type="text" id="newartistid" name="newartistid" size="40" value="" /><br />
|
||||
<strong>OR</strong><br />
|
||||
@ -94,41 +95,59 @@
|
||||
</form>
|
||||
</div>
|
||||
|
||||
<h2>Aliases</h2>
|
||||
<h2>Artist aliases</h2>
|
||||
<div class="box pad">
|
||||
<ul>
|
||||
<h3>List of existing artist aliases</h3>
|
||||
<div class="pad">
|
||||
<ul>
|
||||
|
||||
<?
|
||||
$DB->query("SELECT AliasID, Name, UserID, Redirect FROM artists_alias WHERE ArtistID='$ArtistID'");
|
||||
$DB->query("
|
||||
SELECT AliasID, Name, UserID, Redirect
|
||||
FROM artists_alias
|
||||
WHERE ArtistID = '$ArtistID'");
|
||||
while (list($AliasID, $AliasName, $User, $Redirect) = $DB->next_record(MYSQLI_NUM, true)) {
|
||||
if ($AliasName == $Name) {
|
||||
$DefaultRedirectID = $AliasID;
|
||||
}
|
||||
?>
|
||||
<li>
|
||||
<span title="Alias ID"><?=$AliasID?></span>. <span title="Alias name"><?=$AliasName?></span>
|
||||
<li>
|
||||
<span title="Alias ID"><?=$AliasID?></span>. <span title="Alias name"><?=$AliasName?></span>
|
||||
<? if ($User) { ?>
|
||||
<a href="user.php?id=<?=$User?>" title="Alias creator" class="brackets">User</a>
|
||||
<a href="user.php?id=<?=$User?>" title="Alias creator" class="brackets">User</a>
|
||||
<? }
|
||||
if ($Redirect) { ?>
|
||||
(writes redirect to <span title="Target alias ID"><?=$Redirect?></span>)
|
||||
(writes redirect to <span title="Target alias ID"><?=$Redirect?></span>)
|
||||
<? } ?>
|
||||
<a href="artist.php?action=delete_alias&aliasid=<?=$AliasID?>&auth=<?=$LoggedUser['AuthKey']?>" title="Delete this alias" class="brackets">X</a>
|
||||
</li>
|
||||
<a href="artist.php?action=delete_alias&aliasid=<?=$AliasID?>&auth=<?=$LoggedUser['AuthKey']?>" title="Delete this alias" class="brackets">X</a>
|
||||
</li>
|
||||
<? }
|
||||
?>
|
||||
</ul>
|
||||
<form class="add_form" name="aliases" action="artist.php" method="post">
|
||||
<input type="hidden" name="action" value="add_alias" />
|
||||
<input type="hidden" name="auth" value="<?=$LoggedUser['AuthKey']?>" />
|
||||
<input type="hidden" name="artistid" value="<?=$ArtistID?>" />
|
||||
<h3>Name:</h3>
|
||||
<input type="text" name="name" size="40" value="<?=$Name?>" /><br />
|
||||
<h3>Writes redirect to (enter an Alias ID; leave blank or enter "0" for no redirect):</h3>
|
||||
<input type="text" name="redirect" size="40" value="<?=$DefaultRedirectID?>" /><br />
|
||||
<em>This redirects artist names as they are written (e.g. when new torrents are uploaded or artists added). All uses of this new alias will be redirected to the alias ID you enter here. Use for common misspellings, etc.</em><br />
|
||||
<input type="submit" value="Add alias" />
|
||||
</form>
|
||||
</ul>
|
||||
</div>
|
||||
<br />
|
||||
<h3>Add a new artist alias</h3>
|
||||
<div class="pad">
|
||||
<p>This redirects artist names as they are written (e.g. when new torrents are uploaded or artists added). All uses of this new alias will be redirected to the alias ID you enter here. Use for common misspellings, inclusion of diacritical marks, etc.</p>
|
||||
<form class="add_form" name="aliases" action="artist.php" method="post">
|
||||
<input type="hidden" name="action" value="add_alias" />
|
||||
<input type="hidden" name="auth" value="<?=$LoggedUser['AuthKey']?>" />
|
||||
<input type="hidden" name="artistid" value="<?=$ArtistID?>" />
|
||||
<div class="field_div">
|
||||
<span class="label"><strong>Name:</strong></span>
|
||||
<br />
|
||||
<input type="text" name="name" size="40" value="<?=$Name?>" />
|
||||
</div>
|
||||
<div class="field_div">
|
||||
<span class="label"><strong>Writes redirect to (enter an Alias ID; leave blank or enter "0" for no redirect):</strong></span>
|
||||
<br />
|
||||
<input type="text" name="redirect" size="40" value="<?=$DefaultRedirectID?>" /><br />
|
||||
</div>
|
||||
<div class="submit_div">
|
||||
<input type="submit" value="Add alias" />
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
<? } ?>
|
||||
</div>
|
||||
|
@ -16,11 +16,11 @@
|
||||
error(0);
|
||||
}
|
||||
|
||||
include(SERVER_ROOT.'/classes/wiki.class.php'); // Wiki class
|
||||
$Wiki = new WIKI('wiki_artists', $ArtistID, "artist.php?id=$ArtistID");
|
||||
|
||||
// Get the artist name and the body of the last revision
|
||||
$DB->query("SELECT Name FROM artists_group WHERE ArtistID='$ArtistID'");
|
||||
$DB->query("
|
||||
SELECT Name
|
||||
FROM artists_group
|
||||
WHERE ArtistID = '$ArtistID'");
|
||||
list($Name) = $DB->next_record(MYSQLI_NUM, true);
|
||||
|
||||
View::show_header("Revision history for $Name"); // Set title
|
||||
@ -32,7 +32,8 @@
|
||||
<h2>Revision history for <a href="artist.php?id=<?=$ArtistID?>"><?=$Name?></a></h2>
|
||||
</div>
|
||||
<?
|
||||
$Wiki->revision_history(); // the wiki class takes over from here
|
||||
// the Wiki class takes over from here
|
||||
Wiki::revision_history('wiki_artists', $ArtistID, "artist.php?id=$ArtistID");
|
||||
?>
|
||||
</div>
|
||||
<?
|
||||
|
@ -563,9 +563,9 @@ function generate_torrent_table($Caption, $Tag, $Details, $Limit) {
|
||||
<?
|
||||
if ($IsBookmarked) {
|
||||
?>
|
||||
<a href="#" id="bookmarklink_torrent_<?=$GroupID?>" class="remove_bookmark" title="Remove bookmark" onclick="Unbookmark('torrent',<?=$GroupID?>,'Bookmark');return false;">Unbookmark</a>
|
||||
<a href="#" id="bookmarklink_torrent_<?=$GroupID?>" class="remove_bookmark brackets" title="Remove bookmark" onclick="Unbookmark('torrent', <?=$GroupID?>, 'Bookmark'); return false;">Unbookmark</a>
|
||||
<? } else { ?>
|
||||
<a href="#" id="bookmarklink_torrent_<?=$GroupID?>" class="add_bookmark" title="Add bookmark" onclick="Bookmark('torrent',<?=$GroupID?>,'Unbookmark');return false;">Bookmark</a>
|
||||
<a href="#" id="bookmarklink_torrent_<?=$GroupID?>" class="add_bookmark brackets" title="Add bookmark" onclick="Bookmark('torrent', <?=$GroupID?>, 'Unbookmark'); return false;">Bookmark</a>
|
||||
<? } ?>
|
||||
</span>
|
||||
<div class="tags"><?=$TorrentTags->format()?></div>
|
||||
|
@ -163,7 +163,7 @@ function compare($X, $Y) {
|
||||
<div id="covers">
|
||||
<div id="cover_div_<?=$Index?>" class="pad">
|
||||
<? if ($WikiImage != '') { ?>
|
||||
<p align="center"><img width="100%" src="<?=ImageTools::process($WikiImage, true)?>" alt="<?=$AltName?>" onclick="lightbox.init('<?=ImageTools::process($WikiImage)?>',220);" /></p>
|
||||
<p align="center"><img width="100%" src="<?=ImageTools::process($WikiImage, true)?>" alt="<?=$AltName?>" onclick="lightbox.init('<?=ImageTools::process($WikiImage)?>', 220);" /></p>
|
||||
<? } else { ?>
|
||||
<p align="center"><img src="<?=STATIC_SERVER?>common/noartwork/<?=$CategoryIcons[$GroupCategoryID - 1]?>" alt="<?=$Categories[$GroupCategoryID - 1]?>" title="<?=$Categories[$GroupCategoryID - 1]?>" width="220" height="220" border="0" /></p>
|
||||
<?
|
||||
@ -188,7 +188,7 @@ function compare($X, $Y) {
|
||||
<li>
|
||||
<?=$Summary?>
|
||||
<?=(check_perms('users_mod') ? ' added by ' . Users::format_username($AddedBy, false, false, false, false, false) : '')?>
|
||||
<span class="remove remove_cover_art"><a href="#" onclick="ajax.get('torrents.php?action=remove_cover_art&auth=<?=$LoggedUser['AuthKey']?>&id=<?=$ImageID?>&groupid=<?=$GroupID?>');this.parentNode.parentNode.parentNode.style.display = 'none';this.parentNode.parentNode.parentNode.previousElementSibling.style.display = 'none';" class="brackets" title="Remove Image">X</a></span>
|
||||
<span class="remove remove_cover_art"><a href="#" onclick="ajax.get('torrents.php?action=remove_cover_art&auth=<?=$LoggedUser['AuthKey']?>&id=<?=$ImageID?>&groupid=<?=$GroupID?>'); this.parentNode.parentNode.parentNode.style.display = 'none'; this.parentNode.parentNode.parentNode.previousElementSibling.style.display = 'none';" class="brackets" title="Remove Image">X</a></span>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
@ -244,8 +244,8 @@ function compare($X, $Y) {
|
||||
$AliasID = $Artist['id'];
|
||||
}
|
||||
?>
|
||||
(<?=$AliasID?>)
|
||||
<span class="remove remove_artist"><a href="javascript:void(0);" onclick="ajax.get('torrents.php?action=delete_alias&auth=' + authkey + '&groupid=<?=$GroupID?>&artistid=<?=$Artist['id']?>&importance=4');this.parentNode.parentNode.style.display = 'none';" class="brackets" title="Remove artist">X</a></span>
|
||||
(<span title="Artist alias ID"><?=$AliasID?></span>)
|
||||
<span class="remove remove_artist"><a href="javascript:void(0);" onclick="ajax.get('torrents.php?action=delete_alias&auth=' + authkey + '&groupid=<?=$GroupID?>&artistid=<?=$Artist['id']?>&importance=4'); this.parentNode.parentNode.style.display = 'none';" class="brackets" title="Remove artist">X</a></span>
|
||||
<? } ?>
|
||||
</li>
|
||||
<? }
|
||||
@ -257,14 +257,19 @@ function compare($X, $Y) {
|
||||
<li class="artists_dj">
|
||||
<?=Artists::display_artist($Artist).' ‎'?>
|
||||
<? if (check_perms('torrents_edit')) {
|
||||
$DB->query("SELECT AliasID FROM artists_alias WHERE ArtistID = ".$Artist['id']." AND ArtistID != AliasID AND Name = '".db_string($Artist['name'])."'");
|
||||
$DB->query("
|
||||
SELECT AliasID
|
||||
FROM artists_alias
|
||||
WHERE ArtistID = ".$Artist['id']."
|
||||
AND ArtistID != AliasID
|
||||
AND Name = '".db_string($Artist['name'])."'");
|
||||
list($AliasID) = $DB->next_record();
|
||||
if (empty($AliasID)) {
|
||||
$AliasID = $Artist['id'];
|
||||
}
|
||||
?>
|
||||
(<?=$AliasID?>)
|
||||
<span class="remove remove_artist"><a href="javascript:void(0);" onclick="ajax.get('torrents.php?action=delete_alias&auth=' + authkey + '&groupid=<?=$GroupID?>&artistid=<?=$Artist['id']?>&importance=6');this.parentNode.parentNode.style.display = 'none';" class="brackets" title="Remove artist">X</a></span>
|
||||
(<span title="Artist alias ID"><?=$AliasID?></span>)
|
||||
<span class="remove remove_artist"><a href="javascript:void(0);" onclick="ajax.get('torrents.php?action=delete_alias&auth=' + authkey + '&groupid=<?=$GroupID?>&artistid=<?=$Artist['id']?>&importance=6'); this.parentNode.parentNode.style.display = 'none';" class="brackets" title="Remove artist">X</a></span>
|
||||
<? } ?>
|
||||
</li>
|
||||
<?
|
||||
@ -285,8 +290,8 @@ function compare($X, $Y) {
|
||||
$AliasID = $Artist['id'];
|
||||
}
|
||||
?>
|
||||
(<?=$AliasID?>)
|
||||
<span class="remove remove_artist"><a href="javascript:void(0);" onclick="ajax.get('torrents.php?action=delete_alias&auth=' + authkey + '&groupid=<?=$GroupID?>&artistid=<?=$Artist['id']?>&importance=1');this.parentNode.parentNode.style.display = 'none';" class="brackets" title="Remove artist">X</a></span>
|
||||
(<span title="Artist alias ID"><?=$AliasID?></span>)
|
||||
<span class="remove remove_artist"><a href="javascript:void(0);" onclick="ajax.get('torrents.php?action=delete_alias&auth=' + authkey + '&groupid=<?=$GroupID?>&artistid=<?=$Artist['id']?>&importance=1'); this.parentNode.parentNode.style.display = 'none';" class="brackets" title="Remove artist">X</a></span>
|
||||
<? } ?>
|
||||
</li>
|
||||
<?
|
||||
@ -298,14 +303,19 @@ function compare($X, $Y) {
|
||||
<li class="artist_guest">
|
||||
<?=Artists::display_artist($Artist).' ‎'?>
|
||||
<? if (check_perms('torrents_edit')) {
|
||||
$DB->query("SELECT AliasID FROM artists_alias WHERE ArtistID = ".$Artist['id']." AND ArtistID != AliasID AND Name = '".db_string($Artist['name'])."'");
|
||||
$DB->query("
|
||||
SELECT AliasID
|
||||
FROM artists_alias
|
||||
WHERE ArtistID = ".$Artist['id']."
|
||||
AND ArtistID != AliasID
|
||||
AND Name = '".db_string($Artist['name'])."'");
|
||||
list($AliasID) = $DB->next_record();
|
||||
if (empty($AliasID)) {
|
||||
$AliasID = $Artist['id'];
|
||||
}
|
||||
?>
|
||||
(<?=$AliasID?>)
|
||||
<span class="remove remove_artist"><a href="javascript:void(0);" onclick="ajax.get('torrents.php?action=delete_alias&auth=' + authkey + '&groupid=<?=$GroupID?>&artistid=<?=$Artist['id']?>&importance=2');this.parentNode.parentNode.style.display = 'none';" class="brackets" title="Remove artist">X</a></span>
|
||||
(<span title="Artist alias ID"><?=$AliasID?></span>)
|
||||
<span class="remove remove_artist"><a href="javascript:void(0);" onclick="ajax.get('torrents.php?action=delete_alias&auth=' + authkey + '&groupid=<?=$GroupID?>&artistid=<?=$Artist['id']?>&importance=2'); this.parentNode.parentNode.style.display = 'none';" class="brackets" title="Remove artist">X</a></span>
|
||||
<? } ?>
|
||||
</li>
|
||||
<?
|
||||
@ -318,14 +328,19 @@ function compare($X, $Y) {
|
||||
<li class="artists_conductors">
|
||||
<?=Artists::display_artist($Artist).' ‎'?>
|
||||
<? if (check_perms('torrents_edit')) {
|
||||
$DB->query("SELECT AliasID FROM artists_alias WHERE ArtistID = ".$Artist['id']." AND ArtistID != AliasID AND Name = '".db_string($Artist['name'])."'");
|
||||
$DB->query("
|
||||
SELECT AliasID
|
||||
FROM artists_alias
|
||||
WHERE ArtistID = ".$Artist['id']."
|
||||
AND ArtistID != AliasID
|
||||
AND Name = '".db_string($Artist['name'])."'");
|
||||
list($AliasID) = $DB->next_record();
|
||||
if (empty($AliasID)) {
|
||||
$AliasID = $Artist['id'];
|
||||
}
|
||||
?>
|
||||
(<?=$AliasID?>)
|
||||
<span class="remove remove_artist"><a href="javascript:void(0);" onclick="ajax.get('torrents.php?action=delete_alias&auth=' + authkey + '&groupid=<?=$GroupID?>&artistid=<?=$Artist['id']?>&importance=5');this.parentNode.parentNode.style.display = 'none';" class="brackets" title="Remove conductor">X</a></span>
|
||||
(<span title="Artist alias ID"><?=$AliasID?></span>)
|
||||
<span class="remove remove_artist"><a href="javascript:void(0);" onclick="ajax.get('torrents.php?action=delete_alias&auth=' + authkey + '&groupid=<?=$GroupID?>&artistid=<?=$Artist['id']?>&importance=5'); this.parentNode.parentNode.style.display = 'none';" class="brackets" title="Remove conductor">X</a></span>
|
||||
<? } ?>
|
||||
</li>
|
||||
<?
|
||||
@ -338,14 +353,19 @@ function compare($X, $Y) {
|
||||
<li class="artists_remix">
|
||||
<?=Artists::display_artist($Artist).' ‎'?>
|
||||
<? if (check_perms('torrents_edit')) {
|
||||
$DB->query("SELECT AliasID FROM artists_alias WHERE ArtistID = ".$Artist['id']." AND ArtistID != AliasID AND Name = '".db_string($Artist['name'])."'");
|
||||
$DB->query("
|
||||
SELECT AliasID
|
||||
FROM artists_alias
|
||||
WHERE ArtistID = ".$Artist['id']."
|
||||
AND ArtistID != AliasID
|
||||
AND Name = '".db_string($Artist['name'])."'");
|
||||
list($AliasID) = $DB->next_record();
|
||||
if (empty($AliasID)) {
|
||||
$AliasID = $Artist['id'];
|
||||
}
|
||||
?>
|
||||
(<?=$AliasID?>)
|
||||
<span class="remove remove_artist"><a href="javascript:void(0);" onclick="ajax.get('torrents.php?action=delete_alias&auth=' + authkey + '&groupid=<?=$GroupID?>&artistid=<?=$Artist['id']?>&importance=3');this.parentNode.parentNode.style.display = 'none';" class="brackets" title="Remove artist">X</a></span>
|
||||
(<span title="Artist alias ID"><?=$AliasID?></span>)
|
||||
<span class="remove remove_artist"><a href="javascript:void(0);" onclick="ajax.get('torrents.php?action=delete_alias&auth=' + authkey + '&groupid=<?=$GroupID?>&artistid=<?=$Artist['id']?>&importance=3'); this.parentNode.parentNode.style.display = 'none';" class="brackets" title="Remove artist">X</a></span>
|
||||
<? } ?>
|
||||
</li>
|
||||
<?
|
||||
@ -357,20 +377,21 @@ function compare($X, $Y) {
|
||||
?>
|
||||
<li class="artists_producer">
|
||||
<?=Artists::display_artist($Artist).' ‎'?>
|
||||
<? if (check_perms('torrents_edit')) {
|
||||
$DB->query("
|
||||
SELECT AliasID
|
||||
FROM artists_alias
|
||||
WHERE ArtistID = ".$Artist['id']."
|
||||
AND ArtistID != AliasID
|
||||
AND Name = '".db_string($Artist['name'])."'");
|
||||
list($AliasID) = $DB->next_record();
|
||||
if (empty($AliasID)) {
|
||||
$AliasID = $Artist['id'];
|
||||
}
|
||||
<?
|
||||
if (check_perms('torrents_edit')) {
|
||||
$DB->query("
|
||||
SELECT AliasID
|
||||
FROM artists_alias
|
||||
WHERE ArtistID = ".$Artist['id']."
|
||||
AND ArtistID != AliasID
|
||||
AND Name = '".db_string($Artist['name'])."'");
|
||||
list($AliasID) = $DB->next_record();
|
||||
if (empty($AliasID)) {
|
||||
$AliasID = $Artist['id'];
|
||||
}
|
||||
?>
|
||||
(<?=$AliasID?>)
|
||||
<span class="remove remove_artist"><a href="javascript:void(0);" onclick="ajax.get('torrents.php?action=delete_alias&auth=' + authkey + '&groupid=<?=$GroupID?>&artistid=<?=$Artist['id']?>&importance=7');this.parentNode.parentNode.style.display = 'none';" class="brackets" title="Remove producer">X</a></span>
|
||||
(<span title="Artist alias ID"><?=$AliasID?></span>)
|
||||
<span class="remove remove_artist"><a href="javascript:void(0);" onclick="ajax.get('torrents.php?action=delete_alias&auth=' + authkey + '&groupid=<?=$GroupID?>&artistid=<?=$Artist['id']?>&importance=7'); this.parentNode.parentNode.style.display = 'none';" class="brackets" title="Remove producer">X</a></span>
|
||||
<? } ?>
|
||||
</li>
|
||||
<?
|
||||
|
@ -1,15 +1,15 @@
|
||||
<?
|
||||
/************************************************************************
|
||||
||------------|| Edit artist wiki page ||------------------------------||
|
||||
||------------|| Edit torrent group wiki page ||-----------------------||
|
||||
|
||||
This page is the page that is displayed when someone feels like editing
|
||||
an artist's wiki page.
|
||||
a torrent group's wiki page.
|
||||
|
||||
It is called when $_GET['action'] == 'edit'. $_GET['artistid'] is the
|
||||
ID of the artist, and must be set.
|
||||
It is called when $_GET['action'] == 'edit'. $_GET['groupid'] is the
|
||||
ID of the torrent group and must be set.
|
||||
|
||||
The page inserts a new revision into the wiki_artists table, and clears
|
||||
the cache for the artist page.
|
||||
The page inserts a new revision into the wiki_torrents table, and clears
|
||||
the cache for the torrent group page.
|
||||
|
||||
************************************************************************/
|
||||
|
||||
@ -18,7 +18,7 @@
|
||||
error(0);
|
||||
}
|
||||
|
||||
// Get the artist name and the body of the last revision
|
||||
// Get the torrent group name and the body of the last revision
|
||||
$DB->query("
|
||||
SELECT
|
||||
tg.Name,
|
||||
@ -59,9 +59,9 @@
|
||||
<input type="hidden" name="action" value="takegroupedit" />
|
||||
<input type="hidden" name="auth" value="<?=$LoggedUser['AuthKey']?>" />
|
||||
<input type="hidden" name="groupid" value="<?=$GroupID?>" />
|
||||
<h3>Image</h3>
|
||||
<h3>Image:</h3>
|
||||
<input type="text" name="image" size="92" value="<?=$Image?>" /><br />
|
||||
<h3>Description</h3>
|
||||
<h3>Torrent group description:</h3>
|
||||
<textarea name="body" cols="91" rows="20"><?=$Body?></textarea><br />
|
||||
<? if ($CategoryID == 1) { ?>
|
||||
<select id="releasetype" name="releasetype">
|
||||
@ -78,7 +78,7 @@
|
||||
}
|
||||
}
|
||||
?>
|
||||
<h3>Edit summary</h3>
|
||||
<h3>Edit summary:</h3>
|
||||
<input type="text" name="summary" size="92" /><br />
|
||||
<div style="text-align: center;">
|
||||
<input type="submit" value="Submit" />
|
||||
@ -93,7 +93,7 @@
|
||||
WHERE GroupID = $GroupID");
|
||||
//Users can edit the group info if they've uploaded a torrent to the group or have torrents_edit
|
||||
if (in_array($LoggedUser['ID'], $DB->collect('UserID')) || check_perms('torrents_edit')) { ?>
|
||||
<h3>Non-wiki group editing</h3>
|
||||
<h3>Non-wiki torrent group editing</h3>
|
||||
<div class="box pad">
|
||||
<form class="edit_form" name="torrent_group" action="torrents.php" method="post">
|
||||
<input type="hidden" name="action" value="nonwikiedit" />
|
||||
@ -146,7 +146,7 @@
|
||||
}
|
||||
if (check_perms('torrents_edit')) {
|
||||
?>
|
||||
<h3>Rename (won't merge)</h3>
|
||||
<h3>Rename (will not merge)</h3>
|
||||
<div class="box pad">
|
||||
<form class="rename_form" name="torrent_group" action="torrents.php" method="post">
|
||||
<div>
|
||||
@ -167,7 +167,7 @@
|
||||
<input type="hidden" name="action" value="merge" />
|
||||
<input type="hidden" name="auth" value="<?=$LoggedUser['AuthKey']?>" />
|
||||
<input type="hidden" name="groupid" value="<?=$GroupID?>" />
|
||||
<h3>Target Group ID</h3>
|
||||
<h3>Target torrent group ID</h3>
|
||||
<input type="text" name="targetgroupid" size="10" />
|
||||
<div style="text-align: center;">
|
||||
<input type="submit" value="Merge" />
|
||||
|
@ -1,13 +1,13 @@
|
||||
<?
|
||||
/************************************************************************
|
||||
||------------|| Artist wiki history page ||---------------------------||
|
||||
||------------|| Torrent group wiki history page ||--------------------||
|
||||
|
||||
This page lists previous revisions of the artists page. It gets called
|
||||
if $_GET['action'] == 'history'.
|
||||
This page lists previous revisions of the torrent group page. It gets
|
||||
called if $_GET['action'] == 'history'.
|
||||
|
||||
It also requires $_GET['artistid'].
|
||||
It also requires $_GET['groupid'].
|
||||
|
||||
The wiki class is used here to generate the page history.
|
||||
The Wiki class is used here to generate the page history.
|
||||
|
||||
************************************************************************/
|
||||
|
||||
@ -16,11 +16,11 @@
|
||||
error(0);
|
||||
}
|
||||
|
||||
include(SERVER_ROOT.'/classes/wiki.class.php'); // Wiki class
|
||||
$Wiki = new WIKI('wiki_torrents', $GroupID, "/torrents.php?id=$GroupID");
|
||||
|
||||
// Get the artist name and the body of the last revision
|
||||
$DB->query("SELECT Name FROM torrents_group WHERE ID='$GroupID'");
|
||||
// Get the torrent group name and the body of the last revision
|
||||
$DB->query("
|
||||
SELECT Name
|
||||
FROM torrents_group
|
||||
WHERE ID = '$GroupID'");
|
||||
list($Name) = $DB->next_record();
|
||||
|
||||
if (!$Name) {
|
||||
@ -36,7 +36,8 @@
|
||||
<h2>Revision history for <a href="torrents.php?id=<?=$GroupID?>"><?=$Name?></a></h2>
|
||||
</div>
|
||||
<?
|
||||
$Wiki->revision_history(); // the wiki class takes over from here
|
||||
// the Wiki class takes over from here
|
||||
Wiki::revision_history('wiki_torrents', $GroupID, "/torrents.php?id=$GroupID");
|
||||
?>
|
||||
</div>
|
||||
<?
|
||||
|
@ -1,6 +1,6 @@
|
||||
<?
|
||||
|
||||
//TODO: restrict to viewing bellow class, username in h2
|
||||
//TODO: restrict to viewing below class, username in h2
|
||||
if (isset($_GET['userid']) && check_perms('users_view_ips') && check_perms('users_logout')) {
|
||||
if (!is_number($_GET['userid'])) {
|
||||
error(404);
|
||||
@ -13,15 +13,21 @@
|
||||
if (isset($_POST['all'])) {
|
||||
authorize();
|
||||
|
||||
$DB->query("DELETE FROM users_sessions WHERE UserID='$UserID' AND SessionID != '$SessionID'");
|
||||
$Cache->delete_value('users_sessions_'.$UserID);
|
||||
$DB->query("
|
||||
DELETE FROM users_sessions
|
||||
WHERE UserID = '$UserID'
|
||||
AND SessionID != '$SessionID'");
|
||||
$Cache->delete_value('users_sessions_'.$UserID);
|
||||
}
|
||||
|
||||
if (isset($_POST['session'])) {
|
||||
authorize();
|
||||
|
||||
$DB->query("DELETE FROM users_sessions WHERE UserID='$UserID' AND SessionID='".db_string($_POST['session'])."'");
|
||||
$Cache->delete_value('users_sessions_'.$UserID);
|
||||
$DB->query("
|
||||
DELETE FROM users_sessions
|
||||
WHERE UserID = '$UserID'
|
||||
AND SessionID = '".db_string($_POST['session'])."'");
|
||||
$Cache->delete_value('users_sessions_'.$UserID);
|
||||
}
|
||||
|
||||
$UserSessions = $Cache->get_value('users_sessions_'.$UserID);
|
||||
@ -34,9 +40,9 @@
|
||||
IP,
|
||||
LastUpdate
|
||||
FROM users_sessions
|
||||
WHERE UserID='$UserID'
|
||||
WHERE UserID = '$UserID'
|
||||
ORDER BY LastUpdate DESC");
|
||||
$UserSessions = $DB->to_array('SessionID',MYSQLI_ASSOC);
|
||||
$UserSessions = $DB->to_array('SessionID', MYSQLI_ASSOC);
|
||||
$Cache->cache_value('users_sessions_'.$UserID, $UserSessions, 0);
|
||||
}
|
||||
|
||||
@ -44,17 +50,17 @@
|
||||
View::show_header($Username.' > Sessions');
|
||||
?>
|
||||
<div class="thin">
|
||||
<h2><?=Users::format_username($UserID,$Username)?> > Sessions</h2>
|
||||
<h2><?=Users::format_username($UserID, $Username)?> > Sessions</h2>
|
||||
<div class="box pad">
|
||||
<p>Note: Clearing cookies can result in ghost sessions which are automatically removed after 30 days.</p>
|
||||
</div>
|
||||
<div class="box pad">
|
||||
<table cellpadding="5" cellspacing="1" border="0" class="session_table border" width="100%">
|
||||
<tr class="colhead">
|
||||
<td><strong>IP</strong></td>
|
||||
<td><strong>IP address</strong></td>
|
||||
<td><strong>Browser</strong></td>
|
||||
<td><strong>Platform</strong></td>
|
||||
<td><strong>Last Activity</strong></td>
|
||||
<td><strong>Last activity</strong></td>
|
||||
<td>
|
||||
<form class="manage_form" name="sessions" action="" method="post">
|
||||
<input type="hidden" name="action" value="sessions" />
|
||||
@ -67,7 +73,7 @@
|
||||
<?
|
||||
$Row = 'a';
|
||||
foreach ($UserSessions as $Session) {
|
||||
list($ThisSessionID,$Browser,$OperatingSystem,$IP,$LastUpdate) = array_values($Session);
|
||||
list($ThisSessionID, $Browser, $OperatingSystem, $IP, $LastUpdate) = array_values($Session);
|
||||
$Row = ($Row == 'a') ? 'b' : 'a';
|
||||
?>
|
||||
<tr class="row<?=$Row?>">
|
||||
@ -84,7 +90,7 @@
|
||||
</form>
|
||||
</td>
|
||||
</tr>
|
||||
<? } ?>
|
||||
<? } ?>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -212,9 +212,7 @@ function displayCommStats(stats) {
|
||||
$(baseid + x).html('(' + stats[x] + ')');
|
||||
break;
|
||||
case 'seedingperc':
|
||||
if (stats[x] !== -1) {
|
||||
$(baseid + x).html('(' + stats[x] + '%)');
|
||||
}
|
||||
$(baseid + x).html('(' + stats[x] + '%)');
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
@ -302,13 +302,11 @@ ul.votedalbums li {
|
||||
}
|
||||
|
||||
tr.torrent .bookmark>a:before {
|
||||
content: "[ ";
|
||||
text-decoration: none;
|
||||
font-weight: normal;
|
||||
}
|
||||
|
||||
tr.torrent .bookmark>a:after {
|
||||
content: " ]";
|
||||
text-decoration: none;
|
||||
font-weight: normal;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user