26

Re: OLD TOPIC TO DELETE

very nice mod keep it up tongue

27

Re: OLD TOPIC TO DELETE

spycam wrote:

faax,
Please tell how do u include chatbox on index.php your forum?

it's simple... set up height and width of chatbox from admin plugins and
open index.php
find (line ~39):

require PUN_ROOT.'header.php';

add after

include PUN_ROOT.'chatbox.php';

save/upload

and now there is modification of ajax_chat.js (located in /include/js)

// Some misc. definitions
var sending = false;


//    Check if our browser will support this...
function createRequestObject() {

   var req;

   if(window.XMLHttpRequest){
      // Firefox, Safari, Opera...
      req = new XMLHttpRequest();
   } else if(window.ActiveXObject) {
      // Internet Explorer 5+
      req = new ActiveXObject("Microsoft.XMLHTTP");
   } else {
      return true; // Revert to the regular .php script if there isn't any ajax support. Will throw some JS errors, but hey, what can you do, right? ;)
   }

   return req;

}

// Make the XMLHttpRequest object
var http = createRequestObject();

//    Function used for posting a new entry on the chat page
function sendRequestPost(form_sent, form_user, req_message) {

    var req_username = "";
    var req_email = "";
    var email = "";

    getInput = document.getElementsByTagName("input");
    for (i=0; i< getInput.length; i++) {
            if(getInput[i].name == "req_username") {
                req_username = getInput[i].value;
            }
            if(getInput[i].name == "req_email") {
                req_email = getInput[i].value;
            }
            if(getInput[i].name == "email") {
                email = getInput[i].value;
            }
    }

    // Open PHP script for requests
    http.open('POST', 'index.php', true);
  http.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded; charset=utf-8');
    var postvars = 'form_sent=' + form_sent + '&form_user=' + form_user.replace(/&/g,"%26") + '&req_message=' + req_message.replace(/&/g,"%26") + '&ajax=1' + '&submit=1' + '&req_username=' + req_username + '&req_email=' + req_email + '&email=' + email;
    http.onreadystatechange = handleResponse;
    http.send(postvars);

    // Disable input fields while posting or refreshing
    disableThis = document.getElementsByTagName("input");
    for (i=0; i< disableThis.length; i++) {
            disableThis[i].disabled = true;
    }

    sending = true; // Let the script know that we're trying to post. Used to empty the textarea afterwards, if successful, while not touching it on a refresh
}


//    Function to refresh the chatbox
function refreshBox() {

    // Open PHP script for requests
    http.open('POST', 'index.php', true);
    http.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded; charset=utf-8');
    var postvars = 'ajax=1';
    http.onreadystatechange = handleResponse;
    http.send(postvars);

    // Disable input fields while posting or refreshing
    disableThis = document.getElementsByTagName("input");
    for (i=0; i< disableThis.length; i++) {
            disableThis[i].disabled = true;
    }
}


function getHost(hostId) {
    // Open PHP script for requests
    http.open('POST', 'index.php?get_host='+hostId, true);
    http.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded; charset=utf-8');
    var postvars = 'ajax=1';
    http.onreadystatechange = handleResponse;
    http.send(postvars);
}


// Function to delete specific chatbox posts
function deleteMsg(delThis, usrPostCount) {
    // Open PHP script for requests
    http.open('POST', 'index.php?del='+delThis+'&usr='+usrPostCount, true);
    http.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded; charset=utf-8');
    var postvars = 'ajax=1';
    http.onreadystatechange = handleResponse;
    http.send(postvars);
    document.getElementById('del'+delThis).innerHTML = 'deleting message…';
}


//  Function to handle the data we recieve back from the script.
function handleResponse() {

   if(http.readyState == 4 && http.status == 200){

      // Text returned FROM the PHP script
      var response = http.responseText;

      if(response) {
         // UPDATE page with new content
         document.getElementById("scrollbox").innerHTML = response;

        if(window.sending === true) {
             document.getElementById("req_message").value = "";
        }
                // Re-enable input fields after posting or refreshing
                disableThis = document.getElementsByTagName("input");
                for (i=0; i< disableThis.length; i++) {
                        disableThis[i].disabled = false;
                }
      }
   }

}

