TalkPHP
 
 
Account Login
Latest Articles
» The basic usage of PHPTAL, a XML/XHTML template library for PHP
» Vulnerable methods and the areas they are commonly trusted in.
» Simple way to protect a form from bot
» The Basics On: How Session Stealing Works
» How to keep your forms from double posting data
IRC Channel
IRC Speech Bubble Join the friendly bunch on IRC...
(#TalkPHP on Freenode)

...Also available via a web interface.

See this thread for information on the TalkPHP Free Hugs Initiative™. Subject to availability.
Associates
Associates
CSS Tutorials
Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old 11-29-2008, 09:48 AM   #1 (permalink)
The Acquainted
 
Peuplarchie's Avatar
 
Join Date: May 2008
Location: Québec
Posts: 104
Thanks: 10
Peuplarchie is on a distinguished road
Application file creation date copare user load date time...

Good day to you all,
I have a piece of code which read a diredtory and return a list of txt file and display their content.
I was wondering if there would be a way of making that depending on the time the user load the page, the last created file would appear with their border a different color for 5 stage.

example:
if user load the page an hour after a file was created, border colored green...

here is my code :

PHP Code:

function drawList($list)
{  

      
$thelist ''
      
      
$i 0;
      foreach(
$list as $file=>$string)     
      {

$lines nl2br($string);

    
$usercmt explode("--"$file);
$messtime substr($usercmt[1], 0, -4);
$messtimecor str_replace("-"":"$messtime);
$usercmtcor strtoupper($usercmt[0]);

              
$thelist .= '<div id="test">';
              
$thelist .= "<div id=\"title\"><b>".$usercmtcor."</b> &agrave; ".$messtimecor."  (UTC)</div>";  
$lines=explode("\n",$lines);
foreach(
$lines as $key=>$line)
{  
$lines[$key]="<div class=\"contentalt\" style=\"border-top:0; border-left:0; border-right:0; border-bottom:0px  padding:0; \">{$line}</div>";  }
$lines=implode('',$lines);
              
$thelist .= "<div id=\"commentbg\">".$lines."</div><br/>";
              
$thelist .= '</div><br/><br/>';



}

    return 
$thelist;

       

Thanks !
__________________
That's why we are not alone on earth... let's build !
Peuplarchie is offline  
Reply With Quote
Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
Easy to Modify Login Script with Hierarchical User Permissions and XML Account File Wildhoney Script Giveaway 4 05-04-2011 06:11 AM
Timezone Class: Dealing with Timezones the Proper Way Wildhoney General 2 01-10-2011 11:01 PM
Need more ideas for date and time class Wildhoney General 2 01-18-2008 02:22 PM


All times are GMT. The time now is 12:48 AM.

 
     

Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.1.0
Inactive Reminders By Icora Web Design