<commit_before><?php
/*	For listing, say, the most recent comments on the site.

	Remember, we are currently within the COMMENTLIST class,
	in the render() function.
	
	We cycle through the $data array and output the comment(s). 
	
	See the comments.php template for an example of $data.

*/
global $PAGE, $DATA, $this_page;

if (isset($data['comments']) && count($data['comments']) > 0) {
	$title = 'Most recent comments';
	if (isset($data['full_name'])) {
		$title .= ' on things by ' . $data['full_name'];
	}
	$PAGE->block_start(array('id'=>'recentcomments', 'title'=>$title));
	
	if ($this_page != 'home') $PAGE->page_links($data);
	$USERURL = new URL('userview');
	?>
						<table class="people" border="0" cellpadding="3" cellspacing="0">
<?php
	foreach ($data['comments'] as $n => $comment) {
		?>	

						<tr><?php
		
		$commenttext = trim_characters($comment['body'], 0, 200);
		list($date, $time) = explode(' ', $comment['posted']);
		$date = format_date($date, SHORTDATEFORMAT);
		$time = format_time($time, TIMEFORMAT);
		
		$count = $n+1;
		
		$USERURL->insert(array('u'=>$comment['user_id']));

		// MD5 hash the user's email for their Gravatar
		$usermailmd5 = md5($comment['email']);
		
		?><td><img src="http://www.gravatar.com/avatar/<?php echo $usermailmd5; ?>?s=32&d=identicon&r=g" width="32" height="32" alt="Avatar for <?php echo htmlentities($comment['firstname']) .' '. htmlentities($comment['lastname']); ?>"></td><td><a name="c<?php echo $count; ?>"></a><strong><?php echo htmlentities($comment['firstname'] . ' ' . $comment['lastname']); ?>:</strong> <?php echo $commenttext; ?> <small>(<?php echo relative_time($comment['posted']); ?>)</small><br><a href="<?php echo $comment['url']; ?>">Read comment</a> | <a href="<?php echo $USERURL->generate(); ?>" title="See more information about this user">All by this user</a></td></tr>
<?php
	}
	?><commit_msg>OA-339 Keep the recent comments text the correct size with an inline style as there's no applicable CSS class<commit_after><?php
/*	For listing, say, the most recent comments on the site.

	Remember, we are currently within the COMMENTLIST class,
	in the render() function.
	
	We cycle through the $data array and output the comment(s). 
	
	See the comments.php template for an example of $data.

*/
global $PAGE, $DATA, $this_page;

if (isset($data['comments']) && count($data['comments']) > 0) {
	$title = 'Most recent comments';
	if (isset($data['full_name'])) {
		$title .= ' on things by ' . $data['full_name'];
	}
	$PAGE->block_start(array('id'=>'recentcomments', 'title'=>$title));
	
	if ($this_page != 'home') $PAGE->page_links($data);
	$USERURL = new URL('userview');
	?>
						<table class="people" border="0" cellpadding="3" cellspacing="0">
<?php
	foreach ($data['comments'] as $n => $comment) {
		?>	

						<tr><?php
		
		$commenttext = trim_characters($comment['body'], 0, 200);
		list($date, $time) = explode(' ', $comment['posted']);
		$date = format_date($date, SHORTDATEFORMAT);
		$time = format_time($time, TIMEFORMAT);
		
		$count = $n+1;
		
		$USERURL->insert(array('u'=>$comment['user_id']));

		// MD5 hash the user's email for their Gravatar
		$usermailmd5 = md5($comment['email']);
		
		?><td><img src="http://www.gravatar.com/avatar/<?php echo $usermailmd5; ?>?s=32&d=identicon&r=g" width="32" height="32" alt="Avatar for <?php echo htmlentities($comment['firstname']) .' '. htmlentities($comment['lastname']); ?>"></td><td style="font-size: 1em"><a name="c<?php echo $count; ?>"></a><strong><?php echo htmlentities($comment['firstname'] . ' ' . $comment['lastname']); ?>:</strong> <?php echo $commenttext; ?> <small>(<?php echo relative_time($comment['posted']); ?>)</small><br><a href="<?php echo $comment['url']; ?>">Read comment</a> | <a href="<?php echo $USERURL->generate(); ?>" title="See more information about this user">All by this user</a></td></tr>
<?php
	}
	?>
{'fraction_non_alphanumeric': 0.21669672764751352, 'fraction_numerical': 0.010821953104869879, 'mean_word_length': 5.251207729468599, 'pattern_counts': {'":': 0, '<': 65, '<?xml version=': 0, '>': 83, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, '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': '2275294', 'n_tokens_mistral': 1373, 'n_tokens_neox': 1273, 'n_words': 334}