With the CCK maturing and Views the best thing since sliced bread, drupal is becoming, among many other things, an incredible backend for flash only projects.
I have created a "flashapi.module" that I use to expose just a few functions via xmlrpc that cover most of everything I need in flash, like:
flashapi_get_node(nid) - returns a node object
flashapi_get_view(view_name) - returns an array of node objects in a view (simply amazing)
flashapi_send_contact_email(name, email, subject, message, etc.) - sends an email
...
Here is the code for flashapi_get_view()
function flashapi_get_view ($appkey, $view_name)
{
$app = flashapi_validate_app($appkey);
if($app !== true) {
return flashapi_error($app);
}
$view = views_get_view($view_name);
if ($view == null)
{
return flashapi_error('View does not exist.');
}
$result = views_build_view('result', $view);
while ($node = db_fetch_object($result['result'])) {
$nodes[] = flashapi_node_format(node_load($node));
}
return $nodes;
}
Right now, when returning a node object, the object does not have any filters applied to it.
My question is:
How can I return a node object via flashapi_get_node or a list of nodes via flashapi_get_view, with filters applied?
I can't just run node_prepare() on the node, or check_markup() on the desired fields, becuase I will also need to trigger the hooks in CCK to filter the custom fields there.