Cleaning up blogfilename.

git-svn-id: http://svn.automattic.com/wordpress/trunk@1997 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
saxmatt 2004-12-24 01:34:47 +00:00
parent b73a9d7e8c
commit 637cfdc7a4
10 changed files with 20 additions and 21 deletions

View File

@ -794,7 +794,7 @@ function get_home_path() {
} }
function get_real_file_to_edit($file) { function get_real_file_to_edit($file) {
if ('index.php' == $file || get_settings('blogfilename') == $file || if ('index.php' == $file ||
'.htaccess' == $file) { '.htaccess' == $file) {
$real_file = get_home_path() . $file; $real_file = get_home_path() . $file;
} else { } else {

View File

@ -85,7 +85,7 @@ window.onload = blurry;
<body> <body>
<div id="wphead"> <div id="wphead">
<h1><?php echo wptexturize(get_settings(('blogname'))); ?> <span>(<a href="<?php echo get_settings('home') . '/' . get_settings('blogfilename'); ?>"><?php _e('View site') ?> &raquo;</a>)</span></h1> <h1><?php echo wptexturize(get_settings(('blogname'))); ?> <span>(<a href="<?php echo get_settings('home') . '/'; ?>"><?php _e('View site') ?> &raquo;</a>)</span></h1>
</div> </div>
<?php <?php

View File

@ -154,7 +154,6 @@ function populate_options() {
$guessurl = preg_replace('|/wp-admin/.*|i', '', 'http://' . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI']); $guessurl = preg_replace('|/wp-admin/.*|i', '', 'http://' . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI']);
add_option('siteurl', $guessurl, 'WordPress web address'); add_option('siteurl', $guessurl, 'WordPress web address');
add_option('blogfilename', '', 'Default file for blog');
add_option('blogname', 'My Weblog', 'Blog title'); add_option('blogname', 'My Weblog', 'Blog title');
add_option('blogdescription', 'Just another WordPress weblog', 'Short tagline'); add_option('blogdescription', 'Just another WordPress weblog', 'Short tagline');
add_option('new_users_can_blog', 0); add_option('new_users_can_blog', 0);

View File

@ -128,7 +128,7 @@ function get_author_link($echo = false, $author_id, $author_nicename) {
$link = $wp_rewrite->get_author_permastruct(); $link = $wp_rewrite->get_author_permastruct();
if (empty($link)) { if (empty($link)) {
$file = get_settings('home') . '/' . get_settings('blogfilename'); $file = get_settings('home') . '/';
$link = $file.$querystring_start.'author'.$querystring_equal.$auth_ID; $link = $file.$querystring_start.'author'.$querystring_equal.$auth_ID;
} else { } else {
if ('' == $author_nicename) $author_nicename = $cache_userdata[$author_id]->author_nicename; if ('' == $author_nicename) $author_nicename = $cache_userdata[$author_id]->author_nicename;
@ -170,7 +170,7 @@ function wp_list_authors($args = '') {
} }
function list_authors($optioncount = false, $exclude_admin = true, $show_fullname = false, $hide_empty = true, $feed = '', $feed_image = '') { function list_authors($optioncount = false, $exclude_admin = true, $show_fullname = false, $hide_empty = true, $feed = '', $feed_image = '') {
global $wpdb, $blogfilename; global $wpdb;
$query = "SELECT ID, user_nickname, user_firstname, user_lastname, user_nicename from $wpdb->users " . ($exclude_admin ? "WHERE user_nickname <> 'admin' " : '') . "ORDER BY user_nickname"; $query = "SELECT ID, user_nickname, user_firstname, user_lastname, user_nicename from $wpdb->users " . ($exclude_admin ? "WHERE user_nickname <> 'admin' " : '') . "ORDER BY user_nickname";
$authors = $wpdb->get_results($query); $authors = $wpdb->get_results($query);

View File

@ -30,7 +30,7 @@ function get_category_link($echo = false, $category_id, $category_nicename) {
$catlink = $wp_rewrite->get_category_permastruct(); $catlink = $wp_rewrite->get_category_permastruct();
if (empty($catlink)) { if (empty($catlink)) {
$file = get_settings('home') . '/' . get_settings('blogfilename'); $file = get_settings('home') . '/';
$catlink = $file.$querystring_start.'cat'.$querystring_equal.$cat_ID; $catlink = $file.$querystring_start.'cat'.$querystring_equal.$cat_ID;
} else { } else {
$category_nicename = $cache_categories[$category_id]->category_nicename; $category_nicename = $cache_categories[$category_id]->category_nicename;
@ -213,7 +213,7 @@ function dropdown_cats($optionall = 1, $all = 'All', $sort_column = 'ID', $sort_
$selected=0, $hide=0) { $selected=0, $hide=0) {
global $wpdb; global $wpdb;
global $querystring_start, $querystring_equal, $querystring_separator; global $querystring_start, $querystring_equal, $querystring_separator;
if (($file == 'blah') || ($file == '')) $file = get_settings('home') . '/' . get_settings('blogfilename'); if (($file == 'blah') || ($file == '')) $file = get_settings('home') . '/';
if (!$selected) $selected=$cat; if (!$selected) $selected=$cat;
$sort_column = 'cat_'.$sort_column; $sort_column = 'cat_'.$sort_column;
@ -286,7 +286,7 @@ function list_cats($optionall = 1, $all = 'All', $sort_column = 'ID', $sort_orde
global $querystring_start, $querystring_equal, $querystring_separator; global $querystring_start, $querystring_equal, $querystring_separator;
// Optiondates now works // Optiondates now works
if ('' == $file) { if ('' == $file) {
$file = get_settings('home') . '/' . get_settings('blogfilename'); $file = get_settings('home') . '/';
} }
$exclusions = ''; $exclusions = '';

View File

@ -274,9 +274,9 @@ function get_archives($type='', $limit='', $format='html', $before = '', $after
$archive_week_separator = '&#8211;'; $archive_week_separator = '&#8211;';
// archive link url // archive link url
$archive_link_m = get_settings('siteurl').'/'.get_settings('blogfilename').$querystring_start.'m'.$querystring_equal; # monthly archive; $archive_link_m = get_settings('siteurl').'/'.$querystring_start.'m'.$querystring_equal; # monthly archive;
$archive_link_w = get_settings('siteurl').'/'.get_settings('blogfilename').$querystring_start.'w'.$querystring_equal; # weekly archive; $archive_link_w = get_settings('siteurl').'/'.$querystring_start.'w'.$querystring_equal; # weekly archive;
$archive_link_p = get_settings('siteurl').'/'.get_settings('blogfilename').$querystring_start.'p'.$querystring_equal; # post-by-post archive; $archive_link_p = get_settings('siteurl').'/'.$querystring_start.'p'.$querystring_equal; # post-by-post archive;
// over-ride general date format ? 0 = no: use the date format set in Options, 1 = yes: over-ride // over-ride general date format ? 0 = no: use the date format set in Options, 1 = yes: over-ride
$archive_date_format_over_ride = 0; $archive_date_format_over_ride = 0;
@ -336,7 +336,7 @@ function get_archives($type='', $limit='', $format='html', $before = '', $after
$arc_week = get_weekstartend($arcresult->yyyymmdd, get_settings('start_of_week')); $arc_week = get_weekstartend($arcresult->yyyymmdd, get_settings('start_of_week'));
$arc_week_start = date_i18n($archive_week_start_date_format, $arc_week['start']); $arc_week_start = date_i18n($archive_week_start_date_format, $arc_week['start']);
$arc_week_end = date_i18n($archive_week_end_date_format, $arc_week['end']); $arc_week_end = date_i18n($archive_week_end_date_format, $arc_week['end']);
$url = sprintf('%s/%s%sm%s%s%sw%s%d', get_settings('home'), get_settings('blogfilename'), $querystring_start, $url = sprintf('%s/%s%sm%s%s%sw%s%d', get_settings('home'), '', $querystring_start,
$querystring_equal, $arc_year, $querystring_separator, $querystring_equal, $arc_year, $querystring_separator,
$querystring_equal, $arcresult->week); $querystring_equal, $arcresult->week);
$text = $arc_week_start . $archive_week_separator . $arc_week_end; $text = $arc_week_start . $archive_week_separator . $arc_week_end;

View File

@ -78,7 +78,7 @@ function get_permalink($id = false) {
); );
return get_settings('home') . str_replace($rewritecode, $rewritereplace, $permalink); return get_settings('home') . str_replace($rewritecode, $rewritereplace, $permalink);
} else { // if they're not using the fancy permalink option } else { // if they're not using the fancy permalink option
$permalink = get_settings('home') . '/' . get_settings('blogfilename') . '?p=' . $idpost->ID; $permalink = get_settings('home') . '/?p=' . $idpost->ID;
return $permalink; return $permalink;
} }
} }
@ -113,7 +113,7 @@ function get_year_link($year) {
$yearlink = str_replace('%year%', $year, $yearlink); $yearlink = str_replace('%year%', $year, $yearlink);
return get_settings('home') . trailingslashit($yearlink); return get_settings('home') . trailingslashit($yearlink);
} else { } else {
return get_settings('home') .'/'. get_settings('blogfilename') .$querystring_start.'m'.$querystring_equal.$year; return get_settings('home') .'/'. $querystring_start.'m'.$querystring_equal.$year;
} }
} }
@ -127,7 +127,7 @@ function get_month_link($year, $month) {
$monthlink = str_replace('%monthnum%', zeroise(intval($month), 2), $monthlink); $monthlink = str_replace('%monthnum%', zeroise(intval($month), 2), $monthlink);
return get_settings('home') . trailingslashit($monthlink); return get_settings('home') . trailingslashit($monthlink);
} else { } else {
return get_settings('home') .'/'. get_settings('blogfilename') .$querystring_start.'m'.$querystring_equal.$year.zeroise($month, 2); return get_settings('home') .'/'. $querystring_start.'m'.$querystring_equal.$year.zeroise($month, 2);
} }
} }
@ -144,7 +144,7 @@ function get_day_link($year, $month, $day) {
$daylink = str_replace('%day%', zeroise(intval($day), 2), $daylink); $daylink = str_replace('%day%', zeroise(intval($day), 2), $daylink);
return get_settings('home') . trailingslashit($daylink); return get_settings('home') . trailingslashit($daylink);
} else { } else {
return get_settings('home') .'/'. get_settings('blogfilename') .$querystring_start.'m'.$querystring_equal.$year.zeroise($month, 2).zeroise($day, 2); return get_settings('home') .'/'. $querystring_start.'m'.$querystring_equal.$year.zeroise($month, 2).zeroise($day, 2);
} }
} }

View File

@ -13,7 +13,7 @@ if (preg_match('#([^/]+.php)#', $PHP_SELF, $self_matches)) {
$pagenow = explode('?', $pagenow); $pagenow = explode('?', $pagenow);
$pagenow = $pagenow[0]; $pagenow = $pagenow[0];
if (($querystring_start == '/') && ($pagenow != 'post.php')) { if (($querystring_start == '/') && ($pagenow != 'post.php')) {
$pagenow = get_settings('siteurl') . '/' . get_settings('blogfilename'); $pagenow = get_settings('siteurl') . '/';
} }
} else { } else {
$pagenow = 'index.php'; $pagenow = 'index.php';

View File

@ -130,7 +130,7 @@ case 'disabled':
<div id="login"> <div id="login">
<h2><?php _e('Registration Disabled') ?></h2> <h2><?php _e('Registration Disabled') ?></h2>
<p><?php _e('User registration is currently not allowed.') ?><br /> <p><?php _e('User registration is currently not allowed.') ?><br />
<a href="<?php echo get_settings('home') .'/'. get_settings('blogfilename'); ?>" title="<?php _e('Go back to the blog') ?>"><?php _e('Home') ?></a> <a href="<?php echo get_settings('home') . '/'; ?>" title="<?php _e('Go back to the blog') ?>"><?php _e('Home') ?></a>
</p> </p>
</div> </div>

View File

@ -149,7 +149,7 @@ class wp_xmlrpc_server extends IXR_Server {
$struct = array( $struct = array(
'isAdmin' => $is_admin, 'isAdmin' => $is_admin,
'url' => get_settings('home') .'/'.get_settings('blogfilename'), 'url' => get_settings('home') . '/',
'blogid' => '1', 'blogid' => '1',
'blogName' => get_settings('blogname') 'blogName' => get_settings('blogname')
); );
@ -281,7 +281,7 @@ class wp_xmlrpc_server extends IXR_Server {
} }
/* warning: here we make the assumption that the weblog's URI is on the same server */ /* warning: here we make the assumption that the weblog's URI is on the same server */
$filename = get_settings('home').'/'.get_settings('blogfilename'); $filename = get_settings('home') . '/';
$filename = preg_replace('#http://.+?/#', $_SERVER['DOCUMENT_ROOT'].'/', $filename); $filename = preg_replace('#http://.+?/#', $_SERVER['DOCUMENT_ROOT'].'/', $filename);
$f = fopen($filename, 'r'); $f = fopen($filename, 'r');
@ -315,7 +315,7 @@ class wp_xmlrpc_server extends IXR_Server {
} }
/* warning: here we make the assumption that the weblog's URI is on the same server */ /* warning: here we make the assumption that the weblog's URI is on the same server */
$filename = get_settings('home').'/'.get_settings('blogfilename'); $filename = get_settings('home') . '/';
$filename = preg_replace('#http://.+?/#', $_SERVER['DOCUMENT_ROOT'].'/', $filename); $filename = preg_replace('#http://.+?/#', $_SERVER['DOCUMENT_ROOT'].'/', $filename);
if ($f = fopen($filename, 'w+')) { if ($f = fopen($filename, 'w+')) {