Ticket #4624: gmt-xmlrpc.php.diff
File gmt-xmlrpc.php.diff, 4.6 KB (added by , 17 years ago) |
---|
-
xmlrpc.php
208 208 $allow_pings = ("open" == $page->ping_status) ? 1 : 0; 209 209 210 210 // Format page date. 211 $page_date = mysql2date("Ymd\TH:i:s\Z", $page->post_date_gmt); 211 $page_date = mysql2date("Ymd\TH:i:s", $page->post_date); 212 $page_date_gmt = mysql2date("Ymd\TH:i:s", $page->post_date_gmt); 212 213 213 214 // Pull the categories info together. 214 215 $categories = array(); … … 240 241 "wp_page_parent_title" => $parent_title, 241 242 "wp_page_order" => $page->menu_order, 242 243 "wp_author_id" => $author->ID, 243 "wp_author_display_name" => $author->display_name 244 "wp_author_display_name" => $author->display_name, 245 "date_created_gmt" => new IXR_Date($page_date_gmt) 244 246 ); 245 247 246 248 return($page_struct); … … 429 431 SELECT ID page_id, 430 432 post_title page_title, 431 433 post_parent page_parent_id, 432 post_date_gmt 434 post_date_gmt, 435 post_date 433 436 FROM {$wpdb->posts} 434 437 WHERE post_type = 'page' 435 438 ORDER BY ID … … 438 441 // The date needs to be formated properly. 439 442 $num_pages = count($page_list); 440 443 for($i = 0; $i < $num_pages; $i++) { 441 $post_date = mysql2date("Ymd\TH:i:s\Z", $page_list[$i]->post_date_gmt); 444 $post_date = mysql2date("Ymd\TH:i:s", $page_list[$i]->post_date); 445 $post_date_gmt = mysql2date("Ymd\TH:i:s", $page_list[$i]->post_date_gmt); 446 442 447 $page_list[$i]->dateCreated = new IXR_Date($post_date); 448 $page_list[$i]->date_created_gmt = new IXR_Date($post_date_gmt); 443 449 444 450 unset($page_list[$i]->post_date_gmt); 451 unset($page_list[$i]->post_date); 445 452 } 446 453 447 454 return($page_list); … … 1054 1061 if ( is_array($to_ping) ) 1055 1062 $to_ping = implode(' ', $to_ping); 1056 1063 1057 1058 1059 1060 1061 $post_date= get_date_from_gmt(iso8601_to_datetime($dateCreated));1062 $post_date_gmt = iso8601_to_datetime($dateCreated. "Z", GMT);1063 1064 $post_date= current_time('mysql');1065 1066 1064 // Do some timestamp voodoo 1065 $dateCreatedd = $content_struct['dateCreated']; 1066 if (!empty($dateCreatedd)) { 1067 $dateCreated = $dateCreatedd->getIso(); 1068 $post_date = get_date_from_gmt(iso8601_to_datetime($dateCreated)); 1069 $post_date_gmt = iso8601_to_datetime($dateCreated, GMT); 1070 } else { 1071 $post_date = current_time('mysql'); 1072 $post_date_gmt = current_time('mysql', 1); 1073 } 1067 1074 1068 1075 $catnames = $content_struct['categories']; 1069 1076 logIO('O', 'Post cats: ' . printr($catnames,true)); … … 1341 1348 1342 1349 if ($postdata['post_date'] != '') { 1343 1350 1344 $post_date = mysql2date('Ymd\TH:i:s\Z', $postdata['post_date_gmt']); 1351 $post_date = mysql2date('Ymd\TH:i:s', $postdata['post_date']); 1352 $post_date_gmt = mysql2date('Ymd\TH:i:s', $postdata['post_date_gmt']); 1345 1353 1346 1354 $categories = array(); 1347 1355 $catids = wp_get_post_categories($post_ID); … … 1376 1384 'wp_slug' => $postdata['post_name'], 1377 1385 'wp_password' => $postdata['post_password'], 1378 1386 'wp_author_id' => $author->ID, 1379 'wp_author_display_name' => $author->display_name 1387 'wp_author_display_name' => $author->display_name, 1388 'date_created_gmt' => new IXR_Date($post_date_gmt) 1380 1389 ); 1381 1390 1382 1391 return $resp; … … 1409 1418 1410 1419 foreach ($posts_list as $entry) { 1411 1420 1412 $post_date = mysql2date('Ymd\TH:i:s\Z', $entry['post_date_gmt']); 1421 $post_date = mysql2date('Ymd\TH:i:s', $entry['post_date']); 1422 $post_date_gmt = mysql2date('Ymd\TH:i:s', $entry['post_date_gmt']); 1423 1413 1424 $categories = array(); 1414 1425 $catids = wp_get_post_categories($entry['ID']); 1415 1426 foreach($catids as $catid) { … … 1443 1454 'wp_slug' => $entry['post_name'], 1444 1455 'wp_password' => $entry['post_password'], 1445 1456 'wp_author_id' => $author->ID, 1446 'wp_author_display_name' => $author->display_name 1457 'wp_author_display_name' => $author->display_name, 1458 'date_created_gmt' => new IXR_Date($post_date_gmt) 1447 1459 ); 1448 1460 1449 1461 } … … 1593 1605 1594 1606 foreach ($posts_list as $entry) { 1595 1607 1596 $post_date = mysql2date('Ymd\TH:i:s\Z', $entry['post_date_gmt']); 1608 $post_date = mysql2date('Ymd\TH:i:s', $entry['post_date']); 1609 $post_date_gmt = mysql2date('Ymd\TH:i:s', $entry['post_date_gmt']); 1597 1610 1598 1611 $struct[] = array( 1599 1612 'dateCreated' => new IXR_Date($post_date), 1600 1613 'userid' => $entry['post_author'], 1601 1614 'postid' => $entry['ID'], 1602 1615 'title' => $entry['post_title'], 1616 'date_created_gmt' => new IXR_Date($post_date_gmt) 1603 1617 ); 1604 1618 1605 1619 }