Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 32 additions & 1 deletion main.inc.php
Original file line number Diff line number Diff line change
Expand Up @@ -88,10 +88,10 @@ function tg_groups_display()

foreach ($tags as $tag)
{
// if the tag belongs to no group, we don't show it on the "tag by
// group" display mode
if (strpos($tag['name'], ':') === false)
{
$tags_without_groups[] = $tag;
continue;
}
else
Expand Down Expand Up @@ -158,6 +158,37 @@ function tg_groups_display()
$tag_group
);
}
// Create a group for tags without groups
if (count($tags_without_groups) > 0)
{
$tag_group = array(
'TITLE' => l10n('Ungrouped tags'),
'tags' => array()
);

foreach ($tags_without_groups as $tag)
{
$tag_group['ID'] = $tag['id'];
array_push(
$tag_group['tags'],
array_merge(
$tag,
array(
'URL' => make_index_url(
array(
'tags' => array($tag),
)
),
)
)
);
}

$template->append(
'tag_groups',
$tag_group
);
}
}
}

Expand Down