custom addItemToAlbum php giving ERROR_PLATFORM_FAILURE | Gallery
this code is almost right, you just need to change below:
$usersName = “Ceads";
$filePath = “gallery2/g2data_hg/albums/$usersName/";
$itemName = “testimage.jpg";
$title = “test image 2″;
$base_dir = $filePath; // where to find files to process
$processed_dir = ‘user_images/’; // where to put files when done
$albumId = ’81’; // the id of the target Gallery2 album
if ($handle = opendir($base_dir)) {
if(importToGallery2($base_dir, $itemName, $albumId) != 1) {
//rename ($base_dir.$itemName, $processed_dir.$itemName); // move file to processed directory
echo “<BR>*-* importToGallery2 called and processed and file moved *-*<BR>";
}
closedir($handle);
}
to
$usersName = “Ceads";
$filePath = “F:\\download_test1.jpg";
$itemName = “download_test1.jpg";
$title = “test image 2″;
$base_dir = $filePath; // where to find files to process
$processed_dir = ‘user_images/’; // where to put files when done
$albumId = ’85’; // the id of the target Gallery2 album
if(importToGallery2($base_dir, $itemName, $albumId) != 1) {
//rename ($base_dir.$itemName, $processed_dir.$itemName); // move file to processed directory
echo “<BR>*-* importToGallery2 called and processed and file moved *-*<BR>";
}
and
$ret = GalleryEmbed::init(array(‘activeUserId’ => 6, ‘fullInit’ => true));
to
$ret = GalleryEmbed::init(array(‘fullInit’ => true, ’embedUri’ => ‘/gallery2/main.php’, ‘g2Uri’ => ‘/gallery2/’));