<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	>
<channel>
	<title>Comments on: WordPress Hacking: Multiple Blogs On One Set of Tables</title>
	<atom:link href="http://software.jonandnic.com/hack/wordpress-hacking-multiple-blogs-on-one-set-of-tables-2/feed" rel="self" type="application/rss+xml" />
	<link>http://software.jonandnic.com/hack/wordpress-hacking-multiple-blogs-on-one-set-of-tables-2</link>
	<description>Hacks, scripts and ideas for the refined geek.</description>
	<pubDate>Thu, 28 Aug 2008 06:16:04 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.6.1</generator>
		<item>
		<title>By: Jonathan Wise</title>
		<link>http://software.jonandnic.com/hack/wordpress-hacking-multiple-blogs-on-one-set-of-tables-2#comment-900</link>
		<dc:creator>Jonathan Wise</dc:creator>
		<pubDate>Fri, 01 Aug 2008 15:17:47 +0000</pubDate>
		<guid isPermaLink="false">http://software.jonandnic.com/hack/wordpress-hacking-multiple-blogs-on-one-set-of-tables-2#comment-900</guid>
		<description>I can confirm that &lt;a href="http://www.timandkelly.com/" rel="nofollow"&gt;Tim&lt;/a&gt;'s modification works in 2.6

Another thing you might want to do is to make symlinks to folders in your main blog, so that your plugins and themes are available in your alternate blog...

