Checking if a view has view blocks
Set your views display style to unformatted and add preprocess function into your template.php, smthng like

function theme_preprocess_views_view_unformatted(&amp;$vars) {
  $view = $vars['view'];
  $rows = $vars['rows'];

foreach ($vars['view']-&gt;result as $id =&gt; $row) {

    if ( in this place add your if statement ) {
      $vars['classes_array'][$id] .= ' added_extra_class';
    }  
  }
}


You can check for every row needed condition