var username = avatar = ""; function paripe(username,avatar) { var text; text=$('#comentario').val(); $('div.enviando').hide(); $('#comentario').val(''); anadirElementoFinal(text,username,avatar); } function enviar_coment(texto,username,avatar) { $('div.enviando').show(); $.ajax({ type: "POST", url: "http://noticias.sectorjuegos.net/bcomenta.php", data: "comentario=" + texto + "&topic_id=5989", success: function(datos) { paripe(username,avatar); }}); } function anadirElementoFinal(texto,username,avatar) { var x; x=$(".comentarios_ul"); var comentario; comentario="
  • \
    \
    \

    "+username+"

    \ escribió el 6-09-2010 \
    \
    \ \
    \
    \ \
    "+texto+"
    \
    \
    \
  • "; x.append(comentario); x=$(".comentarios_ul li"); var cantidad=x.length; x=x.eq(cantidad-1); x.fadeIn(1000); } function analizar(datos) { if(datos!="error") { $('div.ho').hide(); var tempo=datos.split(","); username=tempo[0]; avatar=tempo[1] if(datos!="") $("img.avatar").attr("src","http://www.sectorjuegos.net/foro/images/avatars/" + tempo[1]); } else { $('div.error_log').show(); } } function regis_fb(){ $.ajax({ type:"POST", url: "http://noticias.sectorjuegos.net/get_fb.php", data: "", success: function(datos) { alert(datos); }}); } function enviar_log(user,pass) { $.ajax({ type:"POST", url: "http://noticias.sectorjuegos.net/datos/php/logu.php", data: "username=" + user + "&password=" + pass + "&login=1", success: function(datos) { analizar(datos); }}); }