get variable indicating node preview mode (D7)?
The variable that inside node.tpl.php says the view mode currently used for the node is $view_mode, but that variable is not used when Drupal is displaying a preview of the node. To know that, you can:


Check the value of $node-&gt;in_preview; when that value is TRUE, Drupal is displaying the preview of a node.
Check that $classes contains the string 'node-preview', such as with the following code.

if (strpos($classes, 'node-preview') !== FALSE) {
  // Drupal is showing a preview of the node.
}



Drupal already shows a message when the user is watching the preview of a node, anyway.


  The trimmed version of your post shows what your post looks like when promoted to the main page or when exported for syndication. You can insert the delimiter "&lt;!--break--&gt;" (without the quotes) to fine-tune where your post gets split.