Changeset 1754310
- Timestamp:
- 10/28/2017 09:41:26 AM (8 years ago)
- Location:
- ical-feeds
- Files:
-
- 4 edited
- 6 copied
-
tags/1.5 (copied) (copied from ical-feeds/trunk)
-
tags/1.5/ical-feeds.php (copied) (copied from ical-feeds/trunk/ical-feeds.php) (11 diffs)
-
tags/1.5/languages (copied) (copied from ical-feeds/trunk/languages)
-
tags/1.5/languages/icalfeeds-fr_FR.mo (copied) (copied from ical-feeds/trunk/languages/icalfeeds-fr_FR.mo)
-
tags/1.5/languages/icalfeeds-fr_FR.po (copied) (copied from ical-feeds/trunk/languages/icalfeeds-fr_FR.po) (4 diffs)
-
tags/1.5/readme.txt (copied) (copied from ical-feeds/trunk/readme.txt) (2 diffs)
-
trunk/ical-feeds.php (modified) (11 diffs)
-
trunk/languages/icalfeeds-fr_FR.mo (modified) (previous)
-
trunk/languages/icalfeeds-fr_FR.po (modified) (4 diffs)
-
trunk/readme.txt (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
ical-feeds/tags/1.5/ical-feeds.php
r1734807 r1754310 6 6 Author: Maxime VALETTE 7 7 Author URI: http://maxime.sh 8 Version: 1. 4.28 Version: 1.5 9 9 */ 10 10 … … 39 39 if (!isset($options['icalfeeds_senable'])) $options['icalfeeds_senable'] = 0; 40 40 if (!isset($options['icalfeeds_limit'])) $options['icalfeeds_limit'] = 50; 41 if (!isset($options['icalfeeds_future'])) $options['icalfeeds_future'] = 0; 41 42 42 43 $updated = false; … … 68 69 } else { 69 70 $icalfeeds_limit = 50; 71 } 72 73 if (isset($_POST['icalfeeds_future'])) { 74 $icalfeeds_future = $_POST['icalfeeds_future']; 75 } else { 76 $icalfeeds_future = 0; 70 77 } 71 78 … … 74 81 $options['icalfeeds_senable'] = $icalfeeds_senable; 75 82 $options['icalfeeds_limit'] = $icalfeeds_limit; 83 $options['icalfeeds_future'] = $icalfeeds_future; 76 84 77 85 update_option('icalfeeds', $options); … … 112 120 echo '<p><input id="icalfeeds_senable" name="icalfeeds_senable" type="checkbox" value="1"'; 113 121 if ($options['icalfeeds_senable'] == 1) echo ' checked'; 114 echo '/> <label for="icalfeeds_senable">'.__('Enable a secret parameter to view future posts.', ICALFEEDS_TEXTDOMAIN).'</label></p>';122 echo '/> <label for="icalfeeds_senable">'.__('Enable a secret parameter to view ALL future posts.', ICALFEEDS_TEXTDOMAIN).'</label></p>'; 115 123 116 124 echo '<h3><label for="icalfeeds_secret">'.__('Secret parameter value:', ICALFEEDS_TEXTDOMAIN).'</label></h3>'; … … 123 131 echo '<p><input type="number" id="icalfeeds_limit" name="icalfeeds_limit" value="'.$options['icalfeeds_limit'].'" style="width: 50px; text-align: center;" /> '.__('blog posts', ICALFEEDS_TEXTDOMAIN).'</p>'; 124 132 133 echo '<h3><label for="icalfeeds_future">'.__('Number of future posts:', ICALFEEDS_TEXTDOMAIN).'</label></h3>'; 134 echo '<p><input type="number" id="icalfeeds_future" name="icalfeeds_future" value="'.$options['icalfeeds_future'].'" style="width: 50px; text-align: center;" /> '.__('future posts', ICALFEEDS_TEXTDOMAIN).'</p>'; 125 135 126 136 echo '<p class="submit" style="text-align: left">'; … … 240 250 global $wpdb; 241 251 252 //Set defaults if no values exist 242 253 $options = get_option('icalfeeds'); 243 254 if (!isset($options['icalfeeds_minutes'])) $options['icalfeeds_minutes'] = 60; 244 255 if (!isset($options['icalfeeds_limit'])) $options['icalfeeds_limit'] = 50; 245 246 256 if (!isset($options['icalfeeds_future'])) $options['icalfeeds_future'] = 0; 257 258 259 //Get Post Type 247 260 $post_type = 'post'; 248 261 if (isset($_GET['posttype'])) { … … 250 263 } 251 264 252 $post_date_field = 'pubDate'; 265 //Set how many future posts to display 266 $post_status = array( 'publish', 'future' ); 267 if ($_REQUEST['ical'] == $options['icalfeeds_secret']) { 268 269 $future = date('Ymd', strtotime('+3650 day')); //10 years out 270 271 } else { 272 273 $future = date('Ymd', strtotime('+'.$options['icalfeeds_future'].' day')); 274 275 } 276 277 // Is a custom meta_key field being used for date 253 278 if (isset($_GET['datefield'])) { 279 254 280 $post_date_field = $_GET['datefield']; 255 } 256 281 $post_order_by = array( 'meta_key' => $_GET['datefield'], 'meta_value' => $future, 'meta_compare' => '<=', 'orderby' => 'meta_value' ); 282 283 } else { 284 285 $post_date_field = 'pubDate'; 286 $post_order_by = array( 'before' => $future,'orderby' => 'post_date' ); 287 288 } 289 290 //Custom End Date field 257 291 if (isset($_GET['enddatefield'])) { 258 292 $post_end_date_field = $_GET['enddatefield']; … … 261 295 } 262 296 297 // Get category IDs 263 298 if (isset($_GET['category'])) { 264 299 … … 279 314 } 280 315 316 // Set limit on posts retrieved 281 317 $limit = $options['icalfeeds_limit']; 282 283 318 if (isset($_GET['limit']) && is_numeric($_GET['limit'])) { 284 319 $limit = $_GET['limit']; … … 286 321 287 322 288 if ($_REQUEST['ical'] == $options['icalfeeds_secret']) { 289 290 $postCond = "post_status = 'publish' OR post_status = 'future'"; 291 292 } else { 293 $futureEarlyAccessDate = date('Y-m-d', strtotime('+3 day')); 294 295 $postCond = "post_status = 'publish' OR post_status = 'future' AND post_date <= '${futureEarlyAccessDate}'"; 296 297 } 298 299 // Get posts 300 323 // Construct query arguement 301 324 if (isset($_GET['category'])) { 302 325 303 $posts = $wpdb->get_results("SELECT $wpdb->posts.ID, $wpdb->posts.post_content, UNIX_TIMESTAMP($wpdb->posts.post_date) AS post_date, $wpdb->posts.post_title FROM $wpdb->posts 304 LEFT JOIN $wpdb->term_relationships ON ($wpdb->posts.ID = $wpdb->term_relationships.object_id) 305 LEFT JOIN $wpdb->term_taxonomy ON ($wpdb->term_relationships.term_taxonomy_id = $wpdb->term_taxonomy.term_taxonomy_id) 306 WHERE (".$postCond.") AND $wpdb->posts.post_type = '$post_type' AND $wpdb->term_taxonomy.taxonomy = 'category' AND $wpdb->term_taxonomy.term_id IN (".implode(',', $categoryIds).") 307 ORDER BY post_date DESC LIMIT $limit"); 308 326 $args = array( 327 'post_type' => $post_type, 328 'post_status' => $post_status, 329 'posts_per_page' => $limit, 330 'cat' => implode(',', $categoryIds), 331 'order' => 'DESC', 332 ) + $post_order_by; 333 334 309 335 } else { 310 336 311 $posts = $wpdb->get_results("SELECT $wpdb->posts.ID, $wpdb->posts.post_content, UNIX_TIMESTAMP($wpdb->posts.post_date) AS post_date, $wpdb->posts.post_title 312 FROM $wpdb->posts 313 WHERE (".$postCond.") AND $wpdb->posts.post_type = '$post_type' 314 ORDER BY post_date DESC LIMIT $limit"); 315 316 } 317 337 $args = array( 338 'post_type' => $post_type, 339 'post_status' => $post_status, 340 'posts_per_page' => $limit, 341 'order' => 'DESC', 342 ) + $post_order_by; 343 344 } 345 346 // Get posts 347 $posts = new WP_Query( $args ); 348 318 349 $events = null; 319 350 320 foreach ($posts as $post) { 351 while ( $posts->have_posts() ) { 352 $posts->the_post(); 321 353 322 354 if ($post_date_field !== 'pubDate') { 323 $start_time = date( 'Ymd\THis', strtotime( get_post_meta( $post->ID, $post_date_field, true ) ) ); 324 $end_time = date( 'Ymd\THis', strtotime( get_post_meta( $post->ID, $post_date_field, true ) ) + ($options['icalfeeds_minutes'] * 60)); 355 356 $start_time = date( 'Ymd\THis', strtotime( get_post_meta( get_the_ID(), $post_date_field, true ) ) - ( get_option( 'gmt_offset' ) * 3600 ) ); 357 $end_time = date( 'Ymd\THis', strtotime( get_post_meta( get_the_ID(), $post_date_field, true ) ) - ( get_option( 'gmt_offset' ) * 3600 ) + ($options['icalfeeds_minutes'] * 60)); 358 $modified_time = date( 'Ymd\THis', strtotime( get_post_meta( get_the_ID(), $post_date_field, true ) ) - ( get_option( 'gmt_offset' ) * 3600 ) ); 359 325 360 } else { 326 $start_time = date( 'Ymd\THis', get_post_time( 'U', true, $post->ID ) ); 327 $end_time = date( 'Ymd\THis', get_post_time( 'U', true, $post->ID ) + ($options['icalfeeds_minutes'] * 60)); 361 362 $start_time = date( 'Ymd\THis', get_post_time( 'U', true, get_the_ID() ) ); 363 $end_time = date( 'Ymd\THis', get_post_time( 'U', true, get_the_ID() ) + ($options['icalfeeds_minutes'] * 60)); 364 $modified_time = date( 'Ymd\THis', get_post_modified_time( 'U', true, get_the_ID() ) ); 365 328 366 } 329 367 330 $modified_time = date( 'Ymd\THis', get_post_modified_time( 'U', true, $post->ID ) );331 $summary = strip_tags( $post->post_title);332 $permalink = get_permalink( $post->ID);368 //$modified_time = date( 'Ymd\THis', get_post_modified_time( 'U', true, $post->ID ) ); 369 $summary = strip_tags( html_entity_decode( get_the_title() ) ); 370 $permalink = get_permalink(get_the_ID()); 333 371 $timezone = get_option('timezone_string'); 334 $guid = get_the_guid( $post->ID);335 336 if (null !== $post_end_date_field) {337 $end_time = date( 'Ymd\THis', strtotime( get_post_meta( $post->ID, $post_end_date_field, true ) ));372 $guid = get_the_guid(get_the_ID()); 373 374 if (null !== $post_end_date_field) { 375 $end_time = date( 'Ymd\THis', strtotime( get_post_meta( get_the_ID(), $post_end_date_field, true ) ) - ( get_option( 'gmt_offset' ) * 3600 ) ); 338 376 } 339 377 -
ical-feeds/tags/1.5/languages/icalfeeds-fr_FR.po
r951761 r1754310 2 2 msgstr "" 3 3 "Project-Id-Version: iCal Feeds Plugin\n" 4 "POT-Creation-Date: 201 4-07-20 10:16+0100\n"5 "PO-Revision-Date: 201 4-07-20 10:18+0100\n"4 "POT-Creation-Date: 2017-10-28 11:33+0100\n" 5 "PO-Revision-Date: 2017-10-28 11:36+0100\n" 6 6 "Last-Translator: Maxime VALETTE <[email protected]>\n" 7 7 "Language-Team: Maxime VALETTE <[email protected]>\n" … … 25 25 msgstr "Flux iCal" 26 26 27 #: /Users/maxime/Sites/wordpress/wp-content/plugins/ical-feeds/ical-feeds.php: 8027 #: /Users/maxime/Sites/wordpress/wp-content/plugins/ical-feeds/ical-feeds.php:96 28 28 msgid "Configuration updated." 29 29 msgstr "Configuration mise à jour." 30 30 31 #: /Users/maxime/Sites/wordpress/wp-content/plugins/ical-feeds/ical-feeds.php: 9031 #: /Users/maxime/Sites/wordpress/wp-content/plugins/ical-feeds/ical-feeds.php:106 32 32 msgid "You have to define your current timezone (specify a city) in" 33 33 msgstr "Vous devez définir votre fuseau horaire (en spécifiant une ville) dans" 34 34 35 #: /Users/maxime/Sites/wordpress/wp-content/plugins/ical-feeds/ical-feeds.php: 9135 #: /Users/maxime/Sites/wordpress/wp-content/plugins/ical-feeds/ical-feeds.php:107 36 36 msgid "Settings > General" 37 37 msgstr "Réglages > Général" 38 38 39 #: /Users/maxime/Sites/wordpress/wp-content/plugins/ical-feeds/ical-feeds.php: 9639 #: /Users/maxime/Sites/wordpress/wp-content/plugins/ical-feeds/ical-feeds.php:112 40 40 msgid "iCal Feeds Configuration" 41 41 msgstr "Configuration de iCal Feeds" 42 42 43 #: /Users/maxime/Sites/wordpress/wp-content/plugins/ical-feeds/ical-feeds.php:1 0243 #: /Users/maxime/Sites/wordpress/wp-content/plugins/ical-feeds/ical-feeds.php:118 44 44 msgid "Advanced Options" 45 45 msgstr "Options avancées" 46 46 47 #: /Users/maxime/Sites/wordpress/wp-content/plugins/ical-feeds/ical-feeds.php:1 0648 msgid "Enable a secret parameter to view future posts."49 msgstr "Activer un paramètre secret pour voir les billets programmés."47 #: /Users/maxime/Sites/wordpress/wp-content/plugins/ical-feeds/ical-feeds.php:122 48 msgid "Enable a secret parameter to view ALL future posts." 49 msgstr "Activer un paramètre secret pour voir tous les billets programmés." 50 50 51 #: /Users/maxime/Sites/wordpress/wp-content/plugins/ical-feeds/ical-feeds.php:1 0851 #: /Users/maxime/Sites/wordpress/wp-content/plugins/ical-feeds/ical-feeds.php:124 52 52 msgid "Secret parameter value:" 53 53 msgstr "Valeur du paramètre secret :" 54 54 55 #: /Users/maxime/Sites/wordpress/wp-content/plugins/ical-feeds/ical-feeds.php:1 1155 #: /Users/maxime/Sites/wordpress/wp-content/plugins/ical-feeds/ical-feeds.php:127 56 56 msgid "Time interval per post:" 57 57 msgstr "Intervalle de temps par article :" 58 58 59 #: /Users/maxime/Sites/wordpress/wp-content/plugins/ical-feeds/ical-feeds.php:1 1259 #: /Users/maxime/Sites/wordpress/wp-content/plugins/ical-feeds/ical-feeds.php:128 60 60 msgid "minutes" 61 61 msgstr "minutes" 62 62 63 #: /Users/maxime/Sites/wordpress/wp-content/plugins/ical-feeds/ical-feeds.php:116 63 #: /Users/maxime/Sites/wordpress/wp-content/plugins/ical-feeds/ical-feeds.php:130 64 msgid "Number of blog posts:" 65 msgstr "Nombre de billets :" 66 67 #: /Users/maxime/Sites/wordpress/wp-content/plugins/ical-feeds/ical-feeds.php:131 68 msgid "blog posts" 69 msgstr "billets" 70 71 #: /Users/maxime/Sites/wordpress/wp-content/plugins/ical-feeds/ical-feeds.php:133 72 msgid "Number of future posts:" 73 msgstr "Nombre de billets dans le futur :" 74 75 #: /Users/maxime/Sites/wordpress/wp-content/plugins/ical-feeds/ical-feeds.php:134 76 msgid "future posts" 77 msgstr "billets futurs" 78 79 #: /Users/maxime/Sites/wordpress/wp-content/plugins/ical-feeds/ical-feeds.php:138 64 80 msgid "Save" 65 81 msgstr "Sauver" 66 82 67 #: /Users/maxime/Sites/wordpress/wp-content/plugins/ical-feeds/ical-feeds.php:1 1883 #: /Users/maxime/Sites/wordpress/wp-content/plugins/ical-feeds/ical-feeds.php:140 68 84 msgid "Main iCal feeds" 69 85 msgstr "Flux iCal principaux" 70 86 71 #: /Users/maxime/Sites/wordpress/wp-content/plugins/ical-feeds/ical-feeds.php:1 2087 #: /Users/maxime/Sites/wordpress/wp-content/plugins/ical-feeds/ical-feeds.php:142 72 88 msgid "You can use the below addresses to add in your iCal software:" 73 89 msgstr "" … … 75 91 "logiciel iCal :" 76 92 77 #: /Users/maxime/Sites/wordpress/wp-content/plugins/ical-feeds/ical-feeds.php:1 2493 #: /Users/maxime/Sites/wordpress/wp-content/plugins/ical-feeds/ical-feeds.php:146 78 94 msgid "Public iCal feed" 79 95 msgstr "Flux iCal public" 80 96 81 #: /Users/maxime/Sites/wordpress/wp-content/plugins/ical-feeds/ical-feeds.php:1 2797 #: /Users/maxime/Sites/wordpress/wp-content/plugins/ical-feeds/ical-feeds.php:149 82 98 msgid "Private iCal feed" 83 99 msgstr "Flux iCal privé" 84 100 85 #: /Users/maxime/Sites/wordpress/wp-content/plugins/ical-feeds/ical-feeds.php:1 32101 #: /Users/maxime/Sites/wordpress/wp-content/plugins/ical-feeds/ical-feeds.php:154 86 102 msgid "Categories iCal feeds" 87 103 msgstr "Flux iCal des catégories" 88 104 89 #: /Users/maxime/Sites/wordpress/wp-content/plugins/ical-feeds/ical-feeds.php:140 105 #: /Users/maxime/Sites/wordpress/wp-content/plugins/ical-feeds/ical-feeds.php:162 106 #: /Users/maxime/Sites/wordpress/wp-content/plugins/ical-feeds/ical-feeds.php:199 90 107 msgid "Public iCal feed for" 91 108 msgstr "Flux iCal public pour" 92 109 93 #: /Users/maxime/Sites/wordpress/wp-content/plugins/ical-feeds/ical-feeds.php:1 46110 #: /Users/maxime/Sites/wordpress/wp-content/plugins/ical-feeds/ical-feeds.php:168 94 111 msgid "Multiple categories iCal feeds" 95 112 msgstr "Flux iCal de plusieurs catégories" 96 113 97 #: /Users/maxime/Sites/wordpress/wp-content/plugins/ical-feeds/ical-feeds.php:1 48114 #: /Users/maxime/Sites/wordpress/wp-content/plugins/ical-feeds/ical-feeds.php:170 98 115 msgid "" 99 116 "You can add multiple categories in only one URL. Just check the categories " … … 103 120 "catégories que vous souhaitez ci-dessous :" 104 121 105 #: /Users/maxime/Sites/wordpress/wp-content/plugins/ical-feeds/ical-feeds.php:1 60122 #: /Users/maxime/Sites/wordpress/wp-content/plugins/ical-feeds/ical-feeds.php:182 106 123 msgid "URL:" 107 124 msgstr "URL :" 108 125 109 #~ msgid "iCal Posts" 110 #~ msgstr "iCal Posts" 126 #: /Users/maxime/Sites/wordpress/wp-content/plugins/ical-feeds/ical-feeds.php:193 127 msgid "Post Type iCal feeds" 128 msgstr "Flux iCal pour le type de billet" 129 130 #: /Users/maxime/Sites/wordpress/wp-content/plugins/ical-feeds/ical-feeds.php:207 131 msgid "Custom Date iCal feed" 132 msgstr "Flux iCal pour la date personnalisée" 133 134 #: /Users/maxime/Sites/wordpress/wp-content/plugins/ical-feeds/ical-feeds.php:209 135 msgid "" 136 "You can use a custom date field instead of the default publish date. The " 137 "Meta Key must exist in the Post Meta table." 138 msgstr "" 139 "Vous pouvez utiliser un champ de date personnalisé à la place de la date de " 140 "publication par défaut. La clé meta doit exister dans la table Post Meta." 141 142 #: /Users/maxime/Sites/wordpress/wp-content/plugins/ical-feeds/ical-feeds.php:213 143 msgid "You can also use a custom end date field width enddatefield." 144 msgstr "" 145 "Vous pouvez également utiliser un champ de date de fin personnalisé avec " 146 "enddatefield." -
ical-feeds/tags/1.5/readme.txt
r1750579 r1754310 5 5 Requires at least: 3.0 6 6 Tested up to: 4.7.2 7 Stable tag: 1. 4.27 Stable tag: 1.5 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 = 26 27 * New number of Future Posts setting 28 * Replaced get_results with Wp_Query 29 * Better implementation of the custom date field to filter results returned 30 * Timezone support for the custom date field 31 * Reorganized code & Added comments 32 33 Thanks to @contemplate (http://contemplatedesign.com) for this new version! 24 34 25 35 = 1.4.2 = -
ical-feeds/trunk/ical-feeds.php
r1734807 r1754310 6 6 Author: Maxime VALETTE 7 7 Author URI: http://maxime.sh 8 Version: 1. 4.28 Version: 1.5 9 9 */ 10 10 … … 39 39 if (!isset($options['icalfeeds_senable'])) $options['icalfeeds_senable'] = 0; 40 40 if (!isset($options['icalfeeds_limit'])) $options['icalfeeds_limit'] = 50; 41 if (!isset($options['icalfeeds_future'])) $options['icalfeeds_future'] = 0; 41 42 42 43 $updated = false; … … 68 69 } else { 69 70 $icalfeeds_limit = 50; 71 } 72 73 if (isset($_POST['icalfeeds_future'])) { 74 $icalfeeds_future = $_POST['icalfeeds_future']; 75 } else { 76 $icalfeeds_future = 0; 70 77 } 71 78 … … 74 81 $options['icalfeeds_senable'] = $icalfeeds_senable; 75 82 $options['icalfeeds_limit'] = $icalfeeds_limit; 83 $options['icalfeeds_future'] = $icalfeeds_future; 76 84 77 85 update_option('icalfeeds', $options); … … 112 120 echo '<p><input id="icalfeeds_senable" name="icalfeeds_senable" type="checkbox" value="1"'; 113 121 if ($options['icalfeeds_senable'] == 1) echo ' checked'; 114 echo '/> <label for="icalfeeds_senable">'.__('Enable a secret parameter to view future posts.', ICALFEEDS_TEXTDOMAIN).'</label></p>';122 echo '/> <label for="icalfeeds_senable">'.__('Enable a secret parameter to view ALL future posts.', ICALFEEDS_TEXTDOMAIN).'</label></p>'; 115 123 116 124 echo '<h3><label for="icalfeeds_secret">'.__('Secret parameter value:', ICALFEEDS_TEXTDOMAIN).'</label></h3>'; … … 123 131 echo '<p><input type="number" id="icalfeeds_limit" name="icalfeeds_limit" value="'.$options['icalfeeds_limit'].'" style="width: 50px; text-align: center;" /> '.__('blog posts', ICALFEEDS_TEXTDOMAIN).'</p>'; 124 132 133 echo '<h3><label for="icalfeeds_future">'.__('Number of future posts:', ICALFEEDS_TEXTDOMAIN).'</label></h3>'; 134 echo '<p><input type="number" id="icalfeeds_future" name="icalfeeds_future" value="'.$options['icalfeeds_future'].'" style="width: 50px; text-align: center;" /> '.__('future posts', ICALFEEDS_TEXTDOMAIN).'</p>'; 125 135 126 136 echo '<p class="submit" style="text-align: left">'; … … 240 250 global $wpdb; 241 251 252 //Set defaults if no values exist 242 253 $options = get_option('icalfeeds'); 243 254 if (!isset($options['icalfeeds_minutes'])) $options['icalfeeds_minutes'] = 60; 244 255 if (!isset($options['icalfeeds_limit'])) $options['icalfeeds_limit'] = 50; 245 246 256 if (!isset($options['icalfeeds_future'])) $options['icalfeeds_future'] = 0; 257 258 259 //Get Post Type 247 260 $post_type = 'post'; 248 261 if (isset($_GET['posttype'])) { … … 250 263 } 251 264 252 $post_date_field = 'pubDate'; 265 //Set how many future posts to display 266 $post_status = array( 'publish', 'future' ); 267 if ($_REQUEST['ical'] == $options['icalfeeds_secret']) { 268 269 $future = date('Ymd', strtotime('+3650 day')); //10 years out 270 271 } else { 272 273 $future = date('Ymd', strtotime('+'.$options['icalfeeds_future'].' day')); 274 275 } 276 277 // Is a custom meta_key field being used for date 253 278 if (isset($_GET['datefield'])) { 279 254 280 $post_date_field = $_GET['datefield']; 255 } 256 281 $post_order_by = array( 'meta_key' => $_GET['datefield'], 'meta_value' => $future, 'meta_compare' => '<=', 'orderby' => 'meta_value' ); 282 283 } else { 284 285 $post_date_field = 'pubDate'; 286 $post_order_by = array( 'before' => $future,'orderby' => 'post_date' ); 287 288 } 289 290 //Custom End Date field 257 291 if (isset($_GET['enddatefield'])) { 258 292 $post_end_date_field = $_GET['enddatefield']; … … 261 295 } 262 296 297 // Get category IDs 263 298 if (isset($_GET['category'])) { 264 299 … … 279 314 } 280 315 316 // Set limit on posts retrieved 281 317 $limit = $options['icalfeeds_limit']; 282 283 318 if (isset($_GET['limit']) && is_numeric($_GET['limit'])) { 284 319 $limit = $_GET['limit']; … … 286 321 287 322 288 if ($_REQUEST['ical'] == $options['icalfeeds_secret']) { 289 290 $postCond = "post_status = 'publish' OR post_status = 'future'"; 291 292 } else { 293 $futureEarlyAccessDate = date('Y-m-d', strtotime('+3 day')); 294 295 $postCond = "post_status = 'publish' OR post_status = 'future' AND post_date <= '${futureEarlyAccessDate}'"; 296 297 } 298 299 // Get posts 300 323 // Construct query arguement 301 324 if (isset($_GET['category'])) { 302 325 303 $posts = $wpdb->get_results("SELECT $wpdb->posts.ID, $wpdb->posts.post_content, UNIX_TIMESTAMP($wpdb->posts.post_date) AS post_date, $wpdb->posts.post_title FROM $wpdb->posts 304 LEFT JOIN $wpdb->term_relationships ON ($wpdb->posts.ID = $wpdb->term_relationships.object_id) 305 LEFT JOIN $wpdb->term_taxonomy ON ($wpdb->term_relationships.term_taxonomy_id = $wpdb->term_taxonomy.term_taxonomy_id) 306 WHERE (".$postCond.") AND $wpdb->posts.post_type = '$post_type' AND $wpdb->term_taxonomy.taxonomy = 'category' AND $wpdb->term_taxonomy.term_id IN (".implode(',', $categoryIds).") 307 ORDER BY post_date DESC LIMIT $limit"); 308 326 $args = array( 327 'post_type' => $post_type, 328 'post_status' => $post_status, 329 'posts_per_page' => $limit, 330 'cat' => implode(',', $categoryIds), 331 'order' => 'DESC', 332 ) + $post_order_by; 333 334 309 335 } else { 310 336 311 $posts = $wpdb->get_results("SELECT $wpdb->posts.ID, $wpdb->posts.post_content, UNIX_TIMESTAMP($wpdb->posts.post_date) AS post_date, $wpdb->posts.post_title 312 FROM $wpdb->posts 313 WHERE (".$postCond.") AND $wpdb->posts.post_type = '$post_type' 314 ORDER BY post_date DESC LIMIT $limit"); 315 316 } 317 337 $args = array( 338 'post_type' => $post_type, 339 'post_status' => $post_status, 340 'posts_per_page' => $limit, 341 'order' => 'DESC', 342 ) + $post_order_by; 343 344 } 345 346 // Get posts 347 $posts = new WP_Query( $args ); 348 318 349 $events = null; 319 350 320 foreach ($posts as $post) { 351 while ( $posts->have_posts() ) { 352 $posts->the_post(); 321 353 322 354 if ($post_date_field !== 'pubDate') { 323 $start_time = date( 'Ymd\THis', strtotime( get_post_meta( $post->ID, $post_date_field, true ) ) ); 324 $end_time = date( 'Ymd\THis', strtotime( get_post_meta( $post->ID, $post_date_field, true ) ) + ($options['icalfeeds_minutes'] * 60)); 355 356 $start_time = date( 'Ymd\THis', strtotime( get_post_meta( get_the_ID(), $post_date_field, true ) ) - ( get_option( 'gmt_offset' ) * 3600 ) ); 357 $end_time = date( 'Ymd\THis', strtotime( get_post_meta( get_the_ID(), $post_date_field, true ) ) - ( get_option( 'gmt_offset' ) * 3600 ) + ($options['icalfeeds_minutes'] * 60)); 358 $modified_time = date( 'Ymd\THis', strtotime( get_post_meta( get_the_ID(), $post_date_field, true ) ) - ( get_option( 'gmt_offset' ) * 3600 ) ); 359 325 360 } else { 326 $start_time = date( 'Ymd\THis', get_post_time( 'U', true, $post->ID ) ); 327 $end_time = date( 'Ymd\THis', get_post_time( 'U', true, $post->ID ) + ($options['icalfeeds_minutes'] * 60)); 361 362 $start_time = date( 'Ymd\THis', get_post_time( 'U', true, get_the_ID() ) ); 363 $end_time = date( 'Ymd\THis', get_post_time( 'U', true, get_the_ID() ) + ($options['icalfeeds_minutes'] * 60)); 364 $modified_time = date( 'Ymd\THis', get_post_modified_time( 'U', true, get_the_ID() ) ); 365 328 366 } 329 367 330 $modified_time = date( 'Ymd\THis', get_post_modified_time( 'U', true, $post->ID ) );331 $summary = strip_tags( $post->post_title);332 $permalink = get_permalink( $post->ID);368 //$modified_time = date( 'Ymd\THis', get_post_modified_time( 'U', true, $post->ID ) ); 369 $summary = strip_tags( html_entity_decode( get_the_title() ) ); 370 $permalink = get_permalink(get_the_ID()); 333 371 $timezone = get_option('timezone_string'); 334 $guid = get_the_guid( $post->ID);335 336 if (null !== $post_end_date_field) {337 $end_time = date( 'Ymd\THis', strtotime( get_post_meta( $post->ID, $post_end_date_field, true ) ));372 $guid = get_the_guid(get_the_ID()); 373 374 if (null !== $post_end_date_field) { 375 $end_time = date( 'Ymd\THis', strtotime( get_post_meta( get_the_ID(), $post_end_date_field, true ) ) - ( get_option( 'gmt_offset' ) * 3600 ) ); 338 376 } 339 377 -
ical-feeds/trunk/languages/icalfeeds-fr_FR.po
r951761 r1754310 2 2 msgstr "" 3 3 "Project-Id-Version: iCal Feeds Plugin\n" 4 "POT-Creation-Date: 201 4-07-20 10:16+0100\n"5 "PO-Revision-Date: 201 4-07-20 10:18+0100\n"4 "POT-Creation-Date: 2017-10-28 11:33+0100\n" 5 "PO-Revision-Date: 2017-10-28 11:36+0100\n" 6 6 "Last-Translator: Maxime VALETTE <[email protected]>\n" 7 7 "Language-Team: Maxime VALETTE <[email protected]>\n" … … 25 25 msgstr "Flux iCal" 26 26 27 #: /Users/maxime/Sites/wordpress/wp-content/plugins/ical-feeds/ical-feeds.php: 8027 #: /Users/maxime/Sites/wordpress/wp-content/plugins/ical-feeds/ical-feeds.php:96 28 28 msgid "Configuration updated." 29 29 msgstr "Configuration mise à jour." 30 30 31 #: /Users/maxime/Sites/wordpress/wp-content/plugins/ical-feeds/ical-feeds.php: 9031 #: /Users/maxime/Sites/wordpress/wp-content/plugins/ical-feeds/ical-feeds.php:106 32 32 msgid "You have to define your current timezone (specify a city) in" 33 33 msgstr "Vous devez définir votre fuseau horaire (en spécifiant une ville) dans" 34 34 35 #: /Users/maxime/Sites/wordpress/wp-content/plugins/ical-feeds/ical-feeds.php: 9135 #: /Users/maxime/Sites/wordpress/wp-content/plugins/ical-feeds/ical-feeds.php:107 36 36 msgid "Settings > General" 37 37 msgstr "Réglages > Général" 38 38 39 #: /Users/maxime/Sites/wordpress/wp-content/plugins/ical-feeds/ical-feeds.php: 9639 #: /Users/maxime/Sites/wordpress/wp-content/plugins/ical-feeds/ical-feeds.php:112 40 40 msgid "iCal Feeds Configuration" 41 41 msgstr "Configuration de iCal Feeds" 42 42 43 #: /Users/maxime/Sites/wordpress/wp-content/plugins/ical-feeds/ical-feeds.php:1 0243 #: /Users/maxime/Sites/wordpress/wp-content/plugins/ical-feeds/ical-feeds.php:118 44 44 msgid "Advanced Options" 45 45 msgstr "Options avancées" 46 46 47 #: /Users/maxime/Sites/wordpress/wp-content/plugins/ical-feeds/ical-feeds.php:1 0648 msgid "Enable a secret parameter to view future posts."49 msgstr "Activer un paramètre secret pour voir les billets programmés."47 #: /Users/maxime/Sites/wordpress/wp-content/plugins/ical-feeds/ical-feeds.php:122 48 msgid "Enable a secret parameter to view ALL future posts." 49 msgstr "Activer un paramètre secret pour voir tous les billets programmés." 50 50 51 #: /Users/maxime/Sites/wordpress/wp-content/plugins/ical-feeds/ical-feeds.php:1 0851 #: /Users/maxime/Sites/wordpress/wp-content/plugins/ical-feeds/ical-feeds.php:124 52 52 msgid "Secret parameter value:" 53 53 msgstr "Valeur du paramètre secret :" 54 54 55 #: /Users/maxime/Sites/wordpress/wp-content/plugins/ical-feeds/ical-feeds.php:1 1155 #: /Users/maxime/Sites/wordpress/wp-content/plugins/ical-feeds/ical-feeds.php:127 56 56 msgid "Time interval per post:" 57 57 msgstr "Intervalle de temps par article :" 58 58 59 #: /Users/maxime/Sites/wordpress/wp-content/plugins/ical-feeds/ical-feeds.php:1 1259 #: /Users/maxime/Sites/wordpress/wp-content/plugins/ical-feeds/ical-feeds.php:128 60 60 msgid "minutes" 61 61 msgstr "minutes" 62 62 63 #: /Users/maxime/Sites/wordpress/wp-content/plugins/ical-feeds/ical-feeds.php:116 63 #: /Users/maxime/Sites/wordpress/wp-content/plugins/ical-feeds/ical-feeds.php:130 64 msgid "Number of blog posts:" 65 msgstr "Nombre de billets :" 66 67 #: /Users/maxime/Sites/wordpress/wp-content/plugins/ical-feeds/ical-feeds.php:131 68 msgid "blog posts" 69 msgstr "billets" 70 71 #: /Users/maxime/Sites/wordpress/wp-content/plugins/ical-feeds/ical-feeds.php:133 72 msgid "Number of future posts:" 73 msgstr "Nombre de billets dans le futur :" 74 75 #: /Users/maxime/Sites/wordpress/wp-content/plugins/ical-feeds/ical-feeds.php:134 76 msgid "future posts" 77 msgstr "billets futurs" 78 79 #: /Users/maxime/Sites/wordpress/wp-content/plugins/ical-feeds/ical-feeds.php:138 64 80 msgid "Save" 65 81 msgstr "Sauver" 66 82 67 #: /Users/maxime/Sites/wordpress/wp-content/plugins/ical-feeds/ical-feeds.php:1 1883 #: /Users/maxime/Sites/wordpress/wp-content/plugins/ical-feeds/ical-feeds.php:140 68 84 msgid "Main iCal feeds" 69 85 msgstr "Flux iCal principaux" 70 86 71 #: /Users/maxime/Sites/wordpress/wp-content/plugins/ical-feeds/ical-feeds.php:1 2087 #: /Users/maxime/Sites/wordpress/wp-content/plugins/ical-feeds/ical-feeds.php:142 72 88 msgid "You can use the below addresses to add in your iCal software:" 73 89 msgstr "" … … 75 91 "logiciel iCal :" 76 92 77 #: /Users/maxime/Sites/wordpress/wp-content/plugins/ical-feeds/ical-feeds.php:1 2493 #: /Users/maxime/Sites/wordpress/wp-content/plugins/ical-feeds/ical-feeds.php:146 78 94 msgid "Public iCal feed" 79 95 msgstr "Flux iCal public" 80 96 81 #: /Users/maxime/Sites/wordpress/wp-content/plugins/ical-feeds/ical-feeds.php:1 2797 #: /Users/maxime/Sites/wordpress/wp-content/plugins/ical-feeds/ical-feeds.php:149 82 98 msgid "Private iCal feed" 83 99 msgstr "Flux iCal privé" 84 100 85 #: /Users/maxime/Sites/wordpress/wp-content/plugins/ical-feeds/ical-feeds.php:1 32101 #: /Users/maxime/Sites/wordpress/wp-content/plugins/ical-feeds/ical-feeds.php:154 86 102 msgid "Categories iCal feeds" 87 103 msgstr "Flux iCal des catégories" 88 104 89 #: /Users/maxime/Sites/wordpress/wp-content/plugins/ical-feeds/ical-feeds.php:140 105 #: /Users/maxime/Sites/wordpress/wp-content/plugins/ical-feeds/ical-feeds.php:162 106 #: /Users/maxime/Sites/wordpress/wp-content/plugins/ical-feeds/ical-feeds.php:199 90 107 msgid "Public iCal feed for" 91 108 msgstr "Flux iCal public pour" 92 109 93 #: /Users/maxime/Sites/wordpress/wp-content/plugins/ical-feeds/ical-feeds.php:1 46110 #: /Users/maxime/Sites/wordpress/wp-content/plugins/ical-feeds/ical-feeds.php:168 94 111 msgid "Multiple categories iCal feeds" 95 112 msgstr "Flux iCal de plusieurs catégories" 96 113 97 #: /Users/maxime/Sites/wordpress/wp-content/plugins/ical-feeds/ical-feeds.php:1 48114 #: /Users/maxime/Sites/wordpress/wp-content/plugins/ical-feeds/ical-feeds.php:170 98 115 msgid "" 99 116 "You can add multiple categories in only one URL. Just check the categories " … … 103 120 "catégories que vous souhaitez ci-dessous :" 104 121 105 #: /Users/maxime/Sites/wordpress/wp-content/plugins/ical-feeds/ical-feeds.php:1 60122 #: /Users/maxime/Sites/wordpress/wp-content/plugins/ical-feeds/ical-feeds.php:182 106 123 msgid "URL:" 107 124 msgstr "URL :" 108 125 109 #~ msgid "iCal Posts" 110 #~ msgstr "iCal Posts" 126 #: /Users/maxime/Sites/wordpress/wp-content/plugins/ical-feeds/ical-feeds.php:193 127 msgid "Post Type iCal feeds" 128 msgstr "Flux iCal pour le type de billet" 129 130 #: /Users/maxime/Sites/wordpress/wp-content/plugins/ical-feeds/ical-feeds.php:207 131 msgid "Custom Date iCal feed" 132 msgstr "Flux iCal pour la date personnalisée" 133 134 #: /Users/maxime/Sites/wordpress/wp-content/plugins/ical-feeds/ical-feeds.php:209 135 msgid "" 136 "You can use a custom date field instead of the default publish date. The " 137 "Meta Key must exist in the Post Meta table." 138 msgstr "" 139 "Vous pouvez utiliser un champ de date personnalisé à la place de la date de " 140 "publication par défaut. La clé meta doit exister dans la table Post Meta." 141 142 #: /Users/maxime/Sites/wordpress/wp-content/plugins/ical-feeds/ical-feeds.php:213 143 msgid "You can also use a custom end date field width enddatefield." 144 msgstr "" 145 "Vous pouvez également utiliser un champ de date de fin personnalisé avec " 146 "enddatefield." -
ical-feeds/trunk/readme.txt
r1750579 r1754310 5 5 Requires at least: 3.0 6 6 Tested up to: 4.7.2 7 Stable tag: 1. 4.27 Stable tag: 1.5 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 = 26 27 * New number of Future Posts setting 28 * Replaced get_results with Wp_Query 29 * Better implementation of the custom date field to filter results returned 30 * Timezone support for the custom date field 31 * Reorganized code & Added comments 32 33 Thanks to @contemplate (http://contemplatedesign.com) for this new version! 24 34 25 35 = 1.4.2 =
Note: See TracChangeset
for help on using the changeset viewer.