Posted by whytewolf on June 1, 2010 at 8:59pm
I'm having a bit of issues with attaching an image file to a story in services.
now i can get the file to attach, however the caption isn't seeming to take from services. if i edit the story and save with out touching anything, the title,alt and description fields in the image do save. however before that only the image is accessible.
here is the code for the $node['field_story_images'] field.
function imageLink($sid) {
global $db_reader, $xmlrpc;
$files = array();
$sql1 = "SELECT fn.fid, f.description, f.alt from files as f join filenodes as fn on (fn.lid = f.lid) join storyfiles as sf on (sf.lid = f.lid) where sf.sid = '$sid'";
$results = $db_reader->fetch($sql1);
foreach($results as $result) {
$file = $xmlrpc->send('file.get',array($result['fid']));
unset($file['file']);
$file['data'] = array(
'title' => $result['alt'],
'alt' => $result['alt'],
'description' => $result['description']
);
$files[] = $file;
}
return $files;
}sorry for the hard to read code. i rushed through this.
should i save the data fields to the image also? or just the story?
Comments
never mind, found out the
never mind, found out the issue.
it was the order of the fields in data,
they NEED to be description, alt, then title
i was wrong, that didn't fix
i was wrong, that didn't fix the issue. it still does not show up right in lightroom. the images are shown tho and I am able to display the title,alt and description fields with views.
anyone have any idea on this?
i was wrong, that didn't fix
i was wrong, that didn't fix the issue. it still does not show up right in lightroom. the images are shown tho and I am able to display the title,alt and description fields with views.
anyone have any idea on this?