var ajx_pub_var=""; var ajx_pub_var2=""; var ajx_pub_var3=""; function anonymous_subscribe(addvar, warn, type,inf) { __$.fn.createDialog({ html: inf, okLabel: "Suscribirme", cancelLabel: "Cerrar", okClass:"btn", cancelClass:"btn", auto:"yes", cancelClass:"btn", doonok:function (){ perform_fav_complex(addvar, warn, type,__$('#anonymous_email_info').attr("value")); }, opacity: 0.9 }); } function perform_fav(addvar, warn, type){ return perform_fav_complex(addvar, warn, type,"") } function perform_fav_complex(addvar, warn, type,eml){ ajx_pub_var=type; func=function(inf){ if (inf.indexOf ('id="anonymous_email_div"')>0){ anonymous_subscribe(addvar, warn, type,inf); }else if (inf.indexOf ("success")>0){ var re=new RegExp(/\[\[success_type=(.*)\]\]/ig); var suc_type=re.exec(inf); if (suc_type!="anonymous"){ if (suc_type){ __$(".li_fav_button_"+ajx_pub_var+" a").hide(); //input __$(".li_fav_button_"+ajx_pub_var+" ."+suc_type[1]).show(); }else{ __$(".li_fav_button_"+ajx_pub_var+" a").toggle(); //input } } }else if (inf.indexOf ("notify_anyway")>0){ __$.fn.createDialog({ html:inf, method:"get", okLabel: "Cerrar", okClass:"btn", auto:"yes", progress:"yes", cancelClass:"btn", opacity: 0.9 }); } } if (warn=="no"){ msgType="no_confirm"; warn=""; func=function(inf){ if (inf.indexOf ('id="anonymous_email_div"')>0){ anonymous_subscribe(addvar, warn, type,inf); }else if (inf.indexOf ("success")>0){ var re=new RegExp(/\[\[success_type=(.*)\]\]/ig); var suc_type=re.exec(inf); if (suc_type!="anonymous"){ if (suc_type){ __$(".li_fav_button_"+ajx_pub_var+" a").hide(); //input __$(".li_fav_button_"+ajx_pub_var+" ."+suc_type[1]).show(); }else{ __$(".li_fav_button_"+ajx_pub_var+" a").toggle(); //input } } }else{ __$.fn.createDialog({ html:inf, method:"get", okLabel: "Cerrar", okClass:"btn", auto:"yes", progress:"yes", cancelClass:"btn", /*success:func,*/ opacity: 0.9 }); } }; }else{ msgType=""; } if (warn){ direct_subscribe_warn_complex(addvar,warn,func,eml); }else{ direct_ajax_complex(addvar,func,msgType,eml); } return false; } function direct_ajax(addvar,func,msgType){ direct_ajax_complex(addvar,func,msgType,""); } function direct_ajax_complex(addvar,func,msgType,eml){ if (!func)func=function(inf){ return ""; }; if (msgType=="no_confirm"){ __$.ajax({ url:"tus-favoritos.php", type:"get", data:"ajax=1&"+addvar+"&eml="+encodeURI(eml), success:func, beforeSend:function(){ __$('#ubr_alert').html(""); __$('body').append("
"); }, complete:function(){ __$('#ajax_loader_wait').remove(); } }); }else{ __$.fn.createDialog({ addr: "tus-favoritos.php", method:"get", data:"ajax=1&"+addvar+"&eml="+encodeURI(eml), okLabel: "Cerrar", okClass:"btn", auto:"yes", progress:"yes", cancelClass:"btn", success:func, opacity: 0.9 }); } } function make_ajax_now(addvar) { return direct_ajax(addvar,"",""); } function make_vote(addvar,vote,e_id,votnum) { return make_vote_gen(addvar,vote,e_id,votnum,"comment"); } function make_text_vote(addvar,vote,e_id,votnum) { return make_vote_gen(addvar,vote,e_id,votnum,"text"); } function make_thread_vote(addvar,vote,e_id,votnum) { return make_vote_gen(addvar,vote,e_id,votnum,"thread"); } function make_vote_gen(addvar,vote,e_id,votnum,vtype) { var fil="comment_vote.php"; if (vtype=="thread"){ fil="thread_vote.php"; }else if (vtype=="text"){ fil="includes/text_vote.php"; } __$.fn.createDialog({ addr: fil, method:"get", data:"id="+encodeURI (addvar)+"&vk="+encodeURI (vote), okLabel:"Cerrar", okClass:"btn", auto:"yes", progress:"yes", cancelClass:"btn", checkMsg: function(inf){ if (inf.indexOf ("success")>0){ return false; }else return true; }, success: function(inf) { if (inf.indexOf ("success")>0){ votnum=parseInt(votnum); vote=parseInt(vote); votnum +=vote; res=""; if (votnum<0)res=""+votnum+""; if (votnum>0)res="+"+votnum+""; if (votnum==0)res=""+votnum+""; __$("#"+e_id).html('