get('title', $title); if ($node->count() > 0) { // node exists, process $node->fetch(); // NULL extension indicates void image // XXX: kind of hacky, maybe we should rather opt for a specific field if (is_null($node->extension)) { $image_src = NULL; } else { $image_src = IMAGE_DIR . $title . '.' . $node->extension; } } else { // node does not exists (yet) $image_src = NULL; } $tpl->assign('title', $title); $tpl->assign('self', $_SERVER['PHP_SELF']); $tpl->assign('header', ''); $tpl->assign('onload', ''); $tpl->assign('image_src', $image_src); $tpl->display('edit_image.tpl.php'); ?>