add images to Gallery2 by user

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/’));

發表迴響

你的電子郵件位址並不會被公開。 必要欄位標記為 *

What is 10 + 11 ?
Please leave these two fields as-is:
IMPORTANT! To be able to proceed, you need to solve the following simple math (so we know that you are a human) :-)