try/catch in bbclone counter code.. what php versions will that work with? can it be more version independent? thx --Mindless 20:21, 28 March 2006 (PST)
Good call, i'm so into PHP 5 that I forget that some people are using php 4. I've changed it. What do you think? Thanks --Shocksll 04:43, 29 March 2006 (PST)
Looks ok, though if i were reviewing it as G2 code i'd mention a missing $ret error check and excessive use of @ (you certainly don't need it for get* functions). thanks. --Mindless 20:58, 29 March 2006 (PST)
Well, I was having issues with it spitting out errors and that error would be put out before the headers and firefox would just not load images, etc. I was getting these mainly,
PHP Fatal error: Call to undefined method GalleryDerivativeImage::getTitle() in C:\Steve\Pictures\gallery\gallery2.php on line 32
and
PHP Fatal error: Call to a member function initNavigation() on a non-object in C:\Steve\Pictures\gallery2\init.inc on line 154
and
PHP Fatal error: Class 'GalleryCoreApi' not found in C:\Steve\Pictures\gallery2\gallery2.php on line 20
I'll look at the $ret error check. Thanks. --Shocksll 04:19, 30 March 2006 (PST)
And about the $ret, you are referring to
list ($ret, $parents) = @GalleryCoreApi::fetchParentSequence($g2_itemId); $parents[count($parents)+1]=$g2_itemId;
correct? I don't care if it fails or not because I still increment $parents and put in the current itemId. So $parents will always have at least one item. I guess I could do something this to be clear
list ($ret, $parents) = @GalleryCoreApi::fetchParentSequence($g2_itemId);
if ($ret)
{
//Don't do anything, because I'm setting parents to have a least 1 item below
}
$parents[count($parents)+1]=$g2_itemId;
Thanks for your help. --Shocksll 05:53, 30 March 2006 (PST)
Yes, that's the $ret check. It should probably be if ($ret) { $parents = array(); }
For the getTitle error, you don't check what $item is.. how about if (GalleryUtilities::isA($item, 'GalleryItem'). GalleryCoreApi won't be defined on a fast-download request.. we don't initialize the whole framework here.
--Mindless 12:45, 30 March 2006 (PST)
Is there something I can check to see whether it's a fast-download request or not? Thanks for your help! --Shocksll 13:45, 30 March 2006 (PST)
how about class_exists('GalleryCoreApi') ?
--Mindless 15:25, 30 March 2006 (PST)