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?
|
|
|
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
|
|
|
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.
~=~=~=~=~=~=~=~=~=~=~= |
|
|
|