Plugin Directory

Changeset 715558


Ignore:
Timestamp:
05/20/2013 11:20:08 AM (13 years ago)
Author:
iteamweb
Message:

View option for list and drop down

Location:
display-categories-widget/trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • display-categories-widget/trunk/display_categories_widget.php

    r692631 r715558  
    2727    $display_empty_categories = $instance['display_empty_categories'];
    2828    $showcount_value = $instance['showcount_value'];
    29    
     29    $show_format= $instance['show_format'];
    3030
    3131       // Get the existing categories and build a simple select dropdown for the user.
     
    5454<p><?php _e('Display Parent? (optional):'); ?> <br><input name="<?php echo $this->get_field_name('display_parent'); ?>" type="radio" value="1" <?php if(attribute_escape($display_parent)==1) echo "checked"; ?> />Yes &nbsp; <input name="<?php echo $this->get_field_name('display_parent'); ?>" type="radio" value="0"  <?php if(attribute_escape($display_parent)==0) echo "checked"; ?>/>No </p>
    5555<br>
     56<p><?php _e('Show? (optional):'); ?> <br><input name="<?php echo $this->get_field_name('show_format'); ?>" type="radio" value="0" <?php if(attribute_escape($show_format)==0) echo "checked"; ?> />List &nbsp; <input name="<?php echo $this->get_field_name('show_format'); ?>" type="radio" value="2"  <?php if(attribute_escape($show_format)==2) echo "checked"; ?>/>Drop Down </p>
     57<br>
    5658<p><?php _e('Display Empty categories? (optional):'); ?> <br><input name="<?php echo $this->get_field_name('display_empty_categories'); ?>" type="radio" value="0" <?php if(attribute_escape($display_empty_categories)==0) echo "checked"; ?> />Yes &nbsp; <input name="<?php echo $this->get_field_name('display_empty_categories'); ?>" type="radio" value="1"  <?php if(attribute_escape($display_empty_categories)==1) echo "checked"; ?>/>No </p>
    5759<p><?php _e('Display Number of posts near categories? (optional):'); ?> <br><input name="<?php echo $this->get_field_name('showcount_value'); ?>" type="radio" value="1" <?php if(attribute_escape($showcount_value)==1) echo "checked"; ?> />Yes &nbsp; <input name="<?php echo $this->get_field_name('showcount_value'); ?>" type="radio" value="0"  <?php if(attribute_escape($showcount_value)==0) echo "checked"; ?>/>No </p>
     
    7072    $instance['display_empty_categories'] = $new_instance['display_empty_categories'];
    7173    $instance['showcount_value'] = $new_instance['showcount_value'];
     74    $instance['show_format'] = $new_instance['show_format'];
    7275   
    7376   
     
    8588    $display_empty_categories = $instance['display_empty_categories'];
    8689    $showcount_value = $instance['showcount_value'];
     90    $show_format = $instance['show_format'];
    8791   
    8892 
     
    9498        if ($yourcat) echo '<h2>' . $yourcat->name . '</h2>';
    9599      }
     100if($instance['show_format']==0)
     101{
    96102    echo "<ul>";
    97103    wp_list_categories('orderby=name&show_count='.$showcount_value.'&child_of='.$cat_id.'&hide_empty='.$display_empty_categories.'&title_li=&number='.$dcw_limit);
    98     echo "</ul>";
    99  
     104  echo "</ul>";
     105}
     106if($instance['show_format']==2)
     107{
     108?>
     109  <form action="<?php bloginfo('url'); ?>" method="get">
     110  <div>
     111  <?php wp_dropdown_categories('orderby=name&show_count='.$showcount_value.'&child_of='.$cat_id.'&hide_empty='.$display_empty_categories.'&title_li=&number='.$dcw_limit); ?>
     112  <input type="submit" name="submit" value="View" />
     113  </div>
     114  </form>
     115 
     116<?
     117}
    100118    echo $after_widget;
    101119  }
  • display-categories-widget/trunk/readme.txt

    r692631 r715558  
    4242== Changelog ==
    4343
     44= 1.0.6 =
     45* Optional display for Dropdown or List view of categories
     46
     47
    4448= 1.0.5 =
    4549* Display Number of post in each categories
Note: See TracChangeset for help on using the changeset viewer.