From: donchambers Date: Mon, 3 Dec 2007 20:54:55 +0000 (+0000) Subject: category plugin: added
  • classes category_depth# (#= 0=parent, 1=first child,... X-Git-Url: http://git.mjollnir.org/gw?a=commitdiff_plain;h=f0dde9f48535e08d503da95d93293124494242ae;p=s9y.git category plugin: added
  • classes category_depth# (#= 0=parent, 1=first child, etc) and category_# (#=category id). --- diff --git a/include/plugin_internal.inc.php b/include/plugin_internal.inc.php index 28274ae..6de9ca0 100644 --- a/include/plugin_internal.inc.php +++ b/include/plugin_internal.inc.php @@ -382,7 +382,6 @@ class serendipity_quicksearch_plugin extends serendipity_plugin {
    -
    @@ -401,7 +400,7 @@ class serendipity_archives_plugin extends serendipity_plugin { $propbag->add('stackable', true); $propbag->add('author', 'Serendipity Team'); $propbag->add('version', '1.0'); - $propbag->add('configuration', array('title', 'frequency', 'count', 'show_count', 'hide_zero_count')); + $propbag->add('configuration', array('title', 'frequency', 'count', 'show_count')); $propbag->add('groups', array('FRONTEND_VIEWS')); } @@ -437,13 +436,6 @@ class serendipity_archives_plugin extends serendipity_plugin { $propbag->add('default', false); break; - case 'hide_zero_count': - $propbag->add('type', 'boolean'); - $propbag->add('name', CATEGORY_PLUGIN_HIDEZEROCOUNT); - $propbag->add('description', ''); - $propbag->add('default', false); - break; - default: return false; } @@ -459,18 +451,15 @@ class serendipity_archives_plugin extends serendipity_plugin { $ts = mktime(0, 0, 0, date('m'), 1); $add_query = ''; - - $category_set = isset($serendipity['GET']['category']); - if ($category_set) { + if (isset($serendipity['GET']['category'])) { $base_query = 'C' . (int)$serendipity['GET']['category']; $add_query = '/' . $base_query; } $max_x = $this->get_config('count', 3); $show_count = serendipity_db_bool($this->get_config('show_count', false)); - $hide_zero_count = serendipity_db_bool($this->get_config('hide_zero_count', false)); $freq = $this->get_config('frequency', 'months'); - + for($x = 0; $x < $max_x; $x++) { $current_ts = $ts; switch($freq) { @@ -526,7 +515,6 @@ class serendipity_archives_plugin extends serendipity_plugin { $link = serendipity_rewriteURL(PATH_ARCHIVES . '/' . $linkStamp . $add_query . '.html', 'serendipityHTTPPath'); $html_count = ''; - $hidden_by_zero_count = false; if ($show_count) { switch($freq) { case 'months': @@ -552,25 +540,22 @@ class serendipity_archives_plugin extends serendipity_plugin { true, 'count(e.id) AS orderkey', '', - 'single', - false, $category_set // the joins used + 'single' ); if (is_array($ec)) { if (empty($ec['orderkey'])) { $ec['orderkey'] = '0'; } - $hidden_by_zero_count = $hide_zero_count && ( $ec['orderkey'] == '0'); $html_count .= ' (' . $ec['orderkey'] . ')'; } } - if (!$hidden_by_zero_count) { - echo '' . $ts_title . $html_count . '
    ' . "\n"; - } + echo '' . $ts_title . $html_count . '
    ' . "\n"; + } - echo '' . RECENT . '
    ' . "\n"; + echo '' . RECENT . '
    ' . "\n"; echo '' . OLDER . ''. "\n"; } } @@ -1147,7 +1132,7 @@ class serendipity_superuser_plugin extends serendipity_plugin { $link = $base . ($serendipity['rewrite'] == 'none' ? $serendipity['indexFile'] .'?/' : '') . PATH_ADMIN; $text = (($_SESSION['serendipityAuthedUser'] === true) ? SUPERUSER_OPEN_ADMIN : SUPERUSER_OPEN_LOGIN); - echo ''. $text .''; + echo ''. $text .''; } function introspect_config_item($name, &$propbag) @@ -1575,6 +1560,7 @@ class serendipity_categories_plugin extends serendipity_plugin { $categories[$cid]['feedCategoryURL'] = serendipity_feedCategoryURL($cat, 'serendipityHTTPPath'); $categories[$cid]['categoryURL'] = serendipity_categoryURL($cat, 'serendipityHTTPPath'); $categories[$cid]['paddingPx'] = $cat['depth']*6; + $categories[$cid]['catdepth'] = $cat['depth']; if (!empty($cat_count[$cat['categoryid']])) { $categories[$cid]['true_category_name'] = $cat['category_name']; @@ -1582,7 +1568,7 @@ class serendipity_categories_plugin extends serendipity_plugin { } if (!$smarty) { - $html .= '
  • '; + $html .= '
  • '; if ($is_form) { $html .= ''; diff --git a/templates/default/plugin_categories.tpl b/templates/default/plugin_categories.tpl index 645b22d..14f810d 100644 --- a/templates/default/plugin_categories.tpl +++ b/templates/default/plugin_categories.tpl @@ -5,7 +5,7 @@