www.gusucode.com > 仿51.com的php源码 1.1 > Music/MusicNewUpload.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"]; $deferentparameter="&group=".$group; $maxline = 20; $uid=$_COOKIE["uid"]; if($_GET["action"]=="bg") { $group=$_GET["group"]; $page=$_GET["page"]; $id=$_GET["id"]; $sql="select Music_Url,Music_Title from music where id='$id'"; $rs=$dbc->getRs($sql); if($rs==null) { echo "<script>alert('参数出错了');history.back();</script>"; exit(); } else { $mid=$rs["Music_Url"]; $title=$rs["Music_Title"]; $sqlup="update userdata set midbg='$mid',midtitle='$title' where User_Account='$uid'"; $dbc->Execute($sqlup); echo "<script>alert('恭喜,修改成功!');locaction.href='MusicNewUpload.php?group=$group&page=$page';</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%2FMusicNewUpload.php"; } }catch(e){} function showNewMessage(user){ top.showNewMessage(user); } </script> <script> /*********Js Function Begin*********/ // 打开音乐收藏页面 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*********/ 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 chkForm(obj){ if (obj.key.value == ""){ alert("请输入搜索条件!"); obj.key.focus(); return false; } obj.submit_button.disabled = true; return true; } function AppGetObject(id) { if(document.getElementById) { return document.getElementById(id); } else if(document.all) { return document.all[id]; } else if(document.layers) { return document.layers[id]; } } function AppGetCookie(name) //获得Cookie的原始值 { var arg = name + "="; var alen = arg.length; var clen = document.cookie.length; var i = 0; while (i < clen) { var j = i + alen; if (document.cookie.substring(i, j) == arg) return AppGetCookieVal(j); i = document.cookie.indexOf(" ", i) + 1; if (i == 0) break; } return null; } function AppGetCookieVal(offset) //获得Cookie解码后的值 { var endstr = document.cookie.indexOf (";", offset); if (endstr == -1) endstr = document.cookie.length; return unescape(document.cookie.substring(offset, endstr)); } function AppSetCookie(name, value) //设定Cookie值 { var expdate = new Date(); var argv = AppSetCookie.arguments; var argc = AppSetCookie.arguments.length; var expires = (argc > 2) ? argv[2] : null; var path = (argc > 3) ? argv[3] : null; var domain = (argc > 4) ? argv[4] : null; var secure = (argc > 5) ? argv[5] : false; if(expires!=null) expdate.setTime(expdate.getTime() + ( expires * 1000 )) document.cookie = name + "=" + escape (value) +((expires == null) ? "" : ("; expires="+ expdate.toGMTString())) +((path == null) ? "" : ("; path=" + path)) +((domain == null) ? "" : ("; domain=" + domain)) +((secure == true) ? "; secure" : "") delete value } function AppDelCookieMusic(name) //?Cookie { var exp = new Date(); exp.setTime (exp.getTime() - 1); var cval = AppGetCookie (name); AppSetCookie(name, '', exp,'/','www.wu-liao.com'); AppSetCookie(name, '', exp,'/Music','www.wu-liao.com'); } </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" /> 秘密记事本</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)) { ?> <div class="phl2 "><a href="MusicList.php?group=<?php echo $row["GroupName"]; ?>" title="<?php echo $row["GroupName"]; ?>"><?php echo $row["GroupName"]; ?></a></div> <?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" id="xzle">最新上传</div><!--<div class="phl2"> <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?group=<?php echo $group; ?>" 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'>音乐搜索: <input name="key" type="text" class="text" size="20" value='' /> <input type="radio" name="type" value="1" checked /> 歌名 <input type="radio" name="type" value="2" /> 歌手 <input name="submit_button" type="submit" class="btn" value="搜 索" /> </div> </form> <div align=center><table><tr><td width=80% align=center><font color=red>注意:输入的字越少,搜索的结果越多!普通用户显示10首,VIP显示20首!</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"> <!-- BEGIN FieldView:UcNewMusic --> <Table width="580px" border="0" cellpadding="2" cellspacing="0" class="tb"> <TR class="tbti"><TD width="18" style="font-weight:bold;text-align:left;"> </TD><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((int)$_COOKIE["vip"]==0) { $sql="select * from music order by Up_AddDate desc limit 0,10"; } else {$sql="select * from music order by Up_AddDate desc limit 0,20"; } $result22=$dbc->query($sql); $n=$dbc->num_rows($result22); if($n==0) { ?> </TR> <TD colspan="8">提示:暂无纪录</TD> </TR> <?php } while ($row22=@mysql_fetch_array($result22)) { ?> <TR> <TD style="text-align:left;"><input type="checkbox" name="cb1" value="<?php echo $row22["id"]; ?>" /></TD><TD style="text-align:left;"><u><a target=_blank href=../home/PlayMusic.php?id=<?php echo $row22["id"]; ?>&user=<?php echo $row22["User_Account"]; ?>><?php echo $row22["Music_Title"]; ?></a></u><input type="hidden" name="musicTitle1" value="<?php echo $row22["Music_Title"];?>"></TD><TD ><?php echo $row22["Author"]; ?></TD> <TD ><?php echo $row22["Style"]; ?></TD> <TD ><?php echo $row22["User_Account"]; ?></TD> <TD><a href="#" onclick="javascript: return AppMusicFavorite(<?php echo $row22["id"]; ?>)" title='加入收藏'><img src='../images/scj.gif' border=0></a></TD><TD><a onclick="Music_open('<?php echo $row22["Music_Title"]; ?>')" href="javascript:" title="下载到手机"><img src='../images/lss.gif' border=0></a></TD><TD><?php if($row22["Style"]=="wma"){?><a title='设置成主页背景音乐' onclick="return confirm('使用其他用户的音乐做为背景,如果用户删除了这首音乐,您的背景音乐将无法播放!确定要设置这首音乐为背景吗?')" href='?id=<?php echo $row22["id"]; ?>&action=bg&group=<?php echo $group; ?>&page=<?php echo $page; ?>'>设置</a><?php }else{?><font title='背景音乐只能使用WMA格式' color='white' disabled>设置</font><?php }?></TD> </TR> <?php }?> <SCRIPT language="javascript"> function Music_open(title) { window.open('http://www.7town.com/TnSend/mpn.aspx?uid=22607&mn='+title+'&dy=2&a=&b=&c=&d=&e=&f=', '', 'width=450,height=350,left=300,top=120, toolbar=no, menubar=no, scrollbars=no, resizable=no,location=no, status=no'); } </SCRIPT> </Table> <!-- END FieldView:UcNewMusic --> <table width="580" height="40" border="0" cellpadding="0" cellspacing="0"> <tr> <td><input name="acb" id="acb" type="button" class="btn" value="全选" onclick="checkAll()" /> <input name="clearAll" type="button" class="btn" value="全否" onclick="clearAll()" /> <input name="addMusicList" type="button" class="btn" value="加入播放列表" onclick="addPlayList()" /> <select name="playlist" id="playlist" style="width:150px"> </select> <input name="deleteMusic" type="button" class="btn" value="删除" onclick="deleteMusic()" /> <input name="clearPlayList" type="button" class="btn" value="清空列表" onclick="clearPlayList()" /> <input name="loopPlay" id="loopPlay" type="button" class="btn" value="连续播放" onclick="loopPlay()" /> </td> </tr> </table> <script src="../js/musicnewupload.js"></script> <BR/> <div class="fenye"> </div> <BR/> </DIV> <BR/> </div> </div> </div> <div id="bottom"> <div id="baidu" style="color:#a0a0a0;"><?php require("../foot.php"); ?></div> </div> </body> </html>