Hi there,
I'm using a module called AG My Auctions in my Joomla site to display my eBay auctions in the footer of the page.
I won't always have auctions running, so I'd like it to show a message when there are none. I used to be able to make my own basic PHP scripts so would have thought I could do this but apparently not.
The code is:
<?php
/**
* Modulo Sagre in Italia".
*/
// no direct access
defined( '_JEXEC' ) or die( 'Restricted access' );
function getFeedAGMyAuctions($feed_url, $max_items) {
$countitems=1;
$content = file_get_contents($feed_url);
$x = new SimpleXmlElement($content);
echo "<table border='0' cellpadding='0'><tr>";
foreach($x->channel->item as $entry) {
echo "<td><a href='$entry->link' title='$entry->title'>" . $entry->title . "</a>";
echo str_replace ("$" , "$ ", $entry->description);
echo "</td>";
$countitems+=1;
if ($countitems>$max_items)
{
break;
}
}
echo "</tr></table>";
}
$maxitems=$params->get('maxitems');
$feedurl="http://rss.api.ebay.com/ws/rssapi?FeedName=SearchResults&siteId=0&satitle=(".$params->get('keyword1').",".$params->get('keyword2').",".$params->get('keyword3').")&language=".$params->get('language')."&output=RSS20&sass=".$params->get('username')."&frpp=2&rows=2";
getFeedAGMyAuctions($feedurl, $maxitems);
I've tried things like echoing an error message if $countitems == 0 but for some reason can't get anything to display. Quite frustrated that I haven't worked it out.
Anybody able to point me in the right direction?
Thanks a lot,