?
Solved

A page that checks dates of files and displays whos on??

Posted on 2003-03-01
8
Medium Priority
?
181 Views
Last Modified: 2006-11-17
What I am trying to acomplish is..

   I have a site that consists of 10 people they use webcam32 to take pics and upload at an interval. I am trying to create a page that checks the picture files and determines if the user is online and somehow show they are online (displaying a still with there name as link). The files are overwritten everytime a new pic is uploaded and the images run at a 1 second interval so I thought it would be easy to check if the file was recently modified. Would I be better doing this in another language like cgi ??

Thanks for any pointers or ideas

Eric
0
Comment
Question by:ehc_fl
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
8 Comments
 
LVL 15

Expert Comment

by:VGR
ID: 8051240
Yes, and I've something like this. I wrote a Pascal/Delphi CGI "console" application to manipulate/resize the image.

For only checking the last-modified time of the file, no, you don't need CGI : PHP has "filesystem" functions able to retrieve a lot of datetime values on files (creation, modification, last access, althought some do not work on Win32)

To check that the user is online, either you stick with you idea of checking "last modification" time of images, or you PING him/her. This may also be accomplished in pure PHP (depending on server's settings)
0
 
LVL 1

Expert Comment

by:KC_Speedball
ID: 8051761
you're programming in delphi VGR? Great im looking for someone who do this. I need someone telling how to connect with delphi to an mysql-database (with ODCB pleeeeaaaasee)
any usefull links?

Sorry ehc_fl for braking you question ;)
0
 
LVL 15

Expert Comment

by:VGR
ID: 8052381
I suceeded some time ago in D4 with the standard libmysql.dll wrapped in Delphi

I have not tried since a while
0
WordPress Tutorial 2: Terminology

An important part of learning any new piece of software is understanding the terminology it uses. Thankfully WordPress uses fairly simple names for everything that make it easy to start using the software.

 
LVL 8

Accepted Solution

by:
us111 earned 300 total points
ID: 8057479
Store somewhere when the user is logged and check the file picture date time in pure PHP (see VGR comment)

http://www.php.net/manual/sv/ref.filesystem.php
0
 

Author Comment

by:ehc_fl
ID: 8059952
<?php
// outputs if User is Online or offline by comparing date of file
$today = date("F d Y H"); // Month, Day, Year, Hour read into string
$online = date("i")- 1; // read Server minute into string
$cam = './cams/eric.jpg'; // File to be checked
if (date ("F d Y H", filemtime($cam))==$today)  {// Check if File date,Hour
equal to Server
    if (date ("i", filemtime($cam))>=$online) { // Check if file minute >=
Server
    echo "<B>Currently Online</B>"; // Show user is online File is within 1
minute or equal to Server
    }
   else // File is older than 1 minute of Server Time so treated as offline
   {
   echo "<b>Currently Offline</B>"; // Show user as offline
   }
}
else
{
    echo "<b>Currently Offline</B>"; // Show user as offline
}
?>
This is the code I threw together lastnight. I figured I would pass it on

Eric
0
 
LVL 15

Expert Comment

by:VGR
ID: 8059993
well, cool 8-))
Easy points for us111 :D
especially since he (honestly) quoted MY comment :D

cool cool cool
0
 
LVL 15

Expert Comment

by:VGR
ID: 8060000
and not grade "B" please. If he answered your question right, give him grade "A"
0
 
LVL 8

Expert Comment

by:us111
ID: 8062964
;)
yep but the link!!  ;)
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Author Note: Since this E-E article was originally written, years ago, formal testing has come into common use in the world of PHP.  PHPUnit (http://en.wikipedia.org/wiki/PHPUnit) and similar technologies have enjoyed wide adoption, making it possib…
Build an array called $myWeek which will hold the array elements Today, Yesterday and then builds up the rest of the week by the name of the day going back 1 week.   (CODE) (CODE) Then you just need to pass your date to the function. If i…
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…
The viewer will learn how to dynamically set the form action using jQuery.
Suggested Courses

770 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question