Changeset 836
- Timestamp:
- 02/05/2004 08:55:50 PM (21 years ago)
- Location:
- trunk
- Files:
-
- 12 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-admin/options-permalink.php
r782 r836 130 130 $match = str_replace($rewritecode, $rewritereplace, $match); 131 131 $match = preg_replace('|[?]|', '', $match, 1); 132 133 $feedmatch = str_replace('?/?', '/', $match); 134 $trackbackmatch = $feedmatch; 135 132 136 preg_match_all('/%.+?%/', $permalink_structure, $tokens); 133 137 134 138 $query = 'index.php?'; 139 $feedquery = 'wp-feed.php?'; 140 $trackbackquery = 'wp-trackback.php?'; 135 141 for ($i = 0; $i < count($tokens[0]); ++$i) { 136 if (0 < $i) $query .= '&'; 137 $query .= str_replace($rewritecode, $queryreplace, $tokens[0][$i]) . '$'. ($i + 1); 142 if (0 < $i) { 143 $query .= '&'; 144 $feedquery .= '&'; 145 $trackbackquery .= '&'; 146 } 147 148 $query_token = str_replace($rewritecode, $queryreplace, $tokens[0][$i]) . '$'. ($i + 1); 149 $query .= $query_token; 150 $feedquery .= $query_token; 151 $trackbackquery .= $query_token; 138 152 } 139 153 ++$i; 154 140 155 // Add post paged stuff 141 156 $match .= '([0-9]+)?/?'; 142 157 $query .= "&page=$$i"; 158 159 // Add post feed stuff 160 $feedregex = '(feed|rdf|rss|rss2|atom)/?'; 161 $feedmatch .= $feedregex; 162 $feedquery .= "&feed=$$i"; 163 164 // Add post trackback stuff 165 $trackbackregex = 'trackback/?'; 166 $trackbackmatch .= $trackbackregex; 167 168 // Site feed 169 $sitefeedmatch = 'feed/?([0-9a-z-]+)?/?$'; 170 $sitefeedquery = $site_root . 'wp-feed.php?feed=$1'; 171 172 // Site comment feed 173 $sitecommentfeedmatch = 'comments/feed/?([0-9a-z-]+)?/?$'; 174 $sitecommentfeedquery = $site_root . 'wp-feed.php?feed=$1&withcomments=1'; 143 175 144 176 // Code for nice categories, currently not very flexible … … 152 184 RewriteBase <?php echo $site_root; ?> 153 185 RewriteRule ^<?php echo $match; echo '$ ' . $site_root . $query ?> [QSA] 154 RewriteRule ^<?php echo $catmatch; ?>?(.*) <?php echo $site_root; ?>index.php?category_name=$1 [QSA]</textarea> 186 RewriteRule ^<?php echo $feedmatch; echo '$ ' . $site_root . $feedquery ?> [QSA] 187 RewriteRule ^<?php echo $trackbackmatch; echo '$ ' . $site_root . $trackbackquery ?> [QSA] 188 RewriteRule ^<?php echo $catmatch; ?>(.*)/<?php echo $feedregex ?>$ <?php echo $site_root; ?>wp-feed.php?category_name=$1&feed=$2 [QSA] 189 RewriteRule ^<?php echo $catmatch; ?>?(.*) <?php echo $site_root; ?>index.php?category_name=$1 [QSA] 190 RewriteRule ^<?php echo $sitefeedmatch; ?> <?php echo $sitefeedquery ?> [QSA] 191 RewriteRule ^<?php echo $sitecommentfeedmatch; ?> <?php echo $sitecommentfeedquery ?> [QSA]</textarea> 155 192 </form> 156 193 </div> -
trunk/wp-atom.php
r785 r836 1 1 <?php 2 $blog = 1; 3 $doing_rss = 1; 2 if (! $feed) { 3 $blog = 1; 4 $doing_rss = 1; 5 require('wp-blog-header.php'); 6 } 7 4 8 header('Content-type: application/atom+xml', true); 5 require('wp-blog-header.php'); 9 6 10 if (!isset($rss_language)) { $rss_language = 'en'; } 7 11 if (!isset($rss_encoded_html)) { $rss_encoded_html = 0; } -
trunk/wp-blog-header.php
r828 r836 11 11 require($curpath.'/wp-config.php'); 12 12 13 $wpvarstoreset = array('m','p','posts','w', 'cat','withcomments','s','search','exact', 'sentence','poststart','postend','preview','debug', 'calendar','page','paged','more','tb', 'pb','author','order','orderby', 'year', 'monthnum', 'day', 'name', 'category_name' );13 $wpvarstoreset = array('m','p','posts','w', 'cat','withcomments','s','search','exact', 'sentence','poststart','postend','preview','debug', 'calendar','page','paged','more','tb', 'pb','author','order','orderby', 'year', 'monthnum', 'day', 'name', 'category_name', 'feed'); 14 14 15 15 for ($i=0; $i<count($wpvarstoreset); $i += 1) { -
trunk/wp-commentsrss2.php
r722 r836 6 6 /* These first lines are the first part of a WordPress template. 7 7 In every template you do, you got to copy them before the CafeLog 'loop' */ 8 $blog=1; // enter your blog's ID 8 if (! $feed) { 9 $blog=1; // enter your blog's ID 10 require('wp-blog-header.php'); 11 } 12 9 13 header('Content-type: text/xml'); 10 require('wp-blog-header.php');11 14 12 15 if (!isset($rss_language)) { $rss_language = 'en'; } … … 27 30 $i++; 28 31 ?> 29 <title><?php if (isset($_REQUEST["p"]) ) { echo "Comments on: "; the_title_rss(); } else { bloginfo_rss("name"); echo " Comments"; } ?></title>30 <link><?php isset($_REQUEST["p"]) ? permalink_single_rss() : bloginfo_rss("url") ?></link>32 <title><?php if (isset($_REQUEST["p"]) || isset($_REQUEST["name"])) { echo "Comments on: "; the_title_rss(); } else { bloginfo_rss("name"); echo " Comments"; } ?></title> 33 <link><?php (isset($_REQUEST["p"]) || isset($_REQUEST["name"])) ? permalink_single_rss() : bloginfo_rss("url") ?></link> 31 34 <description><?php bloginfo_rss("description") ?></description> 32 35 <dc:language><?php echo $rss_language ?></dc:language> … … 41 44 42 45 <?php 43 if (isset($_REQUEST["p"]) ) {46 if (isset($_REQUEST["p"]) || isset($_REQUEST["name"])) { 44 47 $comments = $wpdb->get_results("SELECT comment_ID, 45 48 comment_author, -
trunk/wp-includes/functions.php
r810 r836 74 74 $pee = preg_replace('/\n?(.+?)(?:\n\s*\n|\z)/s', "\t<p>$1</p>\n", $pee); // make paragraphs, including one at the end 75 75 $pee = preg_replace('|<p>\s*?</p>|', '', $pee); // under certain strange conditions it could create a P of entirely whitespace 76 $pee = preg_replace('!<p>\s*(</?(?:table|tr|td|th|div|ul|ol|li|pre|select|form|blockquote|p|h[1-6])[^>]*>)\s*</p>!', "$1", $pee); // don't pee all over a tag 76 77 $pee = preg_replace("|<p>(<li.+?)</p>|", "$1", $pee); // problem with nested lists 77 78 $pee = preg_replace('|<p><blockquote([^>]*)>|i', "<blockquote$1><p>", $pee); … … 147 148 } 148 149 150 function trailingslashit($string) { 151 if ( '/' != substr($string, -1)) { 152 $string .= '/'; 153 } 154 return $string; 155 } 149 156 150 157 function mysql2date($dateformatstring, $mysqlstring, $use_b2configmonthsdays = 1) { -
trunk/wp-includes/template-functions-category.php
r801 r836 35 35 if ($echo) echo $link; 36 36 return $link; 37 } 38 39 function get_category_rss_link($echo = false, $category_id, $category_nicename) { 40 global $querystring_start, $querystring_equal, $siteurl; 41 $cat_ID = $category_id; 42 $permalink_structure = get_settings('permalink_structure'); 43 44 if ('' == $permalink_structure) { 45 $file = "$siteurl/wp-rss2.php"; 46 $link = $file . $querystring_start . 'cat' . $querystring_equal . $category_id; 47 } else { 48 $link = get_category_link(0, $category_id, $category_nicename); 49 $link = $link . "/feed/"; 50 } 51 52 if ($echo) echo $link; 53 return $link; 37 54 } 38 55 -
trunk/wp-includes/template-functions-comment.php
r805 r836 210 210 global $id; 211 211 global $querystring_start, $querystring_equal, $querystring_separator, $siteurl; 212 $url = $siteurl.'/'.$commentsrssfilename.$querystring_start.'p'.$querystring_equal.$id; 212 213 if ('' != get_settings('permalink_structure')) { 214 $url = trailingslashit(get_permalink()) . 'rss2/'; 215 } else { 216 $url = $siteurl.'/'.$commentsrssfilename.$querystring_start.'p'.$querystring_equal.$id; 217 } 218 213 219 $url = '<a href="'.$url.'">'.$link_text.'</a>'; 214 220 echo $url; … … 253 259 global $siteurl, $id; 254 260 $tb_url = $siteurl.'/wp-trackback.php/'.$id; 261 262 if ('' != get_settings('permalink_structure')) { 263 $tb_url = get_permalink() . 'trackback/'; 264 } 265 255 266 if ($display) { 256 267 echo $tb_url; -
trunk/wp-includes/template-functions-general.php
r814 r836 24 24 function get_bloginfo($show='') { 25 25 global $siteurl, $blogfilename, $blogname, $blogdescription, $siteurl, $admin_email; 26 27 $do_perma = 0; 28 $feed_url = $siteurl; 29 $comment_feed_url = $siteurl; 30 31 if ('' != get_settings('permalink_structure')) { 32 $do_perma = 1; 33 $feed_url = $siteurl . '/feed'; 34 $comment_feed_url = $siteurl . '/comments/feed'; 35 } 36 26 37 switch($show) { 27 38 case "url": … … 33 44 case "rdf_url": 34 45 $output = $siteurl.'/wp-rdf.php'; 46 if ($do_perma) { 47 $output = $feed_url . '/rdf/'; 48 } 35 49 break; 36 50 case "rss_url": 37 51 $output = $siteurl.'/wp-rss.php'; 52 if ($do_perma) { 53 $output = $feed_url . '/rss/'; 54 } 38 55 break; 39 56 case "rss2_url": 40 57 $output = $siteurl.'/wp-rss2.php'; 58 if ($do_perma) { 59 $output = $feed_url . '/rss2/'; 60 } 41 61 break; 42 62 case "atom_url": 43 63 $output = $siteurl.'/wp-atom.php'; 64 if ($do_perma) { 65 $output = $feed_url . '/atom/'; 66 } 44 67 break; 45 68 case "comments_rss2_url": 46 69 $output = $siteurl.'/wp-commentsrss2.php'; 70 if ($do_perma) { 71 $output = $comment_feed_url . '/rss2/'; 72 } 47 73 break; 48 74 case "pingback_url": -
trunk/wp-rdf.php
r724 r836 1 1 <?php /* RDF 1.0 generator, original version by garym@teledyn.com */ 2 $blog = 1; // enter your blog's ID 3 $doing_rss = 1; 2 if (! $feed) { 3 $blog = 1; // enter your blog's ID 4 $doing_rss = 1; 5 require('wp-blog-header.php'); 6 } 7 4 8 header('Content-type: text/xml', true); 5 require('wp-blog-header.php');6 9 7 10 /* This doesn't take into account edits -
trunk/wp-rss.php
r724 r836 1 1 <?php /* These first lines are the first part of a CafeLog template. 2 2 In every template you do, you got to copy them before the CafeLog 'loop' */ 3 $blog = 1; // enter your blog's ID 4 $doing_rss = 1; 3 if (! $feed) { 4 $blog = 1; // enter your blog's ID 5 $doing_rss = 1; 6 require('wp-blog-header.php'); 7 } 8 5 9 header('Content-type: text/xml', true); 6 require('wp-blog-header.php');7 10 8 11 /* This doesn't take into account edits -
trunk/wp-rss2.php
r742 r836 1 1 <?php 2 $blog = 1; 3 $doing_rss = 1; 2 if (! $feed) { 3 $blog = 1; 4 $doing_rss = 1; 5 require('wp-blog-header.php'); 6 } 7 4 8 header('Content-type: text/xml', true); 5 require('wp-blog-header.php');6 9 7 10 /* This doesn't take into account edits -
trunk/wp-trackback.php
r637 r836 11 11 $blog_name = $HTTP_POST_VARS['blog_name']; 12 12 13 require('wp-blog-header.php'); 14 15 if ( (($p != '') && ($p != 'all')) || ($name != '') ) { 16 $tb_id = $posts[0]->ID; 17 } 13 18 14 19 if (empty($title) && empty($tb_url) && empty($blog_name)) {
Note: See TracChangeset
for help on using the changeset viewer.