<?php
include "../../include/cctvai.conn.php";
include "../../include/cctvai.inc.php";
global $db, $userlogined;
$ac=SafeRequest("ac", "get"); //类
$cd_id=SafeRequest("id", "get"); //ID
$cd_did=SafeRequest("did", "get"); //作者ID
$cd_pages=SafeRequest("pages", "get"); //翻页
if(!IsNumID($cd_id)) {
	exit('参数错误！');
}
switch($ac) {
	case 'dj':
		$row=$db->getrow("select * from " . tname('dj') . " where CD_ID='" . $cd_id . "'");
		$title='音乐评论';
		$channel='1';
		break;
	case 'video':
		$row=$db->getrow("select * from " . tname('video') . " where CD_ID='" . $cd_id . "'");
		$title='视频评论';
		$channel='2';
		break;
	case 'singer':
		$row=$db->getrow("select * from " . tname('singer') . " where CD_ID='" . $cd_id . "'");
		$title='歌手评论';
		$channel='3';
		break;
	case 'malbum':
		$row=$db->getrow("select * from " . tname('malbum') . " where CD_ID='" . $cd_id . "'");
		$title='音乐专辑评论';
		$channel='4';
		break;
	case 'valbum':
		$row=$db->getrow("select * from " . tname('valbum') . " where CD_ID='" . $cd_id . "'");
		$title='视频专辑评论';
		$channel='5';
		break;
	case 'news':
		$row=$db->getrow("select * from " . tname('news') . " where CD_ID='" . $cd_id . "'");
		$title='文章评论';
		$channel='6';
		break;
	default:
		exit("参数错误！");
}
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
 <head> 
  <meta http-equiv="Content-Type" content="text/html; charset=gb2312" /> 
  <title><?php echo $row['CD_Name']; ?> - <?php echo $title; ?> - <?php echo cd_webname; ?></title> 
  <script type="text/javascript">var web_url ="<?php echo cd_webpath?>";</script> 
  <script type="text/javascript">
var domIsReady=false,domReadyList=[],domReadyObject=[],$call=function(callback,obj){if(typeof obj!=='object'){obj=document}if(domIsReady){callback.call(obj)}else{domReadyList.push(callback);domReadyObject.push(obj)}};
var site_domain="<?php echo cd_webpath?>";zone_domain="<?php echo cd_webpath?>user/";
	function resize_frame(){
		try{
			var frames=parent.document.documentElement.getElementsByTagName('iframe');
			for(var i=0;i<frames.length;i++){
				if( 'comment' == frames[i].getAttribute('name')){
					frames[i].style.height=document.body.scrollHeight+'px';
					try{
						//parent.document.documentElement.scrollTop = 530;
						//parent.document.body.scrollTop = 530;
					}catch(e){
						return;
					}
					break;
				}
			}
		}catch(e){
			return;
		}
	};
