I am unable to show the access denied message of the premium content module. How can I do this? I have 3 view modes (teaser, presentation and full view mode). I have created a node--content-type.tpl.php and created the code for each view mode using a conditional statement     

if($teaser) {} 
else if($node-&gt;type == 'tu_mooc' &amp;&amp; $view_mode == 'presentation') {} 
else {}


I have linked the 3 view modes. So I can go from the teaser to the presentation and from the presentation to the full view mode.

I have downloaded the premium content module so that access to the full view mode is limited to authenticated users. I made a small change in premium.module so that anonymous users have access to both the teaser view mode and the presentation view mode. The problem I have is that when I try to access the full view mode (as an anonymous user) I don't get the access denied message. Instead I get the code that appears within the teaser view mode. i.e. In node/1 I get the teaser of node1 instead of getting the access denied message.

Do I need to include some code like &lt;?php print $denied_message; ?&gt; into the node--content-type.tpl.php? or what do I need to do?

Thanks in advance.
I have included this code within the teaser in node--content-type.tpl.php:

&lt;?php print $content['body'][0]['#markup']; ?&gt;


And I have included this code in template.php:

function  mimooc_premium_body($arguments) {
  $node = $arguments['node'];
  node_build_content($node, 'teaser');
  unset($node-&gt;content['links']);
  $level = premium_level_load($node-&gt;premium);
  if ($level-&gt;denied_message) {
    $denied_message = $level-&gt;denied_message;
    $denied_message_format = $level-&gt;denied_message_format;
  }
  else {
    $denied_message = variable_get('premium_message', t('Full text available to premium subscribers only.'));
    $denied_message_format = variable_get('premium_format');
  }
  // Only display the premium message, if we actual have any content.
  if (!empty($node-&gt;content)) {
    return '&lt;div class="premium-message"&gt;&lt;h3&gt;' . check_markup($denied_message, $denied_message_format) . '&lt;/h3&gt;&lt;p&gt;' . l('Click here to sign in', 'user') . '&lt;/p&gt;&lt;/div&gt;';
  }
}


Now, when I access the full view mode of the node, I get the teaser of that node with the access denied message.