Plugin Directory

Changeset 639833


Ignore:
Timestamp:
12/15/2012 11:14:03 PM (13 years ago)
Author:
iluminatus
Message:

Adding support for date localization (specially in German) using i18n, thanks to Claas Augner for the patch

Location:
network-latest-posts/trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • network-latest-posts/trunk/network-latest-posts.php

    r639691 r639833  
    44Plugin URI: http://en.8elite.com/network-latest-posts
    55Description: Display the latest posts from the blogs in your network using it as a function, shortcode or widget.
    6 Version: 3.5.3
     6Version: 3.5.4
    77Author: L'Elite
    88Author URI: http://laelite.info/
     
    128128 * -- ThorHammer
    129129 * --- Spotted a warning when NLPosts couldn't find posts.
     130 *
     131 * -- Claas Augner
     132 * **** Patch to correctly format dates for localization.
    130133 *
    131134 * That's it, let the fun begin!
     
    660663                        $author = get_user_by('id',$field->post_author);
    661664                        $format = (string)${'date_format_'.$all_blogkeys[$field->guid]};
    662                         $dateobj = new DateTime(trim($field->post_date));
    663                         $datepost = $dateobj->format("$format");
     665                        $datepost = date_i18n($format, strtotime(trim( $field->post_date) ) );
    664666                        $blog_name = '<a href="'.${'blog_url_'.$all_blogkeys[$field->guid]}.'">'.${'blog_name_'.$all_blogkeys[$field->guid]}."</a>";
    665667                        // The network's root (main blog) is called 'blog',
     
    716718                        $author = get_user_by('id',$field->post_author);
    717719                        $format = (string)${'date_format_'.$all_blogkeys[$field->guid]};
    718                         $dateobj = new DateTime(trim($field->post_date));
    719                         $datepost = $dateobj->format("$format");
     720                        $datepost = date_i18n($format, strtotime(trim( $field->post_date) ) );
    720721                        $blog_name = '<a href="'.${'blog_url_'.$all_blogkeys[$field->guid]}.'">'.${'blog_name_'.$all_blogkeys[$field->guid]}."</a>";
    721722                        // The network's root (main blog) is called 'blog',
     
    880881                        $author = get_user_by('id',$field->post_author);
    881882                        $format = (string)${'date_format_'.$all_blogkeys[$field->guid]};
    882                         $dateobj = new DateTime(trim($field->post_date));
    883                         $datepost = $dateobj->format("$format");
     883                        $datepost = date_i18n($format, strtotime(trim( $field->post_date) ) );
    884884                        $blog_name = '<a href="'.${'blog_url_'.$all_blogkeys[$field->guid]}.'">'.${'blog_name_'.$all_blogkeys[$field->guid]}."</a>";
    885885                        // The network's root (main blog) is called 'blog',
     
    936936                        $author = get_user_by('id',$field->post_author);
    937937                        $format = (string)${'date_format_'.$all_blogkeys[$field->guid]};
    938                         $dateobj = new DateTime(trim($field->post_date));
    939                         $datepost = $dateobj->format("$format");
     938                        $datepost = date_i18n($format, strtotime(trim( $field->post_date) ) );
    940939                        $blog_name = '<a href="'.${'blog_url_'.$all_blogkeys[$field->guid]}.'">'.${'blog_name_'.$all_blogkeys[$field->guid]}."</a>";
    941940                        // The network's root (main blog) is called 'blog',
  • network-latest-posts/trunk/readme.txt

    r639691 r639833  
    55Requires at least: 3.0
    66Tested up to: 3.5
    7 Stable tag: 3.5.3
     7Stable tag: 3.5.4
    88
    99This plugin allows you to pull all the recent posts from the blogs in your WordPress network and display them in your main site (or internal sites)
     
    144144== Changelog ==
    145145
     146= 3.5.4 =
     147* Support for date localization (specially in german) using i18n, thanks to Claas Augner for the patch.
     148
    146149= 3.5.3 =
    147150* Fixing line returns when using display_content parameter. Mixing nl2br and do_shortcode to do the job.
Note: See TracChangeset for help on using the changeset viewer.