Plugin Directory

Changeset 1123220


Ignore:
Timestamp:
03/29/2015 07:50:03 PM (11 years ago)
Author:
Sudavar
Message:

Releasing Version 1.7.1

  • Bug fix for the WP User drawing date wrongly from Custom Meta Field
  • Fix the user's image from gravatar
  • Minor changes
Location:
birthdays-widget
Files:
43 added
4 edited

Legend:

Unmodified
Added
Removed
  • birthdays-widget/trunk/birthday-widget.php

    r1084613 r1123220  
    55    Description: Birthdays widget plugin produces a widget which displays a customizable happy birthday image and wish to your clients/users.
    66    Author: lion2486, Sudavar
    7     Version: 1.7
     7    Version: 1.7.1
    88    Author URI: http://www.codescar.eu
    99    Contributors: lion2486, Sudavar
     
    1616 */
    1717
    18     define( 'BW', '1.7' );
     18    define( 'BW', '1.7.1' );
    1919    require_once dirname( __FILE__ ) . '/class-birthdays-widget.php';
    2020    require_once dirname( __FILE__ ) . '/class-birthdays-widget-installer.php';
  • birthdays-widget/trunk/birthdays-widget-ajax-callback.php

    r1084580 r1123220  
    2929        foreach ( $users as $user ) {
    3030            //If this meta key exists for this user, and it's his/her birthday
    31             if ( isset( $user->{$birthday_date_meta_field} ) ) {
    32                 $date = date( "-m-d", strtotime( $user->{$birthday_date_meta_field} ) );
     31            if ( isset( $user->{$birthday_date_meta_field} ) && !empty( $user->{$birthday_date_meta_field} ) ) {
     32                $date = date( "-m-d", strtotime( str_replace('/', '-', $user->{$birthday_date_meta_field} ) ) );
    3333                if ( ( !$all && $date == date_i18n( '-m-d' ) ) || $all ) {
    3434                    $tmp_user = new stdClass();
    3535                    $tmp_user->name = $user->{$meta_key};
    3636                    $tmp_user->email = $user->user_email;
     37                    $tmp_user->date = date( "Y-m-d", strtotime( str_replace('/', '-', $user->{$birthday_date_meta_field} ) ) );
    3738                    //If user's image is drawn from Gravatar
    3839                    if ( $birthdays_settings[ 'wp_user_gravatar' ] ) {
  • birthdays-widget/trunk/class-birthdays-widget.php

    r1084594 r1123220  
    8888        $days_organized = array();
    8989        foreach ( $filtered as $user_birt ) {
     90            if( !isset( $user_birt->date ) )
     91                var_dump( $user_birt );
    9092            $user_birt->tmp = substr( $user_birt->date, 5 );
    9193            if ( !isset ( $days_organized[ $user_birt->tmp ] ) ) {
     
    145147                //Check if this is record represents a WordPress user
    146148                $wp_usr = strpos( $row->name, $prefix );
    147                 if ( $instance[ 'template' ] == 2 ) {
    148                     $row->image = wp_get_attachment_image_src( $row->image, array( 150, 150 ) );
    149                 } else {
    150                     $row->image = wp_get_attachment_image_src( $row->image, 'medium' );
    151                 }
    152                 $row->image = $row->image[ 0 ];
     149                //var_dump( $row );
     150                if ( is_numeric( $row->image ) || $row->image == NULL ) {
     151                    if ( $instance[ 'template' ] == 2 ) {
     152                        $row->image = wp_get_attachment_image_src( $row->image, array( 150, 150 ) );
     153                    } else {
     154                        $row->image = wp_get_attachment_image_src( $row->image, 'medium' );
     155                    }
     156                    $row->image = $row->image[ 0 ];
     157                }
    153158                if ( $wp_usr !== false ) {
    154159                    //If birthdays are disabled for WP Users, or birthday date is drown from WP Profile, skip the record
     
    268273                                        $html .= '<img src="' . $user->image . '" width="150" /><div class="birthday_center birthday_name">' . $user->name;
    269274                                        if( $birthdays_settings[ 'user_age' ] ) {
    270                                             $bdate = new DateTime( $user->date );
    271                                             $date_now = new DateTime();
    272                                             $interval = $date_now->diff( $bdate );
    273                                             $age = $interval->y;
     275                                            $age = date( "Y" ) - date( "Y", strtotime( $user->date ) );
    274276                                            $html .= '<span class="birthday_age"> ' . $age . ' ' . __( 'years old', 'birthdays-widget' ) . '</span>';
    275277                                        }
  • birthdays-widget/trunk/readme.txt

    r1084610 r1123220  
    44Description: Birthdays widget plugin produces a widget which displays a customizable happy birthday image and wish to your clients/users.
    55Author: lion2486, Sudavar
    6 Version: 1.7
     6Version: 1.7.1
    77Author URI: http://www.codescar.eu
    88Contributors: lion2486, Sudavar
     
    1111Requires at least: 3.0.1
    1212Tested up to: 4.0
    13 Stable tag: 1.7
     13Stable tag: 1.7.1
    1414Text Domain: birthdays-widget
    1515License: GPLv2
     
    5151
    5252== Changelog ==
     53
     54= 1.7.1 =
     55* Bug fix for the WP User drawing date wrongly from Custom Meta Field
     56* Fix the user's image from gravatar
     57* Minor changes
    5358
    5459= 1.7 =
Note: See TracChangeset for help on using the changeset viewer.