<commit_before><div id="content">
	<?=(file_exists(APPATH.($relpath="img/cg/{$Appearance['id']}.png")))?"<img src='/$relpath' alt='{$Appearance['id']}'>":''?>
	<h1><?=$heading?></h1>
	<p>from the MLP-VectorClub <a href="/<?=$color?>guide"><?=$Color?> Guide</a></p>
<?php
	$RenderPath = APPATH."img/cg_render/{$Appearance['id']}.png";
	$FileModTime = '?t='.(file_exists($RenderPath) ? filemtime($RenderPath) : time());
	echo "<div class='align-center'><a class='darkblue btn typcn typcn-image' href='/{$color}guide/appearance/{$Appearance['id']}.png$FileModTime' target='_blank'>View as PNG</a></div>";

	if (!empty($Changes)){ ?>
	<section>
		<label><span class='typcn typcn-warning'></span>List of major changes</label>
		<?=render_changes_html($Changes)?>
	</section>
<?  }
	if ($CGDb->where('ponyid',$Appearance['id'])->has('tagged')){ ?>
	<section id="tags">
		<label><span class='typcn typcn-tags'></span>Tags</label>
		<?=get_tags_html($Appearance['id'],WRAP,NO_INPUT)?>
	</section>
<?php
	}
	$EpTagsOnAppearance = $CGDb->rawQuery(
		"SELECT t.tid
		FROM tagged tt
		LEFT JOIN tags t ON tt.tid = t.tid
		WHERE tt.ponyid = {$Appearance['id']}");
	if (!empty($EpTagsOnAppearance)){
		foreach ($EpTagsOnAppearance as $k => $row)
			$EpTagsOnAppearance[$k] = $row['tid'];

	$EpAppearances = $CGDb->rawQuery(
		"SELECT DISTINCT t.name
		FROM tagged tt
		LEFT JOIN tags t ON tt.tid = t.tid
		WHERE t.type = 'ep' && t.tid IN (".implode(',',$EpTagsOnAppearance).")");
	if (!empty($EpAppearances)){ ?>
	<section id="ep-appearances">
		<label><span class='typcn typcn-video'></span>Appears in <?=plur('episode',count($EpAppearances),PREPEND_NUMBER)?></label>
		<p><?php
			$HTML = '';
			foreach ($EpAppearances as $ep){
				list($season, $episode) = explode('e',substr($ep['name'],1));
				$Ep = get_real_episode($season, $episode);
				$HTML .= empty($Ep)
					? strtoupper($ep['name']).', '
					: "<a href='/episode/S{$Ep['season']}E{$Ep['episode']}'>{$Ep['title']}</a>, ";
			}
			echo rtrim($HTML, ', ')
		?></p>
	</section>
<?php
		}
	}
	if (!empty($Appearance['notes'])){ ?>
	<section><commit_msg>Properly format episode titles on appearance pages<commit_after><div id="content">
	<?=(file_exists(APPATH.($relpath="img/cg/{$Appearance['id']}.png")))?"<img src='/$relpath' alt='{$Appearance['id']}'>":''?>
	<h1><?=$heading?></h1>
	<p>from the MLP-VectorClub <a href="/<?=$color?>guide"><?=$Color?> Guide</a></p>
<?php
	$RenderPath = APPATH."img/cg_render/{$Appearance['id']}.png";
	$FileModTime = '?t='.(file_exists($RenderPath) ? filemtime($RenderPath) : time());
	echo "<div class='align-center'><a class='darkblue btn typcn typcn-image' href='/{$color}guide/appearance/{$Appearance['id']}.png$FileModTime' target='_blank'>View as PNG</a></div>";

	if (!empty($Changes)){ ?>
	<section>
		<label><span class='typcn typcn-warning'></span>List of major changes</label>
		<?=render_changes_html($Changes)?>
	</section>
<?  }
	if ($CGDb->where('ponyid',$Appearance['id'])->has('tagged')){ ?>
	<section id="tags">
		<label><span class='typcn typcn-tags'></span>Tags</label>
		<?=get_tags_html($Appearance['id'],WRAP,NO_INPUT)?>
	</section>
<?php
	}
	$EpTagsOnAppearance = $CGDb->rawQuery(
		"SELECT t.tid
		FROM tagged tt
		LEFT JOIN tags t ON tt.tid = t.tid
		WHERE tt.ponyid = {$Appearance['id']}");
	if (!empty($EpTagsOnAppearance)){
		foreach ($EpTagsOnAppearance as $k => $row)
			$EpTagsOnAppearance[$k] = $row['tid'];

	$EpAppearances = $CGDb->rawQuery(
		"SELECT DISTINCT t.name
		FROM tagged tt
		LEFT JOIN tags t ON tt.tid = t.tid
		WHERE t.type = 'ep' && t.tid IN (".implode(',',$EpTagsOnAppearance).")");
	if (!empty($EpAppearances)){ ?>
	<section id="ep-appearances">
		<label><span class='typcn typcn-video'></span>Appears in <?=plur('episode',count($EpAppearances),PREPEND_NUMBER)?></label>
		<p><?php
			$HTML = '';
			foreach ($EpAppearances as $ep){
				list($season, $episode) = explode('e',substr($ep['name'],1));
				$Ep = get_real_episode($season, $episode);
				$HTML .= empty($Ep)
					? strtoupper($ep['name']).', '
					: "<a href='/episode/S{$Ep['season']}E{$Ep['episode']}'>".format_episode_title($Ep)."</a>, ";
			}
			echo rtrim($HTML, ', ')
		?></p>
	</section>
<?php
		}
	}
	if (!empty($Appearance['notes'])){ ?>
	<section>
{'fraction_non_alphanumeric': 0.25058768218147626, 'fraction_numerical': 0.0014104372355430183, 'mean_word_length': 5.596899224806202, 'pattern_counts': {'":': 2, '<': 97, '<?xml version=': 0, '>': 107, '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': '645673', 'n_tokens_mistral': 1754, 'n_tokens_neox': 1628, 'n_words': 269}