WordPress.org

Plugin Directory

Changeset 599338


Ignore:
Timestamp:
09/15/12 17:03:01 (19 months ago)
Author:
joedolson
Message:

Commit 2.0.4: iCal time option added, bug in today's event shortcode fixed

Location:
my-calendar/trunk
Files:
8 edited

Legend:

Unmodified
Added
Removed
  • my-calendar/trunk/my-calendar-core.php

    r599053 r599338  
    456456        if ( version_compare( $current_version, "1.11.0", "<" ) ) { $upgrade_path[] = "1.11.0"; } 
    457457        if ( version_compare( $current_version, "1.11.1", "<" ) ) { $upgrade_path[] = "1.11.1"; } 
    458         if ( version_compare( $current_version, "2.0.0", "<" ) ) { $upgrade_path[] = "2.0.0"; }      
     458        if ( version_compare( $current_version, "2.0.0", "<" ) ) { $upgrade_path[] = "2.0.0"; }  
     459        if ( version_compare( $current_version, "2.0.4", "<" ) ) { $upgrade_path[] = "2.0.4"; }          
    459460    } 
    460461    // having determined upgrade path, assign new version number 
     
    474475        switch ($upgrade) { 
    475476        // only upgrade db on most recent version 
     477            case '2.0.4': 
     478                update_option('mc_ical_utc','true'); 
     479                break; 
    476480            case '2.0.0': 
    477481                mc_upgrade_db(); 
  • my-calendar/trunk/my-calendar-help.php

    r598242 r599338  
    4141</p> 
    4242<h4><?php _e('Additional Calendar Views (Upcoming events, today\'s events)','my-calendar'); ?></h4> 
    43 <p><code>[my_calendar_upcoming before="3" after="3" type="event" fallback="No events coming up!" category="General" author="1" template="{title} {date}" order="asc" skip="0"]</code></p> 
    44 <p> 
    45     <?php _e('This shortcode displays the output of the Upcoming Events widget. The <code>before</code> and <code>after</code> attributes should be numbers; the <code>type</code> attribute can be either "event" or "days", and the <code>category</code> and <code>author</code> attributes work the same way as on the main calendar shortcode. Templates work using the template codes listed below. <code>fallback</code> provides text in case there are no events meeting your criteria. Order provides a sort order for the events list &ndash; either ascending (<code>asc</code>) or descending (<code>desc</code>). <code>Skip</code> is the number of events to skip in the upcoming events.','my-calendar'); ?> 
     43<p><code>[my_calendar_upcoming before="3" after="3" type="event" fallback="No events coming up!" category="General" author="1" template="{title} {date}" order="asc" show_today="yes" skip="0"]</code></p> 
     44<p> 
     45    <?php _e('This shortcode displays the output of the Upcoming Events widget. The <code>before</code> and <code>after</code> attributes should be numbers; the <code>type</code> attribute can be either "event" or "days", and the <code>category</code> and <code>author</code> attributes work the same way as on the main calendar shortcode. Templates work using the template codes listed below. <code>fallback</code> provides text in case there are no events meeting your criteria. Order provides a sort order for the events list &ndash; either ascending (<code>asc</code>) or descending (<code>desc</code>). <code>show_today</code> is an indicator whether or not to include today\'s events in the list. <code>Skip</code> is the number of events to skip in the upcoming events.','my-calendar'); ?> 
    4646</p> 
    4747<p><code>[my_calendar_today category="" author="1" fallback="Nothing today!" template="{title} {date}"]</code></p> 
  • my-calendar/trunk/my-calendar-settings.php

    r598242 r599338  
    160160            $mc_show_rss = ( !empty($_POST['mc_show_rss']) && $_POST['mc_show_rss']=='on')?'true':'false'; 
    161161            $mc_show_ical = ( !empty($_POST['mc_show_ical']) && $_POST['mc_show_ical']=='on')?'true':'false'; 
     162            $mc_ical_utc = ( !empty($_POST['mc_ical_utc']) && $_POST['mc_ical_utc']=='on')?'true':'false'; 
    162163            $mc_show_print = ( !empty($_POST['mc_show_print']) && $_POST['mc_show_print']=='on')?'true':'false'; 
    163164            // just paste 'em together as a string. All that matters is whether any of them have changed. 
     
    166167        update_option('mc_show_rss',$mc_show_rss); 
    167168        update_option('mc_show_ical',$mc_show_ical); 
     169        update_option('mc_ical_utc',$mc_ical_utc); 
    168170        update_option('mc_show_print',$mc_show_print); 
    169171        if ( $prev_show != $curr_show ) { $update_text = " ".sprintf(__('Visit your <a href="%s">permalinks settings</a> and re-save them.','my-calendar'),admin_url('options-permalink.php')); } else { $update_text = ''; }  
     
    452454    </li> 
    453455    <li> 
    454     <input type="checkbox" id="mc_show_ical" name="mc_show_ical" <?php mc_is_checked('mc_show_ical','true'); ?> /> <label for="mc_show_ical"><?php _e('Show link to iCal format download.','my-calendar'); ?></label> <small><?php _e('iCal outputs events occurring in the current calendar month.','my-calendar'); ?></small> 
     456    <input type="checkbox" id="mc_show_ical" name="mc_show_ical" <?php mc_is_checked('mc_show_ical','true'); ?> /> <label for="mc_show_ical"><?php _e('Show link to iCal format download.','my-calendar'); ?></label> <small><?php _e('iCal outputs events occurring in the current calendar month.','my-calendar'); ?></small> <input type="checkbox" id="mc_ical_utc" name="mc_ical_utc" <?php mc_is_checked('mc_ical_utc','true'); ?> /> <label for="mc_ical_utc"><?php _e('iCal times are UTC','my-calendar'); ?></label> 
     457 
    455458    </li> 
    456459    <li> 
  • my-calendar/trunk/my-calendar-shortcodes.php

    r599053 r599338  
    5050                'fallback' => '' 
    5151            ), $atts)); 
    52     return my_calendar_todays_events($category, $author, $template, $fallback); 
     52    return my_calendar_todays_events($category, $template, $fallback, $author); 
    5353} 
    5454 
  • my-calendar/trunk/my-calendar-templates.php

    r598242 r599338  
    168168    $os = strtotime($event->occur_begin); 
    169169    $oe = strtotime($event->occur_end); 
    170     $dtstart = date("Ymd\THi00", (mktime(date('H',$os),date('i',$os), date('s',$os), date('m',$os),date('d',$os), date('Y',$os) ) - ($offset*60*60) ) );  
    171     $dtend = date("Ymd\THi00", (mktime(date('H',$oe),date('i',$oe), date('s',$oe), date('m',$oe),date('d',$oe), date('Y',$oe) ) - ($offset*60*60) ) ); 
    172     $details['ical_start'] = $dtstart."Z"; 
    173     $details['ical_end'] = $dtend."Z"; 
     170    $dtstart = ( get_option('mc_ical_utc')=='true')?date("Ymd\THi00", (mktime(date('H',$os),date('i',$os), date('s',$os), date('m',$os),date('d',$os), date('Y',$os) ) - ($offset*60*60) ) )."Z":date("Ymd\THi00", (mktime(date('H',$os),date('i',$os), date('s',$os), date('m',$os),date('d',$os), date('Y',$os) ) ) );  
     171    $dtend = ( get_option('mc_ical_utc')=='true')?date("Ymd\THi00", (mktime(date('H',$oe),date('i',$oe), date('s',$oe), date('m',$oe),date('d',$oe), date('Y',$oe) ) - ($offset*60*60) ) )."Z":date("Ymd\THi00", (mktime(date('H',$oe),date('i',$oe), date('s',$oe), date('m',$oe),date('d',$oe), date('Y',$oe) ) ) ); 
     172    $details['ical_start'] = $dtstart; 
     173    $details['ical_end'] = $dtend; 
    174174        $ical_link = mc_build_url( array('vcal'=>$dateid), array('month','dy','yr','ltype','loc','mcat','format'), get_option( 'mc_uri' ) ); 
    175175    $details['ical'] = $ical_link; 
  • my-calendar/trunk/my-calendar-widgets.php

    r598560 r599338  
    473473    $caching = ( get_option('mc_caching_enabled') == 'true' )?true:false; 
    474474    $todays_cache = ($caching)? get_transient('mc_todays_cache') :''; 
     475 
    475476if ( $caching && is_array($todays_cache) && @$todays_cache[$category] ) { return @$todays_cache[$category]; } 
    476477    global $wpdb, $default_template; 
    477478    $mcdb = $wpdb; 
    478      
    479       if ( get_option( 'mc_remote' ) == 'true' && function_exists('mc_remote_db') ) { $mcdb = mc_remote_db(); } 
     479    if ( get_option( 'mc_remote' ) == 'true' && function_exists('mc_remote_db') ) { $mcdb = mc_remote_db(); } 
    480480    $output = ''; 
    481481    $offset = (60*60*get_option('gmt_offset'));   
     
    485485    $template = ($template == 'default')?$defaults['today']['template']:$template; 
    486486    if ($template == '' ) { $template = "$default_template"; };  
     487 
    487488    $category = ($category == 'default')?$defaults['today']['category']:$category; 
    488489    $no_event_text = ($substitute == '')?$defaults['today']['text']:$substitute; 
     
    534535            } 
    535536        } 
     537 
    536538        if (count($events) != 0) { 
    537539            $return = $header.$output.$footer; 
  • my-calendar/trunk/my-calendar.php

    r599053 r599338  
    66Author: Joseph C Dolson 
    77Author URI: http://www.joedolson.com 
    8 Version: 2.0.3 
     8Version: 2.0.4 
    99*/ 
    1010/*  Copyright 2009-2012  Joe Dolson (email : joe@joedolson.com) 
     
    2525*/ 
    2626global $mc_version, $wpdb; 
    27 $mc_version = '2.0.3'; 
     27$mc_version = '2.0.4'; 
    2828 
    2929// Define the tables used in My Calendar 
  • my-calendar/trunk/readme.txt

    r599053 r599338  
    8989 
    9090== Changelog == 
     91 
     92= 2.0.4 = 
     93 
     94* Bug fix: template variable misassigned in the Today's Events shortcode. 
     95* Change: Added option to output iCal either in UTC or with times as entered. (Previously only UTC) 
    9196 
    9297= 2.0.3 = 
Note: See TracChangeset for help on using the changeset viewer.