Ir para conteúdo

POWERED BY:

Arquivado

Este tópico foi arquivado e está fechado para novas respostas.

Err0

chat.php Sistema de ban

Recommended Posts

Ola Para todos Tenho 1 Chat.php em meu project

Já tenho o sistema de /limpar.

Mas quero por o sistema de /banir usuario razão

Ja tentei de varias formas mas n conscegui Se alguem me ajudar Obrigado..

Meu chat.php

  <script>
 var chat = {
        ult_id: 0,
        pos: 'fechado',
        enviando: false,
        count: false,
        carreg: false,
        a: function() {
            $('.sus_hab').click(function() {
                var habb = $(this).attr('id').replace('u_', '');
                var atual = $('#texto_chat').val();
                $('#texto_chat').val('');
                $('#texto_chat').val(':sussurrar '+habb+' '+atual).focus();
            });
        },
        iniciar: function() {
            if ($.cookie('chat_pos') == 'aberto') {
                $('#chat').css('width', '610px');
                $('.button_chat[rel=max]').css('display', 'none');
                $('#chat').css('height', '205px');
                chat.pos = 'aberto';
            }
            $('.button_chat').click(function(){
                if( chat.carreg == false ) {
                    chat.carreg = true;
                    
                    if( chat.pos == 'fechado' ) {
                        
                        $('#chat').css('width', '610px');
                        $('.button_chat[rel=max]').animate({
                            top: '32px'
                        }, 200, function() {
                            $(this).css('display', 'none');
                            $('#chat').animate({
                                height: '205px'
                            }, 200, function() {
                                chat.pos = 'aberto';
                                chat.carreg = false;
                                $.cookie('chat_pos', 'aberto', { path: '/', expires: 7 });
                                chat.msgs();
                            });
                        });
                        

                    } else if( chat.pos == 'aberto' ) {
                        
                        $('#chat').animate({
                            height: '32px'
                        }, 200, function() {
                            $('.button_chat[rel=max]').css('display', 'block');
                            $('.button_chat[rel=max]').animate({
                                top: '0px'
                            }, 200, function() {
                                chat.pos = 'fechado';
                                $('#chat').css('width', '101px');
                                chat.carreg = false;
                                $.cookie('chat_pos', 'fechado', { path: '/', expires: 7 });
                            });
                        });
                        
                    }
                    
                }
            });
            chat.msgs();
        },
        msgs: function() {
            
            
            if (this.pos == 'aberto') {
                $.ajax({
                    type: 'GET',
                    url: 'chat/recebe.php',
                    data: { 'id': chat.ult_id },
                    dataType: 'json',
                    cache: false,
                    success: function (html) {
					if(html == "1"){
					document.location.href="/entrar?url=/home.php&msg=ban";			
					}
                        var texto = '';
						chat.msgs();
                        if(html[0] == 's') {
                        
                            for( i = 0; i < html[2].length; i++ ) {
                                if( $('#chat-' + html[2][i][4]).length == 0 ) {
                                    texto += '<div id="chat-' + html[2][i][4] + '" style="width:568px;padding:3px;background:' + html[2][i][3] + ';border-bottom:1px solid #bbb">';

                                    texto += '<div style="float:left;"><b style="font-size:10px;color:#333">' + html[2][i][0] + '</b><br><span style="font-size:9px;color:#666666;">' + html[2][i][1] + '</span></div>';

                                    texto += '<div style="width:1px;height:21px;border-right:1px solid #666;float:left;margin:4px 3px 0px 3px"></div>';

                                    texto += '<div style="width:438px;float:left;word-wrap:break-word;font-size:11px;color:#333333;max-width:438px">' + html[2][i][2] + '</div>';

                                    texto += '<div class="clear"></div>';

                                    texto += '</div>';
                                }
                            }
                            $('#content_chat').prepend( texto );
                            chat.ult_id = html[1];
                            
                        }
                    }
					
                });
            }

            clearTimeout(this.count);
            chat.count = setTimeout(function() {
                chat.msgs();
            }, 3000);
        },
        form: function() {
            $('#form_chat').submit(function() {
                clearTimeout(chat.count);
                if( chat.enviando == false ) {
                    chat.enviando = true;
                    $('#texto_chat').attr('disabled', 'disabled');
                    var txt = $('#texto_chat').val();
                    if( txt == '' ) {
                        chat.enviando = false;
                        alert('Digite alguma coisa!');
                        $('#texto_chat').removeAttr('disabled');
                    } else {
        
                        $.ajax({
                            type: 'POST',
                            url: 'chat/envia.php',
                            data: { 'texto': txt},
                            dataType: 'json',
                            success: function(html) {						
							if(html == "1"){
							document.location.href="/entrar?url=/home.php&msg=ban";						 
							}

							    if($('#texto_chat').val() == "/limpar"){
								$("#texto_chat").attr("disabled","");
								$("#texto_chat").val('');
								$("#content_chat").html('');
								chat.ult_id = 0;
								chat.enviando = false;
								chat.msgs();
								$('#texto_chat').val('').focus();
								}
                                if( html.erro == 'n' ) {
                                    $('#texto_chat').val('').focus();
                                } else {
                                    alert(html.msg);
                                }
                                $('#texto_chat').removeAttr('disabled');
                                chat.enviando = false;
                                chat.msgs();
								$('#texto_chat').val('').focus();
                            }
                        });
                    
                    }
                }
            return false;
            });
        }
    }
    $(function() {
        chat.iniciar();
        chat.form();
    });
    </script>
	
	
	
	 <div id="chat" style="z-entrar?url=/home.php&msg=:99999;width:101px;position:fixed;height:32px;bottom:0px;right:10px;margin-bottom:55px;overflow:hidden;">

        <div class="button_chat" rel="max" style="position:relative;float:right;width:101px;height:32px;cursor:pointer;opacity:0.9;background:url('/library/imagens/chat_min.png') no-repeat;"></div>

        <div class="clear"></div>

        <div style="width:610px;height:205px;background:url('/library/imagens/fundo_chat.png');">

            <div style="width:590px;margin:0px auto 4px auto;position:relative;top:10px;">

                <b style="color:#333333;float:left;">Chat Habbo Project</b> <span style="float:left;font-size:10px;color:#666666;padding-top:1px;padding-left:10px;">Habbo Project</span>

                <a href="javascript:;" class="button_chat" style="float:right;color:#666666;font-size:10px;" rel="min">Fechar [-]</a>

                <div class="clear"></div>

                <div style="width:590px;height:3px;background:url('/library/imagens/linear_chat.png') no-repeat;margin:2px auto 2px auto"></div>

                <div class="clear"></div>

            </div>

            <div class="clear"></div>

            <div id="content_chat" style="width:590px;height:140px;overflow-y:auto;overflow-x:hidden;margin:12px auto 3px auto"></div>

            <form action="javascript:;" id="form_chat">

                <input type="text" id="texto_chat" maxlength="125" style="width:470px;font-size:11px;font-family:verdana;color:#555;border:3px solid #ccc;margin-left:9px;" />

                <input type="submit" value="Enviar" style="background:#fff;font-weight:bold;width:85px;font-size:11px;font-family:verdana;color:#555;border:3px solid #ccc;margin-left:9px;" />

            </form>

        </div>

    </div>
	

Compartilhar este post


Link para o post
Compartilhar em outros sites

×

Informação importante

Ao usar o fórum, você concorda com nossos Termos e condições.