Changeset 601475
- Timestamp:
- 09/20/2012 08:02:24 AM (14 years ago)
- Location:
- featured-post-with-thumbnail
- Files:
-
- 6 edited
- 1 copied
-
tags/1.5.2 (copied) (copied from featured-post-with-thumbnail/trunk)
-
tags/1.5.2/index.php (modified) (4 diffs)
-
tags/1.5.2/readme.txt (modified) (2 diffs)
-
tags/1.5.2/scripts/yiw-featured-post-widget.php (modified) (3 diffs)
-
trunk/index.php (modified) (4 diffs)
-
trunk/readme.txt (modified) (2 diffs)
-
trunk/scripts/yiw-featured-post-widget.php (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
featured-post-with-thumbnail/tags/1.5.2/index.php
r588810 r601475 62 62 ob_start(); 63 63 ob_end_clean(); 64 $output = preg_match_all('/<img.+src=[\'"]([^\'"]+)[\'"].*>/i', $post->post_content, $matches); 65 $first_img = $matches [1] [0]; 66 67 if(empty($first_img)) { //Defines a default image 64 $num_images = preg_match_all('/<img.+src=[\'"]([^\'"]+)[\'"].*>/i', $post->post_content, $matches); 65 66 if($num_images > 0) { 67 $first_img = $matches[1][0]; 68 } else { 68 69 $first_img = $featured_post_plugin_path . "images/default.gif"; 69 70 } 71 70 72 return $first_img; 71 73 } … … 144 146 145 147 <ul id="yiw-featured-post"> 148 <?php foreach($featured_posts as $post) : 149 setup_postdata($post); 150 ?> 146 151 <li> 147 152 <a href="<?php the_permalink() ?>" class="featured-thumb"> … … 159 164 </h4> 160 165 </li> 166 <?php endforeach; ?> 161 167 </ul> 162 168 … … 263 269 function yiw_add_widget_script(){ 264 270 global $featured_post_plugin_path; 265 wp_enqueue_script('yiw_widget_script', $featured_post_plugin_path . 'js/yiw_widget_script.js'); 271 wp_enqueue_script('yiw_widget_script', $featured_post_plugin_path . 'js/yiw_widget_script.js', 272 array('jquery'), 273 false, 274 true); 266 275 } 267 276 add_action('admin_head', 'yiw_add_widget_script'); -
featured-post-with-thumbnail/tags/1.5.2/readme.txt
r588810 r601475 5 5 Tags: Post, Posts, highlight, widget, thumbnail, Featured Post with Thumbnail, Featured Post, Post, highlighting best articles, 6 6 Requires at least: 2.8, PHP4 & PHP5 7 Tested up to: 2.98 Stable tag: 1.5. 17 Tested up to: 3.4.2 8 Stable tag: 1.5.2 9 9 10 10 A really simple way of putting featured posts on your website. … … 57 57 == Changelog == 58 58 59 = 1.5.2 = 60 * fixed: all featured posts are shown 61 * fixed: in a post without images the default one is shown 62 59 63 = 1.5.1 = 60 64 -
featured-post-with-thumbnail/tags/1.5.2/scripts/yiw-featured-post-widget.php
r582086 r601475 7 7 8 8 9 /*9 /* 10 10 * Aggiungiamo la nostra funzione al gancio widgets_init 11 11 * Add our function to widgets_init hook … … 178 178 179 179 private function showFeaturedOrCategory($instance) { 180 echo '<p >';180 echo '<p id="yiw_featured_post_show">'; 181 181 echo '<label for="' . $this->get_field_id('show') . '">' . _e("Featured or category?", YIW_TEXT_DOMAIN) . '</label>'; 182 182 echo '<select id="' . $this->get_field_id('show') . '" name="' . $this->get_field_name('show') . '">'; … … 186 186 echo '</p>'; 187 187 188 echo '<p >';188 echo '<p id="yiw_featured_post_category">'; 189 189 echo '<label for="' . $this->get_field_id('category') . '">' . _e('Category', YIW_TEXT_DOMAIN) . '</label>'; 190 190 echo '<select id="' . $this->get_field_id('category') . '" name="' . $this->get_field_name('category') . '">'; 191 $categories = get_categories( $args);191 $categories = get_categories(); 192 192 foreach ($categories as $c) { 193 193 echo '<option value="'. $c->cat_ID .'" ' . selected($instance['category'], $c->cat_ID) . '>'. $c->name .'</option>'; -
featured-post-with-thumbnail/trunk/index.php
r588810 r601475 62 62 ob_start(); 63 63 ob_end_clean(); 64 $output = preg_match_all('/<img.+src=[\'"]([^\'"]+)[\'"].*>/i', $post->post_content, $matches); 65 $first_img = $matches [1] [0]; 66 67 if(empty($first_img)) { //Defines a default image 64 $num_images = preg_match_all('/<img.+src=[\'"]([^\'"]+)[\'"].*>/i', $post->post_content, $matches); 65 66 if($num_images > 0) { 67 $first_img = $matches[1][0]; 68 } else { 68 69 $first_img = $featured_post_plugin_path . "images/default.gif"; 69 70 } 71 70 72 return $first_img; 71 73 } … … 144 146 145 147 <ul id="yiw-featured-post"> 148 <?php foreach($featured_posts as $post) : 149 setup_postdata($post); 150 ?> 146 151 <li> 147 152 <a href="<?php the_permalink() ?>" class="featured-thumb"> … … 159 164 </h4> 160 165 </li> 166 <?php endforeach; ?> 161 167 </ul> 162 168 … … 263 269 function yiw_add_widget_script(){ 264 270 global $featured_post_plugin_path; 265 wp_enqueue_script('yiw_widget_script', $featured_post_plugin_path . 'js/yiw_widget_script.js'); 271 wp_enqueue_script('yiw_widget_script', $featured_post_plugin_path . 'js/yiw_widget_script.js', 272 array('jquery'), 273 false, 274 true); 266 275 } 267 276 add_action('admin_head', 'yiw_add_widget_script'); -
featured-post-with-thumbnail/trunk/readme.txt
r588810 r601475 5 5 Tags: Post, Posts, highlight, widget, thumbnail, Featured Post with Thumbnail, Featured Post, Post, highlighting best articles, 6 6 Requires at least: 2.8, PHP4 & PHP5 7 Tested up to: 2.98 Stable tag: 1.5. 17 Tested up to: 3.4.2 8 Stable tag: 1.5.2 9 9 10 10 A really simple way of putting featured posts on your website. … … 57 57 == Changelog == 58 58 59 = 1.5.2 = 60 * fixed: all featured posts are shown 61 * fixed: in a post without images the default one is shown 62 59 63 = 1.5.1 = 60 64 -
featured-post-with-thumbnail/trunk/scripts/yiw-featured-post-widget.php
r582086 r601475 7 7 8 8 9 /*9 /* 10 10 * Aggiungiamo la nostra funzione al gancio widgets_init 11 11 * Add our function to widgets_init hook … … 178 178 179 179 private function showFeaturedOrCategory($instance) { 180 echo '<p >';180 echo '<p id="yiw_featured_post_show">'; 181 181 echo '<label for="' . $this->get_field_id('show') . '">' . _e("Featured or category?", YIW_TEXT_DOMAIN) . '</label>'; 182 182 echo '<select id="' . $this->get_field_id('show') . '" name="' . $this->get_field_name('show') . '">'; … … 186 186 echo '</p>'; 187 187 188 echo '<p >';188 echo '<p id="yiw_featured_post_category">'; 189 189 echo '<label for="' . $this->get_field_id('category') . '">' . _e('Category', YIW_TEXT_DOMAIN) . '</label>'; 190 190 echo '<select id="' . $this->get_field_id('category') . '" name="' . $this->get_field_name('category') . '">'; 191 $categories = get_categories( $args);191 $categories = get_categories(); 192 192 foreach ($categories as $c) { 193 193 echo '<option value="'. $c->cat_ID .'" ' . selected($instance['category'], $c->cat_ID) . '>'. $c->name .'</option>';
Note: See TracChangeset
for help on using the changeset viewer.