By 'online user' i mean clients that have a websocket connection. On Friday, July 10, 2015 at 7:12:50 PM UTC, JorgeH wrote: > > Hah > > Be patient.. Don't expect other people to answer right away. Rest assured > your question is being read. That doesn't mean that everyone have the > answer at hand. > > > I have never done what you need but I am guessing you have to define what > an 'online user is' > Does it mean users logged in? In that case > > I suppose you create a controller to query the user_cas table to see how > many are online, and via ajax, create a view that shows the number of users > online. > > > > > > > On Friday, July 10, 2015 at 1:32:06 PM UTC-5, Samuel Sowah wrote: >> >> I need help please... anyone? >> >> This thread keeps going down the list and I'm afraid it might get missing >> and go unanswered :/ >> >> On Friday, July 10, 2015 at 12:20:39 PM UTC, Samuel Sowah wrote: >>> >>> I checked out the web2py.js file and it looks like what i'm looking for >>> is right in there but i really do not know how to implement this. I >>> realized I can take advantage of the web2py_websocket function's onopen >>> argument and write a function to tell that that user is online, and when >>> the browser tab or window is closed, I'd write a function to execute for >>> onclose. >>> >>> The problem I have now is what function to write. I want to store the >>> ids of all the connected users somewhere so i can refer to it and use it to >>> get whatever information i want (i.e. a count of all users online, urls to >>> their profile pages, etc), and then when they close the page, their ids are >>> removed from wherever i'm storing it. >>> >>> Is it possible to keep that list of ids in a database, or a list, and >>> still update the page in real time when more users connect and disconnect? >>> >>> Scenario. >>> There are 0 users online right now. When I visit the website, I want to >>> see the number automatically say 1 users online. and when my friend also >>> goes to the page on his computer, I want to see in my browser 2 users >>> online. When he leaves the page/closes the page, I want to see in my >>> browser 1 users online without having to refresh the page. >>> >>> I don't know if I'm thinking about this correctly so I need some help >>> and guidance here, thanks. >>> >>
-- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/list (Report Issues) --- You received this message because you are subscribed to the Google Groups "web2py-users" group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.