Changeset 1758769
- Timestamp:
- 11/04/2017 07:37:45 PM (8 years ago)
- Location:
- ical-feeds
- Files:
-
- 2 edited
- 6 copied
-
tags/1.5.1 (copied) (copied from ical-feeds/trunk)
-
tags/1.5.1/ical-feeds.php (copied) (copied from ical-feeds/trunk/ical-feeds.php) (8 diffs)
-
tags/1.5.1/languages (copied) (copied from ical-feeds/trunk/languages)
-
tags/1.5.1/languages/icalfeeds-fr_FR.mo (copied) (copied from ical-feeds/trunk/languages/icalfeeds-fr_FR.mo)
-
tags/1.5.1/languages/icalfeeds-fr_FR.po (copied) (copied from ical-feeds/trunk/languages/icalfeeds-fr_FR.po)
-
tags/1.5.1/readme.txt (copied) (copied from ical-feeds/trunk/readme.txt) (2 diffs)
-
trunk/ical-feeds.php (modified) (8 diffs)
-
trunk/readme.txt (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
ical-feeds/tags/1.5.1/ical-feeds.php
r1754310 r1758769 6 6 Author: Maxime VALETTE 7 7 Author URI: http://maxime.sh 8 Version: 1.5 8 Version: 1.5.1 9 9 */ 10 10 … … 36 36 37 37 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; 38 40 if (!isset($options['icalfeeds_secret'])) $options['icalfeeds_secret'] = 'changeme'; 39 41 if (!isset($options['icalfeeds_senable'])) $options['icalfeeds_senable'] = 0; … … 52 54 $icalfeeds_minutes = 60; 53 55 } 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 } 54 68 55 69 if (isset($_POST['icalfeeds_secret'])) { … … 78 92 79 93 $options['icalfeeds_minutes'] = $icalfeeds_minutes; 94 $options['icalfeeds_start_hours'] = $icalfeeds_start_hours; 95 $options['icalfeeds_start_minutes'] = $icalfeeds_start_minutes; 80 96 $options['icalfeeds_secret'] = $icalfeeds_secret; 81 97 $options['icalfeeds_senable'] = $icalfeeds_senable; … … 127 143 echo '<h3><label for="icalfeeds_minutes">'.__('Time interval per post:', ICALFEEDS_TEXTDOMAIN).'</label></h3>'; 128 144 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>'; 129 149 130 150 echo '<h3><label for="icalfeeds_limit">'.__('Number of blog posts:', ICALFEEDS_TEXTDOMAIN).'</label></h3>'; … … 253 273 $options = get_option('icalfeeds'); 254 274 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; 255 277 if (!isset($options['icalfeeds_limit'])) $options['icalfeeds_limit'] = 50; 256 278 if (!isset($options['icalfeeds_future'])) $options['icalfeeds_future'] = 0; … … 370 392 $permalink = get_permalink(get_the_ID()); 371 393 $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' ); 373 396 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 374 406 if (null !== $post_end_date_field) { 375 407 $end_time = date( 'Ymd\THis', strtotime( get_post_meta( get_the_ID(), $post_end_date_field, true ) ) - ( get_option( 'gmt_offset' ) * 3600 ) ); … … 386 418 DTSTART$start_time 387 419 DTEND$end_time 420 ORGANIZER:$organizer 388 421 SUMMARY:$summary 389 422 URL;VALUE=URI:$permalink -
ical-feeds/tags/1.5.1/readme.txt
r1754310 r1758769 5 5 Requires at least: 3.0 6 6 Tested up to: 4.7.2 7 Stable tag: 1.5 7 Stable tag: 1.5.1 8 8 9 9 Generate a customizable iCal feed of your present and future blog posts. … … 22 22 23 23 == 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 24 30 25 31 = 1.5 = -
ical-feeds/trunk/ical-feeds.php
r1754310 r1758769 6 6 Author: Maxime VALETTE 7 7 Author URI: http://maxime.sh 8 Version: 1.5 8 Version: 1.5.1 9 9 */ 10 10 … … 36 36 37 37 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; 38 40 if (!isset($options['icalfeeds_secret'])) $options['icalfeeds_secret'] = 'changeme'; 39 41 if (!isset($options['icalfeeds_senable'])) $options['icalfeeds_senable'] = 0; … … 52 54 $icalfeeds_minutes = 60; 53 55 } 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 } 54 68 55 69 if (isset($_POST['icalfeeds_secret'])) { … … 78 92 79 93 $options['icalfeeds_minutes'] = $icalfeeds_minutes; 94 $options['icalfeeds_start_hours'] = $icalfeeds_start_hours; 95 $options['icalfeeds_start_minutes'] = $icalfeeds_start_minutes; 80 96 $options['icalfeeds_secret'] = $icalfeeds_secret; 81 97 $options['icalfeeds_senable'] = $icalfeeds_senable; … … 127 143 echo '<h3><label for="icalfeeds_minutes">'.__('Time interval per post:', ICALFEEDS_TEXTDOMAIN).'</label></h3>'; 128 144 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>'; 129 149 130 150 echo '<h3><label for="icalfeeds_limit">'.__('Number of blog posts:', ICALFEEDS_TEXTDOMAIN).'</label></h3>'; … … 253 273 $options = get_option('icalfeeds'); 254 274 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; 255 277 if (!isset($options['icalfeeds_limit'])) $options['icalfeeds_limit'] = 50; 256 278 if (!isset($options['icalfeeds_future'])) $options['icalfeeds_future'] = 0; … … 370 392 $permalink = get_permalink(get_the_ID()); 371 393 $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' ); 373 396 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 374 406 if (null !== $post_end_date_field) { 375 407 $end_time = date( 'Ymd\THis', strtotime( get_post_meta( get_the_ID(), $post_end_date_field, true ) ) - ( get_option( 'gmt_offset' ) * 3600 ) ); … … 386 418 DTSTART$start_time 387 419 DTEND$end_time 420 ORGANIZER:$organizer 388 421 SUMMARY:$summary 389 422 URL;VALUE=URI:$permalink -
ical-feeds/trunk/readme.txt
r1754310 r1758769 5 5 Requires at least: 3.0 6 6 Tested up to: 4.7.2 7 Stable tag: 1.5 7 Stable tag: 1.5.1 8 8 9 9 Generate a customizable iCal feed of your present and future blog posts. … … 22 22 23 23 == 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 24 30 25 31 = 1.5 =
Note: See TracChangeset
for help on using the changeset viewer.