www.gusucode.com > 仿51.com的php源码 1.1 > Music/MusicSearch.php

    <?php
include("../User/CheckLogined.php");
include("../include/dbclass.php");
require_once "../include/page.php";
$dbc=new DbConn();
$group=$_GET["group"];
$page=(int)$_GET["page"];
$type=$_GET["type"];
$maxline = 19;
$uid=$_COOKIE["uid"];
$key=$_GET["key"];
if($_GET["action"]=="bg")
{
if($_COOKIE["vip"]>0){
$id=$_GET["id"];
$sql="select Music_Url from music where id='$id'";
$rs=$dbc->getRs($sql);
$midbg=$rs["Music_Url"];
$upsql="update userdata set midbg='$midbg' where User_Account='$uid'";
$dbc->Execute($upsql);
echo "<script>alert('背景音乐设置成功!');history.back();</scrip>";
}else
{
echo "<script>alert('你还不是VIP以上成员');location.href='/help/free-vip.php';</script>";
}
}
?>
<!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>村委会档案管理中心 -- 音乐</title>
<link href="../images/User_Main.css" rel="stylesheet" type="text/css" />
<script>
try{
	if(top!=window){
		document.domain	="www.wu-liao.com";		
	}else{
		top.location.href="/webin.php?refer=%2FMusic%2FMusicSearch.php";
	}
}catch(e){}
function showNewMessage(user){
	top.showNewMessage(user);
}

</script>
<script>
/*********Js Function Begin*********/
//非VIP使用受限功能时弹出free-vip.php
function AppUpgrateVip(msg) {
<?php if($_COOKIE["vip"]>0){?>
var isVip=false;
<?php }else{?>
	var isVip = true;
	<?php }?>
	if (!isVip) {
		alert(msg);
		window.open('http://www.wu-liao.com/help/free-vip.php', 'VIP');
		return false;
	} else {
		return true;
	}
}
// 打开音乐收藏页面
function AppMusicFavorite(musicId) {
	window.open('../Interface/MusicFavoriteInterface.php?id=' + musicId, 'MusicFavorite', 'height=180, width=350, left=100, top=150, screenX=200, screenY=200, toolbar=no, menubar=no, scrollbars=yes, resizable=no, location=no, status=no, z-look=yes');
	return false;
}
/*********Js Function End*********/
</script>
</head>
<body>
<div id="top">
<div id="logo"><a href="/User/Main.php"></a></div>
<div id="topr">
<div id="exit"><?php require("../menu.php"); ?>
<div id="menu">
<div class="m2">
<div class="mg"><a href="/User/Main.php">用户管理中心</a></div>
<div class="mh"><a href="/Diary/DiaryList.php">日记文集</a></div>
<div class="ma"><a href="/Photo/PhotoList.php">相册</a></div>
<div class="ma"><a href="/Image/ImageList.php">图库</a></div>
<div class="mb" id="do1"><a href="/Music/MusicList.php">音乐</a></div>
<div class="mc"><div id="ms"><a href="/Memo/MemoList.php"><img src="../images/suo2.gif" width="10" height="12" />&nbsp;秘密记事本</a></div>
</div>
<div class="me"><a href="/Fav/FavList.php">网址收藏夹</a></div>
<div class="mf"><a href="/Addr/AddrList.php">通讯录</a></div>
</div>
</div>
</div>
<div id="nav">
<div id="navt"></div>
</div>

<div id="mjx"></div>
<div id="main">
<div id="left">
<div id="leph">
<div class="phff">
<div class="phtt">
音乐分类</div>
<?php 
$sql1="select * from MusicGroup where User_Account='$uid' order by GroupOrder desc";
$result=$dbc->query($sql1);
while ($row=@mysql_fetch_array($result)) {

?>

<?php if ($row["GroupName"]==$group){?>
<div class="phl1"><div class="phz "><a href="MusicList.php?group=<?php echo $row["GroupName"]; ?>" title="<?php echo $row["GroupName"]; ?>"><?php echo $row["GroupName"]; ?></a></div></div><?php }else{?><div class="phl2 "><a href="MusicList.php?group=<?php echo $row["GroupName"]; ?>" title="<?php echo $row["GroupName"]; ?>"><?php echo $row["GroupName"]; ?></a></div><?php }?>

<?php }?> <div class=phl2 style='font-size:12px;color:red'><div class="phz" ><a href='http://my.51.com/FixGroup.php' target=_blank></a></div></div><div class="mxle"><a href="MusicGroup.php">分类管理</a></div><div class="mxle"><a href="MusicCommentToMe.php">评论管理</a></div><div class="mxle"><a href="MusicBg.php">背景设置</a></div><div class="mxle"><a href="MusicNewUpload.php">最新上传</a></div><!--<div class="phl2">&nbsp;&nbsp;<a href="http://bbs.51.com/gourl.php?refer=/tip_list.php?type=122" target="_blank">翻唱专区</a></div>--></div>
</div>
</div>
<div id="right">
<div id="a4n">
<div class="anphg">
<div id="txss">
<div class="a4">
<img width=0 height=14>
<img src="../images/jdsc.gif" width="12" height="12">
<a href="MusicUpload.php" onclick="javascrip: return AppUpgrateVip('只有VIP用户才能上传音乐。请升级为VIP');">上传音乐</a>
</div>
<form action="MusicSearch.php" onsubmit="return chkSearch(this)">
<input type=hidden name=act value=search>
<div   STYLE="text-align:right;font-size:14px;font-weight:bold">
<img src='../images/search.jpg'>音乐搜索:&nbsp;
<input name="key" type="text" class="text" size="20" value='<?php echo $key; ?>' />
<input type="radio" name="type" value="1" <?php if ($type==1){?> checked <?php }?> />
歌名
<input type="radio" name="type" value="2"  <?php if ($type==2){?> checked <?php }?> />
歌手
<input name="submit_button" type="submit" class="btn" value="搜 索" />
</div>
</form>
<div align=center>
<table>
<tr>
<td width=80% align=center>
<font color=red>注意:输入的字越少,搜索的结果越多!</font>
</td>
<td width=40></td>
</tr>
</table>
</div>
</div>
</div>

