Plugin Directory

Changeset 1758769


Ignore:
Timestamp:
11/04/2017 07:37:45 PM (8 years ago)
Author:
maximevalette
Message:

tagging new version

Location:
ical-feeds
Files:
2 edited
6 copied

Legend:

Unmodified
Added
Removed
  • ical-feeds/tags/1.5.1/ical-feeds.php

    r1754310 r1758769  
    66Author: Maxime VALETTE
    77Author URI: http://maxime.sh
    8 Version: 1.5
     8Version: 1.5.1
    99*/
    1010
     
    3636
    3737    if (!isset($options['icalfeeds_minutes'])) $options['icalfeeds_minutes'] = 60;
     38    if (!isset($options['icalfeeds_start_hours'])) $options['icalfeeds_start_hours'] = 0;
     39        if (!isset($options['icalfeeds_start_minutes'])) $options['icalfeeds_start_minutes'] = 0;
    3840    if (!isset($options['icalfeeds_secret'])) $options['icalfeeds_secret'] = 'changeme';
    3941    if (!isset($options['icalfeeds_senable'])) $options['icalfeeds_senable'] = 0;
     
    5254            $icalfeeds_minutes = 60;
    5355        }
     56       
     57    if (isset($_POST['icalfeeds_start_hours'])) {
     58            $icalfeeds_start_hours = (int) $_POST['icalfeeds_start_hours'];
     59        } else {
     60            $icalfeeds_start_hours = 0;
     61        }
     62 
     63        if (isset($_POST['icalfeeds_start_minutes'])) {
     64            $icalfeeds_start_minutes = (int) $_POST['icalfeeds_start_minutes'];
     65        } else {
     66            $icalfeeds_start_minutes = 0;
     67        }
    5468
    5569        if (isset($_POST['icalfeeds_secret'])) {
     
    7892
    7993        $options['icalfeeds_minutes'] = $icalfeeds_minutes;
     94        $options['icalfeeds_start_hours'] = $icalfeeds_start_hours;
     95            $options['icalfeeds_start_minutes'] = $icalfeeds_start_minutes;
    8096        $options['icalfeeds_secret']  = $icalfeeds_secret;
    8197        $options['icalfeeds_senable'] = $icalfeeds_senable;
     
    127143    echo '<h3><label for="icalfeeds_minutes">'.__('Time interval per post:', ICALFEEDS_TEXTDOMAIN).'</label></h3>';
    128144    echo '<p><input type="number" id="icalfeeds_minutes" name="icalfeeds_minutes" value="'.$options['icalfeeds_minutes'].'" style="width: 50px; text-align: center;" /> '.__('minutes', ICALFEEDS_TEXTDOMAIN).'</p>';
     145   
     146    echo '<h3><label for="icalfeeds_minutes">'.__('Start Time per post:', ICALFEEDS_TEXTDOMAIN).'</label></h3>';
     147    echo '<p><input type="number" id="icalfeeds_start_hours" name="icalfeeds_start_hours" value="'.$options['icalfeeds_start_hours'].'" style="width: 50px; text-align: center;" min="0" max="23" /> : <input type="number" id="icalfeeds_start_minutes" name="icalfeeds_start_minutes" value="'.$options['icalfeeds_start_minutes'].'" style="width: 50px; text-align: center;" min="0" max="59" /> '.__('24-hour military time', ICALFEEDS_TEXTDOMAIN).'</p>';
     148    echo '<p><i>leave 0:0 to use time defined by publish date or custom date field.</i></p>';
    129149
    130150    echo '<h3><label for="icalfeeds_limit">'.__('Number of blog posts:', ICALFEEDS_TEXTDOMAIN).'</label></h3>';
     
    253273    $options = get_option('icalfeeds');
    254274    if (!isset($options['icalfeeds_minutes'])) $options['icalfeeds_minutes'] = 60;
     275    if (!isset($options['icalfeeds_start_hours'])) $options['icalfeeds_start_hours'] = 0;
     276    if (!isset($options['icalfeeds_start_minutes'])) $options['icalfeeds_start_minutes'] = 0;
    255277    if (!isset($options['icalfeeds_limit'])) $options['icalfeeds_limit'] = 50;
    256278    if (!isset($options['icalfeeds_future'])) $options['icalfeeds_future'] = 0;
     
    370392        $permalink = get_permalink(get_the_ID());
    371393        $timezone = get_option('timezone_string');
    372         $guid = get_the_guid(get_the_ID());
     394        $guid = urlencode( get_the_guid(get_the_ID()) );
     395    $organizer = get_bloginfo( 'name' );
    373396       
     397       
     398    //Set Static Start & End Time
     399        if( $options['icalfeeds_start_hours'] > 0 || $options['icalfeeds_start_minutes'] > 0) {
     400            $start_time = date( 'Ymd\THis', strtotime( substr($start_time, 0, 8) .' '. $options['icalfeeds_start_hours'] .':'. $options['icalfeeds_start_minutes'] .':00' ) - ( get_option( 'gmt_offset' ) * 3600 ) );
     401            $end_time = date( 'Ymd\THis', strtotime( substr($end_time, 0, 8) .' '. $options['icalfeeds_start_hours'] .':'. $options['icalfeeds_start_minutes'] .':00' ) - ( get_option( 'gmt_offset' ) * 3600 )  + ($options['icalfeeds_minutes'] * 60) );
     402            $modified_time = date( 'Ymd\THis', strtotime( substr($modified_time, 0, 8) .' '. $options['icalfeeds_start_hours'] .':'. $options['icalfeeds_start_minutes'] .':00' ) - ( get_option( 'gmt_offset' ) * 3600 ) );
     403        }
     404       
     405    //Use Custom End date if available
    374406        if (null !== $post_end_date_field) {
    375407            $end_time = date( 'Ymd\THis', strtotime( get_post_meta( get_the_ID(), $post_end_date_field, true ) ) - ( get_option( 'gmt_offset' ) * 3600 ) );
     
    386418DTSTART$start_time
    387419DTEND$end_time
     420ORGANIZER:$organizer
    388421SUMMARY:$summary
    389422URL;VALUE=URI:$permalink
  • ical-feeds/tags/1.5.1/readme.txt

    r1754310 r1758769  
    55Requires at least: 3.0
    66Tested up to: 4.7.2
    7 Stable tag: 1.5
     7Stable tag: 1.5.1
    88
    99Generate a customizable iCal feed of your present and future blog posts.
     
    2222
    2323== Changelog ==
     24
     25= 1.5.1 =
     26
     27* NEW: Default Start Time per post setting
     28* ADDED: ORGANIZER field to iCal file for better validation
     29* FIX: encoded UID field in iCal file for better validation
    2430
    2531= 1.5 =
  • ical-feeds/trunk/ical-feeds.php

    r1754310 r1758769  
    66Author: Maxime VALETTE
    77Author URI: http://maxime.sh
    8 Version: 1.5
     8Version: 1.5.1
    99*/
    1010
     
    3636
    3737    if (!isset($options['icalfeeds_minutes'])) $options['icalfeeds_minutes'] = 60;
     38    if (!isset($options['icalfeeds_start_hours'])) $options['icalfeeds_start_hours'] = 0;
     39        if (!isset($options['icalfeeds_start_minutes'])) $options['icalfeeds_start_minutes'] = 0;
    3840    if (!isset($options['icalfeeds_secret'])) $options['icalfeeds_secret'] = 'changeme';
    3941    if (!isset($options['icalfeeds_senable'])) $options['icalfeeds_senable'] = 0;
     
    5254            $icalfeeds_minutes = 60;
    5355        }
     56       
     57    if (isset($_POST['icalfeeds_start_hours'])) {
     58            $icalfeeds_start_hours = (int) $_POST['icalfeeds_start_hours'];
     59        } else {
     60            $icalfeeds_start_hours = 0;
     61        }
     62 
     63        if (isset($_POST['icalfeeds_start_minutes'])) {
     64            $icalfeeds_start_minutes = (int) $_POST['icalfeeds_start_minutes'];
     65        } else {
     66            $icalfeeds_start_minutes = 0;
     67        }
    5468
    5569        if (isset($_POST['icalfeeds_secret'])) {
     
    7892
    7993        $options['icalfeeds_minutes'] = $icalfeeds_minutes;
     94        $options['icalfeeds_start_hours'] = $icalfeeds_start_hours;
     95            $options['icalfeeds_start_minutes'] = $icalfeeds_start_minutes;
    8096        $options['icalfeeds_secret']  = $icalfeeds_secret;
    8197        $options['icalfeeds_senable'] = $icalfeeds_senable;
     
    127143    echo '<h3><label for="icalfeeds_minutes">'.__('Time interval per post:', ICALFEEDS_TEXTDOMAIN).'</label></h3>';
    128144    echo '<p><input type="number" id="icalfeeds_minutes" name="icalfeeds_minutes" value="'.$options['icalfeeds_minutes'].'" style="width: 50px; text-align: center;" /> '.__('minutes', ICALFEEDS_TEXTDOMAIN).'</p>';
     145   
     146    echo '<h3><label for="icalfeeds_minutes">'.__('Start Time per post:', ICALFEEDS_TEXTDOMAIN).'</label></h3>';
     147    echo '<p><input type="number" id="icalfeeds_start_hours" name="icalfeeds_start_hours" value="'.$options['icalfeeds_start_hours'].'" style="width: 50px; text-align: center;" min="0" max="23" /> : <input type="number" id="icalfeeds_start_minutes" name="icalfeeds_start_minutes" value="'.$options['icalfeeds_start_minutes'].'" style="width: 50px; text-align: center;" min="0" max="59" /> '.__('24-hour military time', ICALFEEDS_TEXTDOMAIN).'</p>';
     148    echo '<p><i>leave 0:0 to use time defined by publish date or custom date field.</i></p>';
    129149
    130150    echo '<h3><label for="icalfeeds_limit">'.__('Number of blog posts:', ICALFEEDS_TEXTDOMAIN).'</label></h3>';
     
    253273    $options = get_option('icalfeeds');
    254274    if (!isset($options['icalfeeds_minutes'])) $options['icalfeeds_minutes'] = 60;
     275    if (!isset($options['icalfeeds_start_hours'])) $options['icalfeeds_start_hours'] = 0;
     276    if (!isset($options['icalfeeds_start_minutes'])) $options['icalfeeds_start_minutes'] = 0;
    255277    if (!isset($options['icalfeeds_limit'])) $options['icalfeeds_limit'] = 50;
    256278    if (!isset($options['icalfeeds_future'])) $options['icalfeeds_future'] = 0;
     
    370392        $permalink = get_permalink(get_the_ID());
    371393        $timezone = get_option('timezone_string');
    372         $guid = get_the_guid(get_the_ID());
     394        $guid = urlencode( get_the_guid(get_the_ID()) );
     395    $organizer = get_bloginfo( 'name' );
    373396       
     397       
     398    //Set Static Start & End Time
     399        if( $options['icalfeeds_start_hours'] > 0 || $options['icalfeeds_start_minutes'] > 0) {
     400            $start_time = date( 'Ymd\THis', strtotime( substr($start_time, 0, 8) .' '. $options['icalfeeds_start_hours'] .':'. $options['icalfeeds_start_minutes'] .':00' ) - ( get_option( 'gmt_offset' ) * 3600 ) );
     401            $end_time = date( 'Ymd\THis', strtotime( substr($end_time, 0, 8) .' '. $options['icalfeeds_start_hours'] .':'. $options['icalfeeds_start_minutes'] .':00' ) - ( get_option( 'gmt_offset' ) * 3600 )  + ($options['icalfeeds_minutes'] * 60) );
     402            $modified_time = date( 'Ymd\THis', strtotime( substr($modified_time, 0, 8) .' '. $options['icalfeeds_start_hours'] .':'. $options['icalfeeds_start_minutes'] .':00' ) - ( get_option( 'gmt_offset' ) * 3600 ) );
     403        }
     404       
     405    //Use Custom End date if available
    374406        if (null !== $post_end_date_field) {
    375407            $end_time = date( 'Ymd\THis', strtotime( get_post_meta( get_the_ID(), $post_end_date_field, true ) ) - ( get_option( 'gmt_offset' ) * 3600 ) );
     
    386418DTSTART$start_time
    387419DTEND$end_time
     420ORGANIZER:$organizer
    388421SUMMARY:$summary
    389422URL;VALUE=URI:$permalink
  • ical-feeds/trunk/readme.txt

    r1754310 r1758769  
    55Requires at least: 3.0
    66Tested up to: 4.7.2
    7 Stable tag: 1.5
     7Stable tag: 1.5.1
    88
    99Generate a customizable iCal feed of your present and future blog posts.
     
    2222
    2323== Changelog ==
     24
     25= 1.5.1 =
     26
     27* NEW: Default Start Time per post setting
     28* ADDED: ORGANIZER field to iCal file for better validation
     29* FIX: encoded UID field in iCal file for better validation
    2430
    2531= 1.5 =
Note: See TracChangeset for help on using the changeset viewer.