<?php
/*
'**************************************************************************************************
' 程序名称: CCTVAI开源音乐管理系统
' 官方网站: http://www.cctvai.com
' 联系 Q Q: 1542367792
' QQ交流群：136687984
' 版本：(终结版)
' 备注：未经书面授权，不得向任何第三方提供本软件系统！
' 功能，模板，插件，扩展，定制请联系QQ：1542367792
'**************************************************************************************************
*/
error_reporting(0);
include '../include/cctvai.conn.php';
require_once("../include/cctvai.label.php");
$cctvai_IDA=$_SERVER['QUERY_STRING'];
$cctvai_IDA=ReplaceStr(ReplaceStr($cctvai_IDA, '.html', ''), 'id=', '');
$cctvai_IDB=explode(',', $cctvai_IDA);
$cctvai_IDC=$cctvai_IDB[1]; //栏目识别
$error="您访问的Url页面不存在，请检查Url是否正确或包含非法字符！";
if(cd_webhtml==1 or cd_webhtml==2 or cd_webhtml==3) {
	if($cctvai_IDB[1]) {
		switch($cctvai_IDB[0]) {
			case '0':
				if(cd_webhtml==1) {
				if (!preg_match("/^[a-zA-Z0-9\s]+$/", $cctvai_IDB[0])) {exit(include _cctvai_root_ . "/include/error/content_error.php");}
				if (!preg_match("/^[a-zA-Z0-9\s]+$/", $cctvai_IDB[1])) {exit(include _cctvai_root_ . "/include/error/content_error.php");}
				if (!preg_match("/^[a-zA-Z0-9\s]+$/", $cctvai_IDB[2])) {exit(include _cctvai_root_ . "/include/error/content_error.php");}
				}
				if(cd_mobile=="yes"){if (isMobile()){header("Location:".cd_mobileurl."artist_list.php?id=".$cctvai_IDC."");exit();}}
				$cache_id='artistlist_' . $cctvai_IDC . '_' . $cctvai_IDB[2];
				if(!($cache_opt->start($cache_id))) {
					if(cd_webhtml==3) {
						if($cctvai_IDB[3]) {
							echo SpansingerabcList("" . $cctvai_IDB[1] . "|" . $cctvai_IDB[2] . "");
						} else {
							echo SpansingerList($cctvai_IDC);
						}
					} else {
						echo SpansingerList($cctvai_IDC);
					}
					$cache_opt->end();
				}
				break;
			case '1':
				if (!IsNumID($cctvai_IDC)) {exit(include _cctvai_root_ . "/include/error/content_error.php");}
				if(cd_mobile=="yes"){if (isMobile()){header("Location:".cd_mobileurl."artist_p.php?id=".$cctvai_IDC."");exit();}}
				$cache_id='artistplay_' . $cctvai_IDC;
				if(!($cache_opt->start($cache_id))) {
					echo SpansingerPlay($cctvai_IDC);
					$cache_opt->end();
				}
				break;
			case '2':
				if(cd_webhtml==1) {
				if (!preg_match("/^[a-zA-Z0-9\s]+$/", $cctvai_IDB[0])) {exit(include _cctvai_root_ . "/include/error/content_error.php");}
				if (!preg_match("/^[a-zA-Z0-9\s]+$/", $cctvai_IDB[1])) {exit(include _cctvai_root_ . "/include/error/content_error.php");}
				if (!preg_match("/^[a-zA-Z0-9\s]+$/", $cctvai_IDB[2])) {exit(include _cctvai_root_ . "/include/error/content_error.php");}
				}
				if(cd_mobile=="yes"){if (isMobile()){header("Location:".cd_mobileurl."artist_list.php?id=".$cctvai_IDC."");exit();}}
				$cache_id='artistlists_' . $cctvai_IDC . '_' . $cctvai_IDB[2];
				if(!($cache_opt->start($cache_id))) {
					echo SpansingerabcList("" . $cctvai_IDC . "|" . $cctvai_IDB[2] . "");
					$cache_opt->end();
				}
				break;
			default:
				exit(include _cctvai_root_ . "/include/error/list_error.php");
		}
	} else {
		if(cd_mobile=="yes"){if (isMobile()){header("Location:".cd_mobileurl."artist.php");exit();}}
		$action=SafeRequest("action", "get");
		if($action=="html"){
		echo GetTemp('singer_index.html',0);	
		}else{
		if(cd_webhtml==1 or !file_exists('index.html')){
		$cache_id ='artist_index';
		if(!($cache_opt->start($cache_id))){
		echo GetTemp('singer_index.html',0);
		$cache_opt->end();
		}
		}else{
			header('Location:index.html');
			}
		}
	}
}
?>