<?php

/*
'**************************************************************************************************
' 程序名称: CCTVAI开源音乐管理系统
' 官方网站: http://www.cctvai.com
' 联系 Q Q: 1542367792
' QQ交流群：136687984
' 版本：(终结版)
' 备注：未经书面授权，不得向任何第三方提供本软件系统！
' 功能，模板，插件，扩展，定制请联系QQ：1542367792
'**************************************************************************************************
*/
error_reporting(0);
$cd_id=SafeRequest("id", "get");
$action=SafeRequest("ac", "get");
if ($action=="feed") {
	$title="的动态";
} elseif ($action=="miniblog") {
	$title="的说说";
} elseif ($action=="fav") {
	$title="的收藏";
} elseif ($action=="vfav") {
	$title="的收藏";
} elseif ($action=="dance") {
	$title="的音乐";
} elseif ($action=="video") {
	$title="的视频";
} elseif ($action=="album") {
	$title="的照片";
} elseif ($action=="friend") {
	$title="的关系";
} elseif ($action=="fans") {
	$title="的粉丝团";
} elseif ($action=="wall") {
	$title="的留言板";
} else {
	$title="的音乐空间";
}
if (!IsNumID($cd_id)) {
	$error="您提交的Url地址无法访问,请检查是否包含非法字符！";
	exit(include _cctvai_root_ . "/include/error/content_error.php");
} else {
	global $db;
	$sql='select * from ' . tname('user') . " where cd_id='".$cd_id."'";
	$result=$db->query($sql);
	if ($row=$db->fetch_array($result)) {
		$cctvai_web_userid=$row["cd_id"];
		$cctvai_web_username=$row["cd_name"];
		$cctvai_web_nicheng=$row["cd_nicheng"];
		$cctvai_web_password=$row["cd_password"];
		$cctvai_web_email=$row["cd_email"];
		$cctvai_web_sex=$row["cd_sex"];
		$cctvai_web_regdate=$row["cd_regdate"];
		$cctvai_web_loginip=$row["cd_loginip"];
		$cctvai_web_loginnum=$row["cd_loginnum"];
		$cctvai_web_qq=$row["cd_qq"];
		$cctvai_web_logintime=$row["cd_logintime"];
		$cctvai_web_grade=$row["cd_grade"];
		$cctvai_web_lock=$row["cd_lock"];
		$cctvai_web_points=$row["cd_points"];
		$cctvai_web_photo=$row["cd_photo"];
		$cctvai_web_sign=$row["cd_sign"];
		$cctvai_web_hidden=$row["cd_hidden"];
		$cctvai_web_birthprovince=$row["cd_birthprovince"];
		$cctvai_web_birthcity=$row["cd_birthcity"];
		$cctvai_web_resideprovince=$row["cd_resideprovince"];
		$cctvai_web_residecity=$row["cd_residecity"];
		$cctvai_web_birthday=$row["cd_birthday"];
		$cctvai_web_vipindate=$row["cd_vipindate"];
		$cctvai_web_vipenddate=$row["cd_vipenddate"];
		$cctvai_web_vipgrade=$row["cd_vipgrade"];
		$cctvai_web_viprank=$row["cd_viprank"];
		$cctvai_web_verified=$row["cd_verified"];
		$cctvai_web_djmub=$row["cd_djmub"];
		$cctvai_web_ufav=$row["cd_ufav"];
		$cctvai_web_ufans=$row["cd_ufans"];
		$cctvai_web_hits=$row["cd_hits"];
		$cctvai_web_isbest=$row["cd_isbest"];
		$cctvai_web_money=$row["cd_money"];
		$cctvai_web_weblock=$row["cd_weblock"];
		$cctvai_web_signd=$row["cd_signd"];
		$cctvai_web_signdcumu=$row["cd_signdcumu"];
		$cctvai_web_signdtime=$row["cd_signdtime"];
		$cctvai_web_skinid=$row["cd_skin"];
		$cctvai_web_friendnum=$row["cd_friendnum"];
		$cctvai_web_creditname=$row["cd_creditname"];
		$cctvai_web_rank=$row["cd_rank"];
		$cctvai_web_credit=$row["cd_credit"];
		$cctvai_web_qqopenid=$row["cd_qqopenid"];
		$cctvai_web_checkmm=$row["cd_checkmm"];
		$cctvai_web_checkmusic=$row["cd_checkmusic"];
		$cctvai_web_groupnum=$row["cd_groupnum"];
		$cookies="pmts_singer_$cd_id";
		if (!isset($_COOKIE[$cookies])) {
			$db->query('update ' . tname('user') . " set cd_hits=cd_hits+1 where cd_id='" . $cd_id . "'");
			setcookie($cookies, time(), time()+86400);
		}
		if($cctvai_web_lock<>"0"){
		$error="您访问的用户空间已被锁定！";
		exit(include _cctvai_root_ . "/include/error/content_error.php");
		} 
	} else {
		$error="您访问的用户空间不存在！";
		exit(include _cctvai_root_ . "/include/error/content_error.php");
	}
}
function getfilesize($str_filename) {
	if (file_exists($str_filename)) {
		$int_filesize=filesize($str_filename);
		if ($int_filesize<0) {
			if (strtolower(substr($_SERVER['OS'], 0, 3))=='win') {
				$int_filesize=0+exec('FOR %A IN ("' . $str_file . '") DO @ECHO %~zA');
			} else {
				$int_filesize=0+trim(`stat -c%s $str_file`);
			}
		}
	} else {
		$int_filesize=0;
	}
	return formatsize($int_filesize);
}
?>