save/upload

i think this is ugly way... wink but simple?

sorry 4 my bad english

it's just me...

Re: OLD TOPIC TO DELETE

@faax : Hummmmm aie aie aie,

Your solution is for users who use the modification of PBBChatbox 1.0 (AJAX) from CodeXP.

Your solution is not compatible with PBBChatbox 2.0 (AJAX).

Becarfull, if you use PBBChatbox 2.0 don't use this modification to your index.php

29 (edited by faax 2006-07-03 12:58)

Re: OLD TOPIC TO DELETE

ops... sorry! sorry! sorry!

there is language (Bosnian - utf-8 or windows-1250)

<?php

// Language definitions used in chatbox.php
$lang_chatbox = array(

'Page_title'            =>    'Porukice',
'Chatbox'            =>    'Porukice',
'Posts'                =>    ' komentari',
'Sending'            =>    'Slanje komentara...',

'No Read Permission'        =>    'Vi nemate pristupa ?itati porukice!',
'No Post Permission'        =>    'Vi nemate pristupa upisivati porukice',
'No Message'            =>    'Trenutno nema porukica...',

'Message'            =>    'Poruka',
'Btn Send'            =>    'Po?alji',
'Autoscroll'            =>    'Automatski scroll',

'Error Title'            =>    'Gre?ka',
'Error No message'        =>    'Morate upisati porukicu.',
'Error Too long message'    =>    'Va?a poruka je preduga!',

);

now i check your chatbox, looks better wink and ... i must include this in index.php ... wink

it's just me...

30

Re: OLD TOPIC TO DELETE

ok so if faax's mod does'nt work, does anybody know how to include it on the index (i'd do it by myself but i'm noob @ JavaScript)

31

Re: OLD TOPIC TO DELETE

loodos wrote:

ok so if faax's mod does'nt work, does anybody know how to include it on the index (i'd do it by myself but i'm noob @ JavaScript)

check wich mod you use...

it's just me...

32 (edited by spycam 2006-07-04 06:11)

Re: OLD TOPIC TO DELETE

faax.
It doesnt work on version chatbox 1.0

Notice: Constant PUN_ROOT already defined in /home/ruspra/public_html/go/chatbox.php on line 25

Fatal error: Cannot redeclare check_cookie() (previously declared in /home/ruspra/public_html/go/include/functions.php:28) in /home/ruspra/public_html/go/include/functions.php on line 28

33 (edited by faax 2006-07-04 11:59)

Re: OLD TOPIC TO DELETE

you have error because of header.php
check mail i can't post here

it's just me...

Re: OLD TOPIC TO DELETE

Can U  explain 4 all?

35

Re: OLD TOPIC TO DELETE

see here...

it's just me...

36

Re: OLD TOPIC TO DELETE

Thanks alot! Its worked perfect for me, Check it out at:
www.awtips.com/forums/chatbox.php

37

Re: OLD TOPIC TO DELETE

Ok its work. Now i use this chatbox2 on index.php
www.ruspravo.net/go

Re: OLD TOPIC TO DELETE

Can someone make a page with just the chatbox in it?  I would like to put it in a separate frame for my forum so people can constantly see the chatbox.

39 (edited by rhan 2006-07-18 05:37)

Re: OLD TOPIC TO DELETE

I have some problem with this chatbox, sometimes an error appear a few seconds in chat window :

HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
Internal server Error
Please contact your admin at ...

I don't know what it is sad

It seems to be a problem with the refresh function if the server can't answer quickly.. but maybe i'm wrong

Re: OLD TOPIC TO DELETE

dss wrote:

I'd love see the topmost new message appear at the top, or have an option to choose top or bottom order.

Be great ! How can we change the order in the code ?

41

Re: OLD TOPIC TO DELETE

pokemon_jojo wrote:

@faax : Hummmmm aie aie aie,
Your solution is for users who use the modification of PBBChatbox 1.0 (AJAX) from CodeXP.
Your solution is not compatible with PBBChatbox 2.0 (AJAX).

