Remove querystring variable legacy code

git-svn-id: http://svn.automattic.com/wordpress/trunk@2239 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
saxmatt 2005-02-07 07:37:53 +00:00
parent 2520d8e8f5
commit b00f007d8f
9 changed files with 28 additions and 56 deletions

View File

@ -92,7 +92,6 @@ function comments_popup_script($width=400, $height=400, $file='') {
function comments_popup_link($zero='No Comments', $one='1 Comment', $more='% Comments', $CSSclass='', $none='Comments Off') {
global $id, $wpcommentspopupfile, $wpcommentsjavascript, $post, $wpdb;
global $querystring_start, $querystring_equal, $querystring_separator;
global $comment_count_cache;
if (! is_single() && ! is_page()) {
@ -113,7 +112,7 @@ function comments_popup_link($zero='No Comments', $one='1 Comment', $more='% Com
}
echo '<a href="';
if ($wpcommentsjavascript) {
echo get_settings('siteurl') . '/' . $wpcommentspopupfile.$querystring_start.'p'.$querystring_equal.$id.$querystring_separator.'c'.$querystring_equal.'1';
echo get_settings('siteurl') . '/' . $wpcommentspopupfile.'?p='.$id.'amp;c=1';
//echo get_permalink();
echo '" onclick="wpopen(this.href); return false"';
} else {
@ -635,7 +634,6 @@ function wp_get_comment_status($comment_id) {
if ( ! function_exists('wp_notify_postauthor') ) {
function wp_notify_postauthor($comment_id, $comment_type='') {
global $wpdb;
global $querystring_start, $querystring_equal, $querystring_separator;
$comment = $wpdb->get_row("SELECT * FROM $wpdb->comments WHERE comment_ID='$comment_id' LIMIT 1");
$post = $wpdb->get_row("SELECT * FROM $wpdb->posts WHERE ID='$comment->comment_post_ID' LIMIT 1");

View File

@ -76,7 +76,6 @@ function comments_rss_link($link_text = 'Comments RSS', $commentsrssfilename = '
function comments_rss($commentsrssfilename = 'wp-commentsrss2.php') {
global $id;
global $querystring_start, $querystring_equal, $querystring_separator;
if ('' != get_settings('permalink_structure'))
$url = trailingslashit( get_permalink() ) . 'feed/';
@ -87,13 +86,12 @@ function comments_rss($commentsrssfilename = 'wp-commentsrss2.php') {
}
function get_author_rss_link($echo = false, $author_id, $author_nicename) {
global $querystring_start, $querystring_equal;
$auth_ID = $author_id;
$permalink_structure = get_settings('permalink_structure');
if ('' == $permalink_structure) {
$file = get_settings('siteurl') . '/wp-rss2.php';
$link = $file . $querystring_start . 'author' . $querystring_equal . $author_id;
$link = $file . '?author=' . $author_id;
} else {
$link = get_author_link(0, $author_id, $author_nicename);
$link = $link . "feed/";
@ -104,13 +102,12 @@ function get_author_rss_link($echo = false, $author_id, $author_nicename) {
}
function get_category_rss_link($echo = false, $category_id, $category_nicename) {
global $querystring_start, $querystring_equal;
$cat_ID = $category_id;
$permalink_structure = get_settings('permalink_structure');
if ('' == $permalink_structure) {
$file = get_settings('siteurl') . '/wp-rss2.php';
$link = $file . $querystring_start . 'cat' . $querystring_equal . $category_id;
$link = $file . '?cat=' . $category_id;
} else {
$link = get_category_link(0, $category_id, $category_nicename);
$link = $link . "feed/";

View File

@ -123,13 +123,13 @@ function the_author_posts_link($idmode='') {
function get_author_link($echo = false, $author_id, $author_nicename) {
global $wpdb, $wp_rewrite, $post, $querystring_start, $querystring_equal, $cache_userdata;
global $wpdb, $wp_rewrite, $post, $cache_userdata;
$auth_ID = $author_id;
$link = $wp_rewrite->get_author_permastruct();
if (empty($link)) {
$file = get_settings('home') . '/';
$link = $file.$querystring_start.'author'.$querystring_equal.$auth_ID;
$link = $file . '?author=' . .$auth_ID;
} else {
if ('' == $author_nicename) $author_nicename = $cache_userdata[$author_id]->author_nicename;
$link = str_replace('%author%', $author_nicename, $link);

View File

@ -25,13 +25,13 @@ function get_the_category($id = false) {
}
function get_category_link($echo = false, $category_id, $category_nicename) {
global $wpdb, $wp_rewrite, $post, $querystring_start, $querystring_equal, $cache_categories;
global $wpdb, $wp_rewrite, $post, $cache_categories;
$cat_ID = $category_id;
$catlink = $wp_rewrite->get_category_permastruct();
if (empty($catlink)) {
$file = get_settings('home') . '/';
$catlink = $file.$querystring_start.'cat'.$querystring_equal.$cat_ID;
$catlink = $file . '?cat=' . $cat_ID;
} else {
$category_nicename = $cache_categories[$category_id]->category_nicename;
if ($parent=$cache_categories[$category_id]->category_parent) $category_nicename = get_category_parents($parent, FALSE, '/', TRUE) . $category_nicename . '/';
@ -182,7 +182,6 @@ function dropdown_cats($optionall = 1, $all = 'All', $sort_column = 'ID', $sort_
$optiondates = 0, $optioncount = 0, $hide_empty = 1, $optionnone=FALSE,
$selected=0, $hide=0) {
global $wpdb;
global $querystring_start, $querystring_equal, $querystring_separator;
if (($file == 'blah') || ($file == '')) $file = get_settings('home') . '/';
if (!$selected) $selected=$cat;
$sort_column = 'cat_'.$sort_column;
@ -253,7 +252,6 @@ function wp_list_cats($args = '') {
function 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, $feed = '', $feed_image = '', $exclude = '', $hierarchical=FALSE) {
global $wpdb, $category_posts;
global $querystring_start, $querystring_equal, $querystring_separator;
// Optiondates now works
if ('' == $file) {
$file = get_settings('home') . '/';
@ -308,16 +306,6 @@ function list_cats($optionall = 1, $all = 'All', $sort_column = 'ID', $sort_orde
}
}
if (intval($optionall) == 1 && !$child_of && $categories) {
$all = apply_filters('list_cats', $all);
$link = "<a href=\"".$file.$querystring_start.'cat'.$querystring_equal.'all">'.$all."</a>";
if ($list) {
echo "\n\t<li>$link</li>";
} else {
echo "\t$link<br />\n";
}
}
$num_found=0;
$thelist = "";

View File

@ -262,7 +262,7 @@ function wp_get_archives($args = '') {
}
function get_archives($type='', $limit='', $format='html', $before = '', $after = '', $show_post_count = false) {
global $querystring_start, $querystring_equal, $querystring_separator, $month, $wpdb;
global $month, $wpdb;
if ('' == $type) {
$type = 'monthly';
@ -276,9 +276,9 @@ function get_archives($type='', $limit='', $format='html', $before = '', $after
$archive_week_separator = '&#8211;';
// archive link url
$archive_link_m = get_settings('siteurl').'/'.$querystring_start.'m'.$querystring_equal; # monthly archive;
$archive_link_w = get_settings('siteurl').'/'.$querystring_start.'w'.$querystring_equal; # weekly archive;
$archive_link_p = get_settings('siteurl').'/'.$querystring_start.'p'.$querystring_equal; # post-by-post archive;
$archive_link_m = get_settings('siteurl') . '/?m='; # monthly archive;
$archive_link_w = get_settings('siteurl') . '/?w='; # weekly archive;
$archive_link_p = get_settings('siteurl') . '/?p='; # post-by-post archive;
// over-ride general date format ? 0 = no: use the date format set in Options, 1 = yes: over-ride
$archive_date_format_over_ride = 0;
@ -338,9 +338,9 @@ function get_archives($type='', $limit='', $format='html', $before = '', $after
$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_end = date_i18n($archive_week_end_date_format, $arc_week['end']);
$url = sprintf('%s/%s%sm%s%s%sw%s%d', get_settings('home'), '', $querystring_start,
$querystring_equal, $arc_year, $querystring_separator,
$querystring_equal, $arcresult->week);
$url = sprintf('%s/%s%sm%s%s%sw%s%d', get_settings('home'), '', '?',
'=', $arc_year, '&amp;',
'=', $arcresult->week);
$text = $arc_week_start . $archive_week_separator . $arc_week_end;
echo get_archives_link($url, $text, $format, $before, $after);
}

View File

@ -102,19 +102,19 @@ function get_page_link($id = false) {
}
function get_year_link($year) {
global $querystring_start, $querystring_equal, $wp_rewrite;
global $wp_rewrite;
if (!$year) $year = gmdate('Y', time()+(get_settings('gmt_offset') * 3600));
$yearlink = $wp_rewrite->get_year_permastruct();
if (!empty($yearlink)) {
$yearlink = str_replace('%year%', $year, $yearlink);
return apply_filters('year_link', get_settings('home') . trailingslashit($yearlink), $year);
} else {
return apply_filters('year_link', get_settings('home') .'/'. $querystring_start.'m'.$querystring_equal.$year, $year);
return apply_filters('year_link', get_settings('home') . '/?m=' . $year, $year);
}
}
function get_month_link($year, $month) {
global $querystring_start, $querystring_equal, $wp_rewrite;
global $wp_rewrite;
if (!$year) $year = gmdate('Y', time()+(get_settings('gmt_offset') * 3600));
if (!$month) $month = gmdate('m', time()+(get_settings('gmt_offset') * 3600));
$monthlink = $wp_rewrite->get_month_permastruct();
@ -123,12 +123,12 @@ function get_month_link($year, $month) {
$monthlink = str_replace('%monthnum%', zeroise(intval($month), 2), $monthlink);
return apply_filters('month_link', get_settings('home') . trailingslashit($monthlink), $year, $month);
} else {
return apply_filters('month_link', get_settings('home') .'/'. $querystring_start.'m'.$querystring_equal.$year.zeroise($month, 2), $year, $month);
return apply_filters('month_link', get_settings('home') . '/?m=' . $year . zeroise($month, 2), $year, $month);
}
}
function get_day_link($year, $month, $day) {
global $querystring_start, $querystring_equal, $wp_rewrite;
global $wp_rewrite;
if (!$year) $year = gmdate('Y', time()+(get_settings('gmt_offset') * 3600));
if (!$month) $month = gmdate('m', time()+(get_settings('gmt_offset') * 3600));
if (!$day) $day = gmdate('j', time()+(get_settings('gmt_offset') * 3600));
@ -140,7 +140,7 @@ function get_day_link($year, $month, $day) {
$daylink = str_replace('%day%', zeroise(intval($day), 2), $daylink);
return apply_filters('day_link', get_settings('home') . trailingslashit($daylink), $year, $month, $day);
} else {
return apply_filters('day_link', get_settings('home') .'/'. $querystring_start.'m'.$querystring_equal.$year.zeroise($month, 2).zeroise($day, 2), $year, $month, $day);
return apply_filters('day_link', get_settings('home') . '/?m=' . $year . zeroise($month, 2) . zeroise($day, 2), $year, $month, $day);
}
}
@ -300,7 +300,6 @@ function next_post_link($format='%link &raquo;', $link='%title', $in_same_cat =
function previous_post($format='%', $previous='previous post: ', $title='yes', $in_same_cat='no', $limitprev=1, $excluded_categories='') {
global $id, $post, $wpdb;
global $posts, $posts_per_page, $s;
global $querystring_start, $querystring_equal, $querystring_separator;
if(($posts_per_page == 1) || is_single()) {
@ -403,11 +402,10 @@ function get_pagenum_link($pagenum = 1){
// lets see what sort of URL we have...
} else {
// we need to know the way queries are being written
global $querystring_start, $querystring_equal, $querystring_separator;
// if there's a querystring_start (a "?" usually), it's deffinitely not mod_rewritten
if ( stristr( $qstr, $querystring_start ) ){
if ( stristr( $qstr, '?' ) ){
// so append the query string (using &, since we already have ?)
$qstr .= $querystring_separator.$page_querystring.$querystring_equal.$pagenum;
$qstr .= '&amp;' . $page_querystring . '=' . $pagenum;
// otherwise, it could be rewritten, OR just the default index ...
} elseif( '' != get_settings('permalink_structure')) {
$permalink = 1;
@ -425,7 +423,7 @@ function get_pagenum_link($pagenum = 1){
$qstr = trailingslashit($qstr) . $page_modstring . $pagenum;
} else {
$qstr = $index . $querystring_start.$page_querystring.$querystring_equal.$pagenum;
$qstr = $index . '?' . $page_querystring . '=' . $pagenum;
}
}
@ -436,7 +434,6 @@ function get_pagenum_link($pagenum = 1){
function next_posts($max_page = 0) { // original by cfactor at cooltux.org
global $paged, $pagenow;
global $querystring_start, $querystring_equal, $querystring_separator;
if (! is_single()) {
if (!$paged) $paged = 1;
@ -468,7 +465,6 @@ function next_posts_link($label='Next Page &raquo;', $max_page=0) {
function previous_posts() { // original by cfactor at cooltux.org
global $_SERVER, $paged, $pagenow;
global $querystring_start, $querystring_equal, $querystring_separator;
if (! is_single()) {
$nextpage = intval($paged) - 1;

View File

@ -170,7 +170,6 @@ function wp_link_pages($args = '') {
function link_pages($before='<br />', $after='<br />', $next_or_number='number', $nextpagelink='next page', $previouspagelink='previous page', $pagelink='%', $more_file='') {
global $id, $page, $numpages, $multipage, $more;
global $pagenow;
global $querystring_start, $querystring_equal, $querystring_separator;
if ($more_file != '') {
$file = $more_file;
} else {
@ -184,9 +183,9 @@ function link_pages($before='<br />', $after='<br />', $next_or_number='number',
echo ' ';
if (($i != $page) || ((!$more) && ($page==1))) {
if ('' == get_settings('permalink_structure')) {
echo '<a href="'.get_permalink().$querystring_separator.'page'.$querystring_equal.$i.'">';
echo '<a href="' . get_permalink() . '&amp;page=' . $i . '">';
} else {
echo '<a href="'.get_permalink().$i.'/">';
echo '<a href="' . get_permalink() . $i . '/">';
}
}
echo $j;
@ -200,15 +199,15 @@ function link_pages($before='<br />', $after='<br />', $next_or_number='number',
$i=$page-1;
if ($i && $more) {
if ('' == get_settings('permalink_structure')) {
echo '<a href="'.get_permalink().$querystring_separator.'page'.$querystring_equal.$i.'">'.$previouspagelink.'</a>';
echo '<a href="' . get_permalink() '&amp;page=' . $i . '">'.$previouspagelink.'</a>';
} else {
echo '<a href="'.get_permalink().$i.'/">'.$previouspagelink.'</a>';
echo '<a href="' . get_permalink() . $i . '/">'.$previouspagelink.'</a>';
}
}
$i=$page+1;
if ($i<=$numpages && $more) {
if ('' == get_settings('permalink_structure')) {
echo '<a href="'.get_permalink().$querystring_separator.'page'.$querystring_equal.$i.'">'.$nextpagelink.'</a>';
echo '<a href="'.get_permalink() . '&amp;page=' . $i . '">'.$nextpagelink.'</a>';
} else {
echo '<a href="'.get_permalink().$i.'/">'.$nextpagelink.'</a>';
}

View File

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

View File

@ -88,9 +88,6 @@ require (ABSPATH . WPINC . '/kses.php');
require (ABSPATH . WPINC . '/version.php');
if (!strstr($_SERVER['PHP_SELF'], 'install.php') && !strstr($_SERVER['PHP_SELF'], 'wp-admin/import')) :
$querystring_start = '?';
$querystring_equal = '=';
$querystring_separator = '&amp;';
// Used to guarantee unique hash cookies
$cookiehash = md5(get_settings('siteurl')); // Remove in 1.4