I think this is more of a branch of
http://forums.modx.com/thread/?thread=80740 i've been working on... which i have working code for 1 image to to upload to user profile extended data.
Though i need to have multiple images... working on extending that code for multiples.
iin the above post i fixed a issue where if a user didn't enter in a file, that then their old photo didn't get over written.
i have no clue on proper syntax on how to do it for multiple images....
not sure now to do that here....
in the
// loop through files
foreach ($submittedfiles as $sf) {
functions
//return exsisting photofields value
if ($Photo_fields != '')
{
how to i make something like
so that the variable name then becomes Photo_fields1, Photo_fields2, Photo_fields3 ....
if ($Photo_fields . $sf!= '')
{
}
$fields = $modx->user->getOne('Profile')->get('extended');
// in the foreach loop
$Photo_fields_index ='Profile_Photos' . $sf
$Photo_fields = $fields[$Photo_fields_index];
i'm guessing could do a array of
if ($Photo_fields[$sf]!= '')
but i've been unable to get containers to work for extended data... then not sure how
// get uploaded file names:
$submittedfiles = array_keys($_FILES);
then works.... with the foreach loop
wish my php skills were better ;-/