apps « Kevin Pajak – Interactive Web Developer/Designer – BLOG

Posts Tagged ‘apps’

How to log out a user who closes the browser window

Wednesday, February 10th, 2010

I would like to thank Brazilian software developer Daniel Melo for posting this code which helped me to solve a problem which was very pesky indeed, and in need of a solution. The problem occurred during a user’s logged-in session for a chat application I was building. This was the issue: the app is basically a live-chat client, which also shows all current users online, by name. If a logged-in user clicked the “Logout” link, all was good, no problem, his/her name was removed from the list of currently logged-on users. However, if the person just suddenly decided to end the chat session by just closing the browser and hitting ‘X’ (as I myself might do!), the user was still showing as currently online, and NOT logged out (obviously this is an annoying issue). (more…)

Live chat client showing list of current users online

Wednesday, February 3rd, 2010

OK, so I’ve nearly got this puppy complete. It’s a live-chat client that will allow logged-on users (and only logged-on users, although I also have a version that guests can use) to make “posts” (just like to a “wall” on Facebook or Twitter), with the chat/comments page automatically refreshing every 500 milliseconds to show latest posts that other users have just made, in real-time. (one tentative name I have for it is a “living wall”). Last night, I added the ability to show a list of all users who are currently logged on, and hope to have this out of beta soon ;)

These are just some of the advantages of this application:

- All posts can be saved into a database (into any table you so choose. You could, for example, insert the posts on tables related to individual topics or categories, current news items, a photo, or basically anything else you can put on an individual web page. [so to use this interactive chat client on a different page, just insert the posts into a different database table]).

- This can provide your web site users with a cross-functional, enhanced web user experience, allowing them to see who else in your online community or company is currently logged on, chat with them, comment on various pages across the site, view/update profile information, other content etc [sounds a little like Facebook, MySpace, or similar online communities doesn’t it, only think of the advantages of having this on your own site ‘).

- Flexibility. If you like, you can either destroy or save records of “chat sessions” (or series of wallposts too, if you’d like to use the app in that way).

More soon! :-) .

jQuery / Ajax live refresh

Saturday, January 30th, 2010

Running live, simultaneous beta tests using three different browsers for my wallpost app, with added jQuery/Ajax page refresh functionality. It is kicking some SERIOUS ass already (think: live chat possibilities, with saved record of all dialogues, that can be added to any page, threaded to any topic, etc) Yeah! ;) .

[Already, I’d like to thank programmer Srinivas Tamada for this rockin’ code!

And additionally, very special thanks to Maruf for helping resolve an annoying IE issue:

After I modified the code, the stupid forced-caching issue of IE (which was delaying or not showing the updated list of all the latest posts) managed to get resolved. Here’s my modified code of the function:

<script>

var refreshId = setInterval(function() {
$("#page_refresh").load(‘show-comments.php?v=’+ Math.random());
}, 500);

</script>

“Twitter emulator” progress

Saturday, January 30th, 2010

OK, so now I’ve got my “Twitter emulator” working (complete post-to-wall, saving all posts into a database), now with post authors listed according to logged-on username [i.e. wall posting for logged on users only]. Almost out of beta, few final tests to go :-) .

My Twitter Emulator

Thursday, January 28th, 2010

Is basically done (as far as the backend stuff). Will install on my blog soon :-) . It functions pretty much just like Twitter (allowing a user to “add his/her post to your wall,” then see the entire stream of posts, with the latest one he/she just added at the top of the list) except that it can be run on your own site internally! :0 Stay tuned ;) .