Changeset 1794 for trunk/wp-includes/functions.php
- Timestamp:
- 10/14/2004 07:26:41 AM (20 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-includes/functions.php
r1792 r1794 735 735 736 736 function pingback($content, $post_ID) { 737 738 global $wp_version; 737 global $wp_version, $wpdb; 739 738 include_once (ABSPATH . WPINC . '/class-IXR.php'); 740 739 741 740 // original code by Mort (http://mort.mine.nu:8080) 742 $log = debug_fopen( './pingback.log', 'a');741 $log = debug_fopen(ABSPATH . '/pingback.log', 'a'); 743 742 $post_links = array(); 744 743 debug_fwrite($log, 'BEGIN '.date('YmdHis', time())."\n"); 744 745 $pung = get_pung($post_ID); 745 746 746 747 // Variables … … 748 749 $gunk = '/#~:.?+=&%@!\-'; 749 750 $punc = '.:?\-'; 750 $any = $ltrs .$gunk.$punc;751 $any = $ltrs . $gunk . $punc; 751 752 752 753 // Step 1 … … 769 770 // We don't wanna ping first and second types, even if they have a valid <link/> 770 771 771 foreach($post_links_temp[0] as $link_test){ 772 $test = parse_url($link_test); 773 if (isset($test['query'])) { 774 $post_links[] = $link_test; 775 } elseif(($test['path'] != '/') && ($test['path'] != '')) { 776 $post_links[] = $link_test; 777 } 778 } 772 foreach($post_links_temp[0] as $link_test) : 773 if ( !in_array($link_test, $pung) ) : // If we haven't pung it already 774 $test = parse_url($link_test); 775 if (isset($test['query'])) 776 $post_links[] = $link_test; 777 elseif(($test['path'] != '/') && ($test['path'] != '')) 778 $post_links[] = $link_test; 779 endif; 780 endforeach; 779 781 780 782 foreach ($post_links as $pagelinkedto){ 781 782 783 debug_fwrite($log, "Processing -- $pagelinkedto\n"); 783 784 $pingback_server_url = discover_pingback_server_uri($pagelinkedto, 2048); 784 785 785 if($pingback_server_url) { 786 786 if ($pingback_server_url) { 787 787 // Now, the RPC call 788 $method = 'pingback.ping'; 789 debug_fwrite($log, 'Page Linked To: '.$pagelinkedto."\n"); 788 debug_fwrite($log, "Page Linked To: $pagelinkedto \n"); 790 789 debug_fwrite($log, 'Page Linked From: '); 791 790 $pagelinkedfrom = get_permalink($post_ID); … … 795 794 $client = new IXR_Client($pingback_server_url); 796 795 $client->timeout = 3; 797 $client->useragent .= ' -- WordPress/' .$wp_version;796 $client->useragent .= ' -- WordPress/' . $wp_version; 798 797 799 798 // when set to true, this outputs debug messages by itself 800 799 $client->debug = false; 801 800 $client->query('pingback.ping', array($pagelinkedfrom, $pagelinkedto)); 802 803 if ( !$client->query('pingback.ping', array($pagelinkedfrom, $pagelinkedto))) {801 802 if ( !$client->query('pingback.ping', array($pagelinkedfrom, $pagelinkedto) ) ) 804 803 debug_fwrite($log, "Error.\n Fault code: ".$client->getErrorCode()." : ".$client->getErrorMessage()."\n"); 805 } 806 } 807 } 808 809 debug_fwrite($log, "\nEND: ".time()."\n****************************\n\r"); 804 else 805 add_ping( $post_ID, $pagelinkedto ); 806 } 807 } 808 809 debug_fwrite($log, "\nEND: ".time()."\n****************************\n"); 810 810 debug_fclose($log); 811 811 } … … 1608 1608 1609 1609 // Get post-meta info 1610 if ( $meta_list = $wpdb->get_results(" 1611 SELECT post_id,meta_key,meta_value 1612 FROM $wpdb->postmeta 1613 WHERE post_id IN($post_id_list) 1614 ORDER BY post_id,meta_key 1615 ", ARRAY_A) ) { 1610 if ( $meta_list = $wpdb->get_results("SELECT post_id, meta_key, meta_value FROM $wpdb->postmeta WHERE post_id IN($post_id_list) ORDER BY post_id, meta_key", ARRAY_A) ) { 1616 1611 1617 1612 // Change from flat structure to hierarchical:
Note: See TracChangeset
for help on using the changeset viewer.