www.gusucode.com > 仿51.com的php源码 1.1 > Music/MusicCommentToMe.php
<?php include("../user/CheckLogined.php"); include("../include/dbclass.php"); include("../include/global.php"); require_once "../include/page.php"; $dbc=new DbConn(); $uid=$_COOKIE["uid"]; $page=(int)$_GET["page"]; $key=$_GET["key"]; $maxline = 10; if ($_GET["action"]=="replyComment") { $page=$_GET["page"]; $id=$_POST["id"]; $memo=$_POST["memo"]; $sql="update MusicCommentToMe set MusicComment_Replay='$memo',MusicComment_Replay_Readed='1' where id='$id'"; $dbc->Execute($sql); header("Location:MusicCommentToMe.php?page=$page"); } if($_GET["action"]=="delComment") { $id=$_GET["id"]; $key=$_GET["key"]; $page=$_GET["page"]; $sql="delete from MusicCommentToMe where MusicComment_UserName='$uid' and id='$id'"; $dbc->Execute($sql); header("Location:MusicCommentToMe.php?page=$page&key=$key"); } ?><!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 src="../js/global.js" language="javascript"></script> <div id="face" style="display:none; position:absolute; width:260px; height:276px;"></div> <script> /*********Js Function Begin*********/ function AppCheckReplyForm(obj){ return AppCheckStrLength(obj.memo.value, 2,500); } function AppCheckStrLength(str,min, max){ len = str.replace(/^\s*/i,'').length; if (len < min ){ alert("输入的字符不能少于"+min+"个"); return false; } if (len > max){ alert("输入的字符不能多于"+max+"个"); return false; } return true; } function AppCtrlEnterCommentToMe(form, button){ var obj = form; if( (event.ctrlKey && event.keyCode == 13) || (event.altKey && event.keyCode == 83)) { obj.memo.value=obj.memo.value.replace(/^\s*/i,''); if(AppCheckReplyForm(obj)){ obj.submit(); } else{ event.returnValue=false; } } } function AppRenewLen(obj, max){ str = obj.value; if(str.length>max) { obj.value=str.substring(0,max);// document.getElementById('zishu').innerHTML="<font color=red><b>0</b></font>"; alert("输入的字符不能多于 "+max+" 个!"); } else { var j=max - str.length; document.getElementById('zishu').innerHTML=j; } } function AppHideReplyInput() { if(current_id > 0) { AppGetObject('reform_'+current_id).style.display = 'none'; AppGetObject('reform_'+current_id).innerHTML = ''; current_id = 0; } } 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 AppShowReplyInput(i) { AppHideReplyInput(); current_id = i; AppGetObject('reform_'+i).innerHTML = reply_code; AppGetObject('reform_'+i).style.display = ''; AppGetObject('ping_id').value = i; AppGetObject('memo').focus(); try { top.init(); } catch (e) {}; return false; } /*********Js Function End*********/ String.prototype.length2 = function() { if (this == " ") return 1; var cArr = this.match(/[^x80-xff]/ig); return this.length + (cArr == null ? 0 : cArr.length); } </script> <script src="../js/face.js" language="JavaScript"> </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"><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 include("../ToMeMenu.php"); ?> </div> </div> </div> <div id="right"> <div id="a4n"> <div class="anphg"> <div class="a5" id="l">别人给我音乐的评论</div> <div class="a5"><a href="MusicCommentToOther.php">我给别人音乐的评论</a> <?php $sql="select id from MusicCommentToMe where MusicComment_Replay_Readed='1' and MusicComment_Name='$uid'"; $rs=$dbc->getRs($sql); if ($rs !=null) { ?> <span style='margin-left:2px;color:red'>(新)</span><?php } ?></div> </div> <div id="txss"> <form> <div class="txyy">用户名: <input name="key" type="text" class="text" value="<?php echo $key; ?>" /> <input name="Submit" type="submit" class="btn" value="搜 索" /> </div> </form> </div> </div> <div id="fenle"> <div class="plhf" id="reform" style="display:none;"> <form name=form2 action="?action=replyComment&page=<?php echo $page; ?>" method="POST" onsubmit="return AppCheckReplyForm(this)"> <table width=100%><tr><td width=200> <div class="plhf1">回复内容 <input type="hidden" name="id" value="" id="ping_id"> <input name="Submit2" type="button" class="btn" value="插入表情" onClick="showFace('face','memo')" /> </div></td><td> <div style="width:200px;text-align:right">还可以输入 <span id=zishu>500</span> 个字</nobr></div> </td></tr></table> <div class="plhf2"> <textarea id="memo" name="memo" cols="75" rows="3" onKeydown="AppCtrlEnterCommentToMe(form2,false);" onKeyUp="AppRenewLen(this, 500);" onPaste="AppRenewLen(this, 500);" onChange="AppRenewLen(this, 500);" onBlur="AppRenewLen(this, 500);"></textarea> </div> <div class="plhf3"> <input name="Submit3" type="submit" class="btn" value="回 复" /> <input name="Submit32" type="button" onclick="AppHideReplyInput();" class="btn" value="关 闭" /> </div> </form> </div> <script> var current_id = 0; var reply_code = AppGetObject('reform').innerHTML; AppGetObject('reform').innerHTML = ''; </script> <!-- BEGIN FieldView:UcMusicCommentToMe --> <?php //更新数据库把没有看的都设为看了 $sqlread="update MusicCommentToMe set MusicComment_Readed='1' where MusicComment_UserName='$uid'"; $dbc->Execute($sqlread); if($key=="") { $sql="select * from MusicCommentToMe where MusicComment_UserName='$uid' order by MusicComment_AddDate desc"; } else { $sql="select * from MusicCommentToMe where MusicComment_Name like '%$key%' and MusicComment_UserName='$uid' order by MusicComment_AddDate desc"; } $news = $dbc->getGopageRs($sql,$maxline); //echo "$sql"; $gopage = new GoPage($dbc->tpages,$dbc->total);//建立翻页程序 $backurl = "MusicCommentToMe.php?".$dbc->getParameter(); for($i=0;$i<$dbc->num_rows;$i++) {?> <table width="570" border="0" cellpadding="0" cellspacing="0" class="tb"> <tr class="ptbti"> <td height="20" colspan="4" align="left"><div class="pz"><a name="3375065"></a><a href="/home.php?user=<?php echo $news[$i]["MusicComment_Name"];?>" target="_blank" style='text-transform: capitalize'><?php echo $news[$i]["MusicComment_Name"];?></a>对我的 <a href="../home/PlayMusic.php?id=<?php echo $news[$i]["MusicComment_CommentObjId"];?>&user=<?php echo $news[$i]["MusicComment_UserName"];?>" target="_blank">《<?php echo $news[$i]["MusicComment_ObjTitle"];?>》</a> 音乐的评论</div> <div class="py" ><a onclick="if(confirm('确定要删除这条评论吗?')){return true;}else{return false;}" href="?action=delComment&id=<?php echo $news[$i]["id"];?>&key=<?php echo $key; ?>&page=<?php echo $page; ?>" style="color:#0000cc;font-weight:bold">[删除]</a> <a href="#" onclick="javascript: return AppShowReplyInput(<?php echo $news[$i]["id"];?>)" style="color:#0000cc;font-weight:bold">[回复]</a></div></td> </tr> <tr> <td width="139" height="120"><div class="plzb"> <script src='../1e/<?php echo $news[$i]["MusicComment_Name"];?>/<?php echo $news[$i]["MusicComment_Name"];?>.js'></script> <script> var ImgShow='<img src=../images/loadface.gif border=0 width=80 height=90>'; if(typeof(<?php echo $news[$i]["MusicComment_Name"];?>_photo)!='undefined') { var ImgShow='<img src='+<?php echo $news[$i]["MusicComment_Name"];?>_photo+' border=0 class=photo width=80 onLoad=reloadImage(this)>'; } </script> <a href="/home.php?user=<?php echo $news[$i]["MusicComment_Name"];?>" target="_blank"><script>document.write(ImgShow);</script></a></div></td> <td colspan="3" valign="top"><div class="plnr"> <?php echo ubb($news[$i]["MusicComment_Memo"]); ?> <div class="plh"> <?php if($news[$i]["MusicComment_Replay"]!=null){?> <hr size="1px" width="100%" /> 回复:<?php echo ubb($news[$i]["MusicComment_Replay"]); ?> </div><?php }?> </div> </div> <div class="ptime">评论时间:<?php echo $news[$i]["MusicComment_AddDate"]; ?></div> </td> </tr> </table> <div class="plhf" id="reform_<?php echo $news[$i]["id"];?>" style="display:none;"> </div> <?php }?> <!-- END FieldView:UcMusicCommentToMe --> <div class="tjfy"> <div class="fenye"> <?=$gopage->style(3)?> </div> </div> </div> </div> </div> <div id="bottom"> <div id="baidu" style="color:#a0a0a0;"><?php require("../foot.php"); ?></div> </div> </body> </html>