Changeset 712486
- Timestamp:
- 05/13/2013 04:23:34 PM (13 years ago)
- Location:
- sync-facebook-events/tags/1.0.8
- Files:
-
- 2 edited
-
readme.txt (modified) (1 diff)
-
sync-facebook-events.php (modified) (6 diffs)
Legend:
- Unmodified
- Added
- Removed
-
sync-facebook-events/tags/1.0.8/readme.txt
r634434 r712486 3 3 Tags: facebook, events, synchronize, calendar 4 4 Requires at least: 3.0 5 Tested up to: 3. 4.25 Tested up to: 3.5.1 6 6 Stable tag: 1.0.8 7 7 -
sync-facebook-events/tags/1.0.8/sync-facebook-events.php
r634434 r712486 5 5 Description: Sync Facebook Events to The Events Calendar Plugin 6 6 Author: Mark Nelson 7 Version: 1.0. 67 Version: 1.0.8 8 8 Author URI: http://pdxt.com 9 9 */ 10 10 11 /* Copyright 201 2PDX Technologies, LLC. (mark.nelson@pdxt.com)11 /* Copyright 2013 PDX Technologies, LLC. (mark.nelson@pdxt.com) 12 12 13 13 This program is free software; you can redistribute it and/or modify … … 64 64 'cookie' => true, 65 65 )); 66 Facebook::$CURL_OPTS[CURLOPT_SSL_VERIFYPEER] = false; 67 Facebook::$CURL_OPTS[CURLOPT_SSL_VERIFYHOST] = 2; 66 68 67 69 $ret = array(); … … 103 105 'posts_per_page'=>'-1' 104 106 )); 105 107 108 109 106 110 foreach($query->posts as $post) { 107 111 if(!empty($post->to_ping)) { … … 110 114 $eids[$eid] = $post->ID; 111 115 } 112 //if you're reading this and you want to delete all those duplicate events, uncomment this temporarially. Note, it will also delete all manually made events since June 13113 //http://codex.wordpress.org/Version_3.4 - June 13, 2012114 //depending on many duplicates you had, you might end up re-loading this script a bunch of times after it times out. Me, I had 14k duplicates. Had to run the script like 10 times.115 /*116 else {117 $post_date = trim(substr($post->post_date, 0, 10));118 if($post->post_date > '2012-06-12')119 wp_delete_post($post->ID);120 }121 */122 116 } 123 117 //file_put_contents($_SERVER['DOCUMENT_ROOT'].'/fbevent.log', print_r(array(time(),$events,$eids),1)."\n".str_repeat('=',40)."\n", FILE_APPEND); 124 118 125 119 foreach($events as $event) { 126 127 120 $args['post_title'] = $event['name']; 128 121 129 122 $offset = get_option('gmt_offset')*3600; 130 123 131 $offsetStart = $event['start_time']+$offset; 124 //$offsetStart = strtotime($event['start_time'])+$offset; 125 $offsetStart =($event['start_time'])+$offset; 126 132 127 $offsetEnd = $event['end_time']+$offset; 133 128 134 129 //don't update or insert events from the past. 135 if($offsetEnd > time()) { 136 130 if($offsetStart > time()) { 137 131 $args['EventStartDate'] = date("m/d/Y", $offsetStart); 138 132 $args['EventStartHour'] = date("H", $offsetStart); … … 182 176 //eid, name, start_time, end_time, location, description 183 177 } 184 reset($eids);178 //reset($eids); 185 179 } 186 180 } … … 283 277 <?php if(isset($events)) { ?> 284 278 <div style="margin-top:20px;font-size:14px;color:#444;border:1px solid #999;padding:15px;width:95%;font-face:couriernew;"> 285 <span style="color:red;">Upda ing all facebook events...</span><br />279 <span style="color:red;">Updating all facebook events...</span><br /> 286 280 <?php fbes_send_events($events); ?><br /> 287 281 <span style="color:red;">Events Calendar updated with current Facebook events.</span><br /><br /> 288 282 </div> 289 <? } ?>283 <?php } ?> 290 284 <?php 291 285 }
Note: See TracChangeset
for help on using the changeset viewer.