Thanks
Dismounted. That appears to be working so far.
Now I'm also looking at using the YUI uploader to allow selecting multiple files (with upload progress bars) for album uploads. In some ways this will be simpler than the original project I had for uploading & adding photos from a .ZIP file.
Looking at the hidden form fields in the
album_picture_upload template:
Code:
<input type="hidden" name="s" value="$session[sessionhash]" />
<input type="hidden" name="securitytoken" value="$bbuserinfo[securitytoken]" />
<input type="hidden" name="do" value="uploadpictures" />
<input type="hidden" name="albumid" value="$albuminfo[albumid]" />
<input type="hidden" name="MAX_FILE_SIZE" value="$inimaxattach" />
It looks like I'll just need to add these to the YUI uploader's POST variables object and set the YUI uploader's URL to use the equivalent of
album.php?do=uploadpictures&albumid=$albuminfo[albumid]
Am I correct that these two do the same thing?
Code:
//In the template
<input type="hidden" name="s" value="$session[sessionhash]" />
Code:
//In the javascript uploader POST object
sessionurl: SESSIONURL
This just leaves the javascript not knowing the albumid or MAX_FILE_SIZE, I believe.
Is the best way to pass these variables from PHP to javascript, the way I have been doing it so far?
Code:
<script type="text/javascript">var jababumid = <?php echo $albuminfo['albumid']; ?>;</script>
<script type="text/javascript">var jabinimaxattach = <?php echo $inimaxattach; ?>;</script>
Thanks for everyone's help,
James