Login
    |

Coding help
 
Post new topic   { POST_REPLY_TOPIC }    SKC MTA Server Forum Index -> General Chat
Previous topic :: Next topic  
ZerO
SKC Elite Member


Joined: 21 Nov 2007
Posts: 160
Location: Orimattila, Finland


Posted: 24 Oct 2009, 16:03    Post subject: Coding help

Hey

Im doin som chat thingy for my website, and im stuck figurin out how to do the following:

I have my page index.php?p=chat which includes chat.php from /pages.
I used to have my chat code at that chat.php, but now i put the code to chatscript.php, which is iframe's src (only the iframe tag at chat.php). so i need to update the iframe the way SKC shoutbox does, every few secs and i someone post something, the whole page dows not refresh.

I tried to make <body onload="chatrefresh()"> and in head section had my scripts.js file. there was this refresh function w/ somethin like makin chatbox a variable by element id , and then chatbox.reload(true) and settimeout("chatrefresh()", 5000)

the test chatscript only included a text and php date to echo seconds

i got it to work, it posted the text and time at my chat page, but it did not refresh the time every few secs.

for skey or someone who knows the way skc shoutbox is done (looked the source, but dindt figure out how the hell its updated? is it the shoutbox_forum.php itself which is updatin independently or the iframe executes the src every few secs or when postin a message?) that is just the way i want to make my chat.

don want some phpbb related thing cuz i don have forum there, but if ya could help me make the iframe update its content or some code for the chatscript so its kinda similar to the SKC style.

ask for more detailed things about tha script if ya willin to help :) (if you understood anything i typed) im makin som test page so ya can test the way its now (the orig. is finnish and requires login)
Top
Profile Send private message
Bagpuss
SKC Elite Member
User avatar

Joined: 19 Sep 2007
Posts: 1200
Location: NL


Posted: 25 Oct 2009, 15:48    Post subject:

Top
Profile Send private message
ZerO
SKC Elite Member


Joined: 21 Nov 2007
Posts: 160
Location: Orimattila, Finland


Posted: 25 Oct 2009, 18:30    Post subject:

Thanks! It works now.

Gotta learn some AJAX to make posting not refresh the whole page but it doesnt really matter cuz the page is quite simple and it doenst take long to load it.
Top
Profile Send private message
Display topics from previous: Sort by
Post new topic   { POST_REPLY_TOPIC }    SKC MTA Server Forum Index -> General Chat



Using mChat © phpBB3BBCodes.com
Powered by phpBB © 2001, 2005, 2007 phpBB Group
cron