1

Topic: ChatBox (ajax) on index.php

there is ChatBox_ajax.zip by CodeXP (download and install)
set up height and width from Administration / plugins.
open index.php, find (line ~ 39):

require PUN_ROOT.'header.php';

add after:

include PUN_ROOT.'chatbox.php';

open chatbox.php, remove lines wich include header.php and footer.php
open /include/js/ajax_chat.js, find:

    http.open('POST', 'chatbox.php', true);

replace with:

    http.open('POST', 'index.php', true);

find again:

    http.open('POST', 'chatbox.php', true);

replace with:

    http.open('POST', 'index.php', true);

find:

    http.open('POST', 'chatbox.php?get_host='+hostId, true);

replace with:

    http.open('POST', 'index.php?get_host='+hostId, true);

find:

    http.open('POST', 'chatbox.php?del='+delThis+'&usr='+usrPostCount, true);

and replace with:

    http.open('POST', 'index.php?del='+delThis+'&usr='+usrPostCount, true);

save/upload & check your index.php

if you have error post here... maybe i miss something wink

it's just me...

Re: ChatBox (ajax) on index.php

I use Russian language and this mod on index.php. i have problem with charset. Do u know how change charset?

3

Re: ChatBox (ajax) on index.php

mmk heres the error im getting its telling me that i cant not redeclare something thats already declared in include/functions.php

Fatal error: Cannot redeclare check_cookie() (previously declared in /home/fatalgam/public_html/fatal-gfx/include/functions.php:28) in /home/fatalgam/public_html/fatal-gfx/include/functions.php on line 28

You cant blame it on me because its a clean install.

Re: ChatBox (ajax) on index.php

chatbox.php is loading common.php, as is header.php. Change the include "common.php"; to include_once "common.php";

5

Re: ChatBox (ajax) on index.php

no its not loading header.php i deleted the lines that loaded in header.php from chatbox.php so that cant be the problem

Re: ChatBox (ajax) on index.php

spycam
copy/past directly from your browser russian language pack from here
http://punbb.org/forums/viewtopic.php?pid=71898#p71898

7

Re: ChatBox (ajax) on index.php

Tubby my fault...
open chatbox.php find (line ~ 26):

require PUN_ROOT.'include/common.php';

and replace with:

/* require PUN_ROOT.'include/common.php'; */

('coz common.php is already included from index.php)

it's just me...

Re: ChatBox (ajax) on index.php

faax,
I use this language pack and i have problem ...
I think this problem with charset...

9

Re: ChatBox (ajax) on index.php

faax wrote:

Tubby my fault...
open chatbox.php find (line ~ 26):

require PUN_ROOT.'include/common.php';

and replace with:

/* require PUN_ROOT.'include/common.php'; */

('coz common.php is already included from index.php)

Ok that solved my problem......i would like to place my chatbox at the bottom near the footer so that it does not attract much attention...the problem is is that after i have finished moving the include for the chatbox to the desired position(after the statistics block jsut before the footer) its gets werid. What happens is when i post it shows the boards inside the chatbox and then the chatbox message. Is funny cause after you reload the page it just shows the chatbox messages and is fine. Im thinking it has something to do with the javascript.

Re: ChatBox (ajax) on index.php

spycam wrote:

I use Russian language and this mod on index.php. i have problem with charset. Do u know how change charset?

raplace in chatbox.php

$lang_common['lang_encoding'] = 'utf-8';
header('Content-type: text/html; charset=utf-8');

with :

$lang_common['lang_encoding'] = 'windows-1251';
header('Content-type: text/html; windows-1251');