<commit_before><?php
function count_by_category_render() {
	ob_start();
	$sql = "select c.name as Kategorie, count(e.id) as Anzahl from {prefix}content e inner join {prefix}categories c on c.id = category where type = 'article'  group by e.category order by Kategorie asc;";
	$query = Database::query ( $sql, true );
	?>
<table class="tablesorter">

	<thead>
		<tr>
			<th>Kategorie</th>
			<th>Anzahl</th>
		</tr>
	</thead>
	<tbody>
	<?php while($row = Database::fetchObject($query)){?>
	<tr>
			<td><?php Template::escape($row->Kategorie);?></td>
			<td class="text-right"><?php  Template::escape(strval($row->Anzahl));?></td>
		</tr>
	<?php }?>
	</tbody>

</table>

<?php
    return ob_get_clean();
}<commit_msg>Kategorien nun auch in der Tabelle auf der Startseite verlinkt<commit_after><?php
function getURLForCategory($category_id) {
	$query = Database::pQuery ( "select systemname from {prefix}content c inner join {prefix}lists l on l.content_id = c.id where c.language = ? and c.active = ? and c.type = ? and l.category_id = ?", array (
			getCurrentLanguage (),
			1,
			"list",
			intval ( $category_id ) 
	
	), true );
	if (Database::any ( $query )) {
		$data = Database::fetchFirst ( $query );
		return buildSEOUrl ( $data->systemname );
	} else {
		return null;
	}
}
function count_by_category_render() {
	ob_start ();
	$sql = "select c.name as Kategorie, c.id as kid, count(e.id) as Anzahl from {prefix}content e inner join {prefix}categories c on c.id = category where type = 'article'  group by e.category order by Kategorie asc;";
	$query = Database::query ( $sql, true );
	?>
<table class="tablesorter">

	<thead>
		<tr>
			<th>Kategorie</th>
			<th>Anzahl</th>
		</tr>
	</thead>
	<tbody>
	<?php while($row = Database::fetchObject($query)){?>
	<?php $url = getURLForCategory($row->kid);?>
	<tr>
			<td><?php if($url){?><a href="<?php Template::escape($url)?>">
			<?php Template::escape($row->Kategorie);?>
			</a><?php } else {?>
			<?php Template::escape($row->Kategorie);?>
			<?php }?>
			</td>
			<td class="text-right"><?php  Template::escape(strval($row->Anzahl));?></td>
		</tr>
	<?php }?>
	</tbody>

</table>

<?php
	return ob_get_clean ();
}
{'fraction_non_alphanumeric': 0.1967741935483871, 'fraction_numerical': 0.0004608294930875576, 'mean_word_length': 4.360493827160494, 'pattern_counts': {'":': 0, '<': 59, '<?xml version=': 0, '>': 64, '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': '1348059', 'n_tokens_mistral': 841, 'n_tokens_neox': 802, 'n_words': 190}