<?php error_reporting(0);?>
  <div class="spaceMain"> 
   <div class="mainTop"></div> 
   <div class="mainCenter"> 
    <div class="publicLeft"> 
     <div class="stageBox"> 
      <div class="stageBoxTop"> 
       <span></span> 
      </div> 
      <div class="stageBoxCenter min_space_height"> 
       <div class="x5_title"> 
        <h1><?php echo $cctvai_web_nicheng?>分享的视频</h1>
<?php if($cctvai_web_userid == $CcTvAi_com_userid){ ?>
        <a href="<?php echo cd_webpath?>user/<?php echo rewrite_url('space.php?do=upvideo&view=list'); ?>"><span>管理</span></a>
<?php } ?>
        </div>
		<div class="space_big">
<li><a href="<?php echo cd_webpath.cd_webmlsinger?>/<?php echo rewrite_url('index.php?ac=video&id='.$cctvai_web_userid.'');?>"<?php if($day == ""){echo " class=\"current\"";} ?>><h1>全部类型</h1></a></li>
<?php
if($day){$videoclass=$db->getrow('select * from ' . tname('videoclass') . " where CD_ID='" . $day . "'");}
$videoclasssql1="select CD_ID,CD_Name from " . tname('videoclass') . " where CD_FatherID=0 and CD_IsHide=0";
$results=$db->query($videoclasssql1);
if($results) {
		while($videoclass1=$db->fetch_array($results)) {
			if($videoclass["CD_FatherID"]=="0"){$FatherID=$videoclass["CD_ID"];}else{$FatherID=$videoclass["CD_FatherID"];}
				if($videoclass1['CD_ID']==$FatherID){
						echo "<li><a href='" . rewrite_url('index.php?ac=video&id=' . $cctvai_web_userid . '&day='.$videoclass1['CD_ID'].'')."' class=\"current\"><h1>" . $videoclass1['CD_Name'] . "</h1></a></li>";
				} else {
						echo "<li><a href='" . rewrite_url('index.php?ac=video&id=' . $cctvai_web_userid . '&day='.$videoclass1['CD_ID'].'')."'><h1>" . $videoclass1['CD_Name'] . "</h1></a></li>";
				}
		}
}
?>
     </div>		
<?php
if($day){
if($class["CD_TieID"]!=999999){
echo'<div class="space_small">';
$videoclasssql2="select CD_ID,CD_Name from " . tname('videoclass') . " where CD_ID in (".$videoclass["CD_TieID"].") and CD_IsHide=0";
$results=$db->query($videoclasssql2);
if($results) {
	while($videoclass2=$db->fetch_array($results)) {
		if($videoclass2['CD_ID']==$day){
			echo "<li><a href='" . rewrite_url('index.php?ac=video&id=' . $cctvai_web_userid . '&day='.$videoclass2['CD_ID'].'')."' class=\"current\">" . $videoclass2['CD_Name'] . "</a><b></b></li>";
		}else{
			echo "<li><a href='" . rewrite_url('index.php?ac=video&id=' . $cctvai_web_userid . '&day='.$videoclass2['CD_ID'].'')."'>" . $videoclass2['CD_Name'] . "</a><b></b></li>";
		}
	}
}
echo'</div>';
}
}
?>
       <div class="danceFavoritesList video"> 
        <div class="list">
		<ul>
<?php
global $db;
$i=0;
if($day) {
if(cd_zclass=="1"){
	if($videoclass["CD_FatherID"]==0){$fidsql=" and CD_ClassID in (".rtrim($videoclass["CD_ID"].','.$videoclass['CD_TieID'], ',').")";}else{$fidsql=" and CD_ClassID='".$videoclass["CD_ID"]."'";}
	}else{
		$fidsql=" and CD_ClassID='".$videoclass["CD_ID"]."'";
		}
		$day="&day=" . $day . "";
}
$sql="select * from " . tname('video') . " where CD_Deleted=0 and CD_Passed=0 and CD_User='".$cctvai_web_username."'$fidsql order by CD_AddTime desc";
$Arr=getwebfavpage($sql, 12, "index.php?ac=video&id=" . $cctvai_web_userid . $day . ""); //sql,每页显示条数
$result=$db->query($Arr[2]);
$num=$db->num_rows($result);
if($num == 0) {
    if($day) {
        echo '<div class="nothing_dance">本类别没有任何视频</div></div>';
    } else {
        echo '<div class="nothing_recommend">还没有上传分享任何视频。</div></div>';
    }
} else {
    if($result) {
        while($row=$db->fetch_array($result)) {
            $i=$i+1;
            echo '<li><a href="' . LinkUrl("video", $row['CD_ClassID'], 1, $row['CD_ID']) . '" title="' . $row["CD_Name"] . '" target="_blank"><img src="' . LinkPicUrl($row["CD_Pic"],'video') . '" alt="' . $row["CD_Name"] . '" width="175" height="105" /></a> 
       <div class="song-item"> 
        <span class="song-title"><a href="' . LinkUrl("video", $row['CD_ClassID'], 1, $row['CD_ID']) . '" title="' . $row["CD_Name"] . '" target="_blank">' . $row["CD_Name"] . '</a></span> 
        <div class="singer-name"> 
         <span class="author_list">' . GetSingerAlias("cctvai_singer", "CD_Name", "CD_ID", $row['CD_Singer']) . '</span> 
        </div> 
        <div class="v-meta-entry">
         <i class="ico-statplay" title="播放"></i>
         <span class="v-num"> ' . bqwhits($row['CD_Hits']) . '</span>
        </div> 
       </div> </li>';
        }
        echo "</ul>\n";
        echo "</div>";
        echo "<div class=\"page\">\n";
        echo '<div class="page_sort"><div class="goto"><a class="go" href="javascript:void(0);" onclick="dancePlayer.getPage(' . $Arr[3] . ',\'' . cd_webpath . cd_webmlsinger . '/index.php?ac=video&id=' . $cctvai_web_userid . '&day=' . $day . '&pages=!!PageNum!!\');return false;"><span>确定</span></a><span class="other">转到<input name="pageNum" id="pageNum" type="text" size="4" class="pageNum" maxlength="4" value="' . $Arr[3] . '" onClick="this.value=\'\';" />页</span></div><ul class="page_link">' . $Arr[0] . '</ul></div>';
        echo "<div id=\"currPage\">" . $Arr[4] . "</div>";
        echo "</div>";
    }
}
?>
        </form> 
       </div> 
      </div> 
      <div class="stageBoxBottom"> 
       <span></span> 
      </div> 
     </div> 
    </div> 
    <div class="publicRight"> 
<?php include "source/cctvai_right.php"; ?> 
    </div> 
   </div> 
   <div class="mainBottom"></div> 
  </div> 
<?php include "source/cctvai_footer.php"; ?>  
  <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>
  <script type="text/javascript">listenMsg.start();nav.init();nav.userMenu();</script>
<?php if($cd_id){ ?>
  <script type="text/javascript" src="<?php echo cd_webpath?>user/static/space/js/dance.js"></script>
  <script type="text/javascript">
nav.helpNoticeInit();
  </script>
<?php }else{ ?>
  <script type="text/javascript">
var didStr = "<?php echo GetFavorites($CcTvAi_com_userid); ?>";
spaceDance.spaceDanceStatus();
  </script>
<?php } ?>
</body>
</html>