Hello David
You did a special Amazon mod for earlier.
This mod show 10 items, but I only like to show 5 - please advise.
{code saved}
//Brian
Hello David
No problem :o)
I tried different things, but it's either 0 or 10 items.
Code again:
{code saved}
//Brian
Thanks Brian - spotted the problem!
The return TRUE; logic only applied when myAmazonDisplayRecordHandler() is being called directly from the parser, but in this case, it's being called in a foreach loop.
Easily fixed, where you have, towards the end of the script:
foreach($amazonItems as $item)
{
myAmazonDisplayRecordHandler($item);
}
...REPLACE with;
foreach($amazonItems as $item)
{
if (myAmazonDisplayRecordHandler($item)) break;
}
...and that should do the trick!
Cheers,
David.
--
PriceTapestry.com
Hello Brian,
I'm really sorry I accidentally deleted the code before saving it, but I did see that it has the $count variable, but it looks like this isn't being used within the myRecordHandler function. If you want to try as follows; look for the opening of the myRecordHandler function as follows:
function myRecordHandler($item)
{
...and then on the next line after the {, add this code:
function myRecordHandler($item)
{
global $count;
if (!$count) return TRUE;
$count--;
If that doesn't do the trick, post the code again and I'll describe the fix for you...
Cheers,
David.
--
PriceTapestry.com