]> git.mjollnir.org Git - s9y.git/commitdiff
category plugin: added <li> classes category_depth# (#= 0=parent, 1=first child,...
authordonchambers <donchambers>
Mon, 3 Dec 2007 20:54:55 +0000 (20:54 +0000)
committerdonchambers <donchambers>
Mon, 3 Dec 2007 20:54:55 +0000 (20:54 +0000)
include/plugin_internal.inc.php
templates/default/plugin_categories.tpl

index 28274aea0e1f2c8e29351bf261c73b8c6939109b..6de9ca09d0ff47db2138a5a1d6a23a053f4520fa 100644 (file)
@@ -382,7 +382,6 @@ class serendipity_quicksearch_plugin extends serendipity_plugin {
     <div>
         <input type="hidden"  name="serendipity[action]" value="search" />
         <input alt="<?php echo QUICKSEARCH; ?>" type="text"   id="serendipityQuickSearchTermField" name="serendipity[searchTerm]" size="13" />
-        <input class="quicksearch_submit" type="submit" value="&gt;" alt="<?php echo QUICKSEARCH; ?>" name="serendipity[searchButton]" title="<?PHP echo GO; ?>" style="width: 2em;" />
     </div>
     <div id="LSResult" style="display: none;"><div id="LSShadow"></div></div>
 </form>
@@ -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 '<a href="' . $link . '" title="' . $ts_title . '">' . $ts_title . $html_count . '</a><br />' . "\n";
-            }
+            echo '<a href="' . $link . '" title="' . $ts_title . '">' . $ts_title . $html_count . '</a><br />' . "\n";
+
         }
 
-        echo '<a href="'. $serendipity['serendipityHTTPPath'] . $serendipity['indexFile'] . '?frontpage">' . RECENT . '</a><br />' . "\n";
+        echo '<a href="'. $serendipity['serendipityHTTPPath'] .'">' . RECENT . '</a><br />' . "\n";
         echo '<a href="'. serendipity_rewriteURL(PATH_ARCHIVE . $add_query) .'">' . OLDER . '</a>'. "\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 '<a href="' . $link . '" rel="nofollow" title="'. $text .'">'. $text .'</a>';
+        echo '<a rel="nofollow" href="' . $link . '" title="'. $text .'">'. $text .'</a>';
     }
 
     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 .= '<li style="display: block;">';
+                    $html .= '<li class="category_depth'. $cat['depth']. ' category_' . $cat['categoryid'] .'" style="display: block;">';
 
                     if ($is_form) {
                         $html .= '<input style="width: 15px" type="checkbox" name="serendipity[multiCat][]" value="' . $cat['categoryid'] . '" />';
index 645b22dd6b31e14308809fb74d9ee93d6f6e151c..14f810d74e32154a9d1edd1135a93c0d4f125e68 100644 (file)
@@ -5,7 +5,7 @@
 
     <ul id="serendipity_categories_list" style="list-style: none; margin: 0px; padding: 0px">
 {foreach from=$categories item="plugin_category"}
-        <li style="display: block;">
+        <li class="category_depth{$plugin_category.catdepth} category_{$plugin_category.categoryid}" style="display: block;">
         {if $is_form}    
             <input style="width: 15px" type="checkbox" name="serendipity[multiCat][]" value="{$plugin_category.categoryid}" />
         {/if}