SitePoint Sponsor

User Tag List

Results 1 to 22 of 22
  1. #1
    SitePoint Addict goma's Avatar
    Join Date
    Jan 2002
    Location
    smelly armpit of Asia
    Posts
    305
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Web design chat room?

    Does anyone know of any decent web design chat rooms? The ones with minimal BS and flooders, with more serious discussions.
    http://www.soapbox101.com

  2. #2
    Perl/Mason Guru Flawless_koder's Avatar
    Join Date
    Feb 2002
    Location
    Gatwick, UK
    Posts
    1,206
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    If you mean live then Yes of course.

    Yahoo:

    join any old room and type:

    /join web design:1

    Once in there if you find the people are being a pain...
    ask for gbjk/flawless - Someone will know how to get
    hold of me and i can come help you there ( if not, and preferably, here ).

    You can also pm me here to get hold of me.

    You'll always get a better response, with a better
    difference of opinion and better ranging responses
    at Sitepoint though!

    Flawless
    ---=| If you're going to buy a pet - get a Shetland Giraffe |=---

  3. #3
    Drupaler bronze trophy greg.harvey's Avatar
    Join Date
    Jul 2002
    Location
    London, UK
    Posts
    3,258
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Anyone's welcome to use the one I'm developing -- it could do with testing and it's a bit quiet ...

    http://your.workcomms.com/dev/


  4. #4
    SitePoint Columnist Skunk's Avatar
    Join Date
    Jan 2001
    Location
    Lawrence, Kansas
    Posts
    2,066
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    #webdev on irc.quakenet.org is pretty good.

  5. #5
    Perl/Mason Guru Flawless_koder's Avatar
    Join Date
    Feb 2002
    Location
    Gatwick, UK
    Posts
    1,206
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally posted by greg.harvey
    Anyone's welcome to use the one I'm developing -- it could do with testing and it's a bit quiet ...

    http://your.workcomms.com/dev/


    What's it written in?

    I've recently written one too - but for completely different
    purposes.

    Flawless
    ---=| If you're going to buy a pet - get a Shetland Giraffe |=---

  6. #6
    Drupaler bronze trophy greg.harvey's Avatar
    Join Date
    Jul 2002
    Location
    London, UK
    Posts
    3,258
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    It's just VBS - I'm quite chuffed with it though, since only a few months ago I wouldn't have known where to start. The only thing is that (obviously) without an applet or something you have to put up with constant browser refreshes to maintain the latest posts. Still, I've made it so that you can turn the refresh rate down/off if the clicking drives you insane!

  7. #7
    Perl/Mason Guru Flawless_koder's Avatar
    Join Date
    Feb 2002
    Location
    Gatwick, UK
    Posts
    1,206
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    You're JOKING!!!

    Ummm - ok:

    I've written an entire suite that allows
    for conferencing, individual chatting etc.
    The messages are checked for every 1 second.
    The session data ( on other users etc ) is updated
    ever 10 seconds.

    It uses a complex system of remote scripting that i wrote
    to keep up with everything, send messages etc...
    The system is driven by a postgres database backend,
    which uses pl/pgsql stored proceedures for speed when
    doing things like creating new conferences, logging users
    in and out, leaving conferences and the same with
    conversations.

    Have you considered this approach?

    Flawless
    ---=| If you're going to buy a pet - get a Shetland Giraffe |=---

  8. #8
    Drupaler bronze trophy greg.harvey's Avatar
    Join Date
    Jul 2002
    Location
    London, UK
    Posts
    3,258
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Flawless,

    I wouldn't even know where to START writing something that complex!

    G

  9. #9
    Perl/Mason Guru Flawless_koder's Avatar
    Join Date
    Feb 2002
    Location
    Gatwick, UK
    Posts
    1,206
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    It didn't take too long at all really.

    I can show you how the database and remote scripting looks if you'd like?

    Flawless
    ---=| If you're going to buy a pet - get a Shetland Giraffe |=---

  10. #10
    Drupaler bronze trophy greg.harvey's Avatar
    Join Date
    Jul 2002
    Location
    London, UK
    Posts
    3,258
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Well I'm always interested in that sort of stuff.

    The trouble with me is I have no formal programming background so I tend to bodge by with code that works but probably isn't the best thing for the job, until one of my friends who really does know what he's doing slaps his head and says "I can't believe you're doing it that way!! Give it here!" That's how I learn ...

  11. #11
    Perl/Mason Guru Flawless_koder's Avatar
    Join Date
    Feb 2002
    Location
    Gatwick, UK
    Posts
    1,206
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    lol - ummm - i think you'll be fine mate.

    I've never studied computer science once in my life.
    Never had ANY formal education in it.

    I was due to go to Manchester University to study for
    a 4 year bsc -> Masters - but i turned it down eventually
    after being sure my job is completely secure.

    I've learnt over 20 different languages from full
    Programming, scripting to light weight markup languages,
    all in the last few years without any courses, obviously.

    I believe a lot of people learn like that.

    Do you know RDBMS's well?
    It's written in Postgres, so i'm asking so i know
    whether or not the create structure would make sense
    to you.

    It's a good path you're on, btw.

    Flawless
    ---=| If you're going to buy a pet - get a Shetland Giraffe |=---

  12. #12
    Drupaler bronze trophy greg.harvey's Avatar
    Join Date
    Jul 2002
    Location
    London, UK
    Posts
    3,258
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I don't know them well as such, but then sometimes I know more than I think and just don't know what it's called! Run it by me and I'll either go "ohhhhhh yeh" or "HELP!"

  13. #13
    Perl/Mason Guru Flawless_koder's Avatar
    Join Date
    Feb 2002
    Location
    Gatwick, UK
    Posts
    1,206
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Part 1 / 5 - the db structure

    Code:
    create sequence people_seq;
    create sequence conferences;
    create table servers (
            id              int Primary Key default nextval('people_seq'),
            username        varchar(20),
            name            varchar(30),
            priority        int);
    
    create table clients (
    	id		int Primary Key default nextval('people_seq'),
    	username	varchar(20),
    	credit_card     bigint,
    	rate 		numeric(10,2),
    	loc_code	varchar(10));
    
    create table current_sessions (
    	id              serial Primary Key,
    	server		int,
    	client		int,
    	time		timestamp,
    	status		varchar(10));
    
    create view persons as select id, username, 'servers' AS type from servers UNION select id, username, 'clients' AS type from clients;
    
    create table convs (
    	id		serial Primary Key,
    	time		timestamp,
    	user_id		int,
    	message		text,
    	session_id	int,
    	constraint convs_sessions FOREIGN KEY (session_id) references current_sessions (id) on delete 
    
    cascade);
    create index conv_time on convs (time);
    
    create table previous_sessions (
    	id              int unique Primary Key,
    	server		int,
    	client		int,
    	time		timestamp,
    	status		varchar(10));
    
    create table logged_convs (
    	id		int unique Primary Key,
    	time		timestamp,
    	user_id		int,
    	message		text,
    	session_id	int,
    	constraint convs_sessions FOREIGN KEY (session_id) references previous_sessions (id) ON DELETE 
    
    CASCADE);
    
    CREATE TABLE session_logs (
    	id		serial Primary Key,
    	session_id	int,
    	time		timestamp,
    	length		interval,
    	charge		numeric(10,2),
    	paid		boolean,
    	constraint sess_prev_sessions FOREIGN KEY (session_id) REFERENCES previous_sessions (id) ON DELETE 
    
    CASCADE);
    
    CREATE TRIGGER logSession BEFORE DELETE ON current_sessions FOR EACH ROW EXECUTE PROCEDURE logSession();
    ---=| If you're going to buy a pet - get a Shetland Giraffe |=---

  14. #14
    Drupaler bronze trophy greg.harvey's Avatar
    Join Date
    Jul 2002
    Location
    London, UK
    Posts
    3,258
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Ok. I have done some of that before. Never seen SEQUENCE or TRIGGER before but just looked them up and that makes sense now. I take it that's SQL Server only stuff.

  15. #15
    Perl/Mason Guru Flawless_koder's Avatar
    Join Date
    Feb 2002
    Location
    Gatwick, UK
    Posts
    1,206
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Part 2 / 5 The functions:

    Nope - PostgreSQL - and no - sequences and triggers
    are universal.

    Code:
    CREATE FUNCTION ActivateServer (text) RETURNS int AS '
            DECLARE
            username_in     ALIAS FOR $1;
            user_id         int;
            prev            int;
            prev_id         int;
            loop_ctl        int :=0;
    	pending		int;
    	convos		int;
    	moving_id	int;
            BEGIN
    
                    SELECT INTO user_id id FROM servers WHERE username=username_in;
    		UPDATE current_sessions SET server=NULL, status=''PEND'' where server=user_id AND status != ''AVAIL'' AND status != ''CONF'';
    		        
    	        WHILE loop_ctl = 0 LOOP
    			SELECT INTO pending count(id) FROM current_sessions WHERE status=''PEND'';
    
    			SELECT INTO convos count(id) FROM current_sessions WHERE server=user_id AND status=''CONV'';
    			
                            IF pending = 0 THEN
                                    loop_ctl:=1;
                            END IF;
                            IF convos  = 5 THEN
                                    loop_ctl:=1;
                            END IF;
    
    			SELECT INTO moving_id id FROM current_sessions WHERE status=''PEND'' order by time DESC;
    			UPDATE current_sessions SET server=user_id, status=''CONV'' where id=moving_id;
    		END LOOP;
    		SELECT INTO convos count(id) FROM current_sessions WHERE server=user_id;
    		WHILE convos < 5 LOOP
    			INSERT INTO current_sessions (server, time, status) VALUES (user_id, ''NOW'',''AVAIL'');
    			SELECT INTO convos count(id) FROM current_sessions WHERE server=user_id;		
    		END LOOP;        
    	        RETURN user_id;
            END;'
    language 'plpgsql';
    
    
    CREATE FUNCTION GetAssigned (int, refcursor) RETURNS refcursor AS '
    	DECLARE
    	user_id ALIAS FOR $1;
    	BEGIN
    		OPEN $2 FOR SELECT cs.id, s.username, c.username, cs.status, cs.client FROM current_sessions cs INNER JOIN persons s ON (s.id=cs.server) INNER JOIN persons c ON (c.id=cs.client) WHERE ((cs.status != ''AVAIL'') AND ((cs.server=user_id) OR (cs.client=user_id AND status != ''CONF'')));
    
    	return $2;
    	END;' 
    language 'plpgsql';
    
    
    CREATE FUNCTION NewClient (text,refcursor) RETURNS refcursor AS '
            DECLARE
            username_in ALIAS FOR $1;
            user_id int;
            server_id int;
            session int;
            prev_server int;
            BEGIN
            SELECT INTO user_id id FROM clients WHERE username=username_in;
            SELECT INTO prev_server server FROM current_sessions WHERE client=user_id;
            IF FOUND THEN
                    DELETE FROM current_sessions where client=user_id AND status != ''ADMIN'';
    		IF prev_server THEN
    	                INSERT INTO current_sessions (server, time, status) VALUES (prev_server, ''NOW'',''AVAIL'');
    		END IF;
            END IF;
            SELECT INTO server_id, session s.server, s.id from current_sessions s inner join servers u on (s.server=u.id) where s.status=''AVAIL'' order by u.priority DESC;
    	IF FOUND THEN
    	        UPDATE current_sessions SET client=user_id, status=''CONV'' WHERE id=session;
    	        OPEN $2 FOR SELECT c.client, c.id, s.name FROM current_sessions c inner join servers s on (c.server=s.id) where c.id=session;
    	ELSE
    		insert into current_sessions (client, time, status) VALUES (user_id, ''NOW'', ''PEND'');
    		open $2 FOR SELECT client, id, ''-1'' FROM current_sessions where client=user_id;
    	END IF;
            return $2;
            END;'
    language 'plpgsql';
    
    create FUNCTION CloseClient (int, int) RETURNS int AS '
    	DECLARE
    	session_id ALIAS FOR $1;
    	client_id ALIAS FOR $2;
    	server_id int;
    	new_client int;
    	BEGIN
    	SELECT INTO server_id server FROM current_sessions WHERE id=session_id AND client=client_id;
    	IF FOUND THEN
    		DELETE FROM current_sessions WHERE id=session_id;
    		SELECT INTo new_client id FROM current_sessions WHERE status=''PEND'' ORDER BY TIME;
    		IF FOUND THEN
    			UPDATE current_sessions SET server=server_id WHERE id=new_client;
    		ELSE
    			INSERT INTO current_sessions (server, time, status) VALUES (server_id,''NOW'',''AVAIL'');
    		END IF;
    		return 1;
    	ELSE
    		return -1;
    	END IF;
    	END;'
    language 'plpgsql';
    
    CREATE FUNCTION logSession () RETURNS opaque AS '
    	DECLARE
    	client_rate	numeric(10,2);
    	period 		interval;
    	to_charge	numeric(10,2);
    	BEGIN
    		SELECT INTO client_rate rate from clients c where c.id=OLD.client;
    		SELECT INTO period max(time) - min(time) FROM convs WHERE session_id=OLD.id;
    		SELECT INTO to_charge (to_number(to_char(period, ''SSSS''), ''99999D99'') / 60 * client_rate);
    		
    		INSERT INTO previous_sessions SELECT * from current_sessions c WHERE c.id=OLD.id;
    		INSERT INTO logged_convs SELECT * from convs c WHERE c.session_id=OLD.id;
    		IF (to_charge::integer > 0.10) THEN
    			INSERT INTO session_logs (session_id, time, length, charge, paid) VALUES (OLD.id,OLD.time,period, to_charge, ''false'');
    		END IF;
    	RETURN OLD;
    	END;'
    language 'plpgsql';
    
    CREATE FUNCTION NewAdmin (int,text) RETURNS text AS '
            DECLARE
            first_server ALIAS FOR $1;
            second_server ALIAS FOR $2;
    	second_sid  int;
    	old_session int;
    	new_session int;
            BEGIN
    		SELECT INTO new_session id FROM current_sessions WHERE server=first_server AND status=''AVAIL'' LIMIT 1;
    		IF NOT FOUND THEN
    			RETURN ''You have no available sessions'';
    		ELSE
    			SELECT INTO old_session, second_sid c.id, c.server FROM current_sessions c INNER JOIN servers s ON (c.server = s.id) WHERE c.server=s.id AND s.username=second_server AND status=''AVAIL'' LIMIT 1;
    			IF NOT FOUND THEN
    				RETURN ''User is not available for a conversation - sorry'';
    			ELSE
    				DELETE FROM current_sessions WHERE id=old_session;
    				UPDATE current_sessions SET client=second_sid, status=''ADMIN'' WHERE id=new_session;
    				RETURN (new_session);
    			END IF;
    		END IF;
            END;'
    language 'plpgsql';
    
    CREATE FUNCTION DeActivateServer (text) RETURNS int AS '
            DECLARE
            username_in     ALIAS FOR $1;
            user_id         int;
            BEGIN
    
                    SELECT INTO user_id id FROM servers WHERE username=username_in;
    		UPDATE current_sessions SET server=NULL, status=''PEND'' where server=user_id AND status = ''CONV'';
    		DELETE FROM current_sessions WHERE server = user_id AND status LIKE ''A%'';
    		DELETE FROM current_sessions WHERE client = user_id AND status = ''ADMIN'';
    		return 1;
    	END;'
    language 'plpgsql';
    
    CREATE FUNCTION NewConf (int) RETURNS text AS '
            DECLARE
            first_server ALIAS FOR $1;
            new_session int;
    	live int;
            BEGIN
    	SELECT INTO live id FROM current_sessions WHERE server=first_server AND status = ''CONF'';
    	IF FOUND THEN
    		RETURN ''You are already in one conference - try not to be greedy - eh?'';
    	ELSE
                    SELECT INTO new_session id FROM current_sessions WHERE server=first_server AND status=''AVAIL'' LIMIT 1;
                    IF NOT FOUND THEN
                            RETURN ''You have no available sessions to start this conference'';
    		ELSE
    			UPDATE current_sessions SET client = (select nextval(''conferences'')), status=''CONF'' WHERE id=new_session;
    			RETURN new_session::text||'' CONF''||(select currval(''conferences''))::text;
    		END IF;
    	END IF;
    	END;'
    language 'plpgsql';
    
    CREATE FUNCTION ExistingConf (int, text) RETURNS text AS '
    	DECLARE
    	conference ALIAS FOR $1;
    	user ALIAS FOR $2;
    	userid int;
    	usertype text;
    	new_session int;
    	live int;
    	BEGIN
    	SELECT INTO userid, usertype id, type from persons where username = user;
    	SELECT INTO live id FROM current_sessions WHERE server=userid AND status = ''CONF'';
    	IF FOUND THEN
            	RETURN ''This user is already in a conference - send them a message!'';
    	ELSE
    		IF (usertype = ''servers'') THEN
    			SELECT INTO new_session id FROM current_sessions WHERE server = userid AND status = ''AVAIL'' LIMIT 1;
    			IF NOT FOUND THEN
    				RETURN ''The selected server has no available sessions - If you are in a conversation with him then please end this to allow the conference to begin.'';
    			ELSE
    				UPDATE current_sessions SET client = conference, status=''CONF'' WHERE id = new_session;
    				RETURN new_session::text||''CONF''||conference;
    			END IF;
    		ELSE
    			SELECT INTO new_session id FROM current_sessions WHERE client = userid AND status != ''CONF'';
    			IF NOT FOUND THEN
    				RETURN ''For some reason the client cannot join the conference. Talk to Gareth - he should be able to fix my syntax!'';
    			ELSE
    				UPDATE current_sessions SET server=userid, client=conference, status=''CONF'' WHERE id = new_session;
    				RETURN new_session::text||''CONF''||conference;
    			END IF;
    		END IF;	
    	END IF;
    	END;'
    language 'plpgsql';
    You can probably guess what functions are used for what.

    But then you can see more specifically how they work in the next part... the calling language.
    All the functions are inside postgres using the language
    pl/pgsql:

    Code:
    CREATE FUNCTION plpgsql_call_handler() RETURNS OPAQUE AS '/usr/lib/pgsql/plpgsql.so' LANGUAGE 'C';
    
    CREATE LANGUAGE 'plpgsql' HANDLER plpgsql_call_handler LANCOMPILER 'PL/pgSQL';
    Flawless
    ---=| If you're going to buy a pet - get a Shetland Giraffe |=---

  16. #16
    Drupaler bronze trophy greg.harvey's Avatar
    Join Date
    Jul 2002
    Location
    London, UK
    Posts
    3,258
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Cool. Fortunately my tinkering with SQL strings leads me to understand most of this ....


  17. #17
    Perl/Mason Guru Flawless_koder's Avatar
    Join Date
    Feb 2002
    Location
    Gatwick, UK
    Posts
    1,206
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Next part

    Good - then hopeully you'll understand then how this works.

    GetServerMessages.js is the script file updated remotely every second:

    Mason is written upside down.
    <%init> sections go at the bottom - but are read first.
    Then it resumes from the top.

    Code:
    %# $Id: GetServerMessages.js,v 1.8 2002/07/25 15:47:15 gbjk Exp $
    % foreach my $message_set (sort(keys(%messages))){
    %	next if (!$message_set);
    %	my ($Mclient, $Mmsg) = @{$messages{$message_set}};
    	if (document.all.content_<%$Mclient%>){
    		var Nmsg=document.createElement('SPAN');
    		Nmsg.innerHTML='<%$Mmsg%><br>';
    		document.all.content_<%$Mclient%>.appendChild(Nmsg);
    		if ('<%$Mclient%>' != user) document.all.<%$Mclient%>.className='blueform'
    		}
    %	}
    % foreach my $c (@clients){
    %	next if (!$c);
    	document.all.content_<%$c%>.scrollTop=document.all.<%$c%>.scrollHeight;
    %	}
    document.all.message.focus();
    msg_id=<% $Nmsg_id %>;
    <%($msg_count)?"window.focus();":""%>
    <%init>
    
    my %messages;
    my @clients;
    my $msg_qry=" AND (m.id > $msg_id)" if ($msg_id);
    my $sqry="AND (m.user_id != $id)";
    my $Nmsg_id;
    
    my $conn=$m->comp('/chat/Comps/DBconn');
    
    my $messages=$conn->exec("SELECT m.id, m.message, s.username, c.username, cs.status FROM convs m INNER JOIN current_sessions cs ON (cs.id=m.session_id) INNER JOIN persons s ON (s.id=cs.server) INNER JOIN persons c ON (c.id=cs.client) WHERE ((cs.server=$id OR cs.client=$id) AND cs.status!='CONF') $sqry $msg_qry");
    
    for (0..$messages->ntuples){
    	my ($Mid, $Mmessage, $Mserver, $Mclient, $Mstatus)=$messages->fetchrow;
    	next if (!$Mmessage);
    	$Mclient=$Mserver if ($Mclient eq $u);
    	$Mmessage=$m->comp('/chat/Comps/parseMsg', message=>$Mmessage);
    	$messages{$Mid}=[$Mclient, (($Mclient eq $u)?"you":$Mclient).' > '.$Mmessage];
    	push @clients, $Mclient;
    	$Nmsg_id=$Mid if ($Mid);
    	}
    
    my $confs = $conn->exec("SELECT m.id, m.message, s.username, cs.client FROM convs m INNER JOIN current_sessions cs ON (cs.id=m.session_id) INNER JOIN persons s ON (s.id=cs.server) WHERE (cs.status = 'CONF') AND (cs.client=(SELECT client FROM current_sessions WHERE server=$id AND status='CONF')) AND (cs.server != $id) $msg_qry");
    
    for (0..$confs->ntuples){
    	my ($Mid, $Mmessage, $Mserver, $Mclient)=$confs->fetchrow;
    	next if (!$Mmessage);
    	$Mmessage=$m->comp('/chat/Comps/parseMsg', message=>$Mmessage);
    	$messages{$Mid}=["CONF$Mclient", $Mserver.' > '.$Mmessage];
    	$Nmsg_id=$Mid if ($Mid && $Mid > $Nmsg_id);
    	}
    
    $Nmsg_id=$msg_id if (!$Nmsg_id);
    my $msg_count=($messages->ntuples + $confs->ntuples);
    
    </%init>
    <%args>
     $id=>undef
     $u=>undef
     $msg_id=>undef
     $session=>undef
    </%args>
    Flawless
    ---=| If you're going to buy a pet - get a Shetland Giraffe |=---

  18. #18
    Drupaler bronze trophy greg.harvey's Avatar
    Join Date
    Jul 2002
    Location
    London, UK
    Posts
    3,258
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Ok. So all your messages are being stored in GetServerMessages.js and this code is ordering everything ready for display from that file .... or have I lost it completely?

    G

  19. #19
    Perl/Mason Guru Flawless_koder's Avatar
    Join Date
    Feb 2002
    Location
    Gatwick, UK
    Posts
    1,206
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Nope - GetServerMessages retrieves the messages
    from the database for display.

    It doesn't need to order them, since they are chronological
    in the database.
    It also only needs to care about ones more recent than
    the one last collected.

    Flawless
    ---=| If you're going to buy a pet - get a Shetland Giraffe |=---

  20. #20
    Drupaler bronze trophy greg.harvey's Avatar
    Join Date
    Jul 2002
    Location
    London, UK
    Posts
    3,258
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Ahhhhhhh! Got you! But this Mason script is actually doing the displaying isn't it?

  21. #21
    Perl/Mason Guru Flawless_koder's Avatar
    Join Date
    Feb 2002
    Location
    Gatwick, UK
    Posts
    1,206
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Indirectly:

    Code:
    if (document.all.content_<%$Mclient%> ){
    		var Nmsg=document.createElement('SPAN');
    		Nmsg.innerHTML='<%$Mmsg%><br>';
    		document.all.content_<%$Mclient%>.appendChild(Nmsg);
    		if ('<%$Mclient%>' != user) document.all.<%$Mclient%>.className='blueform'
    		}
    This section s called for each new message.
    This means it will add it to the content_${current_user}.
    It creates the message as an object and appends it to
    the content of the window for the user.
    There can be several windows ( divs really )
    for each server - so they can talk to five people each.

    (the current user bit allows for the different sessions)

    Flawless
    ---=| If you're going to buy a pet - get a Shetland Giraffe |=---

  22. #22
    Drupaler bronze trophy greg.harvey's Avatar
    Join Date
    Jul 2002
    Location
    London, UK
    Posts
    3,258
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Nice. That was the very bit of code I got hung up on. I see.



Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •