Gazelle/sections/artist/index.php

116 lines
3.3 KiB
PHP
Raw Normal View History

2011-03-28 14:21:28 +00:00
<?
/**************************************************************************
Artists Switch Center
This page acts as a switch that includes the real artist pages (to keep
the root less cluttered).
enforce_login() is run here - the entire artist pages are off limits for
non members.
****************************************************************************/
// Width and height of similar artist map
define('WIDTH', 585);
define('HEIGHT', 400);
enforce_login();
if(!empty($_POST['action'])) {
switch ($_POST['action']) {
case 'edit':
require(SERVER_ROOT.'/sections/artist/takeedit.php');
break;
case 'download':
require(SERVER_ROOT.'/sections/artist/download.php');
break;
case 'rename':
require(SERVER_ROOT.'/sections/artist/rename.php');
break;
case 'add_similar':
require(SERVER_ROOT.'/sections/artist/add_similar.php');
break;
case 'add_alias':
require(SERVER_ROOT.'/sections/artist/add_alias.php');
break;
2012-04-02 08:00:21 +00:00
case 'change_artistid':
require(SERVER_ROOT.'/sections/artist/change_artistid.php');
break;
2011-03-28 14:21:28 +00:00
default:
error(0);
}
} elseif(!empty($_GET['action'])) {
switch ($_GET['action']) {
case 'edit':
require(SERVER_ROOT.'/sections/artist/edit.php');
break;
case 'delete':
require(SERVER_ROOT.'/sections/artist/delete.php');
break;
case 'revert':
require(SERVER_ROOT.'/sections/artist/takeedit.php');
break;
case 'history':
require(SERVER_ROOT.'/sections/artist/history.php');
break;
case 'vote_similar':
require(SERVER_ROOT.'/sections/artist/vote_similar.php');
break;
case 'delete_similar':
require(SERVER_ROOT.'/sections/artist/delete_similar.php');
break;
case 'similar':
require(SERVER_ROOT.'/sections/artist/similar.php');
break;
case 'similar_bg':
require(SERVER_ROOT.'/sections/artist/similar_bg.php');
break;
case 'notify':
require(SERVER_ROOT.'/sections/artist/notify.php');
break;
case 'notifyremove':
require(SERVER_ROOT.'/sections/artist/notifyremove.php');
break;
case 'delete_alias':
require(SERVER_ROOT.'/sections/artist/delete_alias.php');
break;
2012-04-02 08:00:21 +00:00
case 'change_artistid':
require(SERVER_ROOT.'/sections/artist/change_artistid.php');
break;
2011-03-28 14:21:28 +00:00
default:
error(0);
}
} else {
if(!empty($_GET['id'])) {
include (SERVER_ROOT.'/sections/artist/artist.php');
} elseif (!empty($_GET['artistname'])) {
2012-06-02 08:00:16 +00:00
$NameSearch = str_replace('\\', '\\\\', trim($_GET['artistname']));
2012-05-18 13:35:17 +00:00
$DB->query("SELECT ArtistID, Name FROM artists_alias WHERE Name LIKE '".db_string($NameSearch)."'");
if($DB->record_count() == 0) {
2011-03-28 14:21:28 +00:00
if(isset($LoggedUser['SearchType']) && $LoggedUser['SearchType']) {
header('Location: torrents.php?action=advanced&artistname='.urlencode($_GET['artistname']));
} else {
header('Location: torrents.php?searchstr='.urlencode($_GET['artistname']));
}
die();
}
2012-05-18 13:35:17 +00:00
list($FirstID, $Name) = $DB->next_record(MYSQLI_NUM, false);
if($DB->record_count() == 1 || !strcasecmp($Name,$NameSearch)) {
header('Location: artist.php?id='.$FirstID);
die();
}
while(list($ID, $Name) = $DB->next_record(MYSQLI_NUM, false)) {
if(!strcasecmp($Name,$NameSearch)) {
header('Location: artist.php?id='.$ID);
die();
}
}
header('Location: artist.php?id='.$FirstID);
die();
2011-03-28 14:21:28 +00:00
} else {
header('Location: torrents.php');
}
}
?>