<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>WP Engineer &#187; Multisite</title>
	<atom:link href="http://wpengineer.com/tag/multisite/feed/" rel="self" type="application/rss+xml" />
	<link>http://wpengineer.com</link>
	<description>WordPress News, Hacks, Tips, Tutorials, Plugins and Themes</description>
	<lastBuildDate>Mon, 21 May 2012 22:48:48 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>WordPress MultiSite, Plugins and Activation</title>
		<link>http://wpengineer.com/2221/wordpress-multisite-plugins-and-activation/</link>
		<comments>http://wpengineer.com/2221/wordpress-multisite-plugins-and-activation/#comments</comments>
		<pubDate>Tue, 24 May 2011 09:30:08 +0000</pubDate>
		<dc:creator>Frank</dc:creator>
				<category><![CDATA[WordPress Tutorials]]></category>
		<category><![CDATA[development]]></category>
		<category><![CDATA[Multisite]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Plugin]]></category>
		<category><![CDATA[WordPress]]></category>
		<category><![CDATA[WPMU]]></category>

		<guid isPermaLink="false">http://wpengineer.com/?p=2221</guid>
		<description><![CDATA[WordPress offers for normal Plugins the hook register_activation_hook();. This is active right after the activation of a Plugin, so you can start small installation scripts. But if we are in a MultiSite environment (old: MultiUser) and put the Plugin in the folder wp-content/mu-plugins, then the hook doesn't do anything, because the Plugin is automatically activated. [...]]]></description>
			<content:encoded><![CDATA[<p>WordPress offers for normal Plugins the hook <code>register_activation_hook();</code>. This is active right after the activation of a Plugin, so you can start small installation scripts. But if we are in a MultiSite environment (<em>old: MultiUser</em>) and put the Plugin in the folder <code>wp-content/mu-plugins</code>, then the hook doesn't do anything, because the Plugin is automatically activated. But there are few ways you can still have a kind of activation hook. One is this option:</p>
<pre>
if ( ! class_exists( &#039;my_mu_plugin&#039; ) ) {

    if ( function_exists( &#039;add_action&#039; ) ) {
        add_action( &#039;plugins_loaded&#039; ,  array( &#039;my_mu_plugin&#039;, &#039;get_object&#039; ) );
    }

    class my_mu_plugin {

        static private $classobj = NULL;

        public function get_object () {
            if ( NULL === self :: $classobj ) {
                self :: $classobj = new self;
            }
            return self :: $classobj;
        }

        public function __construct () {
            // Fake-Activation-Hook
            $this-&gt;activation();
        }

        private function activation () {
            if ( &#039;activated&#039; == get_blog_option( 1, &#039;my_mu_plugin_activated&#039; ) ) {
                // Do Stuff during activation
                ...

                // Update Option
                update_blog_option( 1, &#039;my_mu_plugin_activated&#039;, &#039;activated&#039; );
            }
        }

    }

}
</pre>
<p>We are doing the following: We check whether a certain option is set in blog 1, if not, then run through an activation function, otherwise do nothing - Blog 1 simple so that the install script is only in blog 1 in use. If you want to use it in all the blogs then simply use the function <code>get_option()</code>. Easy, right?</p>
<div class="incontent">
<h4>Guest Post</h4>
<p><img src="http://wpengineer.com/wp-content/uploads/dasllama-150x150.png" alt="" title="dasllama" width="150" height="150" class="alignleft size-thumbnail wp-image-2223" />This post is written by Thomas Herzog - <a href="http://hughwillfayle.de/">hughwillfayle.de</a> and is a guest post on WP Engineer about WordPress.<br />
Thank you very much from my part to Thomas. Please see <a href="http://profiles.wordpress.org/users/hughwillfayle/">his nice plugins</a> on the official WordPress repository.<br />
If you also like to have your interesting post published on our website, please let us know on our contact page. Of course we will appreciate your contribution!
</div>
<hr /><a href="http://wpplugins.com/plugin/281/snippets" title="More informations about this plugin for WordPress"><img src="http://wpengineer.com/wp-content/themes/wpe-3/images/snippets-125-125.png" height="90" alt="WordPress Snippet Plugin" /></a> <a href="http://xtreme-theme.com"><img src="http://wpengineer.com/wp-content/uploads/feed-banner-2.jpg" alt="Xtreme One WordPress Framework"/></a><br />
&copy; <a href="http://wpengineer.com/">WP Engineer Team</a>, All rights reserved <small>(Digital Fingerprint: WPEngineer-be0254ce2b4972feb4b9cb72034a092d)</small></p>
]]></content:encoded>
			<wfw:commentRss>http://wpengineer.com/2221/wordpress-multisite-plugins-and-activation/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>View Blog ID in WordPress Multisite</title>
		<link>http://wpengineer.com/2188/view-blog-id-in-wordpress-multisite/</link>
		<comments>http://wpengineer.com/2188/view-blog-id-in-wordpress-multisite/#comments</comments>
		<pubDate>Tue, 05 Apr 2011 09:49:56 +0000</pubDate>
		<dc:creator>Frank</dc:creator>
				<category><![CDATA[WordPress Hacks]]></category>
		<category><![CDATA[backend]]></category>
		<category><![CDATA[Code]]></category>
		<category><![CDATA[Multisite]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[WordPress]]></category>
		<category><![CDATA[WP]]></category>
		<category><![CDATA[WP3.0]]></category>
		<category><![CDATA[wp3.1]]></category>

		<guid isPermaLink="false">http://wpengineer.com/?p=2188</guid>
		<description><![CDATA[When you work quite a bit with WordPress Multisites, sometimes you need the IDs for some functions or Plugins. The easiest way is via the hover effect with your mouse or you use a little code snippet to add a column with the ID in the table view. The following code belongs into a Plugin [...]]]></description>
			<content:encoded><![CDATA[<p>When you work quite a bit with WordPress Multisites, sometimes you need the IDs for some functions or Plugins. The easiest way is via the hover effect with your mouse or you use a little code snippet to add a column with the ID in the table view.</p>
<p><a href="http://wpengineer.com/wp-content/uploads/wp-blog-id.png"><img src="http://wpengineer.com/wp-content/uploads/wp-blog-id-300x99.png" alt="" title="wp-blog-id" width="300" height="99" class="aligncenter size-medium wp-image-2189" /></a><br />
<span id="more-2188"></span><br />
The following code belongs into a Plugin and should be placed in the folder mu-plugins.</p>
<pre>
class Add_Blog_ID {

	public static function init() {
		$class = __CLASS__ ;

		if ( empty( $GLOBALS&#091; $class &#093; ) )
			$GLOBALS&#091; $class &#093; = new $class;
	}

	public function __construct() {

		add_filter( &#039;wpmu_blogs_columns&#039;, array( $this, &#039;get_id&#039; ) );
		add_action( &#039;manage_sites_custom_column&#039;, array( $this, &#039;add_columns&#039; ), 10, 2 );
		add_action( &#039;manage_blogs_custom_column&#039;, array( $this, &#039;add_columns&#039; ), 10, 2 );
		add_action( &#039;admin_footer&#039;, array( $this, &#039;add_style&#039; ) );
	}

	public function add_columns( $column_name, $blog_id ) {

		if ( &#039;blog_id&#039; === $column_name )
			echo $blog_id;

		return $column_name;
	}

	// Add in a column header
	public function get_id( $columns ) {

		$columns&#091;&#039;blog_id&#039;&#093; = __(&#039;ID&#039;);

		return $columns;
	}

	public function add_style() {

		echo &#039;&lt;style&gt;#blog_id { width:7%; }&lt;/style&gt;&#039;;
	}
}
add_action( &#039;init&#039;, array( &#039;Add_Blog_ID&#039;, &#039;init&#039; ) );
</pre>
<hr /><a href="http://wpplugins.com/plugin/281/snippets" title="More informations about this plugin for WordPress"><img src="http://wpengineer.com/wp-content/themes/wpe-3/images/snippets-125-125.png" height="90" alt="WordPress Snippet Plugin" /></a> <a href="http://xtreme-theme.com"><img src="http://wpengineer.com/wp-content/uploads/feed-banner-2.jpg" alt="Xtreme One WordPress Framework"/></a><br />
&copy; <a href="http://wpengineer.com/">WP Engineer Team</a>, All rights reserved <small>(Digital Fingerprint: WPEngineer-be0254ce2b4972feb4b9cb72034a092d)</small></p>
]]></content:encoded>
			<wfw:commentRss>http://wpengineer.com/2188/view-blog-id-in-wordpress-multisite/feed/</wfw:commentRss>
		<slash:comments>10</slash:comments>
		</item>
		<item>
		<title>Remove WordPress Multisite Feature &#8211; ToDo List!</title>
		<link>http://wpengineer.com/2056/remove-wordpress-multisite-feature-todo-list/</link>
		<comments>http://wpengineer.com/2056/remove-wordpress-multisite-feature-todo-list/#comments</comments>
		<pubDate>Wed, 03 Nov 2010 11:10:41 +0000</pubDate>
		<dc:creator>Frank</dc:creator>
				<category><![CDATA[WordPress Tutorials]]></category>
		<category><![CDATA[Multisite]]></category>
		<category><![CDATA[uninstall]]></category>
		<category><![CDATA[WordPress]]></category>
		<category><![CDATA[WP]]></category>
		<category><![CDATA[WP3.0]]></category>

		<guid isPermaLink="false">http://wpengineer.com/?p=2056</guid>
		<description><![CDATA[You can activate the Multisite functionality of WordPress relatively quick and it is well explaind in the backend how to do it. But not always you like to keep it as a multi site installation and therefore you have to do some measures to remove the Network function again. Not easy and probably not an [...]]]></description>
			<content:encoded><![CDATA[<p>You can activate the <a href="http://codex.wordpress.org/Create_A_Network">Multisite functionality</a> of WordPress relatively quick and it is well explaind in the backend how to do it. But not always you like to keep it as a multi site installation and therefore you have to do some measures to remove the Network function again.</p>
<p>Not easy and probably not an every day task - so that's why I created a small todo list in order not to forget a step to restore to the default installation.<br />
<span id="more-2056"></span></p>
<ol>
<li><strong>Save all your data</strong> - Database and files via FTP</li>
<li>Set the constant <code>WP_ALLOW_MULTISITE</code> to <code>FALSE</code> or delete the definition</li>
<li>Remove the following line in your <code>wp-config.php</code>; Just comment out is enough.
<pre>
/**
define( &#039;MULTISITE&#039;, true );
define( &#039;SUBDOMAIN_INSTALL&#039;, false );
$base = &#039;/wordpress/&#039;;
define( &#039;DOMAIN_CURRENT_SITE&#039;, &#039;localhost&#039; );
define( &#039;PATH_CURRENT_SITE&#039;, &#039;/wordpress/&#039; );
define( &#039;SITE_ID_CURRENT_SITE&#039;, 1 );
define( &#039;BLOG_ID_CURRENT_SITE&#039;, 1 );
*/
</pre>
</li>
<li>Remove the entries for the network in your <code>.htaccess</code> which is in the root of your installation
<pre>
# BEGIN WordPress
RewriteEngine On
RewriteBase /wordpress/
RewriteRule ^index\.php$ - &#091;L&#093;

# uploaded files
RewriteRule ^(&#091;_0-9a-zA-Z-&#093;+/)?files/(.+) wp-includes/ms-files.php?file=$2 &#091;L&#093;

# add a trailing slash to /wp-admin
RewriteRule ^(&#091;_0-9a-zA-Z-&#093;+/)?wp-admin$ $1wp-admin/ &#091;R=301,L&#093;

RewriteCond %{REQUEST_FILENAME} -f &#091;OR&#093;
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^ - &#091;L&#093;
RewriteRule  ^(&#091;_0-9a-zA-Z-&#093;+/)?(wp-(content|admin|includes).*) $2 &#091;L&#093;
RewriteRule  ^(&#091;_0-9a-zA-Z-&#093;+/)?(.*\.php)$ $2 &#091;L&#093;
RewriteRule . index.php &#091;L&#093;
# END WordPress
</pre>
</li>
<li>Now recreate the permalinks and add the necessary lines to <code>.htaccess</code> (<code>wp-admin/options-permalink.php</code>)</li>
<li>Remove the fields <code>spam</code> and <code>deleted</code> in the user-table (adjust prefix)
<pre>
ALTER TABLE `wp_users` DROP `spam`, DROP `deleted`;
</pre>
</li>
<li>You can delete the following tables in your database (adjust prefix)
<ul>
<li>wp_blogs</li>
<li>wp_blog_versions</li>
<li>wp_registration_log</li>
<li>wp_signups</li>
<li>wp_site</li>
<li>wp_sitemeta</li>
<li>wp_sitecategories (if global terms were active)
<pre>
DROP TABLE
    `wp_blogs`,
    `wp_blog_versions`,
    `wp_registration_log`,
    `wp_signups`,
    `wp_site`,
    `wp_sitemeta`,
    `wp_sitecategories`;
</pre>
</li>
</ul>
</li>
<li>Now you have your default installation of your default blog back. But in your database there are still tables of the 2nd created blog. You have to check if you need some information of this former blog. If not, you can also delete the tables of the former 2nd blog.</li>
</ol>
<p>Just remember: Before proceeding I really recommend to create a backup.<br />
<hr /><a href="http://wpplugins.com/plugin/281/snippets" title="More informations about this plugin for WordPress"><img src="http://wpengineer.com/wp-content/themes/wpe-3/images/snippets-125-125.png" height="90" alt="WordPress Snippet Plugin" /></a> <a href="http://xtreme-theme.com"><img src="http://wpengineer.com/wp-content/uploads/feed-banner-2.jpg" alt="Xtreme One WordPress Framework"/></a><br />
&copy; <a href="http://wpengineer.com/">WP Engineer Team</a>, All rights reserved <small>(Digital Fingerprint: WPEngineer-be0254ce2b4972feb4b9cb72034a092d)</small></p>
]]></content:encoded>
			<wfw:commentRss>http://wpengineer.com/2056/remove-wordpress-multisite-feature-todo-list/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>WordPress 3.0 Multisite Settings</title>
		<link>http://wpengineer.com/1953/wordpress-3-multisite-settings/</link>
		<comments>http://wpengineer.com/1953/wordpress-3-multisite-settings/#comments</comments>
		<pubDate>Tue, 19 Jan 2010 18:51:17 +0000</pubDate>
		<dc:creator>Michael</dc:creator>
				<category><![CDATA[WordPress News]]></category>
		<category><![CDATA[Multisite]]></category>
		<category><![CDATA[WordPress]]></category>
		<category><![CDATA[WP3.0]]></category>

		<guid isPermaLink="false">http://wpengineer.com/?p=1953</guid>
		<description><![CDATA[Exclusively 2 Screenshots of the new WordPress 3.0 Multisite Settings. You can find them under Options-&#62;Network: After you set the settings, you receive in a second step the content for wp-config.php and .htaccess. Additionally you have to create the subfolder blogs.dir in wp-content , where you put the media-files for each blog. Since WordPress 3.0 [...]]]></description>
			<content:encoded><![CDATA[<p>Exclusively 2 Screenshots  of the new WordPress 3.0 Multisite Settings. You can find them under Options-&gt;Network:<br />
<img class="aligncenter size-full wp-image-1955" title="WordPress 3.0 Network settings step 1" src="http://wpengineer.com/wp-content/uploads/wordpress-3.0-network-settings.jpg" alt="WordPress 3.0 Network settings step 1" width="600" height="476" /><br />
After you set the settings, you receive in a second step the content for wp-config.php and .htaccess. Additionally you have to create the subfolder blogs.dir in wp-content , where you put the media-files for each blog.</p>
<p><img class="aligncenter size-full wp-image-1956" title="WordPress 3.0 Network settings step 2" src="http://wpengineer.com/wp-content/uploads/wordpress-3.0-network-settings-1.jpg" alt="WordPress 3.0 Network settings step 2" width="600" height="596" /></p>
<p>Since WordPress 3.0 is still in development, there might be many changes until the final release.<br />
<hr /><a href="http://wpplugins.com/plugin/281/snippets" title="More informations about this plugin for WordPress"><img src="http://wpengineer.com/wp-content/themes/wpe-3/images/snippets-125-125.png" height="90" alt="WordPress Snippet Plugin" /></a> <a href="http://xtreme-theme.com"><img src="http://wpengineer.com/wp-content/uploads/feed-banner-2.jpg" alt="Xtreme One WordPress Framework"/></a><br />
&copy; <a href="http://wpengineer.com/">WP Engineer Team</a>, All rights reserved <small>(Digital Fingerprint: WPEngineer-be0254ce2b4972feb4b9cb72034a092d)</small></p>
]]></content:encoded>
			<wfw:commentRss>http://wpengineer.com/1953/wordpress-3-multisite-settings/feed/</wfw:commentRss>
		<slash:comments>65</slash:comments>
		</item>
	</channel>
</rss>

