CodeCharge Studio
search Register Login  

Visual PHP Web Development

Visually Create Internationalized Web Applications, Web Reports, Calendars, and more.
CodeCharge.com

YesSoftware Forums -> CodeCharge Studio -> PHP

 Users Online ??

Print topic Send  topic

Author Message
2tone

Posts: 20
Posted: 10/07/2011, 3:59 AM

I have been messing around with a project and kind of painted myself in a corner, I have searched the forums however most of the links dont seem to work they seem to be out dated

I want to show users online at the bottom of a forum the only thing i have been able to come up with is coding out side of ccs4 has anyone accomplished this yet?
View profile  Send private message
datadoit
Posted: 10/07/2011, 7:33 AM

Most systems capture when users log in, and then capture their activity,
typically through links or menu items. Both are timestamps. For
visitors, you can capture their session_id.

Just about all projects done here now evolve around a single index page,
so in that index page we have code to update the database when the page
is loaded. From that database field you can query on 'activity', such
as the last 10 minutes to represent those online.
2tone

Posts: 20
Posted: 10/07/2011, 9:32 AM

thank you for the reply data but I understand the concept however there is really no info how to implement this in ccs4 im trying not to patch it together
View profile  Send private message
benjohn


Posts: 30
Posted: 10/12/2011, 4:31 PM

hi there 2tone,

Good Day!

assuming you have a table called activities with structure:

id
activity
userid
activitytimestamp

of the forumers activities then say you drop a label on the footer or wherever you want it to appear called labelWhoIsOnline then on the before Show event of this label you could just create something like

$db = new clsDBConnection(); //use your database connection name
$SQL = "select username from user, activity where user.userid=activities.userid where activities.activitytimestamp >= DATE_ADD(current_timestamp, INTERVAL -10 MINUTE)";
$db->query($SQL);
while($db-next_record()){
$online .= $db->f("username"). ", ";
}
$labelWhoIsOnline->SetValue($online);

hope this helps... all the best!

pal,
Benjohn
_________________
~=~=~=~=~=~=~=~=~=~=~=
get it done. make it happen.
~=~=~=~=~=~=~=~=~=~=~=
View profile  Send private message

Add new topic Subscribe to topic   


These are Community Forums for users to exchange information.
If you would like to obtain technical product help please visit http://support.yessoftware.com.

MS Access to Web

Convert MS Access to Web.
Join thousands of Web developers who build Web applications with minimal coding.

CodeCharge.com

Home   |    Search   |    Members   |    Register   |    Login


Powered by UltraApps Forum created with CodeCharge Studio
Copyright © 2003-2004 by UltraApps.com  and YesSoftware, Inc.