## Magento Forum

 Brent W Peterson   Total Posts:  3194 Joined:  2009-02-26 Minneapolis MN Ok, it is not very “PRETTY” code, but it works, my next step is to put it into the database and also include flash Here is the XML file that holds the images        http://www.midwestsupplies.com    _blank    /skin/frontend/default/custom/images/media/ads/MidSup.jpg    207    100    Midwest Supplies        http://www.midwestsupplies.com    _blank    /skin/frontend/default/custom/images/media/ads/MidwestAd2.gif    207    100    Midwest Supplies    I didn’t include all the ads, you can add as many as you want. I created a simple block in Catalog.xml              Ok, here is the really ugly part, I was a SQL programmer and you will have to excuse my rudimentary PHP  getName() . "";$adCount = count($bannerAd);$randomAdNumber = mt_rand(1,$adCount);//echo $randomAdNumber;$i =1;$j =1;//Loop through array becuase I don't know how to pick one element out of the top array! 04/28/09foreach($bannerAd->children() as $littlens){ if($i == $randomAdNumber){ foreach($littlens as $child){ //created this switch becuase I don't know how to pick one element out of the child array! 04/28/09 switch($j){                case 1;                    echo '';                    break;                case 3;                    echo '';                    break;                default;                    break;            }            $j++; } }$i++;}}catch(exception \$e){        }?>  I have learned a lot since and will be putting newer version on our newest site. I think that is it. Posted: June 7 2009    |  top  |  # 6