Make WordPress Core


Ignore:
Timestamp:
02/26/2004 04:15:48 PM (21 years ago)
Author:
saxmatt
Message:

Removed global $siteurl and $blogfilename, use get_settings. Syntax fix for wp-db.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-includes/functions.php

    r943 r945  
    204204// determine the post ID it represents.
    205205function url_to_postid($url = '') {
    206     global $wpdb, $tableposts, $siteurl;
    207 
     206    global $wpdb, $tableposts;
     207
     208    $siteurl = get_settings('siteurl');
    208209    // Take a link like 'http://example.com/blog/something'
    209210    // and extract just the '/something':
     
    537538function pingWeblogs($blog_ID = 1) {
    538539    // 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)) {
    541542        $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        )));
    543546        $result = $client->send($message);
    544547        if (!$result || $result->faultCode()) {
     
    569572// pings CaféLog.com
    570573function 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 != '')) {
    573576        $client = new xmlrpc_client("/xmlrpc.php", "cafelog.tidakada.com", 80);
    574577        $message = new xmlrpcmsg("b2.ping", array(new xmlrpcval($cafelogID), new xmlrpcval($title), new xmlrpcval($p)));
     
    585588// pings Blo.gs
    586589function 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;
    590593        $client = new xmlrpc_client('/', 'ping.blo.gs', 80);
    591594        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')));
    593596        } else {
    594597            $message = new xmlrpcmsg('weblogUpdates.ping', array(new xmlrpcval($blogname), new xmlrpcval($url)));
     
    658661
    659662function make_url_footnote($content) {
    660     global $siteurl;
    661663    preg_match_all('/<a(.+?)href=\"(.+?)\"(.*?)>(.+?)<\/a>/', $content, $matches);
    662664    $j = 0;
     
    669671        $link_text = $matches[4][$i];
    670672        $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;
    672674        $links_summary .= "\n".$link_number.' '.$link_url;
    673675    }
     
    736738function pingback($content, $post_ID) {
    737739    // original code by Mort (http://mort.mine.nu:8080)
    738     global $siteurl, $blogfilename, $wp_version;
     740    global $wp_version;
    739741    $log = debug_fopen('./pingback.log', 'a');
    740742    $post_links = array();
     
    10151017    global $wpdb, $tablecomments, $tableposts, $tableusers;
    10161018    global $querystring_start, $querystring_equal, $querystring_separator;
    1017     global $blogfilename, $blogname, $siteurl, $blog_charset;
     1019    global $blogname, $blog_charset;
    10181020   
    10191021    $comment = $wpdb->get_row("SELECT * FROM $tablecomments WHERE comment_ID='$comment_id' LIMIT 1");
     
    10761078    global $wpdb, $tablecomments, $tableposts, $tableusers;
    10771079    global $querystring_start, $querystring_equal, $querystring_separator;
    1078     global $blogfilename, $blogname, $siteurl, $blog_charset;
     1080    global $blogname, $blog_charset;
    10791081   
    10801082    $comment = $wpdb->get_row("SELECT * FROM $tablecomments WHERE comment_ID='$comment_id' LIMIT 1");
     
    10911093    $notify_message .= "Whois  : http://ws.arin.net/cgi-bin/whois.pl?queryinput=$comment->comment_author_IP\r\n";
    10921094    $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";
    10951097    $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";
    10971099
    10981100    $subject = '[' . stripslashes($blogname) . '] Please approve: "' .stripslashes($post->post_title).'"';
     
    12791281
    12801282function 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']);
    12841285    //echo "referer is: $referer<br />";
    12851286    if ( ! $engine ) {
Note: See TracChangeset for help on using the changeset viewer.