WordPress.org

Plugin Directory

Changeset 513075


Ignore:
Timestamp:
03/01/12 18:21:02 (2 years ago)
Author:
ryelle
Message:

use wp_trim_words, break apart a translateable string, update readme

Location:
meetup-widgets/trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • meetup-widgets/trunk/readme.txt

    r502493 r513075  
    44441. Example of the single event detail widget, shows title, date, an excerpt of the description, number of currently-rsvp'd attendees, a link to RSVP (through OAuth if configured), and the location (linking to a google map). 
    45452. Example of the upcoming event list widget. Lists a set number of events from the group you specify, title & date. 
     46 
     47== Upgrade Notice == 
     48 
     49= 1.0.1 = 
     50* use `wp_trim_words` rather than writing something custom 
     51* pull apart a translated string somewhat 
  • meetup-widgets/trunk/vs_meetup.php

    r502490 r513075  
    4545        register_setting( 'general', 'vs_meet_options', array($this,'validate')); 
    4646         
    47         add_settings_section('vs_meet', 'Meetup API Settings', array($this, 'setting_section_vs_meetup'), 'general'); 
     47        add_settings_section('vs_meet', __('Meetup API Settings','vsmeet_domain'), array($this, 'setting_section_vs_meetup'), 'general'); 
    4848         
    4949        add_settings_field('vs_meetup_key', '<label for="vs_meetup_key">'.__('OAuth Meetup Key:' , 'vsmeet_domain' ).'</label>' , array(&$this, 'setting_vs_meetup_key') , 'general', 'vs_meet' ); 
     
    5656 
    5757    function setting_section_vs_meetup(){ 
    58         echo "<p>".__("To use the RSVP functionality of this plugin, you need to create an OAuth consumer. You can do that (or reset your information) by going here: <a target='_blank' href='http://www.meetup.com/meetup_api/oauth_consumers/'>Your OAuth Consumers</a>. You can get (& reset, if needed) your <a target='_blank' href='http://www.meetup.com/meetup_api/key/'>API key here.</a>",'vsmeet_domain')."</p>"; 
     58        echo "<p>". spritf( 
     59            __('To use the RSVP functionality of this plugin, you need to create an OAuth consumer. You can do that (or reset your information) by going here: %1$s. You can get (&amp; reset, if needed) your API key at %2$s','vsmeet_domain'), 
     60            "<a target='_blank' href='http://www.meetup.com/meetup_api/oauth_consumers/'>". _x('Your OAuth Consumers','meetup.com page title','vsmeet_domain') ."</a>", 
     61            "<a target='_blank' href='http://www.meetup.com/meetup_api/key/'>". _x('Getting an API key','meetup.com page title','vsmeet_domain') ."</a>" 
     62        ) ."</p>"; 
    5963    } 
    6064 
  • meetup-widgets/trunk/vs_meetup_widgets.php

    r502490 r513075  
    2727                $out .= '<h3><a href="'.$event->event_url.'">'.$event->name.'</a></h3>'; 
    2828                $out .= '<p>'.date('F d, Y @ g:i a',intval($event->time/1000 + $event->utc_offset/1000)).'</p>'; 
    29                 $short_d = $this->short_text(strip_tags($event->description));  
    30                 $out .= '<p>'.$short_d.'</p>'; 
     29                $out .= '<p>'. wp_trim_words(strip_tags($event->description),20) .'</p>'; 
    3130                $out .= '<p><span class="rsvp-count">'.$event->yes_rsvp_count.' '._n('attendee', 'attendees', $event->yes_rsvp_count).'</span>'; 
    3231                if (!empty($options['vs_meetup_key']) && !empty($options['vs_meetup_secret'])) { 
     
    8584        return $out; 
    8685    } 
    87      
    88     public function short_text($text,$length = 20){ 
    89         $words = preg_split("/[\n\r\t ]+/", $text, $length + 1, PREG_SPLIT_NO_EMPTY); 
    90         if ( count($words) > $length ) { 
    91             array_pop($words); 
    92             $text = implode(' ', $words); 
    93             $text .= "..."; 
    94         } else { 
    95             $text = implode(' ', $words); 
    96         } 
    97         return $text; 
    98     } 
    9986} 
    10087 
Note: See TracChangeset for help on using the changeset viewer.