Changeset 945

Show
Ignore:
Timestamp:
02/26/04 16:15:48 (5 years ago)
Author:
saxmatt
Message:

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

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/index-smarty.php

    r750 r945  
    1616define( 'NODISPLAY', false ); 
    1717 
    18 $wpsmarty->assign( 'siteurl', $siteurl ); 
     18$wpsmarty->assign( 'siteurl', get_settings('siteurl') ); 
    1919$wpsmarty->assign( 'b2_version', $wp_version ); 
    2020 
  • trunk/index.php

    r901 r945  
    1616 
    1717    <style type="text/css" media="screen"> 
    18         @import url( <?php echo $siteurl; ?>/wp-layout.css ); 
     18        @import url( <?php echo get_settings('siteurl'); ?>/wp-layout.css ); 
    1919    </style> 
    2020     
    21     <link rel="stylesheet" type="text/css" media="print" href="<?php echo $siteurl; ?>/print.css" /> 
     21    <link rel="stylesheet" type="text/css" media="print" href="<?php echo get_settings('siteurl'); ?>/print.css" /> 
    2222    <link rel="alternate" type="application/rss+xml" title="RSS 2.0" href="<?php bloginfo('rss2_url'); ?>" /> 
    2323    <link rel="alternate" type="application/rdf+xml" title="RDF" href="<?php bloginfo('rdf_url'); ?>" /> 
     
    3333<body> 
    3434<div id="rap"> 
    35 <h1 id="header"><a href="<?php echo $siteurl; ?>" title="<?php bloginfo('name'); ?>"><?php bloginfo('name'); ?></a></h1> 
     35<h1 id="header"><a href="<?php echo get_settings('siteurl'); ?>" title="<?php bloginfo('name'); ?>"><?php bloginfo('name'); ?></a></h1> 
    3636 
    3737<div id="content"> 
     
    7777 </li> 
    7878 <li id="search">Search: 
    79     <form id="searchform" method="get" action="<?php echo $PHP_SELF; /*$siteurl."/".$blogfilename*/ ?>"> 
     79    <form id="searchform" method="get" action="<?php echo $PHP_SELF; ?>"> 
    8080    <div> 
    8181        <input type="text" name="s" size="15" /><br /> 
     
    9494 <li id="other">Other: 
    9595    <ul> 
    96         <li><a href="<?php echo $siteurl; ?>/wp-login.php">login</a></li> 
    97         <li><a href="<?php echo $siteurl; ?>/wp-register.php">register</a></li> 
     96        <li><a href="<?php echo get_settings('siteurl'); ?>/wp-login.php">login</a></li> 
     97        <li><a href="<?php echo get_settings('siteurl'); ?>/wp-register.php">register</a></li> 
    9898    </ul> 
    9999 </li> 
  • trunk/wp-admin/auth.php

    r850 r945  
    55/* Checking login & pass in the database */ 
    66function veriflog() { 
    7     global $HTTP_COOKIE_VARS,$cookiehash; 
     7    global $cookiehash; 
    88    global $tableusers, $wpdb; 
    99 
    10     if (!empty($HTTP_COOKIE_VARS["wordpressuser_".$cookiehash])) { 
    11         $user_login = $HTTP_COOKIE_VARS["wordpressuser_".$cookiehash]; 
    12         $user_pass_md5 = $HTTP_COOKIE_VARS["wordpresspass_".$cookiehash]; 
     10    if (!empty($_COOKIE['wordpressuser_' . $cookiehash])) { 
     11        $user_login = $_COOKIE['wordpressuser_' . $cookiehash]; 
     12        $user_pass_md5 = $_COOKIE['wordpresspass_' . $cookiehash]; 
    1313    } else { 
    1414        return false; 
     
    3838    header('Cache-Control: no-cache, must-revalidate'); 
    3939    header('Pragma: no-cache'); 
    40     if (!empty($HTTP_COOKIE_VARS["wordpressuser_".$cookiehash])) { 
     40    if (!empty($_COOKIE['wordpressuser_' . $cookiehash])) { 
    4141        $error="<strong>Error</strong>: wrong login or password."; 
    4242    } 
    43     $redir = "Location: $siteurl/wp-login.php?redirect_to=" . urlencode($HTTP_SERVER_VARS["REQUEST_URI"]); 
     43    $redir = 'Location: ' . get_settings('siteurl') . '/wp-login.php?redirect_to=' . urlencode($_SERVER['REQUEST_URI']); 
    4444    header($redir); 
    4545    exit(); 
  • trunk/wp-admin/index.php

    r825 r945  
    77 
    88if (0 == $user_level) { 
    9     $redirect_to = $siteurl . '/wp-admin/profile.php'; 
     9    $redirect_to = get_settings('siteurl') . '/wp-admin/profile.php'; 
    1010} else { 
    11     $redirect_to = $siteurl . '/wp-admin/post.php'; 
     11    $redirect_to = get_settings('siteurl') . '/wp-admin/post.php'; 
    1212} 
    1313header ("Location: $redirect_to"); 
  • trunk/wp-admin/install.php

    r921 r945  
    677677 
    678678<?php 
    679 $url = $HTTP_POST_VARS['url']; 
     679$url = $_POST['url']; 
    680680if (isset($url)) { 
    681681    $query= "UPDATE $tableoptions set option_value='$url' where option_id=1"; //siteurl 
  • trunk/wp-admin/link-add.php

    r745 r945  
    238238 
    239239<div class="wrap"> 
    240 <p>You can drag <a href="javascript:void(linkmanpopup=window.open('<?php echo $siteurl; ?>/wp-admin/link-add.php?action=popup&linkurl='+escape(location.href)+'&name='+escape(document.title),'LinkManager','scrollbars=yes,width=750,height=550,left=15,top=15,status=yes,resizable=yes'));linkmanpopup.focus();window.focus();linkmanpopup.focus();" title="Link add bookmarklet">Link This</a> to your toolbar and when you click it a window will pop up that will allow you to add whatever site you're on to your links! Right now this only works on Mozilla or Netscape, but we're working on it.</p> 
     240<p>You can drag <a href="javascript:void(linkmanpopup=window.open('<?php echo get_settings('siteurl'); ?>/wp-admin/link-add.php?action=popup&linkurl='+escape(location.href)+'&name='+escape(document.title),'LinkManager','scrollbars=yes,width=750,height=550,left=15,top=15,status=yes,resizable=yes'));linkmanpopup.focus();window.focus();linkmanpopup.focus();" title="Link add bookmarklet">Link This</a> to your toolbar and when you click it a window will pop up that will allow you to add whatever site you're on to your links! Right now this only works on Mozilla or Netscape, but we're working on it.</p> 
    241241</div> 
    242242 
  • trunk/wp-admin/menu.php

    r872 r945  
    2222 
    2323?> 
    24     <li><a href="<?php echo "$siteurl/$blogfilename"; ?>" title="View your site">View site</a></li> 
    25     <li class="last"><a href="<?php echo $siteurl ?>/wp-login.php?action=logout" title="Logout of this account">Logout (<?php echo stripslashes($user_nickname) ?>)</a></li> 
     24    <li><a href="<?php echo get_settings('siteurl') . '/' . get_settings('blogfilename'); ?>" title="View your site">View site</a></li> 
     25    <li class="last"><a href="<?php echo get_settings('siteurl') 
     26     ?>/wp-login.php?action=logout" title="Logout of this account">Logout (<?php echo stripslashes($user_nickname) ?>)</a></li> 
    2627</ul> 
  • trunk/wp-admin/options-permalink.php

    r863 r945  
    9797  <p>Using the permalink structure value you currently have, <code><?php echo $permalink_structure; ?></code>, these are the mod_rewrite rules you should have in your <code>.htaccess</code> file.</p>  
    9898  <?php 
    99 $site_root = str_replace('http://', '', trim($siteurl)); 
     99$site_root = str_replace('http://', '', trim(get_settings('siteurl'))); 
    100100$site_root = preg_replace('|([^/]*)(.*)|i', '$2', $site_root); 
    101101if ('/' != substr($site_root, -1)) $site_root = $site_root . '/'; 
  • trunk/wp-admin/post.php

    r927 r945  
    425425 
    426426        $sendback = $HTTP_SERVER_VARS['HTTP_REFERER']; 
    427         if (strstr($sendback, 'post.php')) $sendback = $siteurl .'/wp-admin/post.php'; 
     427        if (strstr($sendback, 'post.php')) $sendback = get_settings('siteurl') .'/wp-admin/post.php'; 
    428428        header ('Location: ' . $sendback); 
    429429 
     
    473473    echo "<p>Are you sure you want to do that?</p>\n"; 
    474474     
    475     echo "<form action=\"$siteurl/wp-admin/post.php\" method=\"get\">\n"; 
     475    echo "<form action='".get_settings('siteurl')."/wp-admin/post.php' method='get'>\n"; 
    476476    echo "<input type=\"hidden\" name=\"action\" value=\"deletecomment\" />\n"; 
    477477    echo "<input type=\"hidden\" name=\"p\" value=\"$p\" />\n"; 
     
    480480    echo "<input type=\"submit\" value=\"Yes\" />"; 
    481481    echo "&nbsp;&nbsp;"; 
    482     echo "<input type=\"button\" value=\"No\" onClick=\"self.location='$siteurl/wp-admin/edit.php?p=$p&c=1#comments';\" />\n"; 
     482    echo "<input type=\"button\" value=\"No\" onClick=\"self.location='". get_settings('siteurl') ."/wp-admin/edit.php?p=$p&c=1#comments';\" />\n"; 
    483483    echo "</form>\n"; 
    484484    echo "</div>\n"; 
     
    515515        header('Location: ' . $HTTP_SERVER_VARS['HTTP_REFERER']); 
    516516    } else { 
    517         header('Location: '.$siteurl.'/wp-admin/edit.php?p='.$p.'&c=1#comments'); 
     517        header('Location: '. get_settings('siteurl') .'/wp-admin/edit.php?p='.$p.'&c=1#comments'); 
    518518    } 
    519519 
     
    543543        header('Location: ' . $HTTP_SERVER_VARS['HTTP_REFERER']); 
    544544    } else { 
    545         header('Location: '.$siteurl.'/wp-admin/edit.php?p='.$p.'&c=1#comments'); 
     545        header('Location: '. get_settings('siteurl') .'/wp-admin/edit.php?p='.$p.'&c=1#comments'); 
    546546    } 
    547547     
     
    568568    echo "<p>Comment has been approved.</p>\n"; 
    569569     
    570     echo "<form action=\"$siteurl/wp-admin/edit.php?p=$p&c=1#comments\" method=\"get\">\n"; 
     570    echo "<form action=\"". get_settings('siteurl') ."/wp-admin/edit.php?p=$p&c=1#comments\" method=\"get\">\n"; 
    571571    echo "<input type=\"hidden\" name=\"p\" value=\"$p\" />\n"; 
    572572    echo "<input type=\"hidden\" name=\"c\" value=\"1\" />\n"; 
     
    603603        header('Location: ' . $HTTP_SERVER_VARS['HTTP_REFERER']); 
    604604    } else { 
    605         header('Location: '.$siteurl.'/wp-admin/edit.php?p='.$p.'&c=1#comments'); 
     605        header('Location: '. get_settings('siteurl') .'/wp-admin/edit.php?p='.$p.'&c=1#comments'); 
    606606    } 
    607607     
     
    707707if ($is_NS4 || $is_gecko) { 
    708708?> 
    709     <a href="javascript:if(navigator.userAgent.indexOf('Safari') >= 0){Q=getSelection();}else{Q=document.selection?document.selection.createRange().text:document.getSelection();}void(window.open('<?php echo $siteurl ?>/wp-admin/bookmarklet.php?text='+escape(Q)+'&popupurl='+escape(location.href)+'&popuptitle='+escape(document.title),'WordPress bookmarklet','scrollbars=yes,width=600,height=460,left=100,top=150,status=yes'));">Press It  
     709    <a href="javascript:if(navigator.userAgent.indexOf('Safari') >= 0){Q=getSelection();}else{Q=document.selection?document.selection.createRange().text:document.getSelection();}void(window.open('<?php echo get_settings('siteurl') ?>/wp-admin/bookmarklet.php?text='+escape(Q)+'&popupurl='+escape(location.href)+'&popuptitle='+escape(document.title),'WordPress bookmarklet','scrollbars=yes,width=600,height=460,left=100,top=150,status=yes'));">Press It  
    710710    - <?php echo $blogname ?></a>  
    711711    <?php 
    712712} else if ($is_winIE) { 
    713713?> 
    714     <a href="javascript:Q='';if(top.frames.length==0)Q=document.selection.createRange().text;void(btw=window.open('<?php echo $siteurl ?>/wp-admin/bookmarklet.php?text='+escape(Q)+'<?php echo $bookmarklet_tbpb ?>&popupurl='+escape(location.href)+'&popuptitle='+escape(document.title),'bookmarklet','scrollbars=yes,width=600,height=<?php echo $bookmarklet_height ?>,left=100,top=150,status=yes'));btw.focus();">Press it  
     714    <a href="javascript:Q='';if(top.frames.length==0)Q=document.selection.createRange().text;void(btw=window.open('<?php echo get_settings('siteurl') ?>/wp-admin/bookmarklet.php?text='+escape(Q)+'<?php echo $bookmarklet_tbpb ?>&popupurl='+escape(location.href)+'&popuptitle='+escape(document.title),'bookmarklet','scrollbars=yes,width=600,height=<?php echo $bookmarklet_height ?>,left=100,top=150,status=yes'));btw.focus();">Press it  
    715715    - <?php echo $blogname ?></a>  
    716716    <script type="text/javascript" language="JavaScript"> 
     
    728728} else if ($is_opera) { 
    729729?> 
    730     <a href="javascript:void(window.open('<?php echo $siteurl ?>/wp-admin/bookmarklet.php?popupurl='+escape(location.href)+'&popuptitle='+escape(document.title)+'<?php echo $bookmarklet_tbpb ?>','bookmarklet','scrollbars=yes,width=600,height=<?php echo $bookmarklet_height ?>,left=100,top=150,status=yes'));">Press it  
     730    <a href="javascript:void(window.open('<?php echo get_settings('siteurl'); ?>/wp-admin/bookmarklet.php?popupurl='+escape(location.href)+'&popuptitle='+escape(document.title)+'<?php echo $bookmarklet_tbpb ?>','bookmarklet','scrollbars=yes,width=600,height=<?php echo $bookmarklet_height ?>,left=100,top=150,status=yes'));">Press it  
    731731    - <?php echo $blogname ?></a>  
    732732    <?php 
    733733} else if ($is_macIE) { 
    734734?> 
    735     <a href="javascript:Q='';if(top.frames.length==0);void(btw=window.open('<?php echo $siteurl ?>/wp-admin/bookmarklet.php?text='+escape(document.getSelection())+'&popupurl='+escape(location.href)+'&popuptitle='+escape(document.title)+'<?php echo $bookmarklet_tbpb ?>','bookmarklet','scrollbars=yes,width=600,height=<?php echo $bookmarklet_height ?>,left=100,top=150,status=yes'));btw.focus();">Press it  
     735    <a href="javascript:Q='';if(top.frames.length==0);void(btw=window.open('<?php echo get_settings('siteurl'); ?>/wp-admin/bookmarklet.php?text='+escape(document.getSelection())+'&popupurl='+escape(location.href)+'&popuptitle='+escape(document.title)+'<?php echo $bookmarklet_tbpb ?>','bookmarklet','scrollbars=yes,width=600,height=<?php echo $bookmarklet_height ?>,left=100,top=150,status=yes'));btw.focus();">Press it  
    736736    - <?php echo $blogname ?></a>  
    737737    <?php 
  • trunk/wp-admin/profile.php

    r850 r945  
    192192    <p>To have a one-click bookmarklet, just copy and paste this<br />into a new text file:</p> 
    193193    <?php 
    194     $regedit = "REGEDIT4\r\n[HKEY_CURRENT_USER\Software\Microsoft\Internet Explorer\MenuExt\Post To &WP : ".$blogname."]\r\n@=\"javascript:doc=external.menuArguments.document;Q=doc.selection.createRange().text;void(btw=window.open('".$siteurl."/wp-admin/bookmarklet.php?text='+escape(Q)+'".$bookmarklet_tbpb."&popupurl='+escape(doc.location.href)+'&popuptitle='+escape(doc.title),'bookmarklet','scrollbars=no,width=480,height=".$bookmarklet_height.",left=100,top=150,status=yes'));btw.focus();\"\r\n\"contexts\"=hex:31\""; 
     194    $regedit = "REGEDIT4\r\n[HKEY_CURRENT_USER\Software\Microsoft\Internet Explorer\MenuExt\Post To &WP : ".$blogname."]\r\n@=\"javascript:doc=external.menuArguments.document;Q=doc.selection.createRange().text;void(btw=window.open('". get_settings('siteurl') ."/wp-admin/bookmarklet.php?text='+escape(Q)+'".$bookmarklet_tbpb."&popupurl='+escape(doc.location.href)+'&popuptitle='+escape(doc.title),'bookmarklet','scrollbars=no,width=480,height=".$bookmarklet_height.",left=100,top=150,status=yes'));btw.focus();\"\r\n\"contexts\"=hex:31\""; 
    195195    ?> 
    196196    <pre style="margin: 20px; background-color: #cccccc; border: 1px dashed #333333; padding: 5px; font-size: 12px;"><?php echo $regedit; ?></pre> 
     
    324324        { 
    325325          if ((typeof window.sidebar == "object") && (typeof window.sidebar.addPanel == "function")) 
    326             window.sidebar.addPanel("WordPress Post: <?php echo $blogname ?>","<?php echo $siteurl ?>/wp-admin/sidebar.php",""); 
     326            window.sidebar.addPanel("WordPress Post: <?php echo $blogname ?>","<?php echo get_settings('siteurl'); ?>/wp-admin/sidebar.php",""); 
    327327          else 
    328328            alert('No Sidebar found!  You must use Mozilla 0.9.4 or later!'); 
     
    334334    <strong>SideBar</strong><br /> 
    335335    Add this link to your favorites:<br /> 
    336     <a href="javascript:Q='';if(top.frames.length==0)Q=document.selection.createRange().text;void(_search=open('<?php echo $siteurl ?>/wp-admin/sidebar.php?text='+escape(Q)+'&popupurl='+escape(location.href)+'&popuptitle='+escape(document.title),'_search'))">WordPress  
     336    <a href="javascript:Q='';if(top.frames.length==0)Q=document.selection.createRange().text;void(_search=open('<?php echo get_settings('siteurl'); 
     337     ?>/wp-admin/sidebar.php?text='+escape(Q)+'&popupurl='+escape(location.href)+'&popuptitle='+escape(document.title),'_search'))">WordPress  
    337338    Sidebar</a>.  
    338339     
  • trunk/wp-admin/templates.php

    r859 r945  
    6767 
    6868    if ('' == $file) { 
    69         if ('' != $blogfilename) { 
    70             $file = $blogfilename
     69        if ('' != get_settings('blogfilename')) { 
     70            $file = get_settings('blogfilename')
    7171        } else { 
    7272            $file = 'index.php'; 
  • trunk/wp-admin/users.php

    r925 r945  
    259259<div class="wrap"> 
    260260<h2>Add User</h2> 
    261 <p>Users can <a href="<?php echo $siteurl ?>/wp-register.php">register themselves</a> or you can manually create users here.</p> 
     261<p>Users can <a href="<?php echo get_settings('siteurl'); ?>/wp-register.php">register themselves</a> or you can manually create users here.</p> 
    262262<form action="" method="post" name="adduser" id="adduser"> 
    263263  <table border="0" cellspacing="5" cellpadding="3"> 
  • trunk/wp-blog-header.php

    r941 r945  
    8282    @header("Cache-Control: post-check=0, pre-check=0", false); 
    8383    @header("Pragma: no-cache");                                     // HTTP/1.0 
    84     @header ("X-Pingback: $siteurl/xmlrpc.php"); 
     84    @header ('X-Pingback: '. get_settings('siteurl') . '/xmlrpc.php'); 
    8585} else { 
    8686    // We're showing a feed, so WP is indeed the only thing that last changed 
    8787    @header('Last Modified: ' . gmdate(get_lastpostmodified())); 
    88     @header ("X-Pingback: $siteurl/xmlrpc.php"); 
     88    @header ('X-Pingback: ' . get_settings('siteurl') . '/xmlrpc.php'); 
    8989} 
    9090 
  • trunk/wp-comments-popup.php

    r880 r945  
    2424<h2 id="comments">Comments</h2> 
    2525 
    26 <p><a href="<?php echo $siteurl; ?>/wp-commentsrss2.php?p=<?php echo $post->ID; ?>">RSS feed for comments on this post.</a></p> 
     26<p><a href="<?php echo get_settings('siteurl'); ?>/wp-commentsrss2.php?p=<?php echo $post->ID; ?>">RSS feed for comments on this post.</a></p> 
    2727 
    2828<?php if ('open' == $post->ping_status) { ?> 
     
    5959<p>Line and paragraph breaks automatic, website trumps email, <acronym title="Hypertext Markup Language">HTML</acronym> allowed: <code><?php echo allowed_tags(); ?></code></p> 
    6060 
    61 <form action="<?php echo $siteurl; ?>/wp-comments-post.php" method="post" id="commentform"> 
     61<form action="<?php echo get_settings('siteurl'); ?>/wp-comments-post.php" method="post" id="commentform"> 
    6262    <p> 
    6363      <input type="text" name="author" id="author" class="textarea" value="<?php echo $comment_author; ?>" size="28" tabindex="1" /> 
  • trunk/wp-comments.php

    r808 r945  
    4848<p>Line and paragraph breaks automatic, website trumps email, <acronym title="Hypertext Markup Language">HTML</acronym> allowed: <code><?php echo allowed_tags(); ?></code></p> 
    4949 
    50 <form action="<?php echo $siteurl; ?>/wp-comments-post.php" method="post" id="commentform"> 
     50<form action="<?php echo get_settings('siteurl'); ?>/wp-comments-post.php" method="post" id="commentform"> 
    5151    <p> 
    5252      <input type="text" name="author" id="author" class="textarea" value="<?php echo $comment_author; ?>" size="28" tabindex="1" /> 
  • 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�g.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 ) { 
  • trunk/wp-includes/template-functions-category.php

    r893 r945  
    1717 
    1818function get_category_link($echo = false, $category_id, $category_nicename) { 
    19     global $wpdb, $tablecategories, $post, $querystring_start, $querystring_equal, $siteurl, $blogfilename, $cache_categories; 
     19    global $wpdb, $tablecategories, $post, $querystring_start, $querystring_equal, $cache_categories; 
    2020    $cat_ID = $category_id; 
    2121    $permalink_structure = get_settings('permalink_structure'); 
    2222     
    2323    if ('' == $permalink_structure) { 
    24         $file = "$siteurl/$blogfilename"
     24        $file = get_settings('siteurl') . '/' . get_settings('blogfilename')
    2525        $link = $file.$querystring_start.'cat'.$querystring_equal.$cat_ID; 
    2626    } else { 
     
    2828        // Get any static stuff from the front 
    2929        $front = substr($permalink_structure, 0, strpos($permalink_structure, '%')); 
    30         $link = $siteurl . $front . 'category/'; 
     30        $link = get_settings('siteurl') . $front . 'category/'; 
    3131        if ($parent=$cache_categories[$category_id]->category_parent) $link .= get_category_parents($parent, FALSE, '/', TRUE); 
    3232        $link .= $category_nicename . '/'; 
     
    3838 
    3939function get_category_rss_link($echo = false, $category_id, $category_nicename) { 
    40        global $querystring_start, $querystring_equal, $siteurl
     40       global $querystring_start, $querystring_equal
    4141       $cat_ID = $category_id; 
    4242       $permalink_structure = get_settings('permalink_structure'); 
    4343 
    4444       if ('' == $permalink_structure) { 
    45                $file = "$siteurl/wp-rss2.php"
     45               $file = get_settings('siteurl') . '/wp-rss2.php'
    4646        $link = $file . $querystring_start . 'cat' . $querystring_equal . $category_id; 
    4747       } else { 
     
    186186        $selected=0, $hide=0) { 
    187187    global $tablecategories, $tableposts, $tablepost2cat, $wpdb; 
    188     global $pagenow, $siteurl, $blogfilename
     188    global $pagenow
    189189    global $querystring_start, $querystring_equal, $querystring_separator; 
    190     if (($file == 'blah') || ($file == '')) $file = "$siteurl/$blogfilename"
     190    if (($file == 'blah') || ($file == '')) $file = get_settings('siteurl') . '/' . get_settings('blogfilename')
    191191    if (!$selected) $selected=$cat; 
    192192    $sort_column = 'cat_'.$sort_column; 
     
    253253function list_cats($optionall = 1, $all = 'All', $sort_column = 'ID', $sort_order = 'asc', $file = '', $list = true, $optiondates = 0, $optioncount = 0, $hide_empty = 1, $use_desc_for_title = 1, $children=FALSE, $child_of=0, $categories=0, $recurse=0) { 
    254254    global $tablecategories, $tableposts, $tablepost2cat, $wpdb; 
    255     global $pagenow, $siteurl, $blogfilename
     255    global $pagenow
    256256    global $querystring_start, $querystring_equal, $querystring_separator; 
    257257    // Optiondates now works 
    258258    if ('' == $file) { 
    259         $file = "$siteurl/$blogfilename"
     259        $file = "$siteurl/" . get_settings('blogfilename')
    260260    } 
    261261    if (intval($categories)==0){ 
  • trunk/wp-includes/template-functions-comment.php

    r924 r945  
    6161function comments_popup_link($zero='No Comments', $one='1 Comment', $more='% Comments', $CSSclass='', $none='Comments Off') { 
    6262    global $id, $wpcommentspopupfile, $wpcommentsjavascript, $post, $wpdb, $tablecomments, $HTTP_COOKIE_VARS, $cookiehash; 
    63     global $querystring_start, $querystring_equal, $querystring_separator, $siteurl
     63    global $querystring_start, $querystring_equal, $querystring_separator
    6464    global $comment_count_cache, $single; 
    6565    if (!$single) { 
     
    8181        echo '<a href="'; 
    8282        if ($wpcommentsjavascript) { 
    83             echo $siteurl.'/'.$wpcommentspopupfile.$querystring_start.'p'.$querystring_equal.$id.$querystring_separator.'c'.$querystring_equal.'1'; 
     83            echo get_settings('siteurl') . '/' . $wpcommentspopupfile.$querystring_start.'p'.$querystring_equal.$id.$querystring_separator.'c'.$querystring_equal.'1'; 
    8484            //echo get_permalink(); 
    8585            echo '" onclick="wpopen(this.href); return false"'; 
     
    228228function comments_rss_link($link_text='Comments RSS', $commentsrssfilename = 'wp-commentsrss2.php') { 
    229229    global $id; 
    230     global $querystring_start, $querystring_equal, $querystring_separator, $siteurl
     230    global $querystring_start, $querystring_equal, $querystring_separator
    231231 
    232232    if ('' != get_settings('permalink_structure')) { 
    233233        $url = trailingslashit(get_permalink()) . 'rss2/'; 
    234234    } else { 
    235         $url = $siteurl.'/'.$commentsrssfilename.$querystring_start.'p'.$querystring_equal.$id; 
     235        $url = get_settings('siteurl') . '/' . $commentsrssfilename.$querystring_start.'p'.$querystring_equal.$id; 
    236236    } 
    237237 
     
    285285 
    286286function trackback_rdf($timezone = 0) { 
    287     global $siteurl, $id, $HTTP_SERVER_VARS
    288     if (!stristr($HTTP_SERVER_VARS['HTTP_USER_AGENT'], 'W3C_Validator')) { 
     287    global $id
     288    if (!stristr($_SERVER['HTTP_USER_AGENT'], 'W3C_Validator')) { 
    289289    echo '<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"  
    290290        xmlns:dc="http://purl.org/dc/elements/1.1/" 
  • trunk/wp-includes/template-functions-general.php

    r938 r945  
    2323 
    2424function get_bloginfo($show='') { 
    25     global $siteurl, $blogfilename, $blogname, $blogdescription, $siteurl, $admin_email; 
     25    global $blogname, $blogdescription, $admin_email; 
    2626 
    2727    $do_perma = 0; 
    28     $feed_url = $siteurl
    29     $comment_feed_url = $siteurl
     28    $feed_url = get_settings('siteurl')
     29    $comment_feed_url = get_settings('siteurl')
    3030 
    3131    if ('' != get_settings('permalink_structure')) { 
    3232        $do_perma = 1; 
    33         $feed_url = $siteurl . '/feed'; 
    34         $comment_feed_url = $siteurl . '/comments/feed'; 
     33        $feed_url = get_settings('siteurl') . '/feed'; 
     34        $comment_feed_url = get_settings('siteurl') . '/comments/feed'; 
    3535    } 
    3636 
    3737    switch($show) { 
    3838        case 'url': 
    39             $output = $siteurl.'/'.$blogfilename
     39            $output = get_settings('siteurl') .'/'. get_settings('blogfilename')
    4040            break; 
    4141        case 'description': 
     
    4343            break; 
    4444        case 'rdf_url': 
    45             $output = $siteurl.'/wp-rdf.php'; 
     45            $output = get_settings('siteurl') .'/wp-rdf.php'; 
    4646            if ($do_perma) { 
    4747                $output = $feed_url . '/rdf/'; 
     
    4949            break; 
    5050        case 'rss_url': 
    51             $output = $siteurl.'/wp-rss.php'; 
     51            $output = get_settings('siteurl') .'/wp-rss.php'; 
    5252            if ($do_perma) { 
    5353                $output = $feed_url . '/rss/'; 
     
    5555            break; 
    5656        case 'rss2_url': 
    57             $output = $siteurl.'/wp-rss2.php'; 
     57            $output = get_settings('siteurl') .'/wp-rss2.php'; 
    5858            if ($do_perma) { 
    5959                $output = $feed_url . '/rss2/'; 
     
    6161            break; 
    6262        case 'atom_url': 
    63             $output = $siteurl.'/wp-atom.php'; 
     63            $output = get_settings('siteurl') .'/wp-atom.php'; 
    6464            if ($do_perma) { 
    6565                $output = $feed_url . '/atom/'; 
     
    6767            break;         
    6868        case 'comments_rss2_url': 
    69             $output = $siteurl.'/wp-commentsrss2.php'; 
     69            $output = get_settings('siteurl') .'/wp-commentsrss2.php'; 
    7070            if ($do_perma) { 
    7171                $output = $comment_feed_url . '/rss2/'; 
     
    7373            break; 
    7474        case 'pingback_url': 
    75             $output = $siteurl.'/xmlrpc.php'; 
     75            $output = get_settings('siteurl') .'/xmlrpc.php'; 
    7676            break; 
    7777        case 'admin_email': 
     
    205205 
    206206function get_archives($type='', $limit='', $format='html', $before = "", $after = "", $show_post_count = false) { 
    207     global $tableposts, $time_difference, $siteurl, $blogfilename
     207    global $tableposts, $time_difference
    208208    global $querystring_start, $querystring_equal, $querystring_separator, $month, $wpdb, $start_of_week; 
    209209 
     
    220220 
    221221    // archive link url 
    222     $archive_link_m = $siteurl.'/'.$blogfilename.$querystring_start.'m'.$querystring_equal;    # monthly archive; 
    223     $archive_link_w = $siteurl.'/'.$blogfilename.$querystring_start.'w'.$querystring_equal;    # weekly archive; 
    224     $archive_link_p = $siteurl.'/'.$blogfilename.$querystring_start.'p'.$querystring_equal;    # post-by-post archive; 
     222    $archive_link_m = get_settings('siteurl').'/'.get_settings('blogfilename').$querystring_start.'m'.$querystring_equal;    # monthly archive; 
     223    $archive_link_w = get_settings('siteurl').'/'.get_settings('blogfilename').$querystring_start.'w'.$querystring_equal;    # weekly archive; 
     224    $archive_link_p = get_settings('siteurl').'/'.get_settings('blogfilename').$querystring_start.'p'.$querystring_equal;    # post-by-post archive; 
    225225 
    226226    // over-ride general date format ? 0 = no: use the date format set in Options, 1 = yes: over-ride 
     
    284284                    $arc_week_start = date_i18n($archive_week_start_date_format, $arc_week['start']); 
    285285                    $arc_week_end = date_i18n($archive_week_end_date_format, $arc_week['end']); 
    286                     $url  = sprintf('%s/%s%sm%s%s%sw%s%d', $siteurl, $blogfilename, $querystring_start, 
     286                    $url  = sprintf('%s/%s%sm%s%s%sw%s%d', get_settings('siteurl'), get_settings('blogfilename'), $querystring_start, 
    287287                                    $querystring_equal, $arc_year, $querystring_separator, 
    288288                                    $querystring_equal, $arcresult->week); 
  • trunk/wp-includes/template-functions-links.php

    r935 r945  
    3636 
    3737function permalink_single_rss($file = '') { 
    38     global $siteurl; 
    3938    echo get_permalink(); 
    4039} 
     
    4241function get_permalink($id=false) { 
    4342    global $post, $wpdb, $tableposts; 
    44     global $siteurl, $blogfilename, $querystring_start, $querystring_equal; 
     43    global $querystring_start, $querystring_equal; 
    4544 
    4645    $rewritecode = array( 
     
    6160                $post->ID 
    6261            ); 
    63             return $siteurl . str_replace($rewritecode, $rewritereplace, get_settings('permalink_structure')); 
     62            return get_settings('siteurl') . str_replace($rewritecode, $rewritereplace, get_settings('permalink_structure')); 
    6463        } else { // if they're not using the fancy permalink option 
    65             return $siteurl . '/' . $blogfilename.$querystring_start.'p'.$querystring_equal.$post->ID; 
     64            return get_settings('siteurl') . '/' . get_settings('blogfilename').$querystring_start.'p'.$querystring_equal.$post->ID; 
    6665        } 
    6766    } else { // if an ID is given 
     
    7675                $id 
    7776            ); 
    78             return $siteurl . str_replace($rewritecode, $rewritereplace, get_settings('permalink_structure')); 
     77            return get_settings('siteurl') . str_replace($rewritecode, $rewritereplace, get_settings('permalink_structure')); 
    7978        } else { 
    80             return $siteurl . '/' . $blogfilename.$querystring_start.'p'.$querystring_equal.$id; 
     79            return get_settings('siteurl') . '/' . get_settings('blogfilename').$querystring_start.'p'.$querystring_equal.$id; 
    8180        } 
    8281    } 
     
    8483 
    8584function get_month_link($year, $month) { 
    86     global $siteurl, $blogfilename, $querystring_start, $querystring_equal; 
     85    global $querystring_start, $querystring_equal; 
    8786    if (!$year) $year = date('Y', time()+($time_difference * 3600)); 
    8887    if (!$month) $month = date('m', time()+($time_difference * 3600)); 
     
    9594        $monthlink = str_replace('%monthnum%', zeroise(intval($month), 2), $monthlink); 
    9695        $monthlink = str_replace('%post_id%', '', $monthlink); 
    97         return $siteurl . $monthlink; 
     96        return get_settings('siteurl') . $monthlink; 
    9897    } else { 
    99         return $siteurl.'/'.$blogfilename.$querystring_start.'m'.$querystring_equal.$year.zeroise($month, 2); 
     98        return get_settings('siteurl') .'/'. get_settings('blogfilename') .$querystring_start.'m'.$querystring_equal.$year.zeroise($month, 2); 
    10099    } 
    101100} 
    102101 
    103102function get_day_link($year, $month, $day) { 
    104     global $siteurl, $blogfilename, $querystring_start, $querystring_equal; 
     103    global $querystring_start, $querystring_equal; 
    105104    if (!$year) $year = date('Y', time()+($time_difference * 3600)); 
    106105    if (!$month) $month = date('m', time()+($time_difference * 3600)); 
     
    115114        $daylink = str_replace('%day%', zeroise(intval($day), 2), $daylink); 
    116115        $daylink = str_replace('%post_id%', '', $daylink); 
    117         return $siteurl . $daylink; 
     116        return get_settings('siteurl') . $daylink; 
    118117    } else { 
    119         return $siteurl.'/'.$blogfilename.$querystring_start.'m'.$querystring_equal.$year.zeroise($month, 2).zeroise($day, 2); 
     118        return get_settings('siteurl') .'/'. get_settings('blogfilename') .$querystring_start.'m'.$querystring_equal.$year.zeroise($month, 2).zeroise($day, 2); 
    120119    } 
    121120} 
    122121 
    123122function edit_post_link($link = 'Edit This', $before = '', $after = '') { 
    124     global $user_level, $post, $siteurl
     123    global $user_level, $post
    125124 
    126125    get_currentuserinfo(); 
     
    135134    } 
    136135 
    137     $location = "$siteurl/wp-admin/post.php?action=edit&amp;post=$post->ID"; 
     136    $location = get_settings('siteurl') . "/wp-admin/post.php?action=edit&amp;post=$post->ID"; 
    138137    echo "$before <a href=\"$location\">$link</a> $after"; 
    139138} 
    140139 
    141140function edit_comment_link($link = 'Edit This', $before = '', $after = '') { 
    142     global $user_level, $post, $comment, $siteurl
     141    global $user_level, $post, $comment
    143142 
    144143    get_currentuserinfo(); 
     
    153152    } 
    154153 
    155     $location = "$siteurl/wp-admin/post.php?action=editcomment&amp;comment=$comment->comment_ID"; 
     154    $location = get_settings('siteurl') . "/wp-admin/post.php?action=editcomment&amp;comment=$comment->comment_ID"; 
    156155    echo "$before <a href=\"$location\">$link</a> $after"; 
    157156} 
  • trunk/wp-includes/template-functions-post.php

    r930 r945  
    262262 
    263263function previous_post($format='%', $previous='previous post: ', $title='yes', $in_same_cat='no', $limitprev=1, $excluded_categories='') { 
    264     global $tableposts, $id, $post, $siteurl, $blogfilename, $wpdb; 
     264    global $tableposts, $id, $post, $wpdb; 
    265265    global $p, $posts, $posts_per_page, $s, $single; 
    266266    global $querystring_start, $querystring_equal, $querystring_separator; 
     
    300300 
    301301function next_post($format='%', $next='next post: ', $title='yes', $in_same_cat='no', $limitnext=1, $excluded_categories='') { 
    302     global $tableposts, $p, $posts, $id, $post, $siteurl, $blogfilename, $wpdb; 
     302    global $tableposts, $p, $posts, $id, $post, $wpdb; 
    303303    global $time_difference, $single; 
    304304    global $querystring_start, $querystring_equal, $querystring_separator; 
     
    340340 
    341341function next_posts($max_page = 0) { // original by cfactor at cooltux.org 
    342     global $HTTP_SERVER_VARS, $siteurl, $blogfilename, $p, $paged, $what_to_show, $pagenow; 
     342    global $HTTP_SERVER_VARS, $p, $paged, $what_to_show, $pagenow; 
    343343    global $querystring_start, $querystring_equal, $querystring_separator; 
    344344    if (empty($p) && ($what_to_show == 'paged')) { 
     
    359359        $nextpage = intval($paged) + 1; 
    360360        if (!$max_page || $max_page >= $nextpage) { 
    361             echo  $siteurl.'/'.$pagenow.$querystring_start. 
     361            echo  get_settings('siteurl') .'/'.$pagenow.$querystring_start. 
    362362                ($qstr == '' ? '' : $qstr.$querystring_separator) . 
    363363                'paged'.$querystring_equal.$nextpage; 
     
    393393 
    394394function previous_posts() { // original by cfactor at cooltux.org 
    395     global $HTTP_SERVER_VARS, $siteurl, $blogfilename, $p, $paged, $what_to_show, $pagenow; 
     395    global $HTTP_SERVER_VARS, $p, $paged, $what_to_show, $pagenow; 
    396396    global $querystring_start, $querystring_equal, $querystring_separator; 
    397397    if (empty($p) && ($what_to_show == 'paged')) {