I have the following code:
<?php
if ((is_home()) OR (!is_single()) OR (!is_page('171'))) : ?>
<body>
<?php else: ?>
<body class="last-page">
<?php endif; ?>
However it doesn't seem to work as expected. I want the class "last-page" to be applied to the body of the page with the id of 171 and pages that display single posts. If I take the third condition out, the "last-page" class is applied correctly to single post pages but with the third condition there it doesn't get applied to any of the two.
I want the "last-page" class to be applied to both single post pages and page 171.
Appreciate the help.

body_classfilter for this: related example. – Geert May 6 '11 at 12:55