Home | Reviews | GUIpedia | Forum | Fun500
tacodrake95 | I've got an ideaHey Brandon, could you add something that shows who's online so that people can know who's on at the time? | 2011-03-19 | 10:42 PM |
HorvatM | Re:I\'ve got an ideaSeconded. Below the "New to the blog?" area would be a perfect place. | 2011-03-20 | 5:14 AM |
Brandon | Re:I\'ve got an ideaTodd, how hard would that be for me to implement? What would I need to do code wise? | 2011-03-20 | 8:42 AM |
Todd | Re:I\'ve got an ideaYou'd need to do session tracking, basically when someone logs in, assign their login to a session ID (can be random). When they do something like reload a page, go to a forum topic, or just access the website, update the user's session ID to the current time. The chat room should look for people who were active within the recent 15 minutes or so (i.e. query the session table for recent activity and their users).
Does this make sense or do you need more clarification? | 2011-03-20 | 10:17 AM |
pharoah | Re:I\'ve got an ideaBrandon, I'm betting that you already are using sessions, since it wouldn't keep me logged in if you weren't. The tough thing will be if you want the list to reflect who is active, rather than simply logged in. Maybe associate a value lastAction with each session in your database, and whenever that person loads a page, shove the valueof time() into there. Then you can sort by most recent lastAction times and pull up anyone who has been active in the last x minutes.
Assuming you're using a database, that is. If you're not, well, almost everything will be a pain in the ass to implement. | 2011-03-20 | 11:05 AM |
Brandon | Re:I\'ve got an ideaI just use cookies :P No session stuff. | 2011-03-20 | 7:15 PM |
pharoah | Re:I\'ve got an ideaStoring important information in cookies is called "trusting the client", and it's not secure (Brandon knows that now). Here's how to implement sessions. It's easy!
A bunch of PHP later, I think I've fixed it. | 2011-03-20 | 7:42 PM |
Other
2021 Brandon Cornell