Changeset 945 for trunk/wp-includes/functions.php
- Timestamp:
- 02/26/2004 04:15:48 PM (21 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-includes/functions.php
r943 r945 204 204 // determine the post ID it represents. 205 205 function url_to_postid($url = '') { 206 global $wpdb, $tableposts, $siteurl; 207 206 global $wpdb, $tableposts; 207 208 $siteurl = get_settings('siteurl'); 208 209 // Take a link like 'http://example.com/blog/something' 209 210 // and extract just the '/something': … … 537 538 function pingWeblogs($blog_ID = 1) { 538 539 // original function by Dries Buytaert for Drupal 539 global $use_weblogsping, $blogname ,$siteurl,$blogfilename;540 if ((!(($blogname=="my weblog") && ( $siteurl=="http://example.com") && ($blogfilename=="wp.php"))) && (!preg_match("/localhost\//",$siteurl)) && ($use_weblogsping)) {540 global $use_weblogsping, $blogname; 541 if ((!(($blogname=="my weblog") && (get_settings('siteurl')=="http://example.com") && (get_settings('blogfilename') == "wp.php"))) && (!preg_match("/localhost\//", get_settings('siteurl'))) && ($use_weblogsping)) { 541 542 $client = new xmlrpc_client("/RPC2", "rpc.weblogs.com", 80); 542 $message = new xmlrpcmsg("weblogUpdates.ping", array(new xmlrpcval($blogname), new xmlrpcval($siteurl."/".$blogfilename))); 543 $message = new xmlrpcmsg("weblogUpdates.ping", array(new xmlrpcval($blogname), 544 new xmlrpcval(get_settings('siteurl') . '/' . get_settings('blogfilename') 545 ))); 543 546 $result = $client->send($message); 544 547 if (!$result || $result->faultCode()) { … … 569 572 // pings CaféLog.com 570 573 function pingCafelog($cafelogID,$title='',$p='') { 571 global $use_cafelogping, $blogname , $siteurl, $blogfilename;572 if ((!(($blogname=="my weblog") && ( $siteurl=="http://example.com") && ($blogfilename=="wp.php"))) && (!preg_match("/localhost\//",$siteurl)) && ($use_cafelogping) && ($cafelogID != '')) {574 global $use_cafelogping, $blogname; 575 if ((!(($blogname=="my weblog") && (get_settings('siteurl') == "http://example.com") && (get_settings('blogfilename')=="wp.php"))) && (!preg_match("/localhost\//", get_settings('siteurl'))) && ($use_cafelogping) && ($cafelogID != '')) { 573 576 $client = new xmlrpc_client("/xmlrpc.php", "cafelog.tidakada.com", 80); 574 577 $message = new xmlrpcmsg("b2.ping", array(new xmlrpcval($cafelogID), new xmlrpcval($title), new xmlrpcval($p))); … … 585 588 // pings Blo.gs 586 589 function pingBlogs($blog_ID="1") { 587 global $use_blodotgsping, $blodotgsping_url, $use_rss, $blogname , $siteurl, $blogfilename;588 if ((!(($blogname=='my weblog') && ( $siteurl=='http://example.com') && ($blogfilename=='wp.php'))) && (!preg_match('/localhost\//',$siteurl)) && ($use_blodotgsping)) {589 $url = ($blodotgsping_url == 'http://example.com') ? $siteurl.'/'.$blogfilename: $blodotgsping_url;590 global $use_blodotgsping, $blodotgsping_url, $use_rss, $blogname; 591 if ((!(($blogname=='my weblog') && (get_settings('siteurl')=='http://example.com') && (get_settings('blogfilename')=='wp.php'))) && (!preg_match('/localhost\//',get_settings('siteurl'))) && ($use_blodotgsping)) { 592 $url = ($blodotgsping_url == 'http://example.com') ? get_settings('siteurl').'/'.get_settings('blogfilename') : $blodotgsping_url; 590 593 $client = new xmlrpc_client('/', 'ping.blo.gs', 80); 591 594 if ($use_rss) { 592 $message = new xmlrpcmsg('weblogUpdates.extendedPing', array(new xmlrpcval($blogname), new xmlrpcval($url), new xmlrpcval($url), new xmlrpcval( $siteurl.'/b2rss.xml')));595 $message = new xmlrpcmsg('weblogUpdates.extendedPing', array(new xmlrpcval($blogname), new xmlrpcval($url), new xmlrpcval($url), new xmlrpcval(get_settings('siteurl').'/b2rss.xml'))); 593 596 } else { 594 597 $message = new xmlrpcmsg('weblogUpdates.ping', array(new xmlrpcval($blogname), new xmlrpcval($url))); … … 658 661 659 662 function make_url_footnote($content) { 660 global $siteurl;661 663 preg_match_all('/<a(.+?)href=\"(.+?)\"(.*?)>(.+?)<\/a>/', $content, $matches); 662 664 $j = 0; … … 669 671 $link_text = $matches[4][$i]; 670 672 $content = str_replace($link_match, $link_text.' '.$link_number, $content); 671 $link_url = (strtolower(substr($link_url,0,7)) != 'http://') ? $siteurl.$link_url : $link_url;673 $link_url = (strtolower(substr($link_url,0,7)) != 'http://') ? get_settings('siteurl') . $link_url : $link_url; 672 674 $links_summary .= "\n".$link_number.' '.$link_url; 673 675 } … … 736 738 function pingback($content, $post_ID) { 737 739 // original code by Mort (http://mort.mine.nu:8080) 738 global $ siteurl, $blogfilename, $wp_version;740 global $wp_version; 739 741 $log = debug_fopen('./pingback.log', 'a'); 740 742 $post_links = array(); … … 1015 1017 global $wpdb, $tablecomments, $tableposts, $tableusers; 1016 1018 global $querystring_start, $querystring_equal, $querystring_separator; 1017 global $blog filename, $blogname, $siteurl, $blog_charset;1019 global $blogname, $blog_charset; 1018 1020 1019 1021 $comment = $wpdb->get_row("SELECT * FROM $tablecomments WHERE comment_ID='$comment_id' LIMIT 1"); … … 1076 1078 global $wpdb, $tablecomments, $tableposts, $tableusers; 1077 1079 global $querystring_start, $querystring_equal, $querystring_separator; 1078 global $blog filename, $blogname, $siteurl, $blog_charset;1080 global $blogname, $blog_charset; 1079 1081 1080 1082 $comment = $wpdb->get_row("SELECT * FROM $tablecomments WHERE comment_ID='$comment_id' LIMIT 1"); … … 1091 1093 $notify_message .= "Whois : http://ws.arin.net/cgi-bin/whois.pl?queryinput=$comment->comment_author_IP\r\n"; 1092 1094 $notify_message .= "Comment:\r\n".stripslashes($comment->comment_content)."\r\n\r\n"; 1093 $notify_message .= "To approve this comment, visit: $siteurl/wp-admin/post.php?action=mailapprovecomment&p=".$comment->comment_post_ID."&comment=$comment_id\r\n";1094 $notify_message .= "To delete this comment, visit: $siteurl/wp-admin/post.php?action=confirmdeletecomment&p=".$comment->comment_post_ID."&comment=$comment_id\r\n";1095 $notify_message .= "To approve this comment, visit: " . get_settings('siteurl') . "/wp-admin/post.php?action=mailapprovecomment&p=".$comment->comment_post_ID."&comment=$comment_id\r\n"; 1096 $notify_message .= "To delete this comment, visit: " . get_settings('siteurl') . "/wp-admin/post.php?action=confirmdeletecomment&p=".$comment->comment_post_ID."&comment=$comment_id\r\n"; 1095 1097 $notify_message .= "Currently $comments_waiting comments are waiting for approval. Please visit the moderation panel:\r\n"; 1096 $notify_message .= "$siteurl/wp-admin/moderation.php\r\n";1098 $notify_message .= get_settings('siteurl') . "/wp-admin/moderation.php\r\n"; 1097 1099 1098 1100 $subject = '[' . stripslashes($blogname) . '] Please approve: "' .stripslashes($post->post_title).'"'; … … 1279 1281 1280 1282 function is_referer_search_engine($engine = 'google') { 1281 global $siteurl; 1282 1283 $referer = urldecode($_SERVER[HTTP_REFERER]); 1283 $siteurl = get_settings('siteurl'); 1284 $referer = urldecode($_SERVER['HTTP_REFERER']); 1284 1285 //echo "referer is: $referer<br />"; 1285 1286 if ( ! $engine ) {
Note: See TracChangeset
for help on using the changeset viewer.