/*================================================================ modify date:2013-7-24 author:linwenzhong copyright:www.kesion.com bbs.kesion.com version:kesioncms v9.5 营销qq:4000080263 ==================================================================*/ //ajax 控件 function pageajax(){ if(window.xmlhttprequest){ return new xmlhttprequest(); } else if(window.activexobject){ return new activexobject("microsoft.xmlhttp"); } throw new error("xmlhttp object could be created."); } var loader=new pageajax; function ajaxloadpage(url,request,method,fun) { method=method.touppercase(); if (method=='get') { urls=url.split("?"); if (urls[1]=='' || typeof urls[1]=='undefined') { url=urls[0]+"?"+request; } else { url=urls[0]+"?"+urls[1]+"&"+request; } request=null; } loader.open(method,url,true); if (method=="post") { loader.setrequestheader("content-type","application/x-www-form-urlencoded"); } loader.onreadystatechange=function(){ eval(fun+'()'); } loader.send(request); } //评论支持 function support(channelid,infoid,postid,id,typeid,installdir) { try{ $.ajax({ type: "post", url: installdir+'plus/comment.asp', data:'action=support&channelid='+channelid+'&infoid='+infoid+'&postid='+postid+'&type='+typeid+'&id=' +id, success: function(s){ if (s=='good'){ $("#d"+id).html(parseint($("#d"+id).html())+1); }else if (s=='bad'){ $("#c"+id).html(parseint($("#c"+id).html())+1); } else tipsshow(s); } }); } catch(e){createjs(installdir+'plus/comment.asp?action=support&channelid='+channelid+'&infoid='+infoid+'&postid='+postid+'&type='+typeid+'&id=' +id);} } //回复 var box=''; function replycmt(postid,channelid,infoid,quoteid,installdir){ box=$.dialog({id:'quotebox',lock:true,title:'引用回复',content:"url:" +installdir+"plus/comment.asp?action=showquote&channelid="+channelid+"&infoid="+infoid+""eid="+quoteid+"&postid="+postid,width:500,height:240,min:false,max:false}); } //当前页,频道id,栏目id,信息id,action,installdir function page(curpage,channelid,infoid,action,maxperpage,installdir){ this._channelid = channelid; this._infoid = infoid; this._action = action; this._maxperpage= maxperpage; this._url = installdir +"plus/comment.asp"; this._c_obj="c_"+infoid; this._p_obj="p_"+infoid; this._installdir=installdir; this._page=curpage; loaddate(1,0); } function loaddate(p,postload){ this._page=p; var loadurl=_url+"?postload="+postload+"&channelid="+_channelid+"&infoid="+_infoid+"&from3g="+from3g+"&maxperpage="+_maxperpage+"&action=" +_action+"&page="+p; try{ var xhr=new pageajax(); xhr.open("get",loadurl,true); xhr.onreadystatechange=function (){ if(xhr.readystate==1){ }else if(xhr.readystate==4){ if (xhr.status==200) { show(xhr.responsetext); } } } xhr.send(null); }catch(e){ createjs(loadurl); } } function createjs(loadurl) { var head = document.getelementsbytagname("head")[0]; var js = document.createelement("script"); js.src = loadurl+'&printout=js'; head.appendchild(js); } function show(s) { if (s.indexof("ks:page")==-1){ $(".cmtnum").html(parseint($(".cmtnum").html())+1); $("#cc_"+this._infoid).prepend(s); }else{ var pagearr=s.split("{ks:page}") var pageparamarr=pagearr[1].split("|"); count=pageparamarr[0]; perpagenum=pageparamarr[1]; pagecount=pageparamarr[2]; itemunit=pageparamarr[3]; itemname=pageparamarr[4]; pagestyle=pageparamarr[5]; pagestyle=1; if (this._page>1){ $("#cc_"+this._infoid).append(pagearr[0]); }else{ $("#"+_c_obj).html(pagearr[0]); } pagelist(); } } function pagelist(){ var statushtml=""; if (parseint(this.pagecount)<=parseint(this._page)){ statushtml="
已加载完全部内容
" } else{ statushtml="
加载更多内容
" } if (this.pagecount!=""&&this.count!=0) { $("#"+this._p_obj).html('
'+statushtml+'
'); } } function nextpage() { if(this._page