Mario, that sounds like a righteous hack, but its definitely outside of the scope of this. Let us know if you crack it!</description>
		<content:encoded><![CDATA[<p>I can confirm that <a href="http://www.timandkelly.com/" rel="nofollow">Tim</a>&#8217;s modification works in 2.6</p>
<p>Another thing you might want to do is to make symlinks to folders in your main blog, so that your plugins and themes are available in your alternate blog&#8230;</p>
<p>Mario, that sounds like a righteous hack, but its definitely outside of the scope of this. Let us know if you crack it!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: mario</title>
		<link>http://software.jonandnic.com/hack/wordpress-hacking-multiple-blogs-on-one-set-of-tables-2#comment-871</link>
		<dc:creator>mario</dc:creator>
		<pubDate>Tue, 29 Jul 2008 18:21:02 +0000</pubDate>
		<guid isPermaLink="false">http://software.jonandnic.com/hack/wordpress-hacking-multiple-blogs-on-one-set-of-tables-2#comment-871</guid>
		<description>AAHHHHRRRGG!! I did everything as you said but it does not work.. :( Anyway...this is not even what I am trying to achieve but could have helped..what I am really trying to achieve is having one user dedicated admin installation with custom fields and all modified template pages sitting under a subdomain and my admin, full-capable admin installation wherever (on the main domain probably) while BOTH use the same tables and modify ONE website..thanks for the post though..</description>
		<content:encoded><![CDATA[<p>AAHHHHRRRGG!! I did everything as you said but it does not work.. <img src='http://software.jonandnic.com/wp-includes/images/smilies/icon_sad.gif' alt=':(' class='wp-smiley' /> Anyway&#8230;this is not even what I am trying to achieve but could have helped..what I am really trying to achieve is having one user dedicated admin installation with custom fields and all modified template pages sitting under a subdomain and my admin, full-capable admin installation wherever (on the main domain probably) while BOTH use the same tables and modify ONE website..thanks for the post though..</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: United States Of Martin &#187; Blog Archive &#187; One install to rule them all</title>
		<link>http://software.jonandnic.com/hack/wordpress-hacking-multiple-blogs-on-one-set-of-tables-2#comment-583</link>
		<dc:creator>United States Of Martin &#187; Blog Archive &#187; One install to rule them all</dc:creator>
		<pubDate>Thu, 08 May 2008 11:29:13 +0000</pubDate>
		<guid isPermaLink="false">http://software.jonandnic.com/hack/wordpress-hacking-multiple-blogs-on-one-set-of-tables-2#comment-583</guid>
		<description>[...] like to disclose right away that almost everything in this post is lifted from this post and the comments therein. I only parrot it here with some supplementary info for the exact [...]</description>
		<content:encoded><![CDATA[<p>[...] like to disclose right away that almost everything in this post is lifted from this post and the comments therein. I only parrot it here with some supplementary info for the exact [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jonathan Wise</title>
		<link>http://software.jonandnic.com/hack/wordpress-hacking-multiple-blogs-on-one-set-of-tables-2#comment-546</link>
		<dc:creator>Jonathan Wise</dc:creator>
		<pubDate>Sat, 19 Apr 2008 21:05:28 +0000</pubDate>
		<guid isPermaLink="false">http://software.jonandnic.com/hack/wordpress-hacking-multiple-blogs-on-one-set-of-tables-2#comment-546</guid>
		<description>Awesome! Thanks for the update!</description>
		<content:encoded><![CDATA[<p>Awesome! Thanks for the update!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Tim</title>
		<link>http://software.jonandnic.com/hack/wordpress-hacking-multiple-blogs-on-one-set-of-tables-2#comment-541</link>
		<dc:creator>Tim</dc:creator>
		<pubDate>Fri, 18 Apr 2008 20:13:58 +0000</pubDate>
		<guid isPermaLink="false">http://software.jonandnic.com/hack/wordpress-hacking-multiple-blogs-on-one-set-of-tables-2#comment-541</guid>
		<description>Jonathan - This was a brilliant help for me. I had a different issue (trying to create a blog for my dad and step-mom and a sub-blog for just my step-mom with the same database). Anyway, in Wordpress 2.5 you need to edit the wp-db.php file in the wp-includes directory. In the function set_prefix($prefix) section, you can override the settings. Following

foreach ( $this-&#62;tables as $table )
	$this-&#62;$table = $this-&#62;prefix . $table;

the code should look like this:

$this-&#62;posts = 'wp_' . 'posts';
$this-&#62;users = 'wp_' . 'users';
$this-&#62;categories = 'wp_' . 'categories';
$this-&#62;post2cat = 'wp_' . 'post2cat';
$this-&#62;links = 'wp_' . 'links';
$this-&#62;postmeta = 'wp_' . 'postmeta';
$this-&#62;usermeta = 'wp_' . 'usermeta';
$this-&#62;terms = 'wp_' . 'terms';
$this-&#62;term_taxonomy = 'wp_' . 'term_taxonomy';
$this-&#62;term_relationships = 'wp_' . 'term_relationships';

Thanks again. This was a big help.</description>
		<content:encoded><![CDATA[<p>Jonathan - This was a brilliant help for me. I had a different issue (trying to create a blog for my dad and step-mom and a sub-blog for just my step-mom with the same database). Anyway, in Wordpress 2.5 you need to edit the wp-db.php file in the wp-includes directory. In the function set_prefix($prefix) section, you can override the settings. Following</p>
<p>foreach ( $this-&gt;tables as $table )<br />
	$this-&gt;$table = $this-&gt;prefix . $table;</p>
<p>the code should look like this:</p>
<p>$this-&gt;posts = &#8216;wp_&#8217; . &#8216;posts&#8217;;<br />
$this-&gt;users = &#8216;wp_&#8217; . &#8216;users&#8217;;<br />
$this-&gt;categories = &#8216;wp_&#8217; . &#8216;categories&#8217;;<br />
$this-&gt;post2cat = &#8216;wp_&#8217; . &#8216;post2cat&#8217;;<br />
$this-&gt;links = &#8216;wp_&#8217; . &#8216;links&#8217;;<br />
$this-&gt;postmeta = &#8216;wp_&#8217; . &#8216;postmeta&#8217;;<br />
$this-&gt;usermeta = &#8216;wp_&#8217; . &#8216;usermeta&#8217;;<br />
$this-&gt;terms = &#8216;wp_&#8217; . &#8216;terms&#8217;;<br />
$this-&gt;term_taxonomy = &#8216;wp_&#8217; . &#8216;term_taxonomy&#8217;;<br />
$this-&gt;term_relationships = &#8216;wp_&#8217; . &#8216;term_relationships&#8217;;</p>
<p>Thanks again. This was a big help.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jonathan Wise</title>
		<link>http://software.jonandnic.com/hack/wordpress-hacking-multiple-blogs-on-one-set-of-tables-2#comment-506</link>
		<dc:creator>Jonathan Wise</dc:creator>
		<pubDate>Mon, 14 Apr 2008 13:19:19 +0000</pubDate>
		<guid isPermaLink="false">http://software.jonandnic.com/hack/wordpress-hacking-multiple-blogs-on-one-set-of-tables-2#comment-506</guid>
		<description>Try this: below the line &lt;code&gt;$prefix = $wpdb-&gt;set_prefix($table_prefix);&lt;/code&gt;
just manually over-ride the other tables by adding this code:
&lt;code&gt;
$wpdb-&gt;users = ‘wp_’ . ‘users’;
$wpdb-&gt;posts = ‘wp_’ . ‘posts’;
$wpdb-&gt;comments = ‘wp_’ . ‘comments’
&lt;/code&gt;

We let Wordpress do its global (once-for-all) setting, then we take over by repointing the tables we're interested in. I'm not able to test this at the moment, but give it a try and let us know if it works!</description>
		<content:encoded><![CDATA[<p>Try this: below the line <code>$prefix = $wpdb->set_prefix($table_prefix);</code><br />
just manually over-ride the other tables by adding this code:<br />
<code><br />
$wpdb->users = ‘wp_’ . ‘users’;<br />
$wpdb->posts = ‘wp_’ . ‘posts’;<br />
$wpdb->comments = ‘wp_’ . ‘comments’<br />
</code></p>
<p>We let Wordpress do its global (once-for-all) setting, then we take over by repointing the tables we&#8217;re interested in. I&#8217;m not able to test this at the moment, but give it a try and let us know if it works!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jonathan Wise</title>
		<link>http://software.jonandnic.com/hack/wordpress-hacking-multiple-blogs-on-one-set-of-tables-2#comment-505</link>
		<dc:creator>Jonathan Wise</dc:creator>
		<pubDate>Mon, 14 Apr 2008 13:16:20 +0000</pubDate>
		<guid isPermaLink="false">http://software.jonandnic.com/hack/wordpress-hacking-multiple-blogs-on-one-set-of-tables-2#comment-505</guid>
		<description>The problem with the wp-settings.php file is that they've moved to a "set once for all" approach. The line &lt;code&gt;$prefix = $wpdb-&gt;set_prefix($table_prefix);&lt;/code&gt; sets the table prefix for users, posts AND options, which prevents us from over-riding just the tables we want. I'll keep poking...</description>
		<content:encoded><![CDATA[<p>The problem with the wp-settings.php file is that they&#8217;ve moved to a &#8220;set once for all&#8221; approach. The line <code>$prefix = $wpdb->set_prefix($table_prefix);</code> sets the table prefix for users, posts AND options, which prevents us from over-riding just the tables we want. I&#8217;ll keep poking&#8230;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jonathan Wise</title>
		<link>http://software.jonandnic.com/hack/wordpress-hacking-multiple-blogs-on-one-set-of-tables-2#comment-504</link>
		<dc:creator>Jonathan Wise</dc:creator>
		<pubDate>Mon, 14 Apr 2008 13:07:42 +0000</pubDate>
		<guid isPermaLink="false">http://software.jonandnic.com/hack/wordpress-hacking-multiple-blogs-on-one-set-of-tables-2#comment-504</guid>
		<description>&lt;strong&gt;For problem #1&lt;/strong&gt;, it appears that wp-settings.php has changed significantly since 2.1. I'm not sure how to update these instructions to make them work. I'll keep looking when I have some time.

&lt;strong&gt;For problem #2&lt;/strong&gt;, try enclosing the newwp_user_level in quotes, so the command would look like this:
INSERT INTO wp_usermeta (user_id, meta_key, meta_value) VALUES (1, 'newwp_user_level', 10)

I used phpMySql to insert it by hand -- I didn't actually use a SQL statement, so I must have made an error when deriving the code for my post. I'll update it.

Hope this helps! These instructions were originally written for WordPress 2.1, so if anyone knows how to change things for 2.5, let us know!</description>
		<content:encoded><![CDATA[<p><strong>For problem #1</strong>, it appears that wp-settings.php has changed significantly since 2.1. I&#8217;m not sure how to update these instructions to make them work. I&#8217;ll keep looking when I have some time.</p>
<p><strong>For problem #2</strong>, try enclosing the newwp_user_level in quotes, so the command would look like this:<br />
INSERT INTO wp_usermeta (user_id, meta_key, meta_value) VALUES (1, &#8216;newwp_user_level&#8217;, 10)</p>
<p>I used phpMySql to insert it by hand &#8212; I didn&#8217;t actually use a SQL statement, so I must have made an error when deriving the code for my post. I&#8217;ll update it.</p>
<p>Hope this helps! These instructions were originally written for WordPress 2.1, so if anyone knows how to change things for 2.5, let us know!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: shamus</title>
		<link>http://software.jonandnic.com/hack/wordpress-hacking-multiple-blogs-on-one-set-of-tables-2#comment-489</link>
		<dc:creator>shamus</dc:creator>
		<pubDate>Fri, 11 Apr 2008 00:57:32 +0000</pubDate>
		<guid isPermaLink="false">http://software.jonandnic.com/hack/wordpress-hacking-multiple-blogs-on-one-set-of-tables-2#comment-489</guid>
		<description>Hi, ran into issues during step 2, I did not find any of the mentioned lines in wp-settings.

I did find one line which looks similar:

$prefix = $wpdb-&#62;set_prefix($table_prefix);

but did not have success modifying it as mentioned in the link above, possible i am doing it wrong?

newwp_ is the custom code for the 2nd install on the same database, so i changed it to read:

$prefix = 'newwp_' . 'posts';

also, i get the following sql error when trying to add the admin user. here is my modified query and the error.

INSERT INTO wp_usermeta (user_id, meta_key, meta_value) VALUES (1, newwp_user_level, 10)

#1054 - Unknown column 'newwp_user_level' in 'field list' 

Default is wp_ and new is newwp_

Any help would be much appreciated.</description>
		<content:encoded><![CDATA[<p>Hi, ran into issues during step 2, I did not find any of the mentioned lines in wp-settings.</p>
<p>I did find one line which looks similar:</p>
<p>$prefix = $wpdb-&gt;set_prefix($table_prefix);</p>
<p>but did not have success modifying it as mentioned in the link above, possible i am doing it wrong?</p>
<p>newwp_ is the custom code for the 2nd install on the same database, so i changed it to read:</p>
<p>$prefix = &#8216;newwp_&#8217; . &#8216;posts&#8217;;</p>
<p>also, i get the following sql error when trying to add the admin user. here is my modified query and the error.</p>
<p>INSERT INTO wp_usermeta (user_id, meta_key, meta_value) VALUES (1, newwp_user_level, 10)</p>
<p>#1054 - Unknown column &#8216;newwp_user_level&#8217; in &#8216;field list&#8217; </p>
<p>Default is wp_ and new is newwp_</p>
<p>Any help would be much appreciated.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jonathan Wise</title>
		<link>http://software.jonandnic.com/hack/wordpress-hacking-multiple-blogs-on-one-set-of-tables-2#comment-226</link>
		<dc:creator>Jonathan Wise</dc:creator>
		<pubDate>Tue, 19 Feb 2008 16:56:57 +0000</pubDate>
		<guid isPermaLink="false">http://software.jonandnic.com/hack/wordpress-hacking-multiple-blogs-on-one-set-of-tables-2#comment-226</guid>
		<description>You can run this with as many domains, subdomains or in-domain directories as you want... but this is really only a hack to get Wordpress installations to share a database.
I don't know much about Wordpress MU, but I can tell you that this approach requires a Wordpress install for each site (regardless of domain name) you want to use.
In other words, you'd have at least one new table in your SQL database for each site, and you'd have one Wordpress folder on your server for each site. If you want to upgrade to a new version of Wordpress, you'd have to upgrade each installation. For what you're trying to do, it seems like WordPress MU would be a better approach...</description>
		<content:encoded><![CDATA[<p>You can run this with as many domains, subdomains or in-domain directories as you want&#8230; but this is really only a hack to get Wordpress installations to share a database.<br />
I don&#8217;t know much about Wordpress MU, but I can tell you that this approach requires a Wordpress install for each site (regardless of domain name) you want to use.<br />
In other words, you&#8217;d have at least one new table in your SQL database for each site, and you&#8217;d have one Wordpress folder on your server for each site. If you want to upgrade to a new version of Wordpress, you&#8217;d have to upgrade each installation. For what you&#8217;re trying to do, it seems like WordPress MU would be a better approach&#8230;</p>
]]></content:encoded>
	</item>
</channel>
</rss>
