<commit_before><?php
	# First retrieve the needed parameters
	$messageId = $tplHelper->getParam('messageid');
	$pageNr = $tplHelper->getParam('pagenr');
	
	# Get the spot comments for each 5 comments
	$comments = $tplHelper->getSpotComments($messageId, ($pageNr * 5), 5);
	$comments = $tplHelper->formatComments($comments);
	
	/*
	 * We retrieve the fullspot as well because we want to compare the spotterids.
	 * This operation is rather cheap because we already have the fullspot cached
	 * in the database
	 */
	$spot = $tplHelper->getFullSpot($messageId, true);
	
	foreach($comments as $comment) {
		if ($comment['verified']) {
			$commenterIsPoster = ($comment['spotterid'] == $spot['spotterid']);

			if($comment['spotrating'] == 0) {
				$rating = '';
			} elseif($comment['spotrating'] == 1) {
				$rating = '<span class="rating" title="'.$comment['fromhdr'].' gaf deze spot '.$comment['spotrating'].' ster"><span style="width:' . $comment['spotrating'] * 4 . 'px;"></span></span>';
			} else {
				$rating = '<span class="rating" title="'.$comment['fromhdr'].' gaf deze spot '.$comment['spotrating'].' sterren"><span style="width:' . $comment['spotrating'] * 4 . 'px;"></span></span>';
			}
?>

					<li<?php if ($commenterIsPoster) { echo ' class="poster"'; } ?>><img class="commentavatar" src='<?php echo $tplHelper->makeCommenterImageUrl($comment); ?>'><strong> <?php echo $rating; ?><?php echo sprintf(_('Posted by %s'), '<span class="user">' . $comment['fromhdr'] . '</span>'); ?>
					(<a class="spotterid" target = "_parent" href="<?php echo $tplHelper->makeSpotterIdUrl($comment); ?>" title='<?php echo sprintf(_('Find spots from %s'), $comment['fromhdr']); ?>'><?php echo $comment['spotterid']; ?></a>) @ <?php echo $tplHelper->formatDate($comment['stamp'], 'comment'); ?> </strong> <br />
					<?php echo join("<br>", $comment['body']); ?>
					</li>
<?php	
			} # if
	} # for
<commit_msg>Showing of avatars is a user preference<commit_after><?php
	# First retrieve the needed parameters
	$messageId = $tplHelper->getParam('messageid');
	$pageNr = $tplHelper->getParam('pagenr');
	
	# Get the spot comments for each 5 comments
	$comments = $tplHelper->getSpotComments($messageId, ($pageNr * 5), 5);
	$comments = $tplHelper->formatComments($comments);

	# Does the user want to see avatars?
	$show_avatars = $currentSession['user']['prefs']['show_avatars'];
	
	/*
	 * We retrieve the fullspot as well because we want to compare the spotterids.
	 * This operation is rather cheap because we already have the fullspot cached
	 * in the database
	 */
	$spot = $tplHelper->getFullSpot($messageId, true);
	
	foreach($comments as $comment) {
		if ($comment['verified']) {
			$commenterIsPoster = ($comment['spotterid'] == $spot['spotterid']);

			if($comment['spotrating'] == 0) {
				$rating = '';
			} elseif($comment['spotrating'] == 1) {
				$rating = '<span class="rating" title="'.$comment['fromhdr'].' gaf deze spot '.$comment['spotrating'].' ster"><span style="width:' . $comment['spotrating'] * 4 . 'px;"></span></span>';
			} else {
				$rating = '<span class="rating" title="'.$comment['fromhdr'].' gaf deze spot '.$comment['spotrating'].' sterren"><span style="width:' . $comment['spotrating'] * 4 . 'px;"></span></span>';
			}
?>

					<li<?php if ($commenterIsPoster) { echo ' class="poster"'; } ?>><?php if ($show_avatars) { ?><img class="commentavatar" src='<?php echo $tplHelper->makeCommenterImageUrl($comment); ?>'><?php } ?><strong> <?php echo $rating; ?><?php echo sprintf(_('Posted by %s'), '<span class="user">' . $comment['fromhdr'] . '</span>'); ?>
					(<a class="spotterid" target = "_parent" href="<?php echo $tplHelper->makeSpotterIdUrl($comment); ?>" title='<?php echo sprintf(_('Find spots from %s'), $comment['fromhdr']); ?>'><?php echo $comment['spotterid']; ?></a>) @ <?php echo $tplHelper->formatDate($comment['stamp'], 'comment'); ?> </strong> <br />
					<?php echo join("<br>", $comment['body']); ?>
					</li>
<?php	
			} # if
	} # for

{'fraction_non_alphanumeric': 0.21600985221674876, 'fraction_numerical': 0.0034482758620689655, 'mean_word_length': 4.547814207650274, 'pattern_counts': {'":': 0, '<': 65, '<?xml version=': 0, '>': 79, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4604692', 'n_tokens_mistral': 1411, 'n_tokens_neox': 1286, 'n_words': 321}