Changeset 1031311
- Timestamp:
- 11/23/2014 07:40:25 PM (11 years ago)
- Location:
- post-tiles
- Files:
-
- 84 added
- 3 edited
-
tags/1.4.6 (added)
-
tags/1.4.6/.git (added)
-
tags/1.4.6/.git/COMMIT_EDITMSG (added)
-
tags/1.4.6/.git/FETCH_HEAD (added)
-
tags/1.4.6/.git/HEAD (added)
-
tags/1.4.6/.git/ORIG_HEAD (added)
-
tags/1.4.6/.git/config (added)
-
tags/1.4.6/.git/index (added)
-
tags/1.4.6/.git/logs (added)
-
tags/1.4.6/.git/logs/HEAD (added)
-
tags/1.4.6/.git/logs/refs (added)
-
tags/1.4.6/.git/logs/refs/heads (added)
-
tags/1.4.6/.git/logs/refs/heads/NewFeatures (added)
-
tags/1.4.6/.git/logs/refs/heads/master (added)
-
tags/1.4.6/.git/logs/refs/remotes (added)
-
tags/1.4.6/.git/logs/refs/remotes/origin (added)
-
tags/1.4.6/.git/logs/refs/remotes/origin/HEAD (added)
-
tags/1.4.6/.git/logs/refs/remotes/origin/NewFeatures (added)
-
tags/1.4.6/.git/media (added)
-
tags/1.4.6/.git/media/objects (added)
-
tags/1.4.6/.git/media/tmp (added)
-
tags/1.4.6/.git/objects (added)
-
tags/1.4.6/.git/objects/03 (added)
-
tags/1.4.6/.git/objects/03/c2e6a4bd4f8f6302ef6ad0073f8cd9914df63d (added)
-
tags/1.4.6/.git/objects/05 (added)
-
tags/1.4.6/.git/objects/05/1f77606871f3bae936dc93a0d3dbbb60504638 (added)
-
tags/1.4.6/.git/objects/14 (added)
-
tags/1.4.6/.git/objects/14/a7411b80fa417c70506fcfdbb6ef3389747f98 (added)
-
tags/1.4.6/.git/objects/15 (added)
-
tags/1.4.6/.git/objects/15/321c686ca88fdd75873f63fc47450ec9aa6e18 (added)
-
tags/1.4.6/.git/objects/1f (added)
-
tags/1.4.6/.git/objects/1f/f22d679b43425e843d88a24f3fb95e1c9ba8b6 (added)
-
tags/1.4.6/.git/objects/28 (added)
-
tags/1.4.6/.git/objects/28/3dff26cbf8a863f4a13bf9511e94a499d544a2 (added)
-
tags/1.4.6/.git/objects/31 (added)
-
tags/1.4.6/.git/objects/31/c4d40c1164ae439e9aeefb48c59812fb45fa8a (added)
-
tags/1.4.6/.git/objects/3d (added)
-
tags/1.4.6/.git/objects/3d/82c5e65a0772a61faf6dcf27ca1cb1d6cf833b (added)
-
tags/1.4.6/.git/objects/53 (added)
-
tags/1.4.6/.git/objects/53/d37d8f9378dfe5666de94534070a029e809c19 (added)
-
tags/1.4.6/.git/objects/65 (added)
-
tags/1.4.6/.git/objects/65/f123b201152e18a044cc7b758d6b632887acfc (added)
-
tags/1.4.6/.git/objects/67 (added)
-
tags/1.4.6/.git/objects/67/d18bcf8d8ac201ff3a37468ce9195bccc65a2e (added)
-
tags/1.4.6/.git/objects/77 (added)
-
tags/1.4.6/.git/objects/77/c9b6bbaf3eedaa9065a3c3fc3e24001c106196 (added)
-
tags/1.4.6/.git/objects/7a (added)
-
tags/1.4.6/.git/objects/7a/db29215af660341066330afd3fdfd6b51e936e (added)
-
tags/1.4.6/.git/objects/86 (added)
-
tags/1.4.6/.git/objects/86/f865149beed63944a02fce54254e7ae5604932 (added)
-
tags/1.4.6/.git/objects/8e (added)
-
tags/1.4.6/.git/objects/8e/092f560ac9acc1a2d4f584cb14cdf3c9fe3d63 (added)
-
tags/1.4.6/.git/objects/b0 (added)
-
tags/1.4.6/.git/objects/b0/f2442adb3a3286b60585bf71c9015e18819e14 (added)
-
tags/1.4.6/.git/objects/c5 (added)
-
tags/1.4.6/.git/objects/c5/b2a26376f7499731e84335b740b9a899ebaba1 (added)
-
tags/1.4.6/.git/objects/de (added)
-
tags/1.4.6/.git/objects/de/85878ce16879ce1225c36b3ad49def7caf9f52 (added)
-
tags/1.4.6/.git/objects/info (added)
-
tags/1.4.6/.git/objects/pack (added)
-
tags/1.4.6/.git/objects/pack/pack-a261254aafbe1216c04618dd885139cad5ee6deb.idx (added)
-
tags/1.4.6/.git/objects/pack/pack-a261254aafbe1216c04618dd885139cad5ee6deb.pack (added)
-
tags/1.4.6/.git/packed-refs (added)
-
tags/1.4.6/.git/refs (added)
-
tags/1.4.6/.git/refs/heads (added)
-
tags/1.4.6/.git/refs/heads/NewFeatures (added)
-
tags/1.4.6/.git/refs/heads/master (added)
-
tags/1.4.6/.git/refs/remotes (added)
-
tags/1.4.6/.git/refs/remotes/origin (added)
-
tags/1.4.6/.git/refs/remotes/origin/HEAD (added)
-
tags/1.4.6/.git/refs/remotes/origin/NewFeatures (added)
-
tags/1.4.6/.git/refs/tags (added)
-
tags/1.4.6/plus.png (added)
-
tags/1.4.6/plus@2x.png (added)
-
tags/1.4.6/post-tiles-frontend.js (added)
-
tags/1.4.6/post-tiles.css (added)
-
tags/1.4.6/post-tiles.js (added)
-
tags/1.4.6/post-tiles.php (added)
-
tags/1.4.6/readme.txt (added)
-
tags/1.4.6/screenshot-1.png (added)
-
tags/1.4.6/screenshot-2.png (added)
-
tags/1.4.6/screenshot-3.png (added)
-
tags/1.4.6/screenshot-4.png (added)
-
tags/1.4.6/screenshot-5.png (added)
-
trunk/post-tiles.css (modified) (3 diffs)
-
trunk/post-tiles.php (modified) (15 diffs)
-
trunk/readme.txt (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
post-tiles/trunk/post-tiles.css
r1030862 r1031311 54 54 padding: 5px 10px; 55 55 margin-bottom: 0; 56 list-style: none; 57 } 58 .tile-colors { 59 width: 100%; 60 margin-top: 20px; 61 margin-bottom: 20px; 62 border: 1px solid rgba(0, 0, 0, 0.12); 63 border-radius: 5px; 64 } 65 .tile-colors thead { 66 background-color: rgba(0, 0, 0, 0.04); 67 color: rgba(0, 0, 0, 0.47); 68 } 69 .tile-colors th { 70 line-height: 26px; 71 } 72 .tile-colors input { 73 width: auto; 74 } 75 .tile-colors td { 76 padding: 5px; 56 77 } 57 78 .tc-note { … … 247 268 padding: 4px 10px !important; 248 269 } 270 li.featured-image.static-over a { 271 top: 0; 272 } 249 273 li.featured-image.up a { 250 274 top: 100%; … … 259 283 left: 105%; 260 284 } 261 li.featured-image.fade a { 285 li.featured-image.fade a, 286 li.featured-image.static-hide a { 262 287 left: 105%; 263 288 display: none; -
post-tiles/trunk/post-tiles.php
r1030970 r1031311 5 5 Description: 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']. 6 6 Author: Ethan Hackett 7 Version: 1.4. 57 Version: 1.4.6 8 8 Author URI: http://www.posttiles.com 9 9 … … 47 47 48 48 // Registers Non Category Related Settings (it's outside the categories loop) 49 register_setting( 'tc-plugin-settings', 'posttile-transparency'); 49 50 register_setting( 'tc-plugin-settings', 'category-key'); 50 51 register_setting( 'tc-plugin-settings', 'category-key-jquery'); … … 65 66 foreach($categories as $category) { 66 67 // Get category slug incase of special characters 67 $cat_slug = "cat_".$category->slug;68 $cat_slug = $category->slug; 68 69 // Creates a registered setting for each category. 69 register_setting('tc-plugin-settings', $cat_slug); 70 register_setting('tc-plugin-settings', "cat_bg_".$cat_slug); 71 register_setting('tc-plugin-settings', "cat_tx_".$cat_slug); 70 72 } 71 73 } … … 87 89 // Get the plugin Url to attatch CSS and images etc. 88 90 $plugin_url = plugins_url()."/post-tiles"; 89 wp_enqueue_style( 'post-tiles', $plugin_url.'/post-tiles.css' );91 wp_enqueue_style( 'post-tiles', $plugin_url.'/post-tiles.css', false, filemtime( plugin_dir_path( __FILE__ ).'/post-tiles.css' ), 'all' ); 90 92 wp_enqueue_script('post-tiles', $plugin_url.'/post-tiles.js' ); 91 93 … … 105 107 <div id='example-post'><div id='example-tile'><big>Example Post Title Here</big></div>Example post excerpt displayed below the title.</div> 106 108 </div> 107 <form method='POST' action='options.php'><div id='category-list'><h3>Pick Your Cutom Tile Colors:</h3><em>1.) Click inside each of the category inputs. <br/>2.) Next use the color picker on the left to select the color for that categories tiles.<br/>3.) Save Your Changes</em>< ul>";109 <form method='POST' action='options.php'><div id='category-list'><h3>Pick Your Cutom Tile Colors:</h3><em>1.) Click inside each of the category inputs. <br/>2.) Next use the color picker on the left to select the color for that categories tiles.<br/>3.) Save Your Changes</em><table class='tile-colors' cellspacing='0' cellpadding='0'><thead><tr><th>Category</th><th>Background</th><th>Text</th></thead><tbody>"; 108 110 109 111 … … 112 114 113 115 // Retrieve additional options before the categories loop 116 $posttile_transparency = get_option('posttile-transparency'); 117 if(empty($posttile_transparency)){ 118 $posttile_transparency = "100%"; 119 } 114 120 $show_key = get_option('category-key'); 115 121 if(empty($show_key)){ … … 169 175 //Loops through each category and displays color inputs. 170 176 foreach($categories as $category) { 171 $cat_var = "cat_".$category->name; 172 $cat_slug = "cat_".$category->slug; 177 $cat_bg_var = "cat_bg_".$category->name; 178 $cat_tx_var = "cat_tx_".$category->name; 179 $cat_slug = $category->slug; 173 180 // Make lowercase 174 $cat_var = strtolower($cat_var); 175 $cat_var = str_replace(" ", "_", $cat_var); 181 $cat_bg_var = strtolower($cat_bg_var); 182 $cat_bg_var = str_replace(" ", "_", $cat_bg_var); 183 $cat_tx_var = strtolower($cat_tx_var); 184 $cat_tx_var = str_replace(" ", "_", $cat_tx_var); 176 185 $cat = $category->name; 177 186 $id = $category->cat_ID; 178 187 // Retrieves option value 179 $cat_var_value = get_option($cat_slug); 188 $cat_bg_var_value = get_option("cat_bg_".$cat_slug); 189 $cat_tx_var_value = get_option("cat_tx_".$cat_slug); 180 190 // Checks the value to see if it's empty. If it is use default. 181 if (empty($cat_ var_value)){182 $cat_ var_value = "#afe2f8";191 if (empty($cat_bg_var_value)){ 192 $cat_bg_var_value = "#afe2f8"; 183 193 } 194 if (empty($cat_tx_var_value)){ 195 $cat_tx_var_value = "#ffffff"; 196 } 184 197 185 198 // Echo out each list Category Name > Id > Input 186 echo "< li><strong>".$cat." </strong> <em>(".$id.")</em>187 < input type='text' class='colorwell' name='".$cat_slug."' value='".$cat_var_value."' />188 </ li>";199 echo "<tr><td><strong>".$cat." </strong> <em>(".$id.")</em></td> 200 <td><input title='Category background color' type='text' class='colorwell background' name='cat_bg_".$cat_slug."' value='".$cat_bg_var_value."' /></td><td><input title='Category text color' type='text' class='colorwell text' name='cat_tx_".$cat_slug."' value='".$cat_tx_var_value."' /> 201 </td></tr>"; 189 202 } 190 203 191 204 ?> 205 </tbody> 206 </table> 207 <li class='category-key-list-item'> 208 <div class='category-key-radio'> 209 <select name="posttile-transparency" id="posttile-transparency"> 210 <?php for ($i=0;$i<96;$i+=5): ?> 211 <option value="<?php echo $i/100 ?>" <?php if($posttile_transparency == $i/100) echo 'selected="selected"'; ?> ><?php echo $i ?>%</option> 212 <?php endfor; ?> 213 <option value="0" <?php if($posttile_transparency == 0) echo 'selected="selected"'; ?> >100%</option> 214 </select> 215 </div> 216 <div class='category-key-admin'> 217 <strong>Tile Trasnparency</strong> 218 <br/> 219 <small><em>Pick from one of the transparency levels.</em></small> 220 <!-- An alert that this feature requires jQuery be turned on --> 221 <?php if($show_key_jquery == 'false') echo '<br/><small class="attention"><em><strong>ATTENTION:</strong> This featured requires jQuery be turned on</em></small>'; ?> 222 </div> 223 </li> 224 192 225 <li class='category-key-list-item'> 193 226 <strong><big>Layout</big></strong> … … 288 321 <li class='category-key-list-item'> 289 322 <div class='category-key-radio'> 290 <select name="animation-style" id="animation-style"> 323 <select name="animation-style" id="animation-style">static-over 324 <option value="static-over" <?php if($animation_style == 'static-over') echo 'selected="selected"'; ?>>Static Overlay (no jQuery required)</option> 325 <option value="static-hide" <?php if($animation_style == 'static-hide') echo 'selected="selected"'; ?>>Static No Overlay (no jQuery required)</option> 291 326 <option value="up" <?php if($animation_style == 'up') echo 'selected="selected"'; ?>>Slide Up</option> 292 327 <option value="down" <?php if($animation_style == 'down') echo 'selected="selected"'; ?>>Slide Down</option> … … 301 336 <small><em>Pick from one of the preselected animations</em></small> 302 337 <!-- An alert that this feature requires jQuery be turned on --> 303 <?php if($show_key_jquery == 'false') echo '<br/><small class="attention"><em><strong>ATTENTION:</strong> This feature d requiresjQuery be turned on</em></small>'; ?>338 <?php if($show_key_jquery == 'false') echo '<br/><small class="attention"><em><strong>ATTENTION:</strong> This feature may require jQuery be turned on</em></small>'; ?> 304 339 </div> 305 340 </li> … … 402 437 if(empty($animation_style)){ 403 438 $animation_style = "up"; 439 } 440 441 // Retrieves The Tile Trasnparency 442 $posttile_transparency = get_option('posttile-transparency'); 443 if(empty($posttile_transparency)){ 444 $posttile_transparency = "100"; 404 445 } 405 446 … … 539 580 // Recovering Saved Color Values 540 581 // Define the Settings for recording 541 $cat_var = "cat_".$category_slug; 582 $cat_bg_var = "cat_bg_".$category_slug; 583 $cat_tx_var = "cat_tx_".$category_slug; 542 584 // Make lowercase 543 585 //$cat_var_value = strtolower($cat_var); 544 586 //$cat_var = str_replace(" ", "_", $cat_var); 545 587 // Retrieve the option "hexadecimal value" for this category 546 $cat_var_value = get_option($cat_var); 588 $cat_bg_var_value = get_option($cat_bg_var); 589 $cat_tx_var_value = get_option($cat_tx_var); 547 590 // Checks the value to see if it's empty. If it is use default. 548 if (empty($cat_var_value)){ 549 $cat_var_value = "#afe2f8"; 591 if (empty($cat_bg_var_value)){ 592 $cat_bg_var_value = "#afe2f8"; 593 } 594 if (empty($cat_tx_var_value)){ 595 $cat_tx_var_value = "#ffffff"; 550 596 } 551 597 … … 561 607 // Reset featured image bottom border fix 562 608 // There's a margin issue on responsive so this fixes the bottom gap with border 563 $featured_border = "border-bottom: 3px solid ".$cat_ var_value.";border-right: 2px solid ".$cat_var_value.";";609 $featured_border = "border-bottom: 3px solid ".$cat_bg_var_value.";border-right: 2px solid ".$cat_bg_var_value.";"; 564 610 // If there is a featured image. 565 611 if ($featured_images_key == "true") { … … 569 615 // Strip featured image down to the url. 570 616 $url = $thumb['0']; 571 $featured_style = "style='background: url(".$url.") no-repeat center center; background-size: cover;' class='featured-image ".$animation_style." ".$cat_ var."'";617 $featured_style = "style='background: url(".$url.") no-repeat center center; background-size: cover;' class='featured-image ".$animation_style." ".$cat_bg_var."'"; 572 618 } else { 573 $featured_style = "class='".$cat_ var."'";619 $featured_style = "class='".$cat_bg_var."'"; 574 620 } 575 621 } 576 622 // Each output creates the li > link > title > exerpt 577 $output .= "<li ".$featured_style." class='".$cat_var."' 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"; 623 $rgbColor = hex2rgb($cat_bg_var_value); 624 $rgba_value = "rgba(".$rgbColor[0].",".$rgbColor[1].",".$rgbColor[2].",".$posttile_transparency.")"; 625 $output .= "<li ".$featured_style." class='".$cat_bg_var."' id='".$theID."'><a href='$temp_link' class='".$cat_bg_var."' style='background-color: $rgba_value; color: $cat_tx_var_value; $featured_border'><h3 style='color: $cat_tx_var_value;'>$temp_title </h3>$temp_excerpt</a></li>\n"; 578 626 // Each output_key creates a li > category color block > category name 579 627 … … 616 664 foreach($categories as $category) { 617 665 // Set's category names 618 $cat_ var = $category->name;666 $cat_bg_var = $category->name; 619 667 // Sets the slug 620 668 $cat_slug = $category->slug; 621 669 // Cleans up category names that have spaces 622 $cat_ var_key = "cat_".$cat_slug;670 $cat_bg_var_key = "cat_bg_".$cat_slug; 623 671 // Get's the category options which are the hexadecimal colors 624 $cat_ var_key_val = get_option($cat_var_key);672 $cat_bg_var_key_val = get_option($cat_bg_var_key); 625 673 // loops through the each category and prints them 626 $key_items .= "<a href='#' class='key' id='".$cat_ var_key."' style='background-color:".$cat_var_key_val.";'>".$cat_var."</a>\n";674 $key_items .= "<a href='#' class='key' id='".$cat_bg_var_key."' style='background-color:".$cat_bg_var_key_val.";'>".$cat_bg_var."</a>\n"; 627 675 } 628 676 … … 644 692 function post_tiles_stylesheet() { 645 693 $plugin_url = plugins_url()."/post-tiles"; 694 wp_enqueue_style( 'post-tiles', $plugin_url.'/post-tiles.css', false, filemtime( plugin_dir_path( __FILE__ ).'/post-tiles.css' ), 'all' ); 646 695 wp_enqueue_style( 'post-tiles', $plugin_url.'/post-tiles.css' ); 647 696 // wp_enqueue_script('post-tiles', $plugin_url.'/post-tiles-frontend.js' ); 648 697 } 698 // Adds tranformations from Hex to RGB color 699 // Example: hex2rgb("#cc0") 700 // Returns: Array ( [0] => 204 [1] => 204 [2] => 0 ) 701 // Source: http://bavotasan.com/2011/convert-hex-color-to-rgb-using-php/ 702 function hex2rgb($hex) { 703 $hex = str_replace("#", "", $hex); 704 705 if(strlen($hex) == 3) { 706 $r = hexdec(substr($hex,0,1).substr($hex,0,1)); 707 $g = hexdec(substr($hex,1,1).substr($hex,1,1)); 708 $b = hexdec(substr($hex,2,1).substr($hex,2,1)); 709 } else { 710 $r = hexdec(substr($hex,0,2)); 711 $g = hexdec(substr($hex,2,2)); 712 $b = hexdec(substr($hex,4,2)); 713 } 714 $rgb = array($r, $g, $b); 715 //return implode(",", $rgb); // returns the rgb values separated by commas 716 return $rgb; // returns an array with the rgb values 717 } 649 718 ?> -
post-tiles/trunk/readme.txt
r1030970 r1031311 5 5 Requires at least: 3.0 6 6 Tested up to: 4.0.0 7 Stable tag: 1.4. 57 Stable tag: 1.4.6 8 8 License: GPLv2 or later 9 9 License URI: http://www.gnu.org/licenses/gpl-2.0.html … … 23 23 *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']** 24 24 25 Version 1.4. 325 Version 1.4.6 26 26 27 27 == Installation == … … 45 45 46 46 == Changelog == 47 48 = 1.4.6 = 49 * Thanks to alfred_j_kwack's PR, added text color picking and slide transparency via the admin. 47 50 48 51 = 1.4.5 =
Note: See TracChangeset
for help on using the changeset viewer.