[wp-cvs] wordpress/wp-includes classes.php, 1.28,
1.29 template-functions-author.php, 1.11, 1.12
Ryan Boren
rboren at users.sourceforge.net
Thu Dec 9 02:40:37 UTC 2004
Update of /cvsroot/cafelog/wordpress/wp-includes
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv30426/wp-includes
Modified Files:
classes.php template-functions-author.php
Log Message:
get_author_permastruct()
Index: template-functions-author.php
===================================================================
RCS file: /cvsroot/cafelog/wordpress/wp-includes/template-functions-author.php,v
retrieving revision 1.11
retrieving revision 1.12
diff -C2 -d -r1.11 -r1.12
*** template-functions-author.php 3 Sep 2004 04:03:55 -0000 1.11
--- template-functions-author.php 9 Dec 2004 02:40:35 -0000 1.12
***************
*** 78,94 ****
function get_author_link($echo = false, $author_id, $author_nicename) {
! global $wpdb, $post, $querystring_start, $querystring_equal, $cache_userdata;
$auth_ID = $author_id;
! $permalink_structure = get_settings('permalink_structure');
! if ('' == $permalink_structure) {
$file = get_settings('home') . '/' . get_settings('blogfilename');
$link = $file.$querystring_start.'author'.$querystring_equal.$auth_ID;
} else {
if ('' == $author_nicename) $author_nicename = $cache_userdata[$author_id]->author_nicename;
! // Get any static stuff from the front
! $front = substr($permalink_structure, 0, strpos($permalink_structure, '%'));
! $link = get_settings('home') . $front . 'author/';
! $link .= $author_nicename . '/';
}
--- 78,92 ----
function get_author_link($echo = false, $author_id, $author_nicename) {
! global $wpdb, $wp_rewrite, $post, $querystring_start, $querystring_equal, $cache_userdata;
$auth_ID = $author_id;
! $link = $wp_rewrite->get_author_permastruct();
! if (empty($link)) {
$file = get_settings('home') . '/' . get_settings('blogfilename');
$link = $file.$querystring_start.'author'.$querystring_equal.$auth_ID;
} else {
if ('' == $author_nicename) $author_nicename = $cache_userdata[$author_id]->author_nicename;
! $link = str_replace('%author%', $author_nicename, $link);
! $link = get_settings('home') . trailingslashit($link);
}
Index: classes.php
===================================================================
RCS file: /cvsroot/cafelog/wordpress/wp-includes/classes.php,v
retrieving revision 1.28
retrieving revision 1.29
diff -C2 -d -r1.28 -r1.29
*** classes.php 4 Dec 2004 00:12:08 -0000 1.28
--- classes.php 9 Dec 2004 02:40:35 -0000 1.29
***************
*** 703,706 ****
--- 703,707 ----
var $category_base;
var $category_structure;
+ var $author_structure;
var $date_structure;
var $front;
***************
*** 878,881 ****
--- 879,897 ----
}
+ function get_author_permastruct() {
+ if (isset($this->author_structure)) {
+ return $this->author_structure;
+ }
+
+ if (empty($this->permalink_structure)) {
+ $this->author_structure = '';
+ return false;
+ }
+
+ $this->author_structure = $this->front . 'author/%author%';
+
+ return $this->author_structure;
+ }
+
function add_rewrite_tag($tag, $pattern, $query) {
$this->rewritecode[] = $tag;
***************
*** 1005,1010 ****
// Authors
! $author_structure = $this->front . 'author/%author%';
! $author_rewrite = $this->generate_rewrite_rules($author_structure);
// Pages
--- 1021,1025 ----
// Authors
! $author_rewrite = $this->generate_rewrite_rules($this->get_author_permastruct());
// Pages
***************
*** 1079,1082 ****
--- 1094,1098 ----
$this->category_base = get_settings('category_base');
unset($this->category_structure);
+ unset($this->author_structure);
unset($this->date_structure);
}
More information about the cvs
mailing list