[wpmu-trac] Re: [WordPress MU Trac] #341: Pages not showing on
multi-site install
WordPress MU Trac
wpmu-trac at lists.automattic.com
Sun Jun 3 19:17:09 GMT 2007
#341: Pages not showing on multi-site install
------------------------------------------+---------------------------------
Reporter: Bisente | Owner: donncha
Type: defect | Status: assigned
Priority: normal | Milestone: WPMU 1.0
Component: component1 | Version: 2.0
Severity: normal | Resolution:
Keywords: pages multi-site wp_site 404 |
------------------------------------------+---------------------------------
Comment (by bisente):
Replying to [comment:1 donncha]:
> The reason this happens is because wpmu-settings.php, line 116 checks
blog 1 for the page. Fixing it is a bit convoluted but if you supply a
patch I'll look it over and apply it.
I think I've fixed it. It was easy now that you've told me where to look
at. :)
If I've got it right, we need to find out the blog_id for the "main" blog
(directly on $prefix) on the current domain instead of hardcoding it to
"1":
{{{
function is_blogname_page( $blogname ) {
global $wpdb, $table_prefix, $domain, $path;
$blog_data = $wpdb->get_row("SELECT blog_id FROM $wpdb->blogs
WHERE domain = '$domain' AND path = '$path'");
$blog_id = $blog_data->blog_id;
// is the request for a page of the main blog? We need to cache
this information somewhere to save a request
$pages = $wpdb->get_col( "SELECT LOWER(post_name) FROM
{$table_prefix}{$blog_id}_posts WHERE post_type='page'" );
}}}
"Works for me." Anyway I'm not familiar with WPMU internals so I may have
broken something else. Please test and mark as "Fixed" if everything is
OK.
--
Ticket URL: <http://trac.mu.wordpress.org/ticket/341#comment:2>
WordPress MU Trac <http://mu.wordpress.org/>
WordPress Multiuser
More information about the wpmu-trac
mailing list