WordPress.org

Plugin Directory

Changeset 791818


Ignore:
Timestamp:
10/22/13 14:55:30 (6 months ago)
Author:
ydubois
Message:

0.2.1 beta 2 small bugfixes release

Location:
wp-frontpage-news/trunk
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • wp-frontpage-news/trunk/css/wpcufpn_admin.css

    r789344 r791818  
    3737    display: table; 
    3838} 
     39#wpcufpn_config_zone h4 { 
     40    margin: -4px 0 0 8px; 
     41    font-style: italic 
     42} 
    3943 
    4044/** horizontal li **/ 
     
    7680#wpcufpn_config_zone { 
    7781    min-height: 260px; 
     82    overflow: hidden; 
    7883} 
    7984ul.arrow_col { 
     
    111116#wpcufpn_config_zone div.wpcu-inner-admin-block.with-border { 
    112117    display: inline-block; 
    113     height: 72px; 
     118    min-height: 72px; 
    114119    margin: 4px 0; 
    115120    padding: 0 5px; 
  • wp-frontpage-news/trunk/inc/wp-fpn-front.inc.php

    r789344 r791818  
    390390                } 
    391391            } 
    392             if( 'First image' == $field || (isset($this->widget->settings['thumb_img'])&&$this->widget->settings['thumb_img']==1) ) { 
    393                 /** Use first image of post **/ 
     392             
     393            /** Find image **/ 
     394            if( 'First image' == $field || (isset($this->widget->settings['thumb_img'])&&$this->widget->settings['thumb_img']==2) ) { 
     395                /** Use first attachment of post **/ 
    394396                $attachments = get_children( array('post_parent' => get_the_ID(), 'post_type' => 'attachment', 'post_mime_type' => 'image', 'orderby' => 'menu_order' ) ); 
    395397                if ( is_array($attachments) ) { 
    396398                    $first_attachment = array_shift($attachments); 
    397                     $src = wp_get_attachment_image_src( $first_attachment->ID ); 
     399                    $srca = wp_get_attachment_image_src( $first_attachment->ID ); 
     400                    $src = $srca[0]; 
    398401                } 
     402 
     403            } elseif (isset($this->widget->settings['thumb_img'])&&$this->widget->settings['thumb_img']==1) { 
     404                /** Use first image of post **/ 
     405                global $post; 
     406                if (preg_match('/<img[^>]+src=[\'"]([^\'"]+)[\'"][^>]*>/i', $post->post_content, $matches)) 
     407                    $src = $matches[1]; 
     408                 
    399409            } else { 
    400410                /** Use default WP thumbnail **/ 
    401                 $src = wp_get_attachment_image_src( get_post_thumbnail_id($post->ID), $sizing ); 
    402             } 
     411                $srca = wp_get_attachment_image_src( get_post_thumbnail_id($post->ID), $sizing ); 
     412                $src = $srca[0]; 
     413                 
     414            } 
     415            /* DEBUG 
     416            echo 'img_src: ' . $this->widget->settings['thumb_img'] . '<br/>'; 
     417            echo 'post_id: ' . get_the_ID() . '<br/>'; 
     418            echo 'src: ' . $src . '<br/><br/>'; 
     419            */ 
    403420             
    404421            /** If no thumb or first image get default image **/ 
    405             if( isset($src[0]) && $src[0] ) { 
    406                 $img = '<img src="' . $src[0] . '" style="' . $style . '" alt="' . get_the_title() . '" class="wpcufpn_thumb" />'; 
     422            if( isset($src) && $src ) { 
     423                $img = '<img src="' . $src . '" style="' . $style . '" alt="' . get_the_title() . '" class="wpcufpn_thumb" />'; 
    407424            } else { 
    408425                if( isset($this->widget->settings['default_img']) && $this->widget->settings['default_img'] ) { 
     
    420437                $style .= 'height:' . $this->widget->settings['thumb_height'] . 'px;'; 
    421438            } else { 
    422                 $style .= 'width:100%'; 
     439                $style .= 'width:100%;'; 
    423440            } 
    424441             
  • wp-frontpage-news/trunk/inc/wp-fpn-main.inc.php

    r789375 r791818  
    5252        'margin_left'           => 0, 
    5353        'margin_top'            => 0, 
    54         'margin_right'          => 0, 
    55         'margin_bottom'         => 0, 
     54        'margin_right'          => 4, 
     55        'margin_bottom'         => 4, 
    5656        'date_fmt'              => '', 
    5757        'read_more'             => '', 
     
    8787    private $_thumb_img_values = array( 
    8888        'Use featured image', 
     89        'Use first attachment', 
    8990        'Use first image' 
    9091    ); 
  • wp-frontpage-news/trunk/readme.txt

    r789354 r791818  
    22Contributors: ydubois, wpcode-united 
    33Donate link: http://www.wpcode-united.com/wordpress-plugin/wp-frontpage-news 
    4 Tags: news, widget, recent posts, posts, plugin, sidebar, thumbnail, images, tags, automatic, custom, Post, admin, image, previous posts, template, page, administration, English, shortcode, excerpt, featured image, featured posts 
     4Tags: news, widget, recent posts, posts, plugin, sidebar, thumbnail, images, tags, automatic, custom, Post, admin, image, previous posts, template, page, administration, English, shortcode, excerpt, featured image, first image, featured posts 
    55Requires at least: 3.6 
    66Tested up to: 3.6.1 
     
    5454* Limit the total number of displayed news items 
    5555 
    56 * Select image source (featured image thumbnail or post first images) 
     56* Select image source (featured image thumbnail, first image attachment, or post first image) 
    5757 
    5858* Add custom margins 
     
    8484* 0.1.0. Initial (alpha) release of 2013-10-03 
    8585* 0.2.0. Initial (beta) release of 2013-10-17 
     86* 0.2.1. Beta 2 release of 2013-10-22 
    8687 
    8788 
     
    100101* Simplified settings, now completely usable out-of-the-box 
    101102* Default image now included and pre-configured for perfect output even with articles without images 
     103= 0.2.1 = 
     104* Beta release 2 (bug fixes): 
     105* Fixed image margin 
     106* Added default right and bottom 4px image margins 
     107* Added choice of first image or first post attachment 
     108* Drag-and drop containers in the widget display admin now grow in height as items are added 
    102109 
    103110 
     
    108115= 0.2.0 = 
    109116* No specifics. Automatic upgrade works fine. 
     117= 0.2.1 = 
     118* No specifics. Automatic upgrade works fine. 
    110119 
    111120 
  • wp-frontpage-news/trunk/wp-frontpage-news.php

    r789344 r791818  
    33 * @package WP-Frontpage-News 
    44 * @author WPCode-United / Yann Dubois 
    5  * @version 0.2.0 
     5 * @version 0.2.1 
    66 */ 
    77 
     
    1010 Plugin URI: http://www.wpcode-united.com/wordpress-plugin/wp-frontpage-news 
    1111 Description: Advanced frontpage and widget news slider 
    12  Version: 0.2.0 
     12 Version: 0.2.1 
    1313 Author: WPCode-United / Yann Dubois 
    1414 Author URI: http://www.wpcode-united.com/ 
     
    3838 
    3939/** 
     40 Revision 0.2.1: 
     41 - Beta release 2 (bug fixes): 
     42 * Fixed image margin 
     43 * Added default right and bottom 4px image margins 
     44 * Added choice of first image or first post attachment 
     45 * Drag-and drop containers in the widget display admin now grow in height as items are added 
    4046 Revision 0.2.0: 
    4147 - Original beta release: 
     
    6773    array( 
    6874        'name'              => 'WP Frontpage News', 
    69         'version'           => '0.2.0', 
     75        'version'           => '0.2.1', 
    7076        'has_option_page'   => false, 
    7177        'option_page_title' => 'Frontpage News Settings', 
Note: See TracChangeset for help on using the changeset viewer.