Plugin Directory

Changeset 623444


Ignore:
Timestamp:
11/10/2012 07:03:21 PM (13 years ago)
Author:
ethanhackett
Message:

Some big fixes. Make sure to backup your category colors before updating.

Location:
post-tiles/trunk
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • post-tiles/trunk/post-tiles-frontend.js

    r605963 r623444  
    1111    $('#category-key a').not('#category-all').click(function() {
    1212        var categoryClass = '.'+$(this).attr('id');
    13         $('ul#post-tiles li a').not(categoryClass).fadeTo('slow', 0.3);
     13        $('ul#post-tiles li').not(categoryClass).fadeTo('slow', 0.3);
    1414        $('.post-tile-selected').removeClass('post-tile-selected')
    1515        $(categoryClass).fadeTo('fast', 1.0);
    16         $(categoryClass).parent('li').addClass('post-tile-selected');
     16        $(categoryClass).addClass('post-tile-selected');
    1717        return false;
    1818    });       
     
    2020    // This returns all category types to accent when all is clicked
    2121    $('#category-all').click(function() {
    22         $('ul#post-tiles li a').fadeTo('fast', 1.0);
     22        $('ul#post-tiles li').fadeTo('fast', 1.0);
    2323        return false;
    2424    });
  • post-tiles/trunk/post-tiles.js

    r485208 r623444  
    88              // Define X as the background color of the class "colorwell-selected" - Defined later on .focus
    99              var x = $('.colorwell-selected').css('backgroundColor');
    10               // Run the hexc function which changes an RBG value to a hexadecimal value.
    11               hexc(x);
    1210             
    1311              // Apply the color value to the
    1412              $('#example-post').css('backgroundColor', color);
    15              
    16               // Setup hexc function to convert RBG to Hexadecimal example - #ffffff
    17               function hexc(colorval) {
    18                   var parts = colorval.match(/^rgb\((\d+),\s*(\d+),\s*(\d+)\)$/);
    19                   delete(parts[0]);
    20                   for (var i = 1; i <= 3; ++i) {
    21                       parts[i] = parseInt(parts[i]).toString(16);
    22                       if (parts[i].length == 1) parts[i] = '0' + parts[i];
    23                   }
    24                   color = '#' + parts.join('');
    25               }
     13         
    2614          }, 100);
    2715           
  • post-tiles/trunk/post-tiles.php

    r606934 r623444  
    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.2
     7Version: 1.3.3
    88Author URI: http://www.posttiles.com
    99
     
    6161    //Loop Through Each Category
    6262    foreach($categories as $category) {
    63         $cat_var = "cat_".$category->name;
    64         // Make lowercase
    65         $cat_var = strtolower($cat_var);
    66         $cat_var = str_replace(" ", "_", $cat_var);
    67         $cat = $category->name;
    68        
     63        // Get category slug incase of special characters
     64        $cat_slug = "cat_".$category->slug;
    6965        // Creates a registered setting for each category.
    70         register_setting('tc-plugin-settings', $cat_var);
     66        register_setting('tc-plugin-settings', $cat_slug);
    7167    }
    7268}
     
    159155    foreach($categories as $category) {
    160156        $cat_var = "cat_".$category->name;
     157        $cat_slug = "cat_".$category->slug;
    161158        // Make lowercase
    162159        $cat_var = strtolower($cat_var);
     
    165162        $id = $category->cat_ID;
    166163        // Retrieves option value
    167         $cat_var_value = get_option($cat_var);
     164        $cat_var_value = get_option($cat_slug);
    168165        // Checks the value to see if it's empty. If it is use default.
    169166        if (empty($cat_var_value)){
     
    173170        // Echo out each list Category Name > Id > Input
    174171        echo "<li><strong>".$cat." </strong> <em>(".$id.")</em>
    175         <input type='text' class='colorwell' name='".$cat_var."' value='".$cat_var_value."' />
     172        <input type='text' class='colorwell' name='".$cat_slug."' value='".$cat_var_value."' />
    176173        </li>";
    177174    }
     
    384381                    height: <?php echo $posttiles_height; ?>px;
    385382                }       
    386        </style><?php
     383       </style>
     384       <?php
    387385       
    388386       // If jquery is on(true) then output the following
     
    416414              $excerpt_length =  '19';
    417415          }
     416         
    418417          // Truncates the excerpt length (Not using default wordpress for plugin conflicts)
    419418          $words = explode(' ', $temp_excerpt);
     
    427426          $category = get_the_category();
    428427          $category_name = $category[0]->cat_name;
     428          $category_slug = $category[0]->slug;
    429429         
    430430          // Recovering Saved Color Values
    431431          // Define the Settings for recording
    432           $cat_var = "cat_".$category_name;
     432          $cat_var = "cat_".$category_slug;
    433433          // Make lowercase
    434           $cat_var_value = strtolower($cat_var);
    435           $cat_var = str_replace(" ", "_", $cat_var);
     434          //$cat_var_value = strtolower($cat_var);
     435          //$cat_var = str_replace(" ", "_", $cat_var);
    436436          // Retrieve the option "hexadecimal value" for this category
    437437          $cat_var_value = get_option($cat_var);
     
    460460                  // Strip featured image down to the url.
    461461                  $url = $thumb['0'];
    462                   $featured_style = "style='background: url(".$url.") 0 0;' class='featured-image ".$animation_style."'";
    463               }
     462                  $featured_style = "style='background: url(".$url.") 0 0;' class='featured-image ".$animation_style." ".$cat_var."'";
     463              } else {
     464                  $featured_style = "class='".$cat_var."'";
     465              }
    464466         }
    465467          // Each output creates the li > link > title > exerpt
    466           $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";
     468          $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";
    467469          // Each output_key creates a li > category color block > category name
    468470             
     
    502504                    // Set's category names
    503505                    $cat_var = $category->name;
     506                    // Sets the slug
     507                    $cat_slug = $category->slug;
    504508                    // Cleans up category names that have spaces
    505                     $cat_var = str_replace(" ", "_", $cat_var);
    506                     // Joins the cat_ with the category name to retrieve option
    507                     $cat_var_key = "cat_".$cat_var;
     509                    $cat_var_key = "cat_".$cat_slug;
    508510                    // Get's the category options which are the hexadecimal colors
    509511                    $cat_var_key_val = get_option($cat_var_key);
  • post-tiles/trunk/readme.txt

    r606934 r623444  
    55Requires at least: 3.0
    66Tested up to: 3.4.2
    7 Stable tag: 1.3.2
     7Stable tag: 1.3.3
    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.2
     25Version 1.3.3
    2626
    2727== Installation ==
     
    4545
    4646== Changelog ==
     47
     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
    4754
    4855= 1.3.2 =
     
    8592== Upgrade Notice ==
    8693
    87 * Responsive functionality added (Alternate fluid design responds to location width)
    88 * Admin controlled animation styles (Bottom, top, right, left and fade)
    89 * Admin controlled Tile width and Height
    90 * Admin controlled excerpt length
    91 * Fixed spelling errors
     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
    9298
    9399== Frequently Asked Questions ==
     
    96102
    97103If 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
     107Here's a link to a support thread where CoCha appeared to have a decent solution.
     108http://wordpress.org/support/topic/plugin-post-tiles-using-nextgen-gallery-thumbnails
    98109 
    99110== Arbitrary section ==
Note: See TracChangeset for help on using the changeset viewer.