//评论
var wallLib = {
	wallTimer: 0,
	commentTimer: 0,	
	//添加新评论init
	wallAddInit: function(uid, uidkey){
		var $wallContent = $("#wallContent");
		var type = $('#praise').attr('uid');
		//$wallContent.emotEditor("content");
		//$wallContent.emotEditor("focus");
		//alert($wallContent.html());
		
		//alert($wallContent.emotEditor("content"));
		//return false;
		var $currPage = $('#currPage');
		var $sW_message = $('#sW_message');
			var validCharLength = $wallContent.emotEditor("validCharLength");
			if(validCharLength<1){
				$sW_message.html('请输入您的评论内容！');
				
				clearTimeout(wallLib.wallTimer);
				wallLib.wallTimer = setTimeout(function(){$sW_message.html('');}, 2000);
				$wallContent.emotEditor("focus");
				return;
			}
			$("#wallSubmit").attr('disabled', 'disabled');
			setTimeout(function() {
				$("#wallSubmit").removeAttr('disabled');
				}, 5000);
			$.ajax({
				type: "POST",
				global: false,// 禁用全局Ajax事件.
				url: "ajax.php?action=comment&cd_channel=<?php echo $channel?>&cd_dataid=<?php echo $cd_id?>&type=<?php echo $ac?>",
				data:{'id': uid, 'content': escape($wallContent.emotEditor("content"))},
				dataType: "text",
				success: function(data){
					//alert(data);
					if(data==10007){
						$sW_message.html('请输入您的评论内容！');
						$wallContent.emotEditor("focus");
						clearTimeout(wallLib.wallTimer);
						wallLib.wallTimer = setTimeout(function(){$sW_message.html('');}, 2000);
					}else if(data==10006){
						$sW_message.html('评论内容不能超过300个字！');
						$wallContent.emotEditor("focus");
						clearTimeout(wallLib.wallTimer);
						wallLib.wallTimer = setTimeout(function(){$sW_message.html('');}, 2000);
					}else if(data==30001){
						asyncbox.tips("参数错误！", "alert", 1500);
					}else if(data==50001){
						asyncbox.tips("您输入的内容包含敏感词汇,请修改!", "alert", 2500);
					}else if(data==20001){
						asyncbox.tips("请先登录！", "alert", 1500);
					}else if(data==10002){
						asyncbox.tips("您的操作太频繁了，休息一会吧！", "alert", 1500);
						$wallContent.emotEditor("focus");
						clearTimeout(wallLib.wallTimer);
						wallLib.wallTimer = setTimeout(function(){$sW_message.html('');}, 8000);
					}else if(data == 10011){
						location.href = location.href;
					}else{
						asyncbox.tips("评论成功!", "success", 3000);
						window.location.reload();
					}
				}
			});
	}
}
</script> 
  <script type="text/javascript" src="<?php echo cd_webpath?>user/static/js/jquery/jquery.min.js"></script> 
  <script type="text/javascript" src="<?php echo cd_webpath?>user/static/js/core.js"></script> 
  <script type="text/javascript" src="<?php echo cd_webpath?>user/static/js/card.js"></script> 
  <script type="text/javascript" src="<?php echo cd_webpath?>user/static/js/dialog.js"></script> 
  <script type="text/javascript" src="<?php echo cd_webpath?>user/static/js/jquery/jquery.plugins.js"></script> 
  <script type="text/javascript" src="<?php echo cd_webpath?>user/static/space/js/common.js"></script> 
  <link href="<?php echo cd_webpath?>plug/asynctips/asynctips.css" rel="stylesheet" type="text/css" /> 
  <script type="text/javascript" src="<?php echo cd_webpath?>plug/asynctips/asyncbox.v1.4.5.js"></script> 
  <style type="text/css">
