Plugin Directory

Changeset 651739


Ignore:
Timestamp:
01/12/2013 09:59:53 PM (13 years ago)
Author:
ethanhackett
Message:

Added the ability to control tile size and featured image size. I also added pagination and fixed the dimension issue.

Location:
post-tiles/trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • post-tiles/trunk/post-tiles.css

    r606300 r651739  
    127127/* Frontend CSS */
    128128ul#post-tiles {
    129     margin: 0 0 0 -10px;
    130     padding: 10px;
     129    margin: 0;
     130    padding: 14px 10px 10px;
    131131    overflow: auto;
    132132}
     
    185185#category-key {
    186186    overflow: auto;
    187     padding: 1px;
     187    padding-top: 14px;
     188    padding-right: 0 !important;
     189    padding-left: 0 !important;
    188190}
    189191#category-key a{
     
    191193    float: left;
    192194    padding: 5px 10px;
    193     border-radius: 10px;
    194     -moz-border-radius: 10px;
    195     -webkit-border-radius: 10px;
    196195    color: #ffffff;
    197196    margin-right: 5px;
    198197    font-size: 12px;
    199198}
    200 #category-key a:hover{
    201     text-decoration: none;
    202     -moz-box-shadow: 0 2px 0 rgba(0, 0, 0, 0.11);
    203     -webkit-box-shadow: 0 2px 0 rgba(0, 0, 0, 0.11);
    204     box-shadow: 0 2px 0 rgba(0, 0, 0, 0.11);
    205     margin-top: -2px;
    206 }
    207199#category-all {
    208200    border: 1px solid #b1b1b1;
    209     color: #b1b1b1 !important;
     201    color: #888888 !important;
    210202    padding: 4px 10px !important;
    211203}
     
    232224    box-shadow: 0 0 10px rgba(0, 0, 0, 0.62);
    233225}
     226/* @group Pagination */
     227.posttiles-pagination {
     228    display: block;
     229    overflow: auto;
     230    padding-bottom: 14px;
     231}
     232
     233.posttiles-pagination a {
     234    display: block;
     235    float: left;
     236    display: block;
     237    float: left;
     238    padding: 4px 10px;
     239    margin-right: 5px;
     240    font-size: 12px;
     241    border: 1px solid #b1b1b1;
     242    color: #888888;
     243}
     244.posttiles-pagination a {
     245   
     246}
     247.posttiles-pagination span {
     248    display: block;
     249    float: left;
     250    display: block;
     251    float: left;
     252    padding: 4px 10px;
     253    margin-right: 5px;
     254    font-size: 12px;
     255    border: 1px solid #d3d3d3;
     256    color: #d3d3d3;
     257}
     258
     259/* @end */
     260
    234261/* Add retina display plus icon */
    235262@media screen and (-webkit-min-device-pixel-ratio: 2),
  • post-tiles/trunk/post-tiles.php

    r623444 r651739  
    55Description: This plugin displays recent posts as tiles. Posts can choose categories by id and numbeer of posts to display. Example shortcode: [post-tiles] or [post-tiles categories='1,2,4,10' posts='8' excerpt='18'].
    66Author: Ethan Hackett
    7 Version: 1.3.3
     7Version: 1.3.4
    88Author URI: http://www.posttiles.com
    99
     
    5454    register_setting( 'tc-plugin-settings', 'posttiles-width');
    5555    register_setting( 'tc-plugin-settings', 'posttiles-height');
     56    register_setting( 'tc-plugin-settings', 'featured-image-width');
     57    register_setting( 'tc-plugin-settings', 'featured-image-height');
    5658    register_setting( 'tc-plugin-settings', 'excerpt-length');
     59    register_setting( 'tc-plugin-settings', 'pagination-key');
    5760   
    5861    // Get all Post Categories
     
    117120        $show_key_jquery = "true";
    118121    }
     122    $pagination_key = get_option('pagination-key');
     123    if(empty($pagination_key)){
     124        $pagination_key = "true";
     125    }
    119126    $featured_images_key = get_option('featured-images');
    120127    if(empty($featured_images_key)){
     
    142149    if(empty($posttiles_height)){
    143150        $posttiles_height = "175";
     151    }
     152    $featured_image_width = get_option('featured-image-width');
     153    if(empty($featured_image_width)){
     154        $featured_image_width = "250";
     155    }
     156    $featured_image_height = get_option('featured-image-height');
     157    if(empty($featured_image_height)){
     158        $featured_image_height = "250";
    144159    }
    145160    $excerpt_length = get_option('excerpt-length');
     
    185200      </div>
    186201     
     202      <div id="box-dimentions" style="margin-top: 10px; margin-bottom: 10px;">
     203          <strong>Set Featured Image Dimensions</strong>
     204          <br/>
     205          <small><em>It can help if the images are larger than the tiles.</em></small><br/>
     206          <input type="text" name="featured-image-width" value="<?php echo $featured_image_width; ?>" class="small-input" /> <input type="text" name="featured-image-height" value="<?php echo $featured_image_height; ?>" class="small-input" />
     207      </div>
     208     
    187209      <div class='category-key-radio'>
    188210          <input type="radio" name="responsive-key" <?php if($responsive_key == 'true') echo 'checked="checked"'; ?> value="true" /> On &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
     
    206228          <small><em>Excerpt is uses word count. Default is 12.</a></em></small>
    207229      </div>
    208      
    209      
    210230    </li>
    211231   
     
    233253          <!-- An alert that this feature requires jQuery be turned on -->
    234254          <?php if($show_key_jquery == 'false') echo '<br/><small class="attention"><em><strong>ATTENTION:</strong> This featured requires jQuery be turned on</em></small>'; ?>
     255      </div>
     256    </li>
     257   
     258    <li class='category-key-list-item'>
     259      <div class='category-key-radio'>
     260          <input type="radio" name="pagination-key" <?php if($pagination_key == 'true') echo 'checked="checked"'; ?> value="true" /> Show &nbsp;&nbsp;
     261          <input type="radio" name="pagination-key" <?php if($pagination_key == 'false') echo 'checked="checked"'; ?> value="false" /> hide&nbsp;
     262      </div>
     263      <div class='category-key-admin'>
     264          <strong>Display Pagination For Tiles</strong>
     265          <br/>
     266          <small><em>Pagination enables the viewing of overflow tiles.</em></small>
    235267      </div>
    236268    </li>
     
    319351            }   
    320352        }
    321        
     353       
     354       // Pagination starting point
     355       if ( get_query_var('paged') ) { $paged = get_query_var('paged'); }
     356       elseif ( get_query_var('page') ) { $paged = get_query_var('page'); }
     357       else { $paged = 1; }
     358       
    322359       // Configure Categories For Query
    323360       $cat_num = $atts['categories'];     
     
    332369       }
    333370       else {
    334            $posts_query = 'posts_per_page=8';
     371           $posts_query = 'posts_per_page=4';
    335372       }
    336373       
    337374       // Configure Both Categories and Number of Posts For Query
    338        $the_query = $posts_query.$cat_query;
    339         
     375       $the_query = $posts_query.$cat_query.'&paged='.$paged;
     376      
    340377       // Run the query             
    341378       query_posts($the_query);
     
    359396       
    360397       // Retrieves Tile Width
    361        $posttiles_width = get_option('posttiles-width');
    362        if(empty($posttiles_width)){
    363           $posttiles_width = "175";
    364        }
    365        $posttiles_li_width = $posttiles_width+20;
     398       $posttiles_li_width = get_option('posttiles-width');
     399       if(empty($posttiles_li_width)){
     400          $posttiles_li_width = "175";
     401       }
     402       $posttiles_width = $posttiles_li_width-20;
    366403       
    367404       // Retrieves Tile Height
    368        $posttiles_height = get_option('posttiles-height');
    369        if(empty($posttiles_height)){
     405       $posttiles_li_height = get_option('posttiles-height');
     406       if(empty($posttiles_li_height)){
    370407          $posttiles_height = "175";
    371408       }
    372        $posttiles_li_height = $posttiles_height+20;
     409       $posttiles_height = $posttiles_li_height-20;
     410       
     411       // Retrieve Featured Image Height
     412       $featured_image_height = get_option('featured-image-height');
     413       if(empty($featured_image_height)){
     414          $featured_image_height = "250";
     415       }
     416       // Retrieves Featured Image Width
     417       $featured_image_width = get_option('featured-image-width');
     418       if(empty($featured_image_width)){
     419          $featured_image_width = "250";
     420       }
     421       
     422       
     423       
    373424       ?>
    374425       <style media="screen" type="text/css">
     
    399450           </style><?php
    400451       }
     452       
     453       // Retrieve Pagination
     454       $pagination_key = get_option('pagination-key');
     455       if(empty($pagination_key)){
     456          $pagination_key = "true";
     457       }
     458       
     459       if ($pagination_key == "true") {
     460            // Build out the pagination
     461             global $wp_query; 
     462             // Get the total number of pages
     463            $total_pages = $wp_query->max_num_pages;
     464            // If the total of pages is greater than one create the pagination 
     465            if ($total_pages > 1){ 
     466              $current_page = max(1, get_query_var('paged')); 
     467              $pagination = paginate_links(array( 
     468                  'base' => get_pagenum_link(1) . '%_%', 
     469                  'format' => 'page/%#%', 
     470                  'current' => $current_page, 
     471                  'total' => $total_pages, 
     472                ));
     473                $pagination ="<div class='posttiles-pagination'>".$pagination."</div>"; 
     474            } else {
     475                $pagination = "<!-- There is no Post Tiles pagination because there aren't enough posts for pagination -->";
     476            }
     477       } else {
     478        $pagination = "<!-- Post Tiles pagination is disabled in the settings -->";
     479       }
     480       
    401481       
    402482               
     
    457537              if ( has_post_thumbnail()) {
    458538                  // Retrieve the featured image.
    459                   $thumb = wp_get_attachment_image_src( get_post_thumbnail_id(), array(350,350));
     539                  $thumb = wp_get_attachment_image_src( get_post_thumbnail_id(), array($featured_image_width,$featured_image_height));
    460540                  // Strip featured image down to the url.
    461541                  $url = $thumb['0'];
     
    464544                  $featured_style = "class='".$cat_var."'";
    465545              }
    466          }
     546          }
    467547          // Each output creates the li > link > title > exerpt
    468548          $output .= "<li ".$featured_style." id='".$theID."'><a href='$temp_link' class='".$cat_var."' style='background-color: $cat_var_value; $featured_border'><h3>$temp_title </h3>$temp_excerpt</a></li>\n";
     
    519599            $key_finished = "<!-- Category Key is turned off. See the admin settings for Post Tiles -->";
    520600       }
    521          
    522        return $key_finished.'<ul id="post-tiles" '.$responsive.'>'.$output.'</ul>';
    523      
     601          
     602       return $key_finished.'<ul id="post-tiles" '.$responsive.'>'.$output.'</ul>'.$pagination;
     603       
    524604       $plugin_url = plugins_url()."/post-tiles";
    525605}
  • post-tiles/trunk/readme.txt

    r623444 r651739  
    44Tags: Post tiles, categories, color coated, shortcode
    55Requires at least: 3.0
    6 Tested up to: 3.4.2
    7 Stable tag: 1.3.3
     6Tested up to: 3.5.0
     7Stable tag: 1.3.4
    88License: GPLv2 or later
    99License URI: http://www.gnu.org/licenses/gpl-2.0.html
     
    2323*NOTE:* The category id numbers are listed below, next to the category names. You can use both the categories and posts attributes **Example: [post-tiles categories='1,2,4' posts='8' excerpt='18']**
    2424
    25 Version 1.3.3
     25Version 1.3.4
    2626
    2727== Installation ==
     
    4646== Changelog ==
    4747
    48 = 1.3.3 =
    49 * WARNING This update will remove your current color settings. Please back them up.
    50 * Fixed category to allow special characters
    51 * Fixed animation to fade featured images too.
    52 * Updated a JS issue
    53 * Added a link in the FAQ for working with the NextGen Gallery
     48= 1.3.4 =
     49* Added the ability to control tile featured image dimensions
     50* Added the ability to paginate
     51* Removed the category key rounded corners
     52* Fixed the tile dimensions. There was a 10px padding discrepancy causing tiles to be +20px wider and taller than defined in the admin settings. Not the width and height of the tiles includes the padding space.
    5453
    5554= 1.3.2 =
     
    9291== Upgrade Notice ==
    9392
    94 * WARNING there were some big changes in this version which will cause you to loose your current tile colors. Backup your colors before updating.
    95 * Fixed some category issue
    96 * Fixed a JS issue
    97 * Fixed an animation issue
     93* Responsive functionality added (Alternate fluid design responds to location width)
     94* Admin controlled animation styles (Bottom, top, right, left and fade)
     95* Admin controlled Tile width and Height
     96* Admin controlled excerpt length
     97* Fixed spelling errors
    9898
    9999== Frequently Asked Questions ==
     
    102102
    103103If in the settings jQuery is turned on then by default everything loads invisible and is revealed with a fade. You should check your version of jQuery to make sure you're running at least 1.4 +. To test whether jQuery is the issue in the settings you can disable the jQuery and the plugin should appear.
    104 
    105 = How do I get Post Tiles to work with NextGen Gallery? =
    106 
    107 Here's a link to a support thread where CoCha appeared to have a decent solution.
    108 http://wordpress.org/support/topic/plugin-post-tiles-using-nextgen-gallery-thumbnails
    109104 
    110105== Arbitrary section ==
Note: See TracChangeset for help on using the changeset viewer.