Gazelle/sections/artist/index.php

129 lines
3.6 KiB
PHP
Raw Normal View History

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