News Feed
Sections




News Archive
Looking for more information on how to do PHP the right way? Check out PHP: The Right Way

Zend Developer Zone:
AJAX Chat Part Tutorial 6 Updating the User List
January 08, 2007 @ 13:14:00

The Zend Developer Zone has posted the second to last part of their Ajax chat tutorial today. This time, they focus on updating the list of users currently in the chat.

Updating the user list should occur whenever the user adds a new chat message or refreshes the chat window. Since we already use the MessageAction() method on our PHP IndexController class to forward such responses to the browser, we'll simply amend it to also return a list of currently online users.

They start by altering the MessageAction controller to handle the fetching of online users and split out the code to grab the latest messages into a getNewMessages function. They check who is online by looking at the last messages to the queue (not reliable, but about as good as it can get with a stateless protocol). Finally, they update the handleRefresh method to execute the new "find online users" code as pass it on to the output view.

0 comments voice your opinion now!
ajax chat tutorial part6 user list online ajax chat tutorial part6 user list online


blog comments powered by Disqus

Similar Posts

Community News: Open Source Golden Rules

PHPMaster.com: Introducing Superglobals

Zend Developer Zone: The ZendCon Sessions Episode 25: (In)secure Ajax-y Websites with PHP

Jani Hartikainen's Blog: Zend_Acl part 3: creating and storing dynamic ACLs

Ryan Mauger's Blog: Keeping your html valid with Zend Framework, Tidy and Firebug


Community Events





Don't see your event here?
Let us know!


package tips bugfix podcast symfony language interview deployment list voicesoftheelephpant release introduction library community install series opinion laravel api framework

All content copyright, 2014 PHPDeveloper.org :: info@phpdeveloper.org - Powered by the Solar PHP Framework