The exact location to put the code will depend on where on the page you want the notice to appear, but you could do it like this:
PHP Code:
if ($cPath != '' or $products_id != '') {
echo 'Your "Not Framed" message.';
}
This says that if there is a category path or a product id currently in use, display the message.
You may also want to include
PHP Code:
or $main_page == 'specials' or $main_page == 'products_new' or $main_page == 'featured_products' or $main_page == 'products_all'
as these have neither cPath or products_id.
You might put it in tpl_header.php, or in tpl_main_page.php.