pokemon, any hacks so far to make the v2.0 displays on index.php? I am using faax solution using codexp mod, would be great if your v2.0 can be used instead -- more features that i can use i.e. autorefresh etc and admin panel. tq

Re: OLD TOPIC TO DELETE

Now it's possible to put your chatbox on your index, see my code, i think it's more symply than codexp mod wink

Re: OLD TOPIC TO DELETE

Ok... Sorry but how do you delete messages??? why did you not use a simliar function to CodeXP for deleting messages?

People keep bringing it up but cannot find your response.

44 (edited by elbekko 2006-07-28 12:10)

Re: OLD TOPIC TO DELETE

I'll try doing the dutch language pack if you want smile

<?php

// Language definitions used in chatbox.php
$lang_chatbox = array(

'Page_title'                =>    'ChatBox',
'Chatbox'                    =>    'ChatBox',
'Posts'                        =>    ' Berichten in ChatBox',
'Sending'                    =>    'Aan het verzenden...',

'No Read Permission'        =>    'U hebt geen toelating om deze ChatBox te lezen.',
'No Post Permission'        =>    'U hebt geen toelating om berichten in deze ChatBox te versturen.',
'No Message'                =>    'Geen berichten in de ChatBox.',

'Message'                    =>    'Bericht',
'Btn Send'                    =>    'Zend',
'Autoscroll'                =>    'Automatisch Scrollen',

'Error Title'                =>    'Fout',
'Error No message'            =>    'U moet een bericht ingeven.',
'Error Too long message'    =>    'Uw bericht is te lang.',

);

There you go... did my best, but I always sucked at translating things from english to dutch tongue

45 (edited by orchid 2006-07-28 16:31)

Re: OLD TOPIC TO DELETE

my Italian translation

<?php

// Language definitions used in chatbox.php
// ITALIAN translation by Orchid
$lang_chatbox = array(

'Page_title'            =>    'ChatBox',
'Chatbox'            =>    'ChatBox',
'Posts'                =>    ' ChatBox Posts',
'Sending'            =>    'Inviando...',

'No Read Permission'        =>    'Non hai permessi per leggere la ChatBox.',
'No Post Permission'        =>    'Non hai i permessi per postare nella ChatBox.',
'No Message'            =>    'Nessun messaggio nella ChatBox.',

'Message'            =>    'Messaggio',
'Btn Send'            =>    'Invia',
'Autoscroll'            =>    'Auto Scroll',

'Error Title'            =>    'Errore',
'Error No message'        =>    'Devi inserire un messaggio.',
'Error Too long message'    =>    'Il tuo messaggio è troppo lungo.',

);

really good work!!! thanks for this mod.

46

Re: OLD TOPIC TO DELETE

I just installed Chat and I love it! Thank you. I would like to purge chat messages every few hours, how do I do this?

Thanks, Yoshi

47

Re: OLD TOPIC TO DELETE

Hi

Here's my Norwegian translation wink

<?php

// Språkdefinisjoner brukt i chatbox.php
$lang_chatbox = array(

'Page_title'            =>    'ChatBox',
'Chatbox'            =>    'ChatBox',
'Posts'                =>    ' ChatBox innlegg',
'Sending'            =>    'Sender...',

'No Read Permission'        =>    'Du har ingen tilgang til å lese i ChatBox.',
'No Post Permission'        =>    'Du har ingen tilgang til å skrive i ChatBox.',
'No Message'            =>    'Ingen meldinger i ChatBox.',

'Message'            =>    'Melding',
'Btn Send'            =>    'Send',
'Autoscroll'            =>    'Auto Scroll',

'Error Title'            =>    'Feil',
'Error No message'        =>    'Du må skrive en melding',
'Error Too long message'    =>    'Din melding er for lang',

);

Re: OLD TOPIC TO DELETE

Thx a lot, i have add it on punres.org wink

49 (edited by mystic 2006-11-01 18:10)

Re: OLD TOPIC TO DELETE

vietnamese language pack

download here

including plugin and lang files also

I love sky - i love flowers - and i love myself :D

Re: OLD TOPIC TO DELETE

i have not permission to download it !