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,{time: 2000}, function(){window.location=bloghost+'User/Certifi.html';}); } } ); } function YtFavorite_custom(yt_type,yt_mms,yt_obj,yt_isok) { if (yt_isok == 'success'){ layer.msg(yt_mms,{time: 2000}); if (yt_type == 'add'){ $(yt_obj).text('取消收藏'); var addStr = $(yt_obj).attr("onclick"); var addStr1 = addStr.replace('add', 'del'); $(yt_obj).attr('onclick',addStr1); $(yt_obj).removeClass("delFavorite").addClass("addFavorite"); }else if (yt_type == 'del'){ $(yt_obj).text('添加收藏'); var delStr = $(yt_obj).attr("onclick"); var delStr1 = delStr.replace('del', 'add'); $(yt_obj).attr('onclick',delStr1); $(yt_obj).removeClass("addFavorite").addClass("delFavorite"); var item = $(yt_obj).parent().parent().parent().parent(); if (item.hasClass("item")){ item.hide('2000',function(){ $(this).remove(); }); } }else{ layer.msg('no zuo no die',{time: 2000}); } }else if (yt_isok == 'failed'){ layer.msg(yt_mms.match(".+?")[0].replace("","").replace("","")); }else{ layer.msg('no zuo no die',{time: 2000}); } } 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',{time: 2000}); } 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,{time: 2000}, function(){window.location.reload()}); } } ); } 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,{time: 2000}, function(){window.location=bloghost+'User/buy/uid/'+$("input[name='LogID']").val()}); } } ); }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,{time: 2000}, function(){window.location=bloghost+'User/Upgrade.html'}); } } ); }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,{time: 2000}); if(yt =="积分不够,请充值."){ window.location=bloghost+'User/Integral.html'; } }else{ var s =data; layer.msg(s,{time: 2000}, function(){window.location=$("input[name='LogUrl']").val()}); } } ); } 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,{time: 2000}, function(){window.location=bloghost+'User/Integral.html'}); } } ); } 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,{time: 2000}, function(){window.location=bloghost+'User/User.html'}); } } ); } 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,{time: 2000}, function(){window.location=bloghost+'User/User.html'}); } } ); } 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,{time: 2000}, function(){window.location.reload()}); } } ); } 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,{time: 2000}, function(){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,{time: 2000}, function(){window.location=bloghost+'User/Login.html'}); } } ); } 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,{time: 2000}, function(){window.location=bloghost+'User/User.html'}); } } ); } 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,{time: 2000}, function(){window.location=bloghost+'User/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,{time: 2000}, function(){window.location=bloghost+'User/Login.html'}); } } ); } function checkInfo(){ $.post(bloghost+'zb_users/plugin/YtUser/cmd.php?act=MemberPst&token=8ab4f6ea1c927231fe70af49cad609a6', $("#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,{time: 2000}, function(){window.location=bloghost+'User/User.html'}); } } ); } 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); } } ); }