Monday 19 March 2007 3:20:46 pm
I've created an extension that will email the content output of an object to a specified email address. These objects have an xml text block that will be referencing attached images and node links. The problem is that the urls are referenced relative to the install of eZ. I need the referenced absolutely with the domain name, so that when people view these in their email they will be able to see the image. Here's how I'm pulling the xml content in the action handler php...
$object =& eZContentObject::fetch( $objectID );
$nodeID = $object->attribute( 'main_node_id' );
$dataMap = $object->dataMap();
$body =& $dataMap['body']->content();
$bodyOutput =& $body->attribute('output');
$bodyOutputText = $bodyOutput->attribute('output_text');
If I include a link to a node or a image it will show up like this...
<img src="/var/tcbc/storage/images/media/images/sample_image/2153-1-eng-US/sample_image_small.jpg" width="125" height="94" style="border: 0px;" alt="" title="" />
<a href="/">node link here</a>
Is there a php function I can use to get the absolute url for everything referenced in the xml block? Thanks. --Andrew
|