From d25b294c8005e4ff610127003cffa06a0b5a3405 Mon Sep 17 00:00:00 2001 From: Thomas Hochstein Date: Sun, 2 Sep 2018 18:05:14 +0200 Subject: [PATCH] Sync authors in core and Spartacus. * Spartacus had 0.11. * Language constants are now in core. Signed-off-by: Thomas Hochstein --- .../UTF-8/lang_cs.inc.php | 11 -- .../UTF-8/lang_cz.inc.php | 11 -- .../UTF-8/lang_de.inc.php | 4 - .../UTF-8/lang_pt.inc.php | 4 - serendipity_plugin_authors/lang_cs.inc.php | 11 -- serendipity_plugin_authors/lang_cz.inc.php | 11 -- serendipity_plugin_authors/lang_de.inc.php | 4 - serendipity_plugin_authors/lang_en.inc.php | 12 -- serendipity_plugin_authors/lang_pt.inc.php | 4 - .../serendipity_plugin_authors.php | 138 +++++++++++------- 10 files changed, 89 insertions(+), 121 deletions(-) delete mode 100644 serendipity_plugin_authors/UTF-8/lang_cs.inc.php delete mode 100644 serendipity_plugin_authors/UTF-8/lang_cz.inc.php delete mode 100644 serendipity_plugin_authors/UTF-8/lang_de.inc.php delete mode 100644 serendipity_plugin_authors/UTF-8/lang_pt.inc.php delete mode 100644 serendipity_plugin_authors/lang_cs.inc.php delete mode 100644 serendipity_plugin_authors/lang_cz.inc.php delete mode 100644 serendipity_plugin_authors/lang_de.inc.php delete mode 100644 serendipity_plugin_authors/lang_en.inc.php delete mode 100644 serendipity_plugin_authors/lang_pt.inc.php diff --git a/serendipity_plugin_authors/UTF-8/lang_cs.inc.php b/serendipity_plugin_authors/UTF-8/lang_cs.inc.php deleted file mode 100644 index e77b90c6..00000000 --- a/serendipity_plugin_authors/UTF-8/lang_cs.inc.php +++ /dev/null @@ -1,11 +0,0 @@ - - * @translated 2009/02/15 - * @author Vladimír Ajgl - * @revisionDate 2009/08/26 - */ - -@define('PLUGIN_AUTHORS_NAME', 'AutoÅ™i'); -@define('PLUGIN_AUTHORS_DESC', 'Zobrazuje příspÄ›vky podle autorů'); \ No newline at end of file diff --git a/serendipity_plugin_authors/UTF-8/lang_cz.inc.php b/serendipity_plugin_authors/UTF-8/lang_cz.inc.php deleted file mode 100644 index e77b90c6..00000000 --- a/serendipity_plugin_authors/UTF-8/lang_cz.inc.php +++ /dev/null @@ -1,11 +0,0 @@ - - * @translated 2009/02/15 - * @author Vladimír Ajgl - * @revisionDate 2009/08/26 - */ - -@define('PLUGIN_AUTHORS_NAME', 'AutoÅ™i'); -@define('PLUGIN_AUTHORS_DESC', 'Zobrazuje příspÄ›vky podle autorů'); \ No newline at end of file diff --git a/serendipity_plugin_authors/UTF-8/lang_de.inc.php b/serendipity_plugin_authors/UTF-8/lang_de.inc.php deleted file mode 100644 index 0d3212af..00000000 --- a/serendipity_plugin_authors/UTF-8/lang_de.inc.php +++ /dev/null @@ -1,4 +0,0 @@ - - * @translated 2009/02/15 - * @author Vladimír Ajgl - * @revisionDate 2009/08/26 - */ - -@define('PLUGIN_AUTHORS_NAME', 'Autoøi'); -@define('PLUGIN_AUTHORS_DESC', 'Zobrazuje pøíspìvky podle autorù'); \ No newline at end of file diff --git a/serendipity_plugin_authors/lang_cz.inc.php b/serendipity_plugin_authors/lang_cz.inc.php deleted file mode 100644 index 0547f86a..00000000 --- a/serendipity_plugin_authors/lang_cz.inc.php +++ /dev/null @@ -1,11 +0,0 @@ - - * @translated 2009/02/15 - * @author Vladimír Ajgl - * @revisionDate 2009/08/26 - */ - -@define('PLUGIN_AUTHORS_NAME', 'Autoøi'); -@define('PLUGIN_AUTHORS_DESC', 'Zobrazuje pøíspìvky podle autorù'); \ No newline at end of file diff --git a/serendipity_plugin_authors/lang_de.inc.php b/serendipity_plugin_authors/lang_de.inc.php deleted file mode 100644 index 90ff6f40..00000000 --- a/serendipity_plugin_authors/lang_de.inc.php +++ /dev/null @@ -1,4 +0,0 @@ - - * EN-Revision: Revision of lang_en.inc.php - */ - -@define('PLUGIN_AUTHORS_NAME', 'Authors'); -@define('PLUGIN_AUTHORS_DESC', 'Displays entries by author.'); - -?> diff --git a/serendipity_plugin_authors/lang_pt.inc.php b/serendipity_plugin_authors/lang_pt.inc.php deleted file mode 100644 index f65bbb04..00000000 --- a/serendipity_plugin_authors/lang_pt.inc.php +++ /dev/null @@ -1,4 +0,0 @@ -add('name', PLUGIN_AUTHORS_NAME); - $propbag->add('description', PLUGIN_AUTHORS_DESC); + global $serendipity; + + $propbag->add('name', AUTHORS); + $propbag->add('description', AUTHOR_PLUGIN_DESC); $propbag->add('stackable', true); - $propbag->add('author', 'Victor Fusco'); - $propbag->add('version', '0.11'); - $propbag->add('requirements', array( - 'serendipity' => '0.8', - 'smarty' => '2.6.7', - 'php' => '4.1.0' - )); - $propbag->add('groups', array('FRONTEND_VIEWS')); - $propbag->add('configuration', array('title')); + $propbag->add('author', 'Serendipity Team'); + $propbag->add('version', '2.2'); // NOTE: This plugin is also in the central repository. Commit changes to the core, too :) + $propbag->add('configuration', array('image', 'allow_select', 'title', 'showartcount', 'mincount')); + $propbag->add('groups', array('FRONTEND_VIEWS')); } function introspect_config_item($name, &$propbag) { + global $serendipity; + switch($name) { + case 'title': $propbag->add('type', 'string'); $propbag->add('name', TITLE); $propbag->add('description', TITLE); - $propbag->add('default', PLUGIN_AUTHORS_NAME); + $propbag->add('default', AUTHORS); break; + + case 'image': + $propbag->add('type', 'string'); + $propbag->add('name', XML_IMAGE_TO_DISPLAY); + $propbag->add('description', XML_IMAGE_TO_DISPLAY_DESC); + $propbag->add('default', serendipity_getTemplateFile('img/xml.gif')); + break; + + case 'showartcount': + $propbag->add('type', 'boolean'); + $propbag->add('name', AUTHORS_SHOW_ARTICLE_COUNT); + $propbag->add('description', AUTHORS_SHOW_ARTICLE_COUNT_DESC); + $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; } return true; } - function generate_content(&$title) { + function generate_content(&$title) + { global $serendipity; - $title = $this->get_config('title', $this->title); + $title = $this->get_config('title', $this->title); - $authors_query = "SELECT realname, username, authorid FROM {$serendipity['dbPrefix']}authors"; - $row_authors = serendipity_db_query($authors_query); - - echo '
    '; - - foreach ($row_authors as $entry) { - if (function_exists('serendipity_authorURL')) { - $entryLink = serendipity_authorURL($entry); - } else { - $entryLink = serendipity_rewriteURL( - PATH_AUTHORS . '/' . - serendipity_makePermalink( - PERM_AUTHORS, - array( - 'id' => $entry['authorid'], - 'title' => $entry['realname'] - ) - ) - ); - } - - echo '
  • ' . $entry['realname'] . '
  • '; + $sort = $this->get_config('sort_order'); + if ($sort == 'none') { + $sort = ''; + } else { + $sort .= ' ' . $this->get_config('sort_method'); } - echo '