*html{background-image:url(about:blank);background-attachment:fixed;}
body{color: #666666;margin:0;padding:0;font: 12px "微软雅黑","Lucida Grande",STHeiti,Verdana,Arial,Times,serif;}
body,div,ul,li,p,span,b,strong,input,a,form,hr,h1,h2,h3{margin:0;padding:0;}
a:link, a:visited{color: #333333;text-decoration: none;}
a:hover{color: #EE0000;text-decoration: underline;}
img{border:0;}
.write_bg{width:100%;background:#FFFFFF;}
/* 颜色 */
.spaceWall{display: inline;float: left;padding:0px;width: 100%;}
.spaceWall .sW_box{background: none repeat scroll 0 0 #EBECE9;display: inline;float: left;padding: 1%;width: 98%;margin-top:1px;}
.wallItem .wI_content{background-color: #ECECEC;height: auto !important;min-height: 62px;margin-left: 80px;}
.wallItem .arrow s{border-color: transparent #C0BCBC transparent transparent;border-style: dashed solid dashed dashed;border-width: 8px;display: inline;float: left;font-size: 0;left: 62px;line-height: 0;position: absolute;top: 37px;}
.wallItem .wI_text{color: #000;display: inline;float: left;font-size:14px;line-height: 24px;margin: 3px 10px 6px;overflow-x: hidden;white-space: normal;width: 99%;word-wrap: break-word;}
.page .pages em, .pages strong, .pages a, .pages input{border: 1px solid #D0D1D0;color: #707070;font-style: normal;line-height: 24px;margin:0 0 0 5px;padding: 0 7px;display: inline;float: left;}
.page .pages strong{background: #F2F8EE;border: 1px solid #D0D1D0;color: #707070;}
.page .pages input{border: 1px solid #D0D1D0;height: 24px;padding: 0 3px;width: 30px;}
.wallLine .info{color: #555555;display: inline;float: left;margin-left: 5px;}
.wallLine .others{color: #55555;display: inline;float: right;}
/*space wall start*/
.rankIcon{width:100%;position:absolute;left:0;}
.spaceWall .wallConsole{display: inline;float: left;width: 100%;z-index:22;position:relative;}
.spaceWall .wallConsole span{display: inline;float: left;font-family: "黑体";font-size: 20px;font-weight: 400;color: #ccc;}
.spaceWall .wallTitle{color: #555555;display: inline;float: left;font-size: 14px;font-weight: bold;padding: 5px 0px 0 5px;width: 100%;}
.spaceWall .sW_box .sW_input{display: inline;float: left;width: 100%;}
.spaceWall .sW_box .sW_input .wallContent{border: 1px solid #CCD6DD;display: inline;float: left;_height: 65px;max-height: 150px;max-width: 100%;min-height: 65px;padding: 0px;width: 100%;cursor:text;overflow: auto;background-color:#fff;word-wrap: break-word;outline:none;}
.spaceWall .sW_box .sW_input .wallContent br{margin:0;}
.spaceWall .sW_box .sW_input .countercss{font-family:"Microsoft YaHei","Lucida Grande",STHeiti,Verdana,Arial,Times,serif;color:#CCCCCC;font-weight:bold;}
.spaceWall .sW_box .counter{color: #CCCCCC;font-size: 20px;font-weight: bold;right: 10px;top: 3px;}
.spaceWall .sW_box .sW_button{display: inline;float: right;margin-top: 5px;padding-right: 0px;}
.spaceWall .sW_box #sW_message{color: #F00000;display: inline;float: right;height: 23px;line-height: 23px;margin-right: 10px;margin-top: 5px;text-align: right;width: 55%;}
.spaceWall .sW_box .emot{display:inline;float:left;width:25px;height:20px;margin-top:5px;cursor:pointer;background:url(<?php echo cd_webpath?>user/static/space/images/emot.gif) no-repeat;}
.spaceWall .sW_box .emotMenu{bottom:-95px;left:7px;}
.spaceWall .load{background:url("<?php echo cd_webpath?>user/static/space/images/load.gif") no-repeat scroll center center;display: inline;float: left;height: 100px;text-align: center;width: 840px;}
.stageBoxCenter .spaceWall .wallTitle{color: #555555;display: inline;float: left;font-size: 14px;font-weight: bold;padding: 5px;width: 830px;margin-top:20px;}
.spaceWall .countercss{position:absolute;right:15px;top:5px;}
.spaceWall1 .sW_box{background:#EFF5F8;display: inline;float: left;padding: 7px;width: 826px;margin-top:10px;}
.wall_index .page{padding-bottom:0;}
.wall_content{display: inline;float: left;width: 100%;}
.wallLine{border-bottom: 0 solid #E1E1E1;display: inline;float: left;width: 100%;}
.wallLine .nickname{display: inline;float: left;}
.wallLine .nickname a{color: #6DB823;font-weight: bold;display: inline;float: left;}
.wallLine .del{background: url("<?php echo cd_webpath?>user/static/space/images/spcomdes.gif");cursor: pointer;display: inline;float: right;font-size: 0;height: 9px;margin: 3px 0 0 12px;width: 9px;}
.wallLine .others span{margin-left: 10px;}
.wallLine .others span a{color: #999999;text-decoration: underline;}
.wallItem{display: inline;float: left;overflow: visible;padding: 15px 0 0;width: 100%;position:relative;margin-left: -1px;}
.wallItem .wI_avatar{display: inline;float: left;width: 61px;margin-right:12px;}
.wallItem .wI_avatar a{display:block;}
.wallItem .wI_avatar img{height: 57px;width: 57px;border:1px solid #F1F1F1;padding: 1px;}
.wallItem .wI_top{display: inline;float: left;margin: 8px 10px 0 10px;width: 97%;}
.wallItem .wI_text img{_width:expression(function(x){var w=x.width||x.offsetWidth;if(w>500)x.style.width=500;}
(this));max-width:500px;-ms-interpolation-mode:bicubic;vertical-align:text-bottom;}
.wallItem .arrow{display: inline;float: left;}
.wallComment{display: inline;float: left;}
.wallCommentItem{background-color: #444444;border-top: 0 dashed #E1E1E1;display: inline;float: left;margin: 5px 0 0 68px;padding: 8px;width: 886px;}
.wallCommentItem .wC_avatar{display: inline;float: left;width: 38px;margin-right: 15px;}
.wallCommentItem .wC_avatar a{display:block;}
.wallCommentItem .wC_top{display: inline;float: left;width: 832px;}
.wallCommentItem .wC_text{display: inline;float: left;line-height: 24px;margin: 0;overflow-x: hidden;white-space: normal;width: 805px;word-wrap: break-word;}
.wallCommentItem .wC_text a{color: #006699;}
.wallCommentItem .wC_text img{vertical-align:text-bottom;}
.wallCommentInputBox{background: #f2f5f8;float: right;margin-top: 1px;padding: 7px;width: 858px;position:relative;}
.wallCommentInputBox .replayUser{display: none;float: left;height: 16px;line-height: 16px;padding-bottom: 5px;}
.wallCommentInputBox .delReplayUser{background: url("<?php echo cd_webpath?>user/static/space/images/spcomdes.gif") repeat scroll 0 0 transparent;cursor: pointer;display: none;float: left;font-size: 0;height: 9px;margin: 3px 0 0 4px;width: 9px;}
.wallCommentInputBox .wCI_input{display: inline;float: left;}
.wallCommentInputBox .wCI_input .wallCommentInput{border: 1px solid #CCD6DD;display: inline;float: left;height: 56px;max-height: 56px;max-width: 546px;min-width: 546px;overflow-x: hidden;overflow-y: auto;padding: 5px;width: 546px;cursor:text;background-color:#fff;outline:none;word-wrap: break-word;}
.wallCommentInputBox .wCI_button{display: inline;float: left;margin-top: 5px;}
.wallCommentInputBox .wCI_cancel{display: inline;float: left;height: 23px;line-height: 23px;margin-top: 5px;padding: 0 10px;}
.wallCommentInputBox .wCI_cancel a{color: #F00000;text-decoration: underline;}
.wallCommentInputBox .wCI_message{color: #F00000;display: inline;float: left;height: 23px;line-height: 23px;margin-top: 5px;text-indent: 10px;width: 330px;}
.wallCommentInputBox .emot{display:inline;float:right;width:35px;height:20px;margin-top:5px;cursor:pointer;background:url(<?php echo cd_webpath?>user/static/space/images/emot.gif) no-repeat;}
.wallCommentInputBox .emotMenu{right:5px;bottom:5px;}
/*end*/
.button-main{background: url("<?php echo cd_webpath?>user/static/space/images/button-main.gif") no-repeat scroll 100% 0;display: inline;float: left;letter-spacing: 1px;margin: 0;padding: 0 10px 0 0;}
.button-main span{background: url("<?php echo cd_webpath?>user/static/space/images/button-main.gif") no-repeat;display: block;padding: 0 0 0 10px;}
.button-main span button{background: none repeat scroll 0 0 transparent;border: 0 none;color: #FFFFFF;cursor: pointer;height: 24px;line-height: 24px;margin: 0 -10px !important;overflow: visible;padding: 0 10px !important;text-decoration: none;white-space: nowrap;width: auto;}
.page{display: inline;float: left;width:100%;}
.page .pages{display: inline;float: right;padding:10px 0;}
.page .pages a:visited{color:#color: #707070;;}
.page .pages a:hover{border: 1px solid #D3CDCD;color: #201E1E;background: #F5F5F5;text-decoration: none;}
/* end */
/*emot*/
.emotMenu{position:absolute;display:block;z-index: 1;}
.emotMenu ul{display:inline;float:left;background:#FFFFFF;border:3px solid #CCCCCC;padding:5px;width:392px;-moz-user-select:none;-webkit-user-select: none;-ms-user-select: none;}
.emotMenu ul li{display:inline ;float:left;overflow:hidden;cursor:pointer;}
.emotMenu ul li img{display:inline ;float:left;cursor:pointer;width:24px;height:24px;padding:2px;}
/* end */
.nothing{display: inline;float: left;font-size: 14px;height: 150px;line-height: 130px;margin-top: 10px;text-align: center;width: inherit;}
.nickname .certify{background: url("<?php echo cd_webpath?>user/static/images/certify.gif") no-repeat -27px 0;}
.nickname .certify_mm{background: url("<?php echo cd_webpath?>user/static/images/mm.gif") no-repeat -27px 0;}
.nickname .certify{width:13px;height:13px;display: inline;float: left;margin:2px 0 0 3px;*margin:0 0 0 3px;}
.nickname .certify_mm{width:13px;height:13px;display: inline;float: left;margin:2px 0 0 3px;*margin:0 0 0 3px;}
html*~body .nickname .certify{margin:0 0 0 3px;}
html*~body .nickname .certify_mm{margin:0 0 0 3px;}
.nickname .vip_style{display: inline;float: left;vertical-align: top;height:13px;margin-top:2px;*margin-top:0;width:32px;}
html*~body .nickname .vip_style{margin-top:0;}
.vip101{background: url("<?php echo cd_webpath?>user/static/space/images/vip/mini_vip101.gif") no-repeat;}
.vip102{background: url("<?php echo cd_webpath?>user/static/space/images/vip/mini_vip102.gif") no-repeat;}
.vip103{background: url("<?php echo cd_webpath?>user/static/space/images/vip/mini_vip103.gif") no-repeat;}
.vip104{background: url("<?php echo cd_webpath?>user/static/space/images/vip/mini_vip104.gif") no-repeat;}
.vip105{background: url("<?php echo cd_webpath?>user/static/space/images/vip/mini_vip105.gif") no-repeat;}
.vip106{background: url("<?php echo cd_webpath?>user/static/space/images/vip/mini_vip106.gif") no-repeat;}
.vip107{background: url("<?php echo cd_webpath?>user/static/space/images/vip/mini_vip107.gif") no-repeat;}
.vip108{background: url("<?php echo cd_webpath?>user/static/space/images/vip/mini_vip108.gif") no-repeat;}
.vip109{background: url("<?php echo cd_webpath?>user/static/space/images/vip/mini_vip109.gif") no-repeat;}
#alert{display:block;padding-top:9px;width:250px;height:26px;font-weight:bold;font-size:14px;border:3px solid #f9d455;background:#fef8d9;}
</style> 
 </head> 
<body onload="resize_frame();" oncontextmenu="return false">
  <div class="write_bg"> 
   <div class="spaceWall"> 
    <div class="wallConsole"> 
     <div class="wallTitle"> 
      <span>评论</span> 
     </div> 
     <div class="title_per"> 
     </div> 
     <div class="sW_box"> 
      <div class="sW_input"> 
       <div contenteditable="true" id="wallContent" class="wallContent" name="wallContent"></div> 
      </div> 
      <div class="sW_button"> 
       <span class="button-main"> <span> <button type="button" id="wallSubmit" onclick="$call(function(){wallLib.wallAddInit(<?php echo $cd_did;?>, 'd88eb702419ed442a8aa4bf9e1ee08972z3mE!WVA9KAhSmZMomdfIgTQtZzICn0tn9c1zq9@XpDwOpHwpu0nZQCRw')});">发表</button> </span> </span> 
      </div> 
      <div id="sW_message" class="wCI_message"></div> 
      <div id="emot_wallContent" class="emot" to="wallContent"></div> 
     </div> 
    </div> 
    <div id="wall_content" class="wall_content minHeight150">
<?php
global $db;
$i=0;
$sql="select * from " . tname('comment') . " where cd_channel=$channel and cd_dataid='$cd_id' order by cd_addtime desc";
$Arr=getuserpage($sql, 15, ''); //sql,每页显示条数
$result=$db->query($Arr[2]);
$num=$db->num_rows($result);
if($num==0) {
	echo '<div class="nothing">囧啊```还木有人评论啊- -! 您来写点什么吧。</div>';
}
if($result) {
	while($row=$db->fetch_array($result)) {
		$user=$db->getrow("select cd_nicheng,cd_checkmusic,cd_checkmm,cd_grade,cd_viprank from " . tname('user') . " where cd_id='" . $row['cd_uid'] . "'");
		$cd_content=preg_replace("/\[em:(\d+)]/is", "<img src=\"" . cd_webpath . "user/static/images/emot/e\\1.gif\" class=\"face\">", $row['cd_content']);
		//$cd_content = preg_replace("/\<br.*?\>/is", ' ', $cd_content);
		echo '<div class="wallLine" id="wall_' . $row['cd_id'] . '">';
		echo '<div class="wallItem">';
		echo '<div class="arrow"><s></s></div>';
		echo '<div class="wI_avatar"><a href="' . linkweburl($row['cd_uid'], $row['cd_uname']) . '" target="_blank"><img class="avatar-58" src="' . linkuserphoto($row['cd_uid'], 48) . '" width="48" height="48"/></a></div>';
		echo '<div class="rankIcon">';
		echo '<div class="wI_content">';
		echo '<div class="wI_top">';
		echo '<span class="nickname"><a href="' . linkweburl($row['cd_uid'], $row['cd_uname']) . '" target="_blank">' . $user['cd_nicheng'] . '</a>';
		echo CheckCertify($user['cd_checkmusic'], $user['cd_checkmm'], $user['cd_grade'], $user['cd_viprank']);
		echo '</span>';
		echo '<span class="info">评论：</span>';
		echo '<span class="others">';
		echo '<span class="createTime">' . datetime($row['cd_addtime']) . '</span>';
		echo '</span>';
		echo '</div>';
		echo '<div class="wI_text">' . $cd_content . '</div>';
		echo '</div>';
		echo '</div>';
		echo '</div>';

		echo '</div>';
	}
}
?>
    <?php if($num>0){?>
    <div class="page" id="page">
    <div class="pages">
    <?php echo $Arr[0];?>
    <input type="text" maxlength="5" onkeydown="function c(event,val){e = event ? event :(window.event ? window.event : null);if(e.keyCode==13){val = parseInt(val);val=isNaN(val)||(val<=0)?1:val;window.location.href='?ac=<?php echo $ac?>&id=<?php echo $cd_id?>&did=<?php echo $cd_did?>&pages='+val+'';return false;}else{return true;}};if(!c(event,this.value))return false;" title="输入页码，按回车快速跳转"/>
    </div>
    </div>
    <?php } ?>
    </div>
   </div> 
  </div> 
  <script type="text/javascript">
	$("#wallContent").elastic({maxHeight:130});
	$("#wallContent").emotEditor({allowed:300, charCount:true, emot:true, newLine:true});
</script>   
 </body>
</html>
<?php
function getuserpage($mysql, $pagesize) {
	global $db;
	$url=$_SERVER["QUERY_STRING"];
	if(stristr($url, '&pages')) {
		$url=preg_replace('/&pages=([\S]+?)$/', '', $url);
	}
	if(stristr($url, 'pages')) {
		$url=preg_replace('/pages=([\S]+?)$/', '', $url);
	}
	if(IsNul($url)) {
		$url.="&";
	}
	$pages=SafeRequest("pages", "get");
	$pagesok=$pagesize;
	if(!isset($pages) || $pages=="" || !is_numeric($pages) || $pages<=0) {
		$pages=1;
	}
	$sqlstr=$mysql;
	$res=$db->query($sqlstr);
	$nums=$db->num_rows($res);
	if($nums==0) {
		$nums=1;
	}
	$pagejs=ceil($nums/$pagesok);
	if($pages>$pagejs) {
		$pages=$pagejs;
	}
	$sql=$sqlstr . " LIMIT " . $pagesok*($pages-1) . "," . $pagesok;
	$result=$db->query($sql);
	$str="";
	if($nums>1) {
		$str.="<a>共" . $nums . "条评论</a> ";
		if($pages==1) {
			$str.="<a>首页</a> ";
		} else {
			$str.="<a href='?" . $url . "pages=1'>首页</a> ";
		}
		if($pages>1) {
			$str.="<a href='?" . $url . "pages=" . ($pages-1) . "'>上一页</a> ";
		} else {
			$str.="<a>上一页</a> ";
		}
		if($pages<$pagejs) {
			$str.="<a href='?" . $url . "pages=" . ($pages+1) . "'>下一页</a> ";
		} else {
			$str.="<a>下一页</a> ";
		}
		if($pages==$pagejs) {
			$str.="<a>尾页</a> ";
		} else {
			$str.="<a href='?" . $url . "pages=" . $pagejs . "'>尾页</a> ";
		}
	}
	while($row=$db->fetch_array($result)) {
	}
	$arr=array(
		$str,
		$result,
		$sql,
		$pagejs,
		$pages
	);
	return $arr;
}
//认证
function CheckCertify($music, $mm = '0', $vip = '0', $viprank = '0') {
	$certify='';
	if($music) {
		$certify.='<a class="certify" href="javascript:void(0)" title="音乐认证" onclick="openWebsite.openTo(\'musiccertify\');"></a>';
	}
	if($mm==1) {
		$certify.='<a class="certify_mm" href="javascript:void(0)" title="美女认证" onclick="openWebsite.openTo(\'certify\');"></a>';
	}
	if($vip) {
		$certify.='<a class="vip_style vip10' . getviprank($viprank, 0) . '" href="javascript:void(0)" title="VIP' . getviprank($viprank, 0) . '会员" onclick="openWebsite.openTo(\'vip\');"></a>';
	}
	return $certify;
}
?>