class AddPhotoController extends GalleryController {
function handleRequest($form) {
/* Check input. */
if (!is_numeric(GalleryUtilities::getRequestVariables('itemId'))) {
} else {
$picture_id=GalleryUtilities::getRequestVariables('itemId');
//Full size picture url
$high_res = "gallery/main.php?g2_view=core.DownloadItem&g2_itemId=".$picture_id;
//Title of picture
$title = "";
//Full size image size
$size = "";
//Full Size resolution width
$res_width = "";
//Full Size resolution height
$res_height = "";
//800x600 mid size image url
$screen = "";
//Thumbnail url
$thumb = "";
//Write variables to my xml file
}
$redirect = $status = $error = array();
$results['return'] = 1;
$results['redirect'] = $redirect;
$status = "Added to Tray";
$results['status'] = $status;
$results['error'] = $error;
return array(null, $results);
}
}
Posts: 8339
check the functions in my mediaBlock.php or the mediaRss.php contained with my minislideshow
-s
FlashYourWeb and Your Gallery with The E2 XML Media Player for Gallery2
Posts: 24
I've tried mediaBlock.php earlier. I get the below error when I copy the getThumbUrl to my inc file.
Posts: 8339
did you copy the function?
or just the call for the function.
-s
FlashYourWeb and Your Gallery with The E2 XML Media Player for Gallery2
Posts: 24
I coppied the entire function and pasted above my function handleRequest($form).
Posts: 8339
so you called it like:
-s
FlashYourWeb and Your Gallery with The E2 XML Media Player for Gallery2
Posts: 24
OK, that helped a lot. I am trying to generate the url for the full sized picture. I am using getView, but all it retrieves is "h".
Posts: 8339
with nearly every function in my script you need to pass an $item object which we loaded here: list($ret, $item) = GalleryCoreApi::loadEntitiesById($picture_id, 'GalleryItem');
you can pass the same object around to retrieve your desired output.
If you're trying to output an xml feed check function displayMediaRss
-s
FlashYourWeb and Your Gallery with The E2 XML Media Player for Gallery2
Posts: 24
Thank you for your help, I've acomplished more in the last few hours than I have all day on this. I was looking through the list and did not find a function to get the file size. If you can point me in the right direction, I think I can write the function.
I also need to get an 800 x 600 view, and I saw the resize function, but I'm not sure how to make it work. Any thoughts?
Thanks again
Posts: 8339
hmmm... size I believe is simply $item->getSize(); from GalleryDataItem.
I don't believe that resize function is actually used, it returns a string of views, not what you want.
but function getBestImageId would.
you'd need to change:
to:
and:
to:
and you would also need to include
function byWidth as well
-s
FlashYourWeb and Your Gallery with The E2 XML Media Player for Gallery2
Posts: 24
Fantastic, that did it.
Thank you