'; + $is_count = serendipity_db_bool($this->get_config('showartcount', 'false')); + $mincount = (int)$this->get_config('mincount'); + $authors = serendipity_fetchUsers(null, 'hidden', $is_count); + $html = ''; + + $image = $this->get_config('image', serendipity_getTemplateFile('img/xml.gif')); + $image = (($image == "'none'" || $image == 'none') ? '' : $image); + + $html .= '
    ' . "\n"; + + if (is_array($authors) && count($authors)) { + foreach ($authors as $auth) { + + if ($is_count) { + if ($auth['artcount'] < $mincount) { + continue; + } + $entrycount = " ({$auth['artcount']})"; + } else { + $entrycount = ""; + } + + $html .= '
  • '; + + if ( !empty($image) ) { + $html .= ' XML '; + } + $html .= ' '. serendipity_specialchars($auth['realname']) . $entrycount . ''; + $html .= '
  • ' . "\n"; + } + } + + $html .= '
' . "\n"; + + $html .= sprintf( + ''."\n", + + $serendipity['serendipityHTTPPath'] . $serendipity['indexFile'], + ALL_AUTHORS, + ALL_AUTHORS + ); + print $html; } } -/* vim: set sts=4 ts=4 expandtab : */ -?> +?> \ No newline at end of file