Make WordPress Core

Changeset 1203


Ignore:
Timestamp:
04/28/2004 07:27:03 AM (21 years ago)
Author:
saxmatt
Message:

Allow WordPress installation URI and blog URI to be different.

Location:
trunk
Files:
15 edited

Legend:

Unmodified
Added
Removed
  • trunk/index.php

    r1181 r1203  
    1313
    1414    <style type="text/css" media="screen">
    15         @import url( <?php bloginfo('url'); ?>/wp-layout.css );
     15        @import url( <?php echo get_settings('siteurl'); ?>/wp-layout.css );
    1616    </style>
    1717   
    18     <link rel="stylesheet" type="text/css" media="print" href="<?php bloginfo('url'); ?>/print.css" />
     18    <link rel="stylesheet" type="text/css" media="print" href="<?php echo get_settings('siteurl'); ?>/print.css" />
    1919    <link rel="alternate" type="application/rss+xml" title="RSS 2.0" href="<?php bloginfo('rss2_url'); ?>" />
    2020    <link rel="alternate" type="text/xml" title="RSS .92" href="<?php bloginfo('rss_url'); ?>" />
  • trunk/wp-admin/menu.php

    r1166 r1203  
    3535
    3636?>
    37     <li><a href="<?php echo get_settings('siteurl') . '/' . get_settings('blogfilename'); ?>" title="<?php _e('View your site') ?>"><?php _e('View site') ?> &raquo;</a></li>
     37    <li><a href="<?php echo get_settings('home') . '/' . get_settings('blogfilename'); ?>" title="<?php _e('View your site') ?>"><?php _e('View site') ?> &raquo;</a></li>
    3838    <li class="last"><a href="<?php echo get_settings('siteurl')
    3939     ?>/wp-login.php?action=logout" title="<?php _e('Log out of this account') ?>"><?php printf(__('Logout (%s)'), stripslashes($user_nickname)) ?></a></li>
  • trunk/wp-admin/options-general.php

    r1150 r1203  
    4747  <form name="form1" method="post" action="options.php">
    4848    <input type="hidden" name="action" value="update" />
    49     <input type="hidden" name="action" value="update" /> <input type="hidden" name="page_options" value="'blogname','blogdescription','siteurl','admin_email','users_can_register','new_users_can_blog','gmt_offset','date_format','time_format'" />
     49    <input type="hidden" name="action" value="update" /> <input type="hidden" name="page_options" value="'blogname','blogdescription','siteurl','admin_email','users_can_register','new_users_can_blog','gmt_offset','date_format','time_format','home'" />
    5050    <table width="100%" cellspacing="2" cellpadding="5" class="editform">
    5151      <tr valign="top">
     
    6060      </tr>
    6161      <tr valign="top">
    62         <th scope="row"><?php _e('Web address (URI):') ?> </th>
     62        <th scope="row"><?php _e('WordPress address (URI):') ?></th>
    6363        <td><input name="siteurl" type="text" id="siteurl" value="<?php echo get_settings('siteurl'); ?>" size="40" class="code" /></td>
    6464      </tr>
     65      <tr valign="top">
     66        <th scope="row"><?php _e('Blog address (URI):') ?></th>
     67        <td><input name="home" type="text" id="home" value="<?php echo get_settings('home'); ?>" size="40" class="code" /><br /><?php _e('If you want your blog homepage to be different than the directory you installed WordPress in, enter that address here. '); ?></td>
     68        </tr>
    6569      <tr valign="top">
    6670        <th scope="row"><?php _e('E-mail address:') ?> </th>
  • trunk/wp-admin/options-permalink.php

    r1198 r1203  
    7676if ('/' != substr($site_root, -1)) $site_root = $site_root . '/';
    7777
     78$home_root = str_replace('http://', '', trim(get_settings('home')));
     79$home_root = preg_replace('|([^/]*)(.*)|i', '$2', $home_root);
     80if ('/' != substr($home_root, -1)) $home_root = $home_root . '/';
     81
    7882?>
    7983<form action="">
    8084    <p>
    8185        <textarea rows="5" style="width: 100%;">RewriteEngine On
    82 RewriteBase <?php echo $site_root; ?>
     86RewriteBase <?php echo $home_root; ?>
    8387<?php
    8488$rewrite = rewrite_rules('', $permalink_structure);
    8589foreach ($rewrite as $match => $query) {
     90    if (strstr($query, 'index.php')) echo 'RewriteRule ^' . $match . ' ' . $home_root . $query . " [QSA]\n";
    8691    echo 'RewriteRule ^' . $match . ' ' . $site_root . $query . " [QSA]\n";
    8792}
  • trunk/wp-admin/upgrade-functions.php

    r1188 r1203  
    799799    }
    800800
     801    // Option for different blog URL
     802    if(!$wpdb->get_var("SELECT option_id FROM $tableoptions WHERE option_name = 'home'")) {
     803        $wpdb->query("INSERT INTO $tableoptions (option_name, option_type, option_value, option_admin_level) VALUES ('home', 3, '', 8)");
     804    }
     805
    801806    // Delete unused options
    802807    $unusedoptions = array ('blodotgsping_url', 'bodyterminator', 'emailtestonly', 'phoneemail_separator', 'smilies_directory', 'subjectprefix', 'use_bbcode', 'use_blodotgsping', 'use_phoneemail', 'use_quicktags', 'use_weblogsping', 'weblogs_cache_file');
  • trunk/wp-comments-reply.php

    r1108 r1203  
    1919<body id="commentspopup">
    2020
    21 <h1 id="header"><a href="<?php echo get_settings('siteurl'); ?>" title="<?php echo get_settings('blogname'); ?>"><?php echo get_settings('blogname'); ?></a></h1>
     21<h1 id="header"><a href="<?php echo get_settings('home'); ?>" title="<?php echo get_settings('blogname'); ?>"><?php echo get_settings('blogname'); ?></a></h1>
    2222
    2323<h2 id="comments">Replying to Comment:</h2>
  • trunk/wp-content/plugins/google-hilite.php

    r1104 r1203  
    5858
    5959function is_referer_search_engine($engine = 'google') {
    60     $siteurl = get_settings('siteurl');
     60    $siteurl = get_settings('home');
    6161    $referer = urldecode($_SERVER['HTTP_REFERER']);
    6262    //echo "referer is: $referer<br />";
  • trunk/wp-includes/functions.php

    r1190 r1203  
    225225    global $wpdb, $tableposts;
    226226
    227     $siteurl = get_settings('siteurl');
     227    $siteurl = get_settings('home');
    228228    // Take a link like 'http://example.com/blog/something'
    229229    // and extract just the '/something':
     
    311311    }
    312312
     313    if ('home' == $setting && '' == $settings->home) return $settings->siteurl;
     314
    313315    if (!isset($settings->$setting)) {
    314316        return false;
     
    326328            //  never underestimate the ingenuity of the fools :)"
    327329            if ('siteurl' == $option->option_name) $option->option_value = preg_replace('|/+$|', '', $option->option_value);
     330            if ('home' == $option->option_name) $option->option_value = preg_replace('|/+$|', '', $option->option_value);
     331
    328332            $all_options->{$option->option_name} = $option->option_value;
    329333        }
     
    532536  $f = new xmlrpcmsg('weblogUpdates.ping',
    533537                array(new xmlrpcval(get_settings('blogname'), 'string'),
    534                     new xmlrpcval(get_settings('siteurl') ,'string')));
     538                    new xmlrpcval(get_settings('home') ,'string')));
    535539  $c = new xmlrpc_client($path, $server, 80);
    536540  $r = $c->send($f);
     
    637641        $link_text = $matches[4][$i];
    638642        $content = str_replace($link_match, $link_text.' '.$link_number, $content);
    639         $link_url = (strtolower(substr($link_url,0,7)) != 'http://') ? get_settings('siteurl') . $link_url : $link_url;
     643        $link_url = (strtolower(substr($link_url,0,7)) != 'http://') ? get_settings('home') . $link_url : $link_url;
    640644        $links_summary .= "\n".$link_number.' '.$link_url;
    641645    }
     
    918922function pingGeoURL($blog_ID) {
    919923
    920     $ourUrl = get_settings('siteurl') ."/index.php?p=".$blog_ID;
     924    $ourUrl = get_settings('home') ."/index.php?p=".$blog_ID;
    921925    $host="geourl.org";
    922926    $path="/ping/?p=".$ourUrl;
  • trunk/wp-includes/template-functions-author.php

    r1186 r1203  
    8383   
    8484    if ('' == $permalink_structure) {
    85         $file = get_settings('siteurl') . '/' . get_settings('blogfilename');
     85        $file = get_settings('home') . '/' . get_settings('blogfilename');
    8686        $link = $file.$querystring_start.'author'.$querystring_equal.$auth_ID;
    8787    } else {
     
    8989        // Get any static stuff from the front
    9090        $front = substr($permalink_structure, 0, strpos($permalink_structure, '%'));
    91         $link = get_settings('siteurl') . $front . 'author/';
     91        $link = get_settings('home') . $front . 'author/';
    9292        $link .= $author_nicename . '/';
    9393    }
  • trunk/wp-includes/template-functions-category.php

    r1191 r1203  
    2222   
    2323    if ('' == $permalink_structure) {
    24         $file = get_settings('siteurl') . '/' . get_settings('blogfilename');
     24        $file = get_settings('home') . '/' . 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 = get_settings('siteurl') . $front . 'category/';
     30        $link = get_settings('home') . $front . 'category/';
    3131        if ($parent=$cache_categories[$category_id]->category_parent) $link .= get_category_parents($parent, FALSE, '/', TRUE);
    3232        $link .= $category_nicename . '/';
     
    188188    global $pagenow;
    189189    global $querystring_start, $querystring_equal, $querystring_separator;
    190     if (($file == 'blah') || ($file == '')) $file = get_settings('siteurl') . '/' . get_settings('blogfilename');
     190    if (($file == 'blah') || ($file == '')) $file = get_settings('home') . '/' . get_settings('blogfilename');
    191191    if (!$selected) $selected=$cat;
    192192    $sort_column = 'cat_'.$sort_column;
     
    260260    // Optiondates now works
    261261    if ('' == $file) {
    262         $file = get_settings('siteurl') . '/' . get_settings('blogfilename');
     262        $file = get_settings('home') . '/' . get_settings('blogfilename');
    263263    }
    264264    if (intval($categories)==0){
  • trunk/wp-includes/template-functions-general.php

    r1185 r1203  
    2727    if ('' != get_settings('permalink_structure')) {
    2828        $do_perma = 1;
    29         $feed_url = get_settings('siteurl') . '/feed';
    30         $comment_feed_url = get_settings('siteurl') . '/comments/feed';
     29        $feed_url = get_settings('home') . '/feed';
     30        $comment_feed_url = get_settings('home') . '/comments/feed';
    3131    }
    3232
     
    3434        case 'url':
    3535        case 'siteurl':
    36             $output = get_settings('siteurl');
     36            $output = get_settings('home');
    3737            break;
    3838        case 'description':
     
    280280                    $arc_week_start = date_i18n($archive_week_start_date_format, $arc_week['start']);
    281281                    $arc_week_end = date_i18n($archive_week_end_date_format, $arc_week['end']);
    282                     $url  = sprintf('%s/%s%sm%s%s%sw%s%d', get_settings('siteurl'), get_settings('blogfilename'), $querystring_start,
     282                    $url  = sprintf('%s/%s%sm%s%s%sw%s%d', get_settings('home'), get_settings('blogfilename'), $querystring_start,
    283283                                    $querystring_equal, $arc_year, $querystring_separator,
    284284                                    $querystring_equal, $arcresult->week);
  • trunk/wp-includes/template-functions-links.php

    r1150 r1203  
    6464                $post->ID
    6565            );
    66             return get_settings('siteurl') . str_replace($rewritecode, $rewritereplace, get_settings('permalink_structure'));
     66            return get_settings('home') . str_replace($rewritecode, $rewritereplace, get_settings('permalink_structure'));
    6767        } else { // if they're not using the fancy permalink option
    68             return get_settings('siteurl') . '/' . get_settings('blogfilename').$querystring_start.'p'.$querystring_equal.$post->ID;
     68            return get_settings('home') . '/' . get_settings('blogfilename').$querystring_start.'p'.$querystring_equal.$post->ID;
    6969        }
    7070    } else { // if an ID is given
     
    7979                $id
    8080            );
    81             return get_settings('siteurl') . str_replace($rewritecode, $rewritereplace, get_settings('permalink_structure'));
     81            return get_settings('home') . str_replace($rewritecode, $rewritereplace, get_settings('permalink_structure'));
    8282        } else {
    83             return get_settings('siteurl') . '/' . get_settings('blogfilename').$querystring_start.'p'.$querystring_equal.$id;
     83            return get_settings('home') . '/' . get_settings('blogfilename').$querystring_start.'p'.$querystring_equal.$id;
    8484        }
    8585    }
     
    9898        $monthlink = str_replace('%monthnum%', zeroise(intval($month), 2), $monthlink);
    9999        $monthlink = str_replace('%post_id%', '', $monthlink);
    100         return get_settings('siteurl') . $monthlink;
     100        return get_settings('home') . $monthlink;
    101101    } else {
    102         return get_settings('siteurl') .'/'. get_settings('blogfilename') .$querystring_start.'m'.$querystring_equal.$year.zeroise($month, 2);
     102        return get_settings('home') .'/'. get_settings('blogfilename') .$querystring_start.'m'.$querystring_equal.$year.zeroise($month, 2);
    103103    }
    104104}
     
    118118        $daylink = str_replace('%day%', zeroise(intval($day), 2), $daylink);
    119119        $daylink = str_replace('%post_id%', '', $daylink);
    120         return get_settings('siteurl') . $daylink;
     120        return get_settings('home') . $daylink;
    121121    } else {
    122         return get_settings('siteurl') .'/'. get_settings('blogfilename') .$querystring_start.'m'.$querystring_equal.$year.zeroise($month, 2).zeroise($day, 2);
     122        return get_settings('home') .'/'. get_settings('blogfilename') .$querystring_start.'m'.$querystring_equal.$year.zeroise($month, 2).zeroise($day, 2);
    123123    }
    124124}
  • trunk/wp-includes/template-functions-post.php

    r1150 r1203  
    374374        $nextpage = intval($paged) + 1;
    375375        if (!$max_page || $max_page >= $nextpage) {
    376             echo  get_settings('siteurl') .'/'.$pagenow.$querystring_start.
     376            echo  get_settings('home') .'/'.$pagenow.$querystring_start.
    377377                ($qstr == '' ? '' : $qstr.$querystring_separator) .
    378378                'paged'.$querystring_equal.$nextpage;
     
    426426        $nextpage = intval($paged) - 1;
    427427        if ($nextpage < 1) $nextpage = 1;
    428         echo  get_settings('siteurl') .'/'.$pagenow.$querystring_start.
     428        echo  get_settings('home') .'/'.$pagenow.$querystring_start.
    429429            ($qstr == '' ? '' : $qstr.$querystring_separator) .
    430430            'paged'.$querystring_equal.$nextpage;
  • trunk/wp-login.php

    r1182 r1203  
    281281<div id="login">
    282282<p>
    283     <a href="<?php echo get_settings('siteurl'); ?>" title="<?php _e('Are you lost?') ?>"><?php _e('Back to blog?') ?></a><br />
     283    <a href="<?php echo get_settings('home'); ?>" title="<?php _e('Are you lost?') ?>"><?php _e('Back to blog?') ?></a><br />
    284284<?php if (get_settings('users_can_register')) { ?>
    285285    <a href="<?php echo get_settings('siteurl'); ?>/wp-register.php" title="<?php _e('Register to be an author') ?>"><?php _e('Register?') ?></a><br />
  • trunk/wp.php

    r956 r1203  
    1616</head>
    1717<body>
    18 <h1 id="header"><a href="<?php echo get_settings('siteurl'); ?>" title="<?php bloginfo('name'); ?>"><?php bloginfo('name'); ?></a></h1>
     18<h1 id="header"><a href="<?php echo get_settings('home'); ?>" title="<?php bloginfo('name'); ?>"><?php bloginfo('name'); ?></a></h1>
    1919
    2020<!-- // loop start -->
Note: See TracChangeset for help on using the changeset viewer.