option to sort taglists alphabetically rather than by tag count
This commit is contained in:
parent
e5e27a7804
commit
0dd7d086f2
@ -14,6 +14,8 @@ class TagList extends Extension {
|
|||||||
$config->set_default_int("tags_min", 3);
|
$config->set_default_int("tags_min", 3);
|
||||||
$config->set_default_string("info_link", 'http://en.wikipedia.org/wiki/$tag');
|
$config->set_default_string("info_link", 'http://en.wikipedia.org/wiki/$tag');
|
||||||
$config->set_default_string("tag_list_image_type", 'related');
|
$config->set_default_string("tag_list_image_type", 'related');
|
||||||
|
$config->set_default_string("tag_list_related_sort", 'alphabetical');
|
||||||
|
$config->set_default_string("tag_list_popular_sort", 'tagcount');
|
||||||
$config->set_default_bool("tag_list_pages", false);
|
$config->set_default_bool("tag_list_pages", false);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -98,6 +100,14 @@ class TagList extends Extension {
|
|||||||
"Image's tags only" => "tags",
|
"Image's tags only" => "tags",
|
||||||
"Show related" => "related"
|
"Show related" => "related"
|
||||||
), "<br>Image tag list: ");
|
), "<br>Image tag list: ");
|
||||||
|
$sb->add_choice_option("tag_list_related_sort", array(
|
||||||
|
"Tag Count" => "tagcount",
|
||||||
|
"Alphabetical" => "alphabetical"
|
||||||
|
), "<br>Sort related list by: ");
|
||||||
|
$sb->add_choice_option("tag_list_popular_sort", array(
|
||||||
|
"Tag Count" => "tagcount",
|
||||||
|
"Alphabetical" => "alphabetical"
|
||||||
|
), "<br>Sort popular list by: ");
|
||||||
$sb->add_bool_option("tag_list_numbers", "<br>Show tag counts: ");
|
$sb->add_bool_option("tag_list_numbers", "<br>Show tag counts: ");
|
||||||
$event->panel->add_block($sb);
|
$event->panel->add_block($sb);
|
||||||
}
|
}
|
||||||
|
@ -36,6 +36,8 @@ class TagListTheme extends Themelet {
|
|||||||
|
|
||||||
$html = "";
|
$html = "";
|
||||||
$n = 0;
|
$n = 0;
|
||||||
|
if($config->get_string('tag_list_related_sort') == 'alphabetical') asort($tag_infos);
|
||||||
|
|
||||||
foreach($tag_infos as $row) {
|
foreach($tag_infos as $row) {
|
||||||
$tag = $row['tag'];
|
$tag = $row['tag'];
|
||||||
$h_tag = html_escape($tag);
|
$h_tag = html_escape($tag);
|
||||||
@ -77,6 +79,7 @@ class TagListTheme extends Themelet {
|
|||||||
|
|
||||||
$html = "";
|
$html = "";
|
||||||
$n = 0;
|
$n = 0;
|
||||||
|
if($config->get_string('tag_list_popular_sort') == 'alphabetical') asort($tag_infos);
|
||||||
|
|
||||||
foreach($tag_infos as $row) {
|
foreach($tag_infos as $row) {
|
||||||
$tag = $row['tag'];
|
$tag = $row['tag'];
|
||||||
|
Loading…
x
Reference in New Issue
Block a user