I used a method I saw on another site to implement inline images to a site that I'm working on. I created a custom node-story.tpl.php file, and put in the appropriate arg() functions so that the custom node type doesn't interfere with the front page template file. Everything works fine except that when I try to view a story node that doesn't have the image I get an invalid argument line 521 error which is a node_load problem. Is there a way to exclude those nodes from having the inline code run on them? I tried using a statement like this "if($featured_image->field_featured_image[0]['filepath'])" , but it ends up excluding all nodes.
Also, is there a line of code that I can use to take the picture out of one particular story node when it's viewed as a node as opposed to viewed on the front page?
Here's the custom node-story.tpl.php that I have
<?php
if ( arg(0) == 'node' && is_numeric(arg(1)) && ! arg(2)) { // Do something with the node
$featured_image= $field_featured_image[0]['nid'];
$featured_image = node_load($featured_image);}
$arr_style = array ('style' => 'float:left; padding: 6px 6px 1px 0;');
?>
<h2><?php print $featured_image->title ?></h2>
<?php if($featured_image->field_featured_image[0]['filepath']): ?>
<?php print theme('imagecache', 'featured_block_2',
$featured_image->field_featured_image[0]['filepath'],$featured_image->field_featured_image[0]['title'],
$featured_image->field_featured_image[0]['alt'],$arr_style);?>
<?php else: ?><h2><a href= "<?php print $node_url ?>" title="<?php print $title ?>"><?php print $title ?></a></h2>
<?php print $content ?>
<?php if ($links): ?>
<div class="links"><?php print $links; ?></div>
<?php endif; ?>
<?php endif;?>
<p><?php print $featured_image->body ?></p>