Jump to content

Search the Community

Showing results for tags 'xml rss feed photo album'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • Welcome to PHP Freaks
    • Announcements
    • Introductions
  • PHP Coding
    • PHP Coding Help
    • Regex Help
    • Third Party Scripts
    • FAQ/Code Snippet Repository
  • SQL / Database
    • MySQL Help
    • PostgreSQL
    • Microsoft SQL - MSSQL
    • Other RDBMS and SQL dialects
  • Client Side
    • HTML Help
    • CSS Help
    • Javascript Help
    • Other
  • Applications and Frameworks
    • Applications
    • Frameworks
    • Other Libraries
  • Web Server Administration
    • PHP Installation and Configuration
    • Linux
    • Apache HTTP Server
    • Microsoft IIS
    • Other Web Server Software
  • Other
    • Application Design
    • Other Programming Languages
    • Editor Help (PhpStorm, VS Code, etc)
    • Website Critique
    • Beta Test Your Stuff!
  • Freelance, Contracts, Employment, etc.
    • Services Offered
    • Job Offerings
  • General Discussion
    • PHPFreaks.com Website Feedback
    • Miscellaneous

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


AIM


MSN


Website URL


ICQ


Yahoo


Jabber


Skype


Location


Interests


Age


Donation Link

Found 1 result

  1. Hi there Sorry to just break in here with a dumb question. But I'm looking for a solution for days and nights without success. To be honest, I have no clue about programming, but I'm sure for most of you it's just a fingersnip with a smile... I have a php script that provides a simple XML file as a feed for a photo album(using cooliris with local images). It's only an output on the screen, so I can copy&paste it to a XML file. The problem is, that the tags in the output are written in this form: <thumbnail>thumbs/picture123.jpg</thumbnail> but for the photo album it's required like this: <media:thumbnail url="thumbs/picture123.jpg"/> The script looks like this: ---------------------------------------------------------------------------------------------- <?php $path_to_image_dir = 'pl_images'; // relative path to your image directory $path_to_thumbs_dir = 'pl_thumbs'; // relative path to your image directory $xml_string = <<<XML <?xml version="1.0" encoding="UTF-8"?> <items> </items> XML; $xml_generator = new SimpleXMLElement($xml_string); if ( $handle = opendir( $path_to_image_dir ) ) { while (false !== ($file = readdir($handle))) { if ( is_file($path_to_image_dir.'/'.$file) ) { $item = $xml_generator->addChild('item'); $item->addChild('thumbnail', $path_to_thumbs_dir.'/'.$file); $item->addChild('preview', $path_to_image_dir.'/'.$file); $item->addChild('category', 'photo'); $item->addChild('description', ' '); } } closedir($handle); } header("Content-Type: text/xml"); echo $xml_generator->asXML(); ?> ---------------------------------------------------------------------------------------------- The goal is to get a XML coding (for each image) like this: <item> <title></title> <description></description> <link>pics/picture123.jpg</link> <media:thumbnail url="thumbs/picture123.jpg"/> <media:content type="image/jpeg" url="pics/picture123.jpg"/> </item> Is there any change to change the syntax of the output accordingly? I think I manage everything, but just not the tag issue. Thank you so much for your help!!! Kind regards, Wolfgang
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.