views:

138

answers:

0

Hi to all, i'm having a bit of a complication reading the itunes:category tag. I'm using blip to host some files, i use simple pie to read the blip feed and then "creating" a valid feed for itunes podcast. My code works fine in some cases but in other it simply doen't work.

Here is the part of my code that reads the itunes:category tag:

$iTunesCategories=$rssDoc->get_channel_tags(SIMPLEPIE_NAMESPACE_ITUNES,'category');


        if ($iTunesCategories) 
        {
           foreach ($iTunesCategories as $iTunesCategory) 
           {
           $category=$iTunesCategory['attribs']['']['text'];
           $category = str_replace("&", "&", $category);
           $aux = split(':',$category);
           if(count($aux) > 1)
           {
            $strxml = $strxml . "<itunes:category text='" . $aux[0] . "' > ";
            $strxml = $strxml . "\n<itunes:category text='" . $aux[1]  . "'/> </itunes:category>\n";
           }
           else
           {
            $strxml = $strxml . "<itunes:category text='" . $aux[0] . "' /> ";
           }
           $subcat=$iTunesCategory['child']["http://www.itunes.com/dtds/podcast-1.0.dtd"]['category'][0]['attribs']['']['text'];
           if ($subcat) 
           {
             $strxml = $strxml . "\n<itunes:category text='" . $subcat  . "'/> </itunes:category>\n";
           }
          }
        }

thanks anyone for the help...

Fernando Nava Feldman Mexico Df 11/08/2009