'SELECT COUNT(*)' . ' FROM #__messages' . ' WHERE state = 0' . ' AND user_id_to = '.(int) $user->get('id')