WordPress.org

Plugin Directory

Changeset 532117


Ignore:
Timestamp:
04/17/12 03:47:36 (2 years ago)
Author:
ericmann
Message:

Update to version 1.2.1.

Location:
wp-core-contributions-widget
Files:
15 added
8 edited

Legend:

Unmodified
Added
Removed
  • wp-core-contributions-widget/trunk/inc/wp-codex-contributions-widget-template.php

    r531237 r532117  
    1111    <?php foreach ( (array) $items as $item ) : 
    1212        $link = 'http://codex.wordpress.org/index.php?title=' . $item['title'] . '&oldid=' . $item['revision']; 
     13 
     14        if ( (bool)$item['function_ref'] ) { 
    1315    ?> 
    14         <li><?php printf( __( 'For %1$s' ), 
    15             '<a href="' . esc_url( $link ) . '">' . esc_html( $item['title'] ) . '</a>' 
     16        <li><?php printf( __( 'Function: %1$s', 'wp-core-contributions-widget' ), 
     17            '<a href="' . esc_url( $link ) . '" title="' . esc_html( $item['description'] ) . '">' . esc_html( $item['title'] ) . '</a>' 
    1618        ); ?></li> 
     19    <?php } else { ?> 
     20        <li><?php printf( __( 'For %1$s', 'wp-core-contributions-widget' ), 
     21            '<a href="' . esc_url( $link ) . '" title="' . esc_html( $item['description'] ) . '">' . esc_html( $item['title'] ) . '</a>' 
     22        ); ?></li> 
     23    <?php } ?> 
    1724    <?php endforeach; ?> 
    1825    </ul> 
  • wp-core-contributions-widget/trunk/lang/wp-core-contributions-widget.po

    r531237 r532117  
    33"Project-Id-Version: WP Core Contributions Widget 0.2\n" 
    44"Report-Msgid-Bugs-To: \n" 
    5 "POT-Creation-Date: 2012-04-14 18:07-0800\n" 
    6 "PO-Revision-Date: 2012-04-14 18:07-0800\n" 
     5"POT-Creation-Date: 2012-04-16 20:42-0800\n" 
     6"PO-Revision-Date: 2012-04-16 20:43-0800\n" 
    77"Last-Translator: Eric Mann <eric@eamann.com>\n" 
    88"Language-Team: Jumping Duck Media <info@jumping-duck.com>\n" 
     
    1616"X-Poedit-SearchPath-0: C:\\xampp\\htdocs\\wp-test\\wp-content\\plugins\\wp-core-contributions-widget\n" 
    1717 
    18 #: C:\xampp\htdocs\wp-test\wp-content\plugins\wp-core-contributions-widget/inc/wp-codex-contributions-widget-template.php:14 
     18#: C:\xampp\htdocs\wp-test\wp-content\plugins\wp-core-contributions-widget/inc/wp-codex-contributions-widget-template.php:16 
     19#, php-format 
     20msgid "Function: %1$s" 
     21msgstr "" 
     22 
     23#: C:\xampp\htdocs\wp-test\wp-content\plugins\wp-core-contributions-widget/inc/wp-codex-contributions-widget-template.php:20 
    1924#, php-format 
    2025msgid "For %1$s" 
    2126msgstr "" 
    2227 
    23 #: C:\xampp\htdocs\wp-test\wp-content\plugins\wp-core-contributions-widget/inc/wp-codex-contributions-widget-template.php:23 
     28#: C:\xampp\htdocs\wp-test\wp-content\plugins\wp-core-contributions-widget/inc/wp-codex-contributions-widget-template.php:30 
    2429msgid "View both changes in the Codex." 
    2530msgstr "" 
  • wp-core-contributions-widget/trunk/lib/class.wp-codex-contributions-widget.php

    r531237 r532117  
    7979        } 
    8080 
    81         include_once( $path ); // This include will generate the markup for the widget 
     81        include( $path ); // This include will generate the markup for the widget 
    8282 
    8383        echo $after_widget; 
  • wp-core-contributions-widget/trunk/lib/class.wp-core-contributions-widget.php

    r478111 r532117  
    7878        } 
    7979 
    80         include_once( $path ); // This include will generate the markup for the widget 
     80        include( $path ); // This include will generate the markup for the widget 
    8181 
    8282        echo $after_widget; 
  • wp-core-contributions-widget/trunk/lib/class.wp-core-contributions.php

    r531237 r532117  
    6868        if ( $username == null ) return array(); 
    6969         
    70         if ( false == ( $formatted = get_transient( 'wp-codex-contributions-' . $username ) ) ) { 
     70        if ( true || false == ( $formatted = get_transient( 'wp-codex-contributions-' . $username ) ) ) { 
    7171             
    72             $results_url = 'http://codex.wordpress.org/api.php?action=query&list=usercontribs&ucuser=' . $username . '&uclimit=' . $limit . '&ucdir=older&format=xml'; 
     72            $results_url = 'http://codex.wordpress.org/api.php?action=query&list=usercontribs&ucuser=' . $username . '&uclimit=' . $limit . '&ucdir=older&format=php'; 
    7373            $results = wp_remote_retrieve_body( wp_remote_get( $results_url, array('sslverify'=>false) ) ); 
     74 
     75            $raw = unserialize( $results ); 
    7476             
    75             /* Expected XML format is as follows: 
    76              * <?xml version="1.0"?> 
    77              * <api> 
    78              *   <query> 
    79              *     <usercontribs> 
    80              *       <item user="Ericmann" pageid="21224" revid="109742" ns="0" title="Nginx" timestamp="2011-09-30T20:39:55Z" comment="External Links" /> 
    81              *       <item user="Ericmann" pageid="15227" revid="107245" ns="0" title="Switching to PHP5" timestamp="2011-07-08T21:41:56Z" comment="" /> 
    82              *       <item user="Ericmann" pageid="4580" revid="105196" ns="0" title="Using Subversion" timestamp="2011-05-19T15:47:29Z" comment="Add a resource." /> 
    83              *       <item user="Ericmann" pageid="4580" revid="104777" ns="0" title="Using Subversion" timestamp="2011-05-12T15:11:59Z" comment="Add a resource." /> 
    84              *       <item user="Ericmann" pageid="21198" revid="102162" ns="0" title="GSoC2011" timestamp="2011-03-17T13:58:14Z" comment="Mentors" /> 
    85              *       <item user="Ericmann" pageid="21198" revid="102100" ns="0" title="GSoC2011" timestamp="2011-03-15T13:55:20Z" minor="" comment="Mentors" /> 
    86              *       <item user="Ericmann" pageid="19084" revid="93082" ns="0" title="Post Types" timestamp="2010-09-18T17:08:51Z" comment="Fixing typos" /> 
    87              *     </usercontribs> 
    88              *   </query> 
    89              *   <query-continue> 
    90              *     <usercontribs ucstart="2010-09-18T16:48:17Z"/> 
    91              *   </query-continue> 
    92              * </api> 
     77            /* Expected array format is as follows: 
     78             * Array 
     79             * ( 
     80             *     [query] => Array 
     81             *         ( 
     82             *             [usercontribs] => Array 
     83             *                 ( 
     84             *                     [0] => Array 
     85             *                         ( 
     86             *                             [user] => Mbijon 
     87             *                             [pageid] => 23000 
     88             *                             [revid] => 112024 
     89             *                             [ns] => 0 
     90             *                             [title] => Function Reference/add help tab 
     91             *                             [timestamp] => 2011-12-13T23:49:38Z 
     92             *                             [minor] => 
     93             *                             [comment] => Functions typo fix 
     94             *                         ) 
    9395             **/ 
    94              
    95             $raw = new SimpleXMLElement( $results ); 
    9696             
    9797            $formatted = array(); 
    9898             
    99             foreach( $raw->query->usercontribs->item as $item ) { 
     99            foreach( $raw['query']['usercontribs'] as $item ) { 
     100                $count = 0; 
     101                $clean_title = preg_replace( '/^Function Reference\//', '', (string)$item['title'], 1, $count ); 
     102 
    100103                $newItem = array( 
    101                     'title' => (string)$item['title'], 
     104                    'title' => $clean_title, 
    102105                    'description' => (string)$item['comment'], 
    103                     'revision' => (int)$item['revid'] 
     106                    'revision' => (int)$item['revid'], 
     107                    'function_ref' => $count == 0 ? false : true 
    104108                ); 
    105109                array_push( $formatted, $newItem ); 
  • wp-core-contributions-widget/trunk/readme.txt

    r531237 r532117  
    55Requires at least: 3.2.1 
    66Tested up to: 3.4 
    7 Stable tag: 1.2 
    8 License GPLv2+ 
     7Stable tag: 1.2.1 
     8License: GPLv2+ 
    99 
    1010Add a list of your accepted contributions to WordPress Core as a sidebar widget. 
     
    5858* `description` -> Description of the change made. 
    5959* `revision` -> Revision number according to the Codex wiki (used to create a link). 
     60* `function_ref` -> Boolean flag regarding whether or not the change was to a function reference. Removes "Function Reference/" from the page title. 
    6061 
    6162== Screenshots == 
     
    6566 
    6667== Changelog == 
     68 
     69= 1.2.1 = 
     70* Switch to PHP return for Codex data 
     71* Shorten page names when returned from Codex 
     72* Add title tags to Codex links for context 
    6773 
    6874= 1.2 = 
  • wp-core-contributions-widget/trunk/wp-core-contributions-widget.php

    r531237 r532117  
    44Plugin URI: http://jumping-duck.com/wordpress 
    55Description: Add a list of your accepted contributions to WordPress Core as a sidebar widget. 
    6 Version: 1.2 
     6Version: 1.2.1 
    77Author: Eric Mann 
    88Author URI: http://eamann.com 
     
    1010*/ 
    1111 
    12 /* Copyright 2011  Eric Mann, Jumping Duck Media 
     12/* Copyright 2011-2012  Eric Mann, Jumping Duck Media 
    1313 * 
    1414 * This program is free software; you can redistribute it and/or modify 
Note: See TracChangeset for help on using the changeset viewer.