1
0

Make authors plugin not show authors with less than X articles

This commit is contained in:
Garvin Hicking
2006-10-26 20:05:04 +00:00
parent f3c779acfc
commit d70de93257
64 changed files with 96 additions and 25 deletions

View File

@ -1583,8 +1583,8 @@ class serendipity_authors_plugin extends serendipity_plugin {
$propbag->add('description', AUTHOR_PLUGIN_DESC);
$propbag->add('stackable', true);
$propbag->add('author', 'Serendipity Team');
$propbag->add('version', '2.0');
$propbag->add('configuration', array('image', 'allow_select', 'title', 'showartcount'));
$propbag->add('version', '2.01');
$propbag->add('configuration', array('image', 'allow_select', 'title', 'showartcount', 'mincount'));
$propbag->add('groups', array('FRONTEND_VIEWS'));
}
@ -1620,6 +1620,13 @@ class serendipity_authors_plugin extends serendipity_plugin {
$propbag->add('default', false);
break;
case 'mincount':
$propbag->add('type', 'string');
$propbag->add('name', PLUGIN_AUTHORS_MINCOUNT);
$propbag->add('description', '');
$propbag->add('default', '');
break;
default:
return false;
}
@ -1639,8 +1646,8 @@ class serendipity_authors_plugin extends serendipity_plugin {
}
$is_form = serendipity_db_bool($this->get_config('allow_select'));
$is_count = serendipity_db_bool($this->get_config('showartcount'));
$mincount = (int)$this->get_config('mincount');
$authors = serendipity_fetchUsers(null, null, $is_count);
$html = '';
if ($is_form) {
@ -1654,6 +1661,9 @@ class serendipity_authors_plugin extends serendipity_plugin {
foreach ($authors as $auth) {
if ($is_count) {
if ($auth['artcount'] < $mincount) {
continue;
}
$entrycount = " ({$auth['artcount']})";
} else {
$entrycount = "";