<table class="cma-thread-list">

    <?php foreach($answers as $answer): ?>

        <tr><?php if( CMA_AnswerThread::isRatingAllowed() ): ?><td class="cma-thread-meta">

                    <div class="cma-thread-numbers cma-thread-votes"><div class="cma-thread-numbers-count cma-thread-votes-count">

                            <?php

                            $votes = $answer['rating'];

                            echo $votes;

                            ?>

                        </div>

                        <div class="cma-thread-numbers-caption cma-thread-votes-caption"><?php

                            if( $votes == 1 )

                            {

                                _e('vote', 'cm-answers');

                            }

                            else

                            {

                                _e('votes', 'cm-answers');

                            }

                            ?>

                        </div>

                    </div>

                </td><?php endif; ?>

            <?php if( !CMA_AnswerThread::isAnswerAutoApproved() ): ?>

                <td class="cma-thread-meta">

                    <?php echo $answer['status']; ?>

                </td>

            <?php endif; ?>

            <td class="cma-thread-summary">

                <div class="cma-answer-title">

                    <a href="<?php echo esc_attr(get_permalink($answer['questionId']) . '#answer-'. $answer['id']); ?>"><?php echo substr(strip_tags($answer['content']), 0, 100); ?>...</a>

                </div>

                <div class="cma-thread-updated">

                    <?php

                    $question = CMA_AnswerThread::getInstance($answer['questionId']);

                    printf(__('posted %s in reply to %s', 'cm-answers'),

                    	$answer['date'],

                    	'<a href="' . esc_attr(get_permalink($answer['questionId'])) . '" >' . $question->getTitle() . '</a>'

                    );

                    ?>

                </div>

            </td>

        </tr>

    <?php endforeach; ?>

</table>

