var ajax = new ajax();ajax.setcharset("utf-8"); function reporterr(id){openwin("/"+sitepath+"err.php?id="+id,400,220,350,250,0)} function addfav(vid,uid) { ajax.get( "/"+sitepath+"include/ajax.php?action=addfav&id="+vid+"&uid="+uid, function(obj) { if (obj.responsetext=="err"){ alert("请先登录!"); location.href="/"+sitepath+"login.php"; }else{ alert("收藏成功!"); } } ); } function viewcomment(id,page){ var url; if (page.length==0){url=id;}else{url="/"+sitepath+"comment.php?id="+id+"&page="+page;} ajax.get( url, function(obj) { if (obj.responsetext=="err"){ set(document.getelementbyid("comment_list"),"发生错误") }else{ set(document.getelementbyid("comment_list"),obj.responsetext) } } ); } function submitcomment(id){ if(document.getelementbyid("username").value.length<1){alert('请填写昵称');return false;} if(document.getelementbyid("msg").value.length<1){alert('请填写内容');return false;} ajax.postf( document.getelementbyid("f_comment"), function(obj){if(obj.responsetext=="ok"){viewcomment(id,1);alert('感谢您的评论!');}else if(obj.responsetext=="validateerr"){alert('验证码错误,请点击验证码图片更新验证码!');}else if(obj.responsetext=="havecomment"){alert('发布过于频繁,请稍后再操作!');}else if(obj.responsetext=="ipcomment"){alert('您所在的ip不能评论');}else if(obj.responsetext=="wordcomment"){alert('您的评论中有禁用词语,不能评论');}/*else{alert(obj.responsetext);}*/} ); } function diggvideo(id,div){ ajax.get( "/"+sitepath+"include/ajax.php?id="+id+"&action=digg", function (obj){ var returnvalue=number(obj.responsetext) if (!isnan(returnvalue)){set(document.getelementbyid(div),returnvalue);alert('成功顶贴!');}else if(obj.responsetext=="err"){alert('顶贴失败')}else if(obj.responsetext=="havescore"){alert('您已经执行过顶踩操作!')} } ); } function treadvideo(id,div){ ajax.get( "/"+sitepath+"include/ajax.php?id="+id+"&action=tread", function (obj){ var returnvalue=number(obj.responsetext) if(!isnan(returnvalue)){set(document.getelementbyid(div),returnvalue);alert('踩贴成功!');}else if(obj.responsetext=="err"){alert('踩贴失败')} else if(obj.responsetext=="havescore"){alert('您已经执行过顶踩操作!')} } ); } function diggnews(id,div){ ajax.get("/"+sitepath+"include/ajax.php?id="+id+"&action=diggnews",function (obj){ var returnvalue=number(obj.responsetext) if (!isnan(returnvalue)){set(document.getelementbyid(div),returnvalue);alert('成功顶贴!');}else if(obj.responsetext=="err"){alert('顶贴失败')}else if(obj.responsetext=="havescore"){alert('您已经执行过顶踩操作!')} } ); } function treadnews(id,div){ ajax.get("/"+sitepath+"include/ajax.php?id="+id+"&action=treadnews",function (obj){ var returnvalue=number(obj.responsetext) if(!isnan(returnvalue)){set(document.getelementbyid(div),returnvalue);alert('踩贴成功!');}else if(obj.responsetext=="err"){alert('踩贴失败')} else if(obj.responsetext=="havescore"){alert('您已经执行过顶踩操作!')} } ); } function alertfrontwin(zindex,width,height,alpha,str){ openwindow(zindex,width,height,alpha) set(document.getelementbyid("msgbody"),str) } function getaspparas(suffix){ var cur_url=location.href; var urlparas=location.search; if (cur_url.indexof("?")>0){ if(cur_url.indexof("-")>0){ return urlparas.substring(1,urlparas.indexof(suffix)).split('-'); } else { var tmpurl = cur_url.split("?"); var mytemp = tmpurl[1]; var superx = mytemp.split("&"); var myarr = new array(superx[0],superx[1],superx[2]); return myarr; } }else{ return cur_url.substring(cur_url.lastindexof("/")+1,cur_url.indexof(suffix)).split('-') //伪静态 } } function gethtmlparas(suffix){ var cur_url=location.href; return cur_url.substring(cur_url.lastindexof("/")+1,cur_url.indexof(suffix)).split('-') //静态 //var urlparas=location.href; //var tempurl = urlparas.replace("http://",""); //去掉 http //tempurl = tempurl.replace("//","/"); //避免出现双杠现象 //var temparr = tempurl.split('/'); //通过 / 划分数组 //var hosturl = "http://" + temparr[0]; // 主域名 //var filename = temparr[temparr.length-1]; //文件名 //var middle = ""; //var filearr = filename.split('-'); //middle = urlparas.replace(filename,"")+filearr[0]; //var myarr = new array(middle,filearr[1],filename.split('.')[0].split('-')[2]); //return myarr; } function handleparas(para1,para2){ var i,fromarray,len1,len2,urlarray,j,datastr,dataarray if (isnan(para1) || isnan(para2)){return false} fromarray=videoinfolist.split('$$$') len1=fromarray.length;if(para2>len1-1){para2=len1-1} for (i=0;ilen2-1){para1=len2-1};for (j=0;j0){return pagevalue;} } return "" } function getpagegourl(maxpage,pagediv,type,listpagename){ var str,gourl var url=location.href pagenum=getpagevalue(pagediv) if (pagenum.length==0||isnan(pagenum)){alert('输入页码非法');return false;} if(pagenum>maxpage){pagenum=maxpage;} if(pagenum<1){pagenum=1;} switch (type){ case 1 : //dynamic //http://127.0.0.1/xxxx/?1.html ; http://127.0.0.1/xxxx/?1-2.html str=(pagenum==1)?'':"-"+pagenum; gourl=regexpsplice(url,/(\/\/\s+\?\d+)[-]{0,1}\d*(\.html|\.htm|\.shtml|\.shtm|\.asp)/,str); break; case 2 : //dir1 //http://127.0.0.1/xxxx/xxxx.html ; http://127.0.0.1/xxxx/xxxx2.html if(url.lastindexof("/")==(url.length-1)){url+=listpagename} str=(pagenum==1)?'':pagenum;; gourl=regexpsplice(url,/(\/\/\s+?)[\d]*(\.html|\.htm|\.shtml|\.shtm|\.asp|\.php)/,str); break; case 3 : //dir2 //http://127.0.0.1/xxxx/1.html ; http://127.0.0.1/xxxx/1_2.html str=(pagenum==1)?'':"_"+pagenum; gourl=(url.split('_').length<3)?regexpsplice(url,/(\/\/\s+\d+?)(\.html|\.htm|\.shtml|\.shtm|\.asp|\.php)/,str):regexpsplice(url,/(\/\/\s+\d+?)_\d+(\.html|\.htm|\.shtml|\.shtm|\.asp)/,str); if(gourl.indexof('//')==-1){gourl=regexpsplice(url,/(\/\/\s+_\d+?)(\.html|\.htm|\.shtml|\.shtm|\.asp|\.php)/,str);} break; case 5 : //zt //http://127.0.0.1/topiclist/?5.html ; http://127.0.0.1/topiclist/?5-2.html //http://127.0.0.1/topiclist/xxx.html ; http://127.0.0.1/topiclist/xxx-2.html str=(pagenum==1)?'':"-"+pagenum; gourl=(url.split('-').length<2)?regexpsplice(url,/(\/\/\s+\d+?)(\.html|\.htm|\.shtml|\.shtm|\.asp|\.php)/,str):regexpsplice(url,/(\/\/\s+\d+?)-\d+(\.html|\.htm|\.shtml|\.shtm|\.asp)/,str); if(gourl.indexof('//')==-1){gourl=regexpsplice(url,/(\/\/\s+\d+?)(\.html|\.htm|\.shtml|\.shtm|\.asp|\.php)/,str);} break; case 6 : //forged str=(pagenum==1)?'':"-"+pagenum; gourl=regexpsplice(url,/(\/\/\s+?)[-]{0,1}[\d]{0,1}(\.html|\.htm|\.shtml|\.shtm|\.asp|\.php)/,str); break; case 7: //ztindex //http://127.0.0.1/topic/?1.html str=pagenum; gourl=regexpsplice(url,/(\/\/\s+\?+?)\d+(\.html|\.htm|\.shtml|\.shtm|\.asp|\.php)/,str); break; } location.href=gourl; } function gosearchpage(maxpage,pagediv,searchtype,searchword){ var pagenum=getpagevalue(pagediv) if (pagenum.length==0||isnan(pagenum)){alert('输入页码非法');return false;} if(pagenum>maxpage){pagenum=maxpage;} if(pagenum<1){pagenum=1;} location.href='?page='+pagenum+'&searchword='+searchword+'&searchtype='+searchtype; } function gocascadepage(maxpage,pagediv,searchwhere){ var pagenum=getpagevalue(pagediv) if (pagenum.length==0||isnan(pagenum)){alert('输入页码非法');return false;} if(pagenum>maxpage){pagenum=maxpage;} if(pagenum<1){pagenum=1;} location.href='?page='+pagenum+'&'+searchwhere; } function leaveword(){ if(document.getelementbyid("m_author").value.length<1){alert('昵称必须填写');return false;} if(document.getelementbyid("m_content").value.length<1){alert('内容必须填写');return false;} ajax.postf( document.getelementbyid("f_leaveword"), function(obj){if(obj.responsetext=="ok"){viewleavewordlist(1);alert('留言成功!');document.getelementbyid("m_content").value='';}else if(obj.responsetext=="haveleave"){alert('发布过于频繁,请稍后再操作!');}else{alert('发生错误');}} ); } function leavewordgbook(){ if(document.getelementbyid("vdcode").value.length<1){alert('验证码必须填写');return false;} if(document.getelementbyid("m_content").value.length<1){alert('内容必须填写');return false;} var obj=document.getelementbyid("m_content").value; if(!(/.*[\u4e00-\u9fa5]+.*$/.test(obj))) {alert("留言内容请包含中文!");return false;} return true; } function leavewordgbook2(){ if(document.getelementbyid("m_content").value.length<1){alert('内容必须填写');return false;} var obj=document.getelementbyid("m_content").value; if(!(/.*[\u4e00-\u9fa5]+.*$/.test(obj))) {alert("留言内容请包含中文!");return false;} return true; } function getvideohit(vid){ ajax.get( "/"+sitepath+"include/ajax.php?action=hit&id="+vid, function (obj){ var result=obj.responsetext if(result=="err"){set(document.getelementbyid('hit'),'发生错误')}else{set(document.getelementbyid('hit'),result);} } ); } function member() { ajax.get( "/"+sitepath+"include/ajax.php?action=member", function (obj){ var result=obj.responsetext; set(document.getelementbyid('seacms_member'),result); } ); } function getnewshit(nid){ ajax.get( "/"+sitepath+"include/ajax.php?action=hitnews&id="+nid, function (obj){ var result=obj.responsetext if(result=="err"){set(document.getelementbyid('hit'),'发生错误')}else{set(document.getelementbyid('hit'),result);} } ); } function markscore0(vd,d,t,s,l,ac){ var alt=['很差','较差','还行','推荐','力荐'],url=ac=='news' ? ["/"+sitepath+"include/ajax.php?id="+vd+"&action=newsscore","/"+sitepath+"include/ajax.php?id="+vd+"&action=scorenews&score="] : ["/"+sitepath+"include/ajax.php?id="+vd+"&action=videoscore","/"+sitepath+"include/ajax.php?id="+vd+"&action=score&score="], x=d,y=(math.round(s / x * 100) / 100) || 0,id='bt'+(new date()).gettime(); document.write('
\
我来评分(请您参与评分,体现您的观点)
\
'+x+' 个人评分, 平均分 '+y+' , 总得分 '+s+'
\
'); for(var i=0;i<=l;i++) document.write(''); document.write(' \
\
'); document.getelementbyid(id).onclick=function (){ for(var i=0;i<=l;i++) if(document.getelementbyid('sint'+i).checked)break; if(i>l){alert('你还没选取分数');return;} ajax.get(url[1]+i,function (obj){ if((''+obj.responsetext).indexof("havescore")!=-1){ alert('你已经评过分啦'); }else{ document.getelementbyid('mark_b4').innerhtml="评分成功!"; alert('感谢你的参与!'); } }); this.disabled=true; } if(new date().togmtstring()!=new date(document.lastmodified).togmtstring()) return ajax.get(url[0],function (obj){ var a=obj.responsetext try{ a.replace(/\[(\d+),(\d+),(\d+)\]/i,function ($0,d,t,s){ var x=parseint(d),y=(math.round(parseint(s) / x * 100) / 100) || 0; document.getelementbyid('mark_b1').innerhtml=x; document.getelementbyid('mark_b2').innerhtml=y; document.getelementbyid('mark_b3').innerhtml=s; }); }catch(ig){} }); } function showpf() {document.getelementbyid('seacmsvpf1').style.display="none";document.getelementbyid('seacmsvpf2').style.display="inline";} function markscore1(vd,d,t,s,l,ac){ var alt=['很差','较差','还行','推荐','力荐'],src=['/'+sitepath+'pic/star0.gif','/'+sitepath+'pic/star1.gif'],url=ac=='news' ? ["/"+sitepath+"include/ajax.php?id="+vd+"&action=newsscore","/"+sitepath+"include/ajax.php?id="+vd+"&action=scorenews&score="] : ["/"+sitepath+"include/ajax.php?id="+vd+"&action=videoscore","/"+sitepath+"include/ajax.php?id="+vd+"&action=score&score="], x=d,y=(math.round(s / x * 100) / 100) || 0,id='star'+(new date()).gettime(); document.write(''); document.write(''); document.write(''); for(var i=1;i<=l;i++){ document.write(''); } document.write(''); document.write(' ()'); var dc=document.getelementbyid(id),im=dc.getelementsbytagname('img'); for(var i=0;i=parseint(im[i].id) ? 0 : 1]; } } dc.onmouseout=function (){ for(var i=0;i=parseint(im[i].id) ? 0 : 1]; document.getelementbyid('mark_b2').innerhtml=y;document.getelementbyid('mark_b3').innerhtml=y>0 ? alt[parseint(y/l*(alt.length-1))] : '请选择' ; } if(new date().togmtstring()!=new date(document.lastmodified).togmtstring()) return ajax.get(url[0],function (obj){ var a=obj.responsetext try{ a.replace(/\[(\d+),(\d+),(\d+)\]/i,function ($0,d,t,s){ var x=parseint(d);y=(math.round(parseint(s) / x * 100) / 100) || 0; dc.onmouseout(); }); }catch(ig){} }); dc.onmouseout(); } function marknews2(vid,style,len){ ajax.get( "/"+sitepath+"include/ajax.php?action=npingfen&id="+vid, function (obj){ var result=obj.responsetext; result=result.split(","); num=result[0]; sum=result[1]; sc=result[2]; if(style==1){ //星星评分 document.getelementbyid('seacmsvpf2').style.display="none"; id='star'+(new date()).gettime(); for(var ii=1;ii<=len;ii++){ if(ii>sc){p=1;}else{p=0;} document.getelementbyid('seacmsvpf1').innerhtml+=''; } document.getelementbyid('mark_b2').innerhtml=sc; document.getelementbyid('mark_b3').innerhtml=''+num+'次评分'; }else{ //单选评分 document.getelementbyid('mark_b2').innerhtml=sc; document.getelementbyid('mark_b3').innerhtml=sum; document.getelementbyid('mark_b1').innerhtml=num; } } ); } function marknews(vd,d,t,s,l,c){ window['markscore'+(c==1 ? 1 : 0)](vd,d,t,s,parseint(l)<0 ? 5 : l,'news'); } function markvideo2(vid,style,len){ ajax.get( "/"+sitepath+"include/ajax.php?action=vpingfen&id="+vid, function (obj){ var result=obj.responsetext; result=result.split(","); num=result[0]; sum=result[1]; sc=result[2]; if(style==1){ //星星评分 document.getelementbyid('seacmsvpf2').style.display="none"; id='star'+(new date()).gettime(); for(var ii=1;ii<=len;ii++){ if(ii>sc){p=1;}else{p=0;} document.getelementbyid('seacmsvpf1').innerhtml+=''; } document.getelementbyid('mark_b2').innerhtml=sc; document.getelementbyid('mark_b3').innerhtml=''+num+'次评分'; }else{ //单选评分 document.getelementbyid('mark_b2').innerhtml=sc; document.getelementbyid('mark_b3').innerhtml=sum; document.getelementbyid('mark_b1').innerhtml=num; } } ); } function markvideo(vd,d,t,s,l,c){ window['markscore'+(c==1 ? 1 : 0)](vd,d,t,s,parseint(l)<0 ? 5 : l); } function addfavorite(surl, stitle){ try{ window.external.addfavorite(surl, stitle);} catch (e){ try{window.sidebar.addpanel(stitle, surl, "");} catch (e) {alert("加入收藏失败,请使用ctrl+d进行添加");} } } function sethome(obj,vrl,url){ try{obj.style.behavior='url(#default#homepage)';obj.sethomepage(vrl); this.style.behavior='url(#default#homepage)';this.sethomepage(url);} catch(e){ if(window.netscape){ try{netscape.security.privilegemanager.enableprivilege("universalxpconnect");} catch (e){alert("此操作被浏览器拒绝!请手动设置");} var prefs = components.classes['@mozilla.org/preferences-service;1'].getservice(components.interfaces.nsiprefbranch); prefs.setcharpref('browser.startup.homepage',vrl); } } } function addface(id) { document.getelementbyid('m_content').value += '[ps:' + id +']'; } function openwin(url,w,h,left,top,resize){ window.open(url,'new_win','toolbars=0, scrollbars=0, location=0, statusbars=0,menubars=0, resizable='+(resize)+',width='+w+',height='+h+',left='+left+',top='+top); } function loadslide(w,h){ var type=1 //type=0不显示幻灯片右侧列表;type=1显示幻灯片右侧列表 document.write(''); } function stringreplaceall(str,findstr,replacestr){var raregexp = new regexp(findstr,"g");return str.replace(raregexp,replacestr);} function addremotefavor(){ ajax.get( "/"+sitepath+"include/ajax.php?action=favorajax&id="+play_vid+"&faction=add", function (obj){alert(obj.responsetext)} ); } var base64decodechars = new array( -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 62, -1, -1, -1, 63, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, -1, -1, -1, -1, -1, -1, -1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, -1, -1, -1, -1, -1, -1, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, -1, -1, -1, -1, -1); function base64decode(str) { var c1, c2, c3, c4; var i, len, out; len = str.length; i = 0; out = ""; while(i < len) { /* c1 */ do { c1 = base64decodechars[str.charcodeat(i++) & 0xff]; } while(i < len && c1 == -1); if(c1 == -1) break; /* c2 */ do { c2 = base64decodechars[str.charcodeat(i++) & 0xff]; } while(i < len && c2 == -1); if(c2 == -1) break; out += string.fromcharcode((c1 << 2) | ((c2 & 0x30) >> 4)); /* c3 */ do { c3 = str.charcodeat(i++) & 0xff; if(c3 == 61) return out; c3 = base64decodechars[c3]; } while(i < len && c3 == -1); if(c3 == -1) break; out += string.fromcharcode(((c2 & 0xf) << 4) | ((c3 & 0x3c) >> 2)); /* c4 */ do { c4 = str.charcodeat(i++) & 0xff; if(c4 == 61) return out; c4 = base64decodechars[c4]; } while(i < len && c4 == -1); if(c4 == -1) break; out += string.fromcharcode(((c3 & 0x03) << 6) | c4); } return out; }