home *** CD-ROM | disk | FTP | other *** search
/ linuxmafia.com 2016 / linuxmafia.com.tar / linuxmafia.com / bale / cottonbale.inc < prev    next >
Text File  |  2002-09-24  |  733b  |  52 lines

  1. <?
  2.  
  3. // change these functions to represent date/time differently
  4.  
  5. function dateExpand($adate)
  6. {
  7.         $d = explode('-', $adate);
  8.         $t = mktime(0, 0, 0, $d[1], $d[2], $d[0]);
  9.         $date = date("D. M. j", $t);
  10.         return $date;
  11. };
  12. ?>
  13.  
  14. <?
  15. function timeExpand($atime, $addap=false) // time as in 1800
  16. {
  17.         $rem = $atime % 100;
  18.         $hr = (int) ($atime / 100);
  19.         
  20.         $pm = $hr > 12 ? 1 : 0;
  21.         
  22.         $hr = $hr > 12 ? $hr - 12 : $hr;
  23.         
  24.         $hour = (string)$hr;
  25.         
  26.         if ($rem > 0)
  27.         {
  28.             $hour = $hour . ':' . (string)$rem;
  29.         }
  30.         
  31.         if ($addap)
  32.         {
  33.             $p = $atime < 1200 ? "a" : "p";
  34.             $hour = $hour . $p;
  35.         }
  36.         
  37.         return $hour;
  38. };
  39. ?>
  40.  
  41. <?
  42. function rowcolor($count)
  43. {
  44.     $i = $count % 2;
  45.     
  46.     $fg = ($i == 0 ? "lightsteelblue" : "CCCCCC" );
  47.     
  48.     return $fg;
  49. };
  50. ?>
  51.  
  52.