<script>
function chkSearch(obj)
{
	var pattern=/^( )+$/i;
	if(obj.key.value=="")
	{
		alert("搜索关键词不能为空");
		return false;
	}
	else if(pattern.test(obj.key.value))
	{
		alert("搜索关键词不能为空");
		return false;
	}
}
</script>
</div>
<div id="fenle">
<Table width="580px" border="0" cellpadding="2" cellspacing="0" class="tb">
<TR class="tbti">
<TD style="font-weight:bold;text-align:left;">音乐名称</TD>
<TD >歌手</TD>
<TD >格式</TD>
<TD >所属用户</TD>
<TD nowrap>收藏</TD>
<TD nowrap>铃声</TD>
<TD>背景音乐</TD></TR>
<?php 
if ($type==1)
{
$sql="select * from music where Music_Title like '%$key%' order by Up_AddDate  desc";

}
else
{
$sql="select * from music where Author like '%$key%'  order by Up_AddDate  desc";
}
$news = $dbc->getGopageRs($sql,$maxline);
  //echo "$sql";
$gopage = new GoPage($dbc->tpages,$dbc->total);//建立翻页程序
$backurl = "MusicSearch.php?".$dbc->getParameter();
if ($dbc->num_rows==0)
{?>
</TR>
<TD colspan="7">提示:没找到歌曲!</TD>
</TR>
<?php
}
for($i=0;$i<$dbc->num_rows;$i++)
{
?>
<TR>
<TD style="text-align:left;">
<u><a target=_blank href=../home/PlayMusic.php?id=<?php echo $news[$i]["id"];?>&user=<?php echo $news[$i]["User_Account"];?>><?php if ($type==1){ echo str_replace($key,"<font color='read'>$key</font>",$news[$i]["Music_Title"]);}else{echo $news[$i]["Music_Title"];}?></a></u>
</TD>
<TD ><u><?php if($news[$i]["Author"]==null){?><a  ><无></a><?php }else{?><a href="MusicSearch.php?type=<?php echo $type; ?>&key=<?php echo $key;?>"><?php if ($type==2){ echo str_replace($key,"<font color='read'>$key</font>",$news[$i]["Author"]);}else{echo $news[$i]["Author"];}?></a><?php }?></u></TD>
<TD ><?php echo $news[$i]["Style"]; ?></TD>
<TD ><a href="http://www.wu-liao.com/home.php?user=<?php echo $news[$i]["User_Account"];?>" target="_blank"><?php echo $news[$i]["User_Account"];?></a></TD>
<TD>
<a href="#" onclick="javascript: return AppMusicFavorite(<?php echo $news[$i]["id"];?>);" title='加入收藏'><img src='../images/scj.gif' border=0></a>
</TD>
<TD>
<a href='http://c.9588.com/?userid=100021&songname=<?php echo $news[$i]["Music_Title"];?>' target="_blank" title="下载到手机"><img src='../images/lss.gif' border=0></a>
</TD>
<TD>
<?php if($news[$i]["Style"]=="wma"){?>

<a title='设置成主页背景音乐' onclick="return AppUpgrateVip('只有VIP用户才能将该音乐设为背景音乐。请升级为VIP') && confirm('使用其他用户的音乐做为背景,如果用户删除了这首音乐,您的背景音乐将无法播放!确定要设置这首音乐为背景吗?')" href='?id=<?php echo $news[$i]["id"];?>&action=bg'>设置</a>
<?php }else{?>
无权
<?php }?>
</TD>
</TR>
<?php }?>


</Table>
<BR>
<div class=fenye><?=$gopage->style(3)?></div><BR><BR>
</div>
</div>
</div>
<div id="bottom">
<div id="baidu" style="color:#a0a0a0;"><?php require("../foot.php"); ?></div>
</div>

</body>
</html>