[pLog-svn] r3029 - plog/trunk/class/gallery/dao

oscar at devel.lifetype.net oscar at devel.lifetype.net
Sun Mar 5 22:21:07 GMT 2006


Author: oscar
Date: 2006-03-05 22:21:06 +0000 (Sun, 05 Mar 2006)
New Revision: 3029

Modified:
   plog/trunk/class/gallery/dao/galleryresources.class.php
Log:
Fixed some more notices

Modified: plog/trunk/class/gallery/dao/galleryresources.class.php
===================================================================
--- plog/trunk/class/gallery/dao/galleryresources.class.php	2006-03-05 22:06:50 UTC (rev 3028)
+++ plog/trunk/class/gallery/dao/galleryresources.class.php	2006-03-05 22:21:06 UTC (rev 3029)
@@ -433,6 +433,7 @@
       		
             // add the record to the database
             $fileName = $upload->getFileName();
+			$filePath = "";
 			$resourceId = $this->addResourceToDatabase( $ownerId, $albumId, $description, $flags, $resourceType, $filePath, $fileName, $info );
 			if( !$resourceId )
 				return false;
@@ -494,11 +495,30 @@
         function _filterMetadata( &$metadata, $resourceType ) 
         {
             $info = Array();
-            $info["md5_file"] = $metadata["md5_file"];
-            $info["md5_data"] = $metadata["md5_data"];
-            $info["filesize"]= $metadata["filesize"];
-            $info["fileformat"] = $metadata["fileformat"]; 
-            $info["comments"] = $metadata["comments"];
+			if( isset( $metadata["md5_file"] ))
+				$info["md5_file"] = $metadata["md5_file"];
+			else
+				$info["md5_file"] = "";
+
+			if( isset( $metadata["md5_data"] ))
+				$info["md5_data"] = $metadata["md5_data"];
+			else
+				$info["md5_data"] = "";
+			
+			if( isset( $metadata["filesize"] ))
+				$info["filesize"]= $metadata["filesize"];
+			else
+				$info["filesize"] = 0;
+				
+			if( isset( $metadata["fileformat"] ))
+				$info["fileformat"] = $metadata["fileformat"]; 			
+			else
+				$metadata["fileformat"] = "";
+
+			if( isset( $metadata["comments"] ))
+				$info["comments"] = $metadata["comments"];
+			else
+				$info["comments"] = 0;
                         
             if($resourceType == GALLERY_RESOURCE_IMAGE){
                 $info["video"] = $metadata["video"];
@@ -523,7 +543,7 @@
                 $info["zip"]["compressed_size"] = $metadata["zip"]["compressed_size"];
                 $info["zip"]["uncompressed_size"] = $metadata["zip"]["uncompressed_size"];
                 $info["zip"]["entries_count"] = $metadata["zip"]["entries_count"];
-                $info["zip"]["copmression_method"] = $metadata["zip"]["copmression_method"];
+                $info["zip"]["compression_method"] = $metadata["zip"]["compression_method"];
                 $info["zip"]["compression_speed"] = $metadata["zip"]["compression_speed"];
              }
              



More information about the pLog-svn mailing list