PDA

View Full Version : Help: some thumbnails do not show


rujero
Nov-28-2009, 11:28 AM
Hi everyone!
I am trying to display the list of my galleries showing the highlight photo thumbnail and the gallery title in a table built with PHP.
Some galleries do not have a highlight photo so I am showing the text "missing etc." but in for a few other the highlight photo exists but does not show in the browser. :scratch

Here is my code:

<?php
$userName = 'domenichini';

require_once("../phpSmug/phpSmug.php");

try {
// Create new phpSmug object
$f = new phpSmug("APIKey=DgWiSWtTTJ4jk4vm0TWR9gAgbgNLxkft", "AppName=youtellyou (http://youtellyou.com)", "APIVer=1.2.2");
// Login Anonymously
$f->login();
// Get list of public albums
$albums = $f->albums_get('NickName=' . $userName, "Heavy=1");

$mod = 3;

$rString = '<table>';

$i = 0;

foreach ($albums as $album) {
$i++;

if (($i-1) % $mod == 0)
$rString .= '<tr>';

$title = $album['Title'];
$thumbid = $album['Highlight']['id'];
$thumbkey = $album['Highlight']['Key'];

if (!empty($thumbid)) {
$photo = $f->images_getInfo("ImageID={$thumbid}", "ImageKey={$thumbkey}");
$url = $photo['SmallURL'];
$rString .= '<td width="130"><img style="max-height:120px; max-width:120px;" src="' . $url . '"></td>';
}
else {
$url = '';
$rString .= '<td width="130">featured photo missing</td>';
}

$rString .= '<td width="130">' . $title . '</td>';

if ($i % $mod == 0)
$rString .= '</tr>';

} // foreach

} //try

catch (Exception $e) {
echo "{$e->getMessage()} (Error Code: {$e->getCode()})";
}

if ($i % $mod != 0)
$rString .= '</tr>';

$rString .= '</table>';

echo $rString;
?>


As you can see, no rocket science here. If you run this code (you might have to change the location of the phpSmug include) you can see what I mean.
I would very much appreciate any help, cheers,

rujero domenichini

rujero
Nov-28-2009, 04:45 PM
It works the same with all browsers and with any URL size (tried Thumb and Tiny and Small).
The URLs are all fine (used individually, the photos appear) but when they are together in the table some (always the same) don't show...

rujero
Dec-01-2009, 11:04 AM
Anybody there?

devbobo
Dec-01-2009, 01:38 PM
Do certain thumbs consistently not display ? It could be related to album security settings.

Do you have some samples urls that don't work ?

Cheers,

David

rujero
Dec-01-2009, 02:21 PM
Do certain thumbs consistently not display ? It could be related to album security settings.

Do you have some samples urls that don't work ?

Cheers,

David

Yes it is consistent and no, it's not related to security. If you load (on another browser tab) the individual photo that does not load in the gallery list it loads fine.

devbobo
Dec-01-2009, 02:53 PM
Yes it is consistent and no, it's not related to security. If you load (on another browser tab) the individual photo that does not load in the gallery list it loads fine.

ok, got a url ?

rujero
Dec-01-2009, 03:24 PM
ok, got a url ?

Sure:

http://www.rujerotest.com.php5-5.dfw1-2.websitetestlink.com/smugLoadGalleries.php

devbobo
Dec-01-2009, 08:05 PM
The reason the images aren't showing up is because the gallery that contains each image has the option 'External Links' set to NO.

It will work fine when loading the image directly in the browser, but if you try to load it from another domain, it won't.

So your options are to either...
- filter any gallery that has 'External' set to false via the api
- or set External Links to YES in each gallery.

Cheers,

David

rujero
Dec-01-2009, 08:33 PM
You are a star!!! Thank you so much! :barb