Hi and welcome,

I used the "inlinepush" technique in my chat application the same way
you want to use it. Basically, I need to format BBcode with PHP and
log the message in a databse before sending it to APE...

For #1 a): If you use a custom function server side, you could cache
the last "x" messages in an array. When a use connect, just send this
array over. But if you already use PHP to log the messages in a
database, it would be easier to just get those messages in the
database.

For #1 b): You can send something to only one client. See:
http://www.ape-project.org/docs/server/users/user.pipe.html

For #2: If you look at the inlinepush code, you'll see a password.
Basically, no one can call the function on server side if they don't
know the "password". But be careful because this password is send in
clear in the request. It's hackable, but for most site I think it's
ok. I use something like this for my own chat and no problem since
then. You could use the APE sessions if you send back the result to
Javascript (in the AJAX) and then transit the message to APE with
Javascript.

On Oct 12, 5:00 am, "[email protected]" <[email protected]> wrote:
> Hello,
>
> I'm trying to write (rewrite) IM and CHAT system for my website.
> Right now i'm doing it using Jquery and HTTP requests, but it's too
> slow, and not reliable for many users.
>
> I found your project, and saw some examples.
>
> I see there is possibility to send data using PHP, what sounds very
> good to me because all data send by user need validation, so first i
> want pass them to PHP, and after checking permissions, flood, spam
> controll send to user by APE using PHP inline.
>
> I saw, that's in example, so i think i won't have any problems.
>
> My question is.
>
> 1) How make, when user connect to channel i would like to send him a
> history, or messages sented to him when he was offline.
> - i know i can do this directly in PHP when rendering page, just echo
> "msesage1 , message2" but it will be nice if possible using APE to
> don't write twice code.
> - maybe, there is any way to detect id of user, and send to this one
> waiting "messages", but directly to one, not for all.
>
> 2) How make sure, that any of  users can't send anything directly to
> APE server.
> - Allow publish only via PHP.
>
> regards

-- 
You received this message because you are subscribed to the Google
Groups "APE Project" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/ape-project?hl=en
---
APE Project (Ajax Push Engine)
Official website : http://www.ape-project.org/
Git Hub : http://github.com/APE-Project/

Reply via email to