Upload Photos
$error) { $photoID = 0; if ($error == UPLOAD_ERR_OK) { $tmpFileName = $_FILES["photos"]["tmp_name"][$key]; $clientName = $_FILES["photos"]["name"][$key]; $clientNameExt = explode(".", $clientName); $clientNameExt = array_pop($clientNameExt); $clientName = str_replace(".".$clientNameExt,"",$clientName); $photoID = addPhoto($tmpFileName,$clientName,0,$connection); if ($photoID > 0) { //Write thumbnails for this photo writeThumbs($photoID,$connection); //Write out the title, description, tags form: $dateCreated = date("Y-m-d H:i:s"); $photoYear = date("Y",strtotime($dateCreated)); $thumbYearDir = THUMB_DIR . $photoYear; $thumbBaseFile = $thumbYearDir . "\\" . md5(SALT.$photoID); $thumbFile_m = $thumbBaseFile . "_m.jpg"; $thumbSRC_m = str_replace(THUMB_DIR, "http://photos.onfocus.com/thumbs/", $thumbFile_m); $thumbSRC_m = str_replace("\\", "/", $thumbSRC_m); list($width_m, $height_m, $type_m, $attr_m) = @getimagesize($thumbFile_m); print <<
Title:
Description:
Tags:
PHOTOEND; } } } ?>