XML issue

4 posts by 2 authors in: Forums > CMS Builder
Last Post: February 12, 2009   (RSS)

By s2smedia - February 11, 2009 - edited: February 11, 2009

I have an xml flash calendar pulling in data from an xml doc.

I searched the forum to find out how to do it but im still having problems.. Its not pulling any data in.

I turned my xml doc into a php doc (ex. events.xml.php) I set this new file name within my flash file

Heres my xml code:
<?php header('Content-type: application/xml; charset=utf-8'); ?>
<?php

require_once "XXXXXXXX";

list($eventsRecords, $eventsMetaData) = getRecords(array(
'tableName' => 'events',
));

?>


<events>
<?php foreach ($eventsRecords as $record): ?>
<event>
<date><?php echo date("d m Y", strtotime($record['date_time'])) ?></date>
<time><?php echo date("g:i a", strtotime($record['date_time'])) ?></time>
<title><?php echo $record['title'] ?></title>
<image><?php foreach ($record['image'] as $upload): ?>
<img src="<?php echo $upload['urlPath'] ?>" width="<?php echo $upload['width'] ?>" height="<?php echo $upload['height'] ?>" alt="" /><br/>

</image>
<?php endif ?>
<?php endforeach ?>
<description>
<![CDATA[<?php echo $record['content'] ?>]]>
</description>
<link><a href="<?php echo $record['_link'] ?>">Get Tickets</a></link>
</event>
<?php endforeach; ?>

<?php if (!$eventsRecords): ?>

<?php endif ?>

</events>

Re: [Dave] XML issue

it works when i use plain text in the xml document... and also when i use plain text in the xml.php doc. So it must be the code in the CMS version.

Heres my code again just incase you might see something.

<?php header('Content-type: application/xml; charset=utf-8'); ?>
<?php

require_once "/XXXXXXXX";

list($eventsRecords, $eventsMetaData) = getRecords(array(
'tableName' => 'events',
));

?>


<events>
<?php foreach ($eventsRecords as $record): ?>
<?php foreach ($record['image'] as $upload): ?>
<event>

<date><?php echo date("d m Y", strtotime($record['date_time'])) ?></date>
<time><?php echo date("g:i a", strtotime($record['date_time'])) ?></time>
<title><?php echo $record['title'] ?></title>
<image><img src="<?php echo $upload['urlPath'] ?>" width="<?php echo $upload['width'] ?>" height="<?php echo $upload['height'] ?>" alt="" /></image>




<description>
<![CDATA[<?php echo $record['content'] ?>]]>
</description>
<link><![CDATA[<a href="<?php echo $record['_link'] ?>">Get Tickets</a></link>
</event>
<?php endif ?>
<?php endforeach ?>
<?php endforeach; ?>

<?php if (!$eventsRecords): ?>

<?php endif ?>

</events>

Re: [s2smedia] XML issue

By Dave - February 12, 2009

Can you post the url to both xml files (or email me if they're private to dave@interactivetools.com) so I can compare?

Let me know which one is working and which one isn't and I'll take a look.
Dave Edis - Senior Developer
interactivetools.com