ok im clearly missing something here and im little stuck again....
Code: Select all
foreach($serendipity['POST']['plugin']['exifdata'] as $key => $value) {
$exif_array[$key] = $key;
}
$newexifstring = implode(',', array_keys($exif_array));
$this->set_config('exif_data', $newexifstring);
That is what i come up with... It doesnt work, and i understand why. But i cannot think of something on how to solve it. Nor can i find a function or way on php.net.
The result of this code is (this gets into the database):
Camera Make,Camera Model,Orientation,Resolution Unit,X Resolution,Y Resolution,Date and Time,YCbCr Positioning,Exposure Time,Aperture,Exposure Program,ISO,Exif Version,Date (Original),Date (Digitized),APEX Exposure Bias,APEX Max Aperture,Metering Mode,Light Source,Flash,FocalLength,User Comment,FlashPix Version,Colour Space,Pixel X Dimension,Pixel Y Dimension,File Source,Special Processing,Exposure Mode,White Balance,Digital Zoom Ratio,Scene Capture Type,Gain Control,Contrast,Saturation,Sharpness,Components Config
As you can see it has a bunch of text, which is good. But the value (option) is not attached to it. It should look some thing like this:
Camera Make-yes,Camera Model-yes,Orientation-yes,Resolution Unit-yes,X Resolution-yes,Y Resolution-yes,Date and Time-yes,YCbCr Positioning-yes,Exposure Time-no,Aperture-yes,Exposure Program-yes,ISO-yes,Exif Version-yes,Date (Original)-yes,Date (Digitized)-yes,APEX Exposure Bias-yes,APEX Max Aperture-yes,Metering Mode-yes,Light Source-yes,Flash-yes,FocalLength-yes,User Comment-yes,FlashPix Version-yes,Colour Space-yes,Pixel X Dimension-yes,Pixel Y Dimension-yes,File Source-yes,Special Processing-yes,Exposure Mode-yes,White Balance-yes,Digital Zoom Ratio-yes,Scene Capture Type-yes,Gain Control-yes,Contrast-yes,Saturation-yes,Sharpness-yes,Components Config-yes
-yes and -no being values (options).
What i want to do is:
this is a array: $serendipity['POST']['plugin']['exifdata']
The key and value of this array should be combined and saved in the database. Making it look like:
Camera Make-yes,Camera Model-yes,Orientation-yes,Resolution Unit-yes,X Resolution-yes,Y Resolution-yes,Date and Time-yes,YCbCr Positioning-yes,Exposure Time-no,Aperture-yes,Exposure Program-yes, etc...
I think the line in the foreach should look like something liike this:
but that gets me nothing... empty string...
i tried creating 2 arrays and use array_combine but that ended up in a empty string somehow and i tried several other things but none works. Im sure its something simple... but i cant think of anything so plz help me out
Thanks!