<?php
/* albums.php - 
    
    dseelig - circa 2004

    common utilities for photo-album code. 
    also see Albums.class and Page.class

*/

//used by Gallery.class.php
function get_rand_file($dir//{{{
{
     
$i=0;
     
$handle opendir("$dir");
     
$entry readdir($handle); //get rid of '.'
     
while(($entry readdir($handle)))
     {
          if(
$entry != "..")
          {
          
$arr[$i] = $entry//make an array of the images
          
$i++;
          }
     }
     
$i--;
     
//generate a random number between zero and $i-1
     //return the $array[$rand] value
     
$random rand0$i);
     
$i++;
     return 
$arr[$random];

}
//}}}
function hyphens_to_spaces$string )  //{{{
{
$search = array('/-/''/_/''/(19|20\d{2})\.\d{2}.\d{2}/', );
$replace = array(' '' ', );

$newstring =preg_replace($search$replace$string);


return 
$newstring;

}
//}}}
$PHP_SELF=$_SERVER["PHP_SELF"];



?>