document.onkeydown = function (e) { var theEvent = window.event || e; var code = theEvent.keyCode || theEvent.which; if (code == 13) { $("#YtUserbnt").click(); } } function Certifi(){ $.post(bloghost+'zb_users/plugin/YtUser/common/certifi.php', { "name":$("input[name='name']").val(), "idcard":$("input[name='idcard']").val(), "token":$("input[name='token']").val(), "verifycode":$("input[name='verifycode']").val(), }, function(data){ var s =data; if((s.search("faultCode")>0)&&(s.search("faultString")>0)) { layer.msg(s.match(".+?")[0].replace("","").replace("","")); $("#reg_verfiycode").attr("src",bloghost+"zb_system/script/c_validcode.php?id=Certifi&tm="+Math.random()); }else{ var s =data; layer.msg(s); window.location=bloghost+'?Certifi'; } } ); } function YtFavorite_custom(yt_type,yt_mms,yt_obj,yt_isok) { if (yt_isok == 'success'){ layer.msg(yt_mms); if (yt_type == 'add'){ if (yt_obj){ $(yt_obj).removeClass('am-icon-star-o'); $(yt_obj).addClass('am-icon-star'); $(yt_obj).text('已收藏'); $(yt_obj).removeAttr('onclick'); }else{ layer.msg('已加入收藏'); window.location.reload(); } }else if (yt_type == 'del'){ if (yt_obj){ $(yt_obj).closest('tr').remove(); }else{ layer.msg('已取消收藏'); window.location.reload(); } }else{ layer.msg('no zuo no die'); } }else if (yt_isok == 'failed'){ layer.msg(yt_mms.match(".+?")[0].replace("","").replace("","")); }else{ layer.msg('no zuo no die'); } } function YtFavorite(fvtype, pid, obj){ if (fvtype == 'add'){ var posturl=bloghost+'zb_users/plugin/YtUser/favorite/add.php'; }else if (fvtype == 'del'){ var posturl=bloghost+'zb_users/plugin/YtUser/favorite/del.php'; }else{ layer.msg('no zuo no die'); } if (fvtype == 'add' || fvtype == 'del'){ $.post(posturl, { "LogID":pid, }, function(data){ var s = data; if((s.search("faultCode")>0)&&(s.search("faultString")>0)){ YtFavorite_custom(fvtype,s,obj,'failed'); }else{ YtFavorite_custom(fvtype,s,obj,'success'); } } ); } } function YtSbuy(){ $.post(bloghost+'zb_users/plugin/YtUser/YtSbuy.php', { "LogID":$("input[name='LogID']").val(), "verifycode":$("input[name='verifycode']").val(), }, function(data){ var s =data; if((s.search("faultCode")>0)&&(s.search("faultString")>0)) { layer.msg(s.match(".+?")[0].replace("","").replace("","")) }else{ var s =data; layer.msg(s); setTimeout(window.location.reload(),2000); } } ); } function Ytbuy(){ $.post(bloghost+'zb_users/plugin/YtUser/Ytbuy.php', { "LogID":$("input[name='LogID']").val(), "verifycode":$("input[name='verifycode']").val(), }, function(data){ var s =data; if((s.search("faultCode")>0)&&(s.search("faultString")>0)) { layer.msg(s.match(".+?")[0].replace("","").replace("","")) }else{ var s =data; layer.msg(s); setTimeout(window.location=bloghost+'?buy&uid='+$("input[name='LogID']").val(),2000); } } ); } function RegPage(){ $.post(bloghost+'zb_users/plugin/YtUser/Upgrade.php', { "invitecode":$("input[name='invitecode']").val(), "verifycode":$("input[name='verifycode']").val(), }, function(data){ var s =data; if((s.search("faultCode")>0)&&(s.search("faultString")>0)) { layer.msg(s.match(".+?")[0].replace("","").replace("","")); $("#reg_verfiycode").attr("src",bloghost+"zb_system/script/c_validcode.php?id=RegPage&tm="+Math.random()); }else{ var s =data; layer.msg(s); setTimeout(window.location=bloghost+'?User',2000); } } ); }function Ytbuypay(){ $.post(bloghost+'zb_users/plugin/YtUser/Ytbuypay.php', { "LogID":$("input[name='LogID']").val(), }, function(data){ var s =data; if((s.search("faultCode")>0)&&(s.search("faultString")>0)) { var yt=s.match(".+?")[0].replace("","").replace("",""); layer.msg(yt); if(yt =="余额不足,请充值."){ window.location=bloghost+'?Integral'; } }else{ var s =data; layer.msg(s); setTimeout(window.location=$("input[name='LogUrl']").val(),2000); } } ); } function Integral(){ $.post(bloghost+'zb_users/plugin/YtUser/Integral.php', { "invitecode":$("input[name='invitecode']").val(), "verifycode":$("input[name='verifycode']").val(), }, function(data){ var s =data; if((s.search("faultCode")>0)&&(s.search("faultString")>0)) { layer.msg(s.match(".+?")[0].replace("","").replace("","")); $("#reg_verfiycode").attr("src",bloghost+"zb_system/script/c_validcode.php?id=Integral&tm="+Math.random()); }else{ var s =data; layer.msg(s); setTimeout(window.location=bloghost+'?Integral',2000); } } ); } function register(){ $.post(bloghost+'zb_users/plugin/YtUser/register.php', { "name":$("input[name='name']").val(), "mobile":$("input[name='mobile']").val(), "mobilecode":$("input[name='mobilecode']").val(), "password":$("input[name='password']").val(), "repassword":$("input[name='repassword']").val(), "email":$("input[name='email']").val(), "homepage":$("input[name='homepage']").val(), "verifycode":$("input[name='verifycode']").val(), "rootid":$("input[name='rootid']").val(), }, function(data){ var s =data; if((s.search("faultCode")>0)&&(s.search("faultString")>0)) { layer.msg(s.match(".+?")[0].replace("","").replace("","")); $("#reg_verfiycode").attr("src",bloghost+"zb_system/script/c_validcode.php?id=register&tm="+Math.random()); }else{ var s =data; layer.msg(s); setTimeout(window.location=bloghost+'?User',2000); } } ); } function Ytuser_Login(){ $.post(bloghost+'zb_users/plugin/YtUser/cmd.php?act=verify', { "verifycode":$("input[name='verifycode']").val(), "username":$("input[name='edtUserName']").val(), "edtPassWord":MD5($("input[name='edtPassWord']").val()), "strSaveDate":$("input[name='chkRemember']").val(), }, function(data){ var s =data; if((s.search("faultCode")>0)&&(s.search("faultString")>0)) { layer.msg(s.match(".+?")[0].replace("","").replace("","")) }else{ var s =data; layer.msg(s); setTimeout(window.location=bloghost+'?User',2000); } } ); } function Ytuser_allLogin(){ $.post(bloghost+'zb_users/plugin/YtUser/cmd.php?act=verify', { "username":$("input[name='allUserName']").val(), "edtPassWord":MD5($("input[name='allPassWord']").val()), "strSaveDate":$("input[name='allRemember']").val(), }, function(data){ var s =data; if((s.search("faultCode")>0)&&(s.search("faultString")>0)) { layer.msg(s.match(".+?")[0].replace("","").replace("","")) }else{ var s =data; layer.msg(s); setTimeout(window.location.reload(),2000); } } ); } function resetpwd(){ $.post(bloghost+'zb_users/plugin/YtUser/mailto.php', { "name":$("input[name='name']").val(), "email":$("input[name='email']").val(), "verifycode":$("input[name='verifycode']").val(), }, function(data){ var s =data; if((s.search("faultCode")>0)&&(s.search("faultString")>0)) { layer.msg(s.match(".+?")[0].replace("","").replace("","")); $("#reg_verfiycode").attr("src",bloghost+"zb_system/script/c_validcode.php?id=resetpwd&tm="+Math.random()); }else{ var s =data; layer.msg(s); window.location=bloghost; } } ); } function Resetpassword(){ $.post(bloghost+'zb_users/plugin/YtUser/resetpassword.php', { "username":$("input[name='username']").val(), "hash":$("input[name='hash']").val(), "password":$("input[name='password']").val(), "verifycode":$("input[name='verifycode']").val(), }, function(data){ var s =data; if((s.search("faultCode")>0)&&(s.search("faultString")>0)) { layer.msg(s.match(".+?")[0].replace("","").replace("","")); $("#reg_verfiycode").attr("src",bloghost+"zb_system/script/c_validcode.php?id=Resetpassword&tm="+Math.random()); }else{ var s =data; layer.msg(s); window.location=bloghost+'?Login'; } } ); } function Nameedit(){ $.post(bloghost+'zb_users/plugin/YtUser/nameedit.php', { "name":$("input[name='name']").val(), "rename":$("input[name='rename']").val(), "token":$("input[name='token']").val(), "verifycode":$("input[name='verifycode']").val(), }, function(data){ var s =data; if((s.search("faultCode")>0)&&(s.search("faultString")>0)) { layer.msg(s.match(".+?")[0].replace("","").replace("","")); $("#reg_verfiycode").attr("src",bloghost+"zb_system/script/c_validcode.php?id=Nameedit&tm="+Math.random()); }else{ var s =data; layer.msg(s); window.location=bloghost+'?User'; } } ); } function checkArticleInfo(){ $.post(bloghost+'zb_users/plugin/YtUser/articleInfo.php', { "Title":$("input[name='Title']").val(), "Alias":$("input[name='Alias']").val(), "Tag":$("input[name='Tag']").val(), "CateID":$("*[name='CateID']").val(), "Content":editor.getContent(), "token":$("input[name='token']").val(), "verifycode":$("input[name='verifycode']").val(), }, function(data){ var s =data; if((s.search("faultCode")>0)&&(s.search("faultString")>0)) { layer.msg(s.match(".+?")[0].replace("","").replace("","")); $("#reg_verfiycode").attr("src",bloghost+"zb_system/script/c_validcode.php?id=Articleedt&tm="+Math.random()); }else{ var s =data; layer.msg(s); window.location=bloghost+'?Articlelist'; } } ); } function Changepassword(){ $.post(bloghost+'zb_users/plugin/YtUser/changepassword.php', { "password":$("input[name='password']").val(), "newpassword":$("input[name='newpassword']").val(), "repassword":$("input[name='repassword']").val(), "token":$("input[name='token']").val(), "verifycode":$("input[name='verifycode']").val(), }, function(data){ var s =data; if((s.search("faultCode")>0)&&(s.search("faultString")>0)) { layer.msg(s.match(".+?")[0].replace("","").replace("","")); $("#reg_verfiycode").attr("src",bloghost+"zb_system/script/c_validcode.php?id=Changepassword&tm="+Math.random()); }else{ var s =data; layer.msg(s); window.location=bloghost+'?Login'; } } ); } function checkInfo(){ $.post(bloghost+'zb_users/plugin/YtUser/cmd.php?act=MemberPst&token=68bfdc2694a356d8898007a77d8824a7', $("#signup-form").serialize(), function(data){ var s =data; if((s.search("faultCode")>0)&&(s.search("faultString")>0)) { layer.msg(s.match(".+?")[0].replace("","").replace("","")) $("#reg_verfiycode").attr("src",bloghost+"zb_system/script/c_validcode.php?id=User&tm="+Math.random()); } else{ var s =data; layer.msg(s); window.location=bloghost+'?User'; } } ); } function YtSign(){ $.post(bloghost+'zb_users/plugin/YtUser/common/sign.php', function(data){ var s = data; alert(s); setTimeout(window.location.reload(),2000); } ); } function ytmobilecode(){ $.post(bloghost+'zb_users/plugin/YtUser/common/mobilecode.php', { "mobile":$("input[name='mobile']").val(), "verifycode":$("input[name='verifycode']").val(), }, function(data){ var s = data; if((s.search("faultCode")>0)&&(s.search("faultString")>0)) { layer.msg(s.match(".+?")[0].replace("","").replace("","")) $("#reg_verfiycode").attr("src",bloghost+"zb_system/script/c_validcode.php?id=register&tm="+Math.random()); } else{ layer.msg(s); } } ); }