<?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>WebLaCarte</title>
	<atom:link href="http://weblacarte.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://weblacarte.com</link>
	<description>Quality Web Development</description>
	<lastBuildDate>Fri, 26 Feb 2010 07:15:51 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Accessing Values by Referrence in a Foreach Loop</title>
		<link>http://weblacarte.com/2010/02/accessing-values-by-referrence-in-a-foreach-loop/</link>
		<comments>http://weblacarte.com/2010/02/accessing-values-by-referrence-in-a-foreach-loop/#comments</comments>
		<pubDate>Fri, 26 Feb 2010 07:15:51 +0000</pubDate>
		<dc:creator>Phillip</dc:creator>
				<category><![CDATA[Web Development]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[WebLaCarte]]></category>

		<guid isPermaLink="false">http://www.phillipharrington.com/?p=221</guid>
		<description><![CDATA[Here&#8217;s a fun little trick. When looping over an array, you can access the values by reference. Instead of:

foreach &#40;$things as $i =&#62; $thing&#41;
&#123;
  $things&#91;$i&#93; = strtolower&#40;$thing&#41;;
&#125;

You can reference the values of the array:

foreach &#40;$things as &#38;$thing&#41;
&#123;
  $thing = strtolower&#40;$thing&#41;;
&#125;

It&#8217;s a small difference, but it comes in handy once in a while, especially [...]]]></description>
			<content:encoded><![CDATA[<p>Here&#8217;s a fun little trick. When looping over an array, you can access the values by reference. Instead of:</p>


<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #b1b100;">foreach</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$things</span> <span style="color: #b1b100;">as</span> <span style="color: #000088;">$i</span> <span style="color: #339933;">=&gt;</span> <span style="color: #000088;">$thing</span><span style="color: #009900;">&#41;</span>
<span style="color: #009900;">&#123;</span>
  <span style="color: #000088;">$things</span><span style="color: #009900;">&#91;</span><span style="color: #000088;">$i</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> <span style="color: #990000;">strtolower</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$thing</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span></pre></div></div>


<p>You can reference the values of the array:</p>


<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #b1b100;">foreach</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$things</span> <span style="color: #b1b100;">as</span> <span style="color: #339933;">&amp;</span><span style="color: #000088;">$thing</span><span style="color: #009900;">&#41;</span>
<span style="color: #009900;">&#123;</span>
  <span style="color: #000088;">$thing</span> <span style="color: #339933;">=</span> <span style="color: #990000;">strtolower</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$thing</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span></pre></div></div>


<p>It&#8217;s a small difference, but it comes in handy once in a while, especially when you&#8217;re doing more significant processing with each item.</p>
]]></content:encoded>
			<wfw:commentRss>http://weblacarte.com/2010/02/accessing-values-by-referrence-in-a-foreach-loop/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Serving Multiple WordPress Blogs from a Single Installation (Without WP MU)</title>
		<link>http://weblacarte.com/2009/11/serving-multiple-wordpress-blogs-from-a-single-installation-without-wp-mu/</link>
		<comments>http://weblacarte.com/2009/11/serving-multiple-wordpress-blogs-from-a-single-installation-without-wp-mu/#comments</comments>
		<pubDate>Sun, 15 Nov 2009 16:46:13 +0000</pubDate>
		<dc:creator>Phillip</dc:creator>
				<category><![CDATA[Web Development]]></category>
		<category><![CDATA[Web Nerdism]]></category>
		<category><![CDATA[WebLaCarte]]></category>
		<category><![CDATA[wordpress]]></category>

		<guid isPermaLink="false">http://www.phillipharrington.com/?p=21</guid>
		<description><![CDATA[I&#8217;m serving multiple WordPress blogs on separate domains from a single installation, but without using WordPress MU (multi-user). Yes, I realize you can probably do everything I&#8217;ve done here by using WPMU. However, in my situation:

I had already installed 2 versions of WordPress and didn&#8217;t want to start all over.
I wanted to easily share plugins [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;m serving multiple WordPress blogs on separate domains from a single installation, but without using WordPress MU (multi-user). Yes, I realize you can probably do everything I&#8217;ve done here by using WPMU. However, in my situation:</p>

<ol>
<li>I had already installed 2 versions of WordPress and didn&#8217;t want to start all over.</li>
<li>I wanted to easily share plugins and themes across multiple blogs without having to install them over and over. WPMU may do this, I didn&#8217;t look deeply into it. I have several blogs which use a few of the same plugins.</li>
<li>I didn&#8217;t want to do all the hacking involved in making WPMU serve multiple domains, Again, WPMU may do this, and it&#8217;s probably easy, but it seemed to involve a plugin. I&#8217;ll rephrase, I didn&#8217;t feel like slogging through the steps to make it work.</li>
<li>This struck me as being easier when I thought of it.</li>
<li>I wanted to spend 15 minutes or less to figure it all out.</li>
<li>To summarize: Laaazy!</li>
</ol>

<p>Maybe this will be helpful to you, and perhaps less daunting than a WPMU install.<span id="more-18"></span></p>

<h4>Overview</h4>

<p>There are 3 folders/directories involved. A lib folder, where you install WordPress, your blog&#8217;s web root folder, and a temp folder to move files to for a while.</p>

<p>Here&#8217;s what I did (I&#8217;ll share all of the shell commands and PHP code below this):</p>

<ol>
<li>I installed a fresh copy of WordPress in a lib folder.</li>
<li>In my web root folder, I moved all of the existing WordPress files to a temp folder.</li>
<li>I made a few wildcard symlinks for the WordPress files and folders pointing to the lib folder location.</li>
</ol>

<p>This allowed me to put the wp-config.php for each specific site back into the web root folder later. I did not link index.php, .htaccess, or &#8211; as mentioned above &#8211; wp-config.php.</p>

<ol>
<li>I copied the contents of the {temp folder}/wp-content/themes and wp-content/plugins into the {lib folder}/wp-content/themes and plugins folders respectively, so I can use them with all of my blogs.</li>
<li>I made a single easy hack to wp-load.php which, if I upgrade, I&#8217;ll have to put back, but it&#8217;s a small price to pay.</li>
</ol>

<p>Then I rinsed and repeated for my other WordPress blogs.</p>

<h4>Shell Commands</h4>

<p>Here are the commands and the PHP hack (lines with # are comments, which you can skip):</p>


<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #666666; font-style: italic;"># change {lib folder} etc. to your actual paths, like /home/user/lib etc.</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># note the periods . at the end of some of these commands.</span>
&nbsp;
<span style="color: #7a0874; font-weight: bold;">cd</span> <span style="color: #7a0874; font-weight: bold;">&#123;</span>your lib folder<span style="color: #7a0874; font-weight: bold;">&#125;</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># install a fresh copy of wordpress.</span>
<span style="color: #c20cb9; font-weight: bold;">wget</span> http:<span style="color: #000000; font-weight: bold;">//</span>wordpress.org<span style="color: #000000; font-weight: bold;">/</span>latest.zip
<span style="color: #c20cb9; font-weight: bold;">unzip</span> latest.zip
&nbsp;
<span style="color: #7a0874; font-weight: bold;">cd</span> <span style="color: #7a0874; font-weight: bold;">&#123;</span>your web root folder<span style="color: #7a0874; font-weight: bold;">&#125;</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># move your existing wp files to a temp folder.</span>
<span style="color: #c20cb9; font-weight: bold;">mv</span> <span style="color: #000000; font-weight: bold;">*</span> <span style="color: #7a0874; font-weight: bold;">&#123;</span>your temp folder<span style="color: #7a0874; font-weight: bold;">&#125;</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># link the wordpress files.</span>
<span style="color: #c20cb9; font-weight: bold;">ln</span> <span style="color: #660033;">-s</span> <span style="color: #7a0874; font-weight: bold;">&#123;</span>lib folder<span style="color: #7a0874; font-weight: bold;">&#125;</span><span style="color: #000000; font-weight: bold;">/</span>wordpress<span style="color: #000000; font-weight: bold;">/</span>wp-<span style="color: #000000; font-weight: bold;">*</span>.php .
&nbsp;
<span style="color: #666666; font-style: italic;"># link the wordpress folders.</span>
<span style="color: #c20cb9; font-weight: bold;">ln</span> <span style="color: #660033;">-s</span> <span style="color: #7a0874; font-weight: bold;">&#123;</span>lib folder<span style="color: #7a0874; font-weight: bold;">&#125;</span><span style="color: #000000; font-weight: bold;">/</span>wordpress<span style="color: #000000; font-weight: bold;">/</span>wp-<span style="color: #000000; font-weight: bold;">*/</span> .
&nbsp;
<span style="color: #666666; font-style: italic;"># link the xmlrpc.php file.</span>
<span style="color: #c20cb9; font-weight: bold;">ln</span> <span style="color: #660033;">-s</span> <span style="color: #7a0874; font-weight: bold;">&#123;</span>lib folder<span style="color: #7a0874; font-weight: bold;">&#125;</span>wordpress<span style="color: #000000; font-weight: bold;">/</span>xmlrpc.php .
&nbsp;
<span style="color: #666666; font-style: italic;"># move the index and config files back.</span>
<span style="color: #c20cb9; font-weight: bold;">mv</span> <span style="color: #7a0874; font-weight: bold;">&#123;</span>temp folder<span style="color: #7a0874; font-weight: bold;">&#125;</span><span style="color: #000000; font-weight: bold;">/</span>index.php <span style="color: #7a0874; font-weight: bold;">&#123;</span>web root folder<span style="color: #7a0874; font-weight: bold;">&#125;</span>
<span style="color: #c20cb9; font-weight: bold;">mv</span> <span style="color: #7a0874; font-weight: bold;">&#123;</span>temp folder<span style="color: #7a0874; font-weight: bold;">&#125;</span><span style="color: #000000; font-weight: bold;">/</span>wp-config.php <span style="color: #7a0874; font-weight: bold;">&#123;</span>web root folder<span style="color: #7a0874; font-weight: bold;">&#125;</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># move your site's plugins and themes into</span>
<span style="color: #666666; font-style: italic;"># the lib folder's wordpress plugins and themes folders.</span>
<span style="color: #c20cb9; font-weight: bold;">mv</span> <span style="color: #7a0874; font-weight: bold;">&#123;</span>temp folder<span style="color: #7a0874; font-weight: bold;">&#125;</span><span style="color: #000000; font-weight: bold;">/</span>wp-content<span style="color: #000000; font-weight: bold;">/</span>themes<span style="color: #000000; font-weight: bold;">/*</span> <span style="color: #7a0874; font-weight: bold;">&#123;</span>lib folder<span style="color: #7a0874; font-weight: bold;">&#125;</span><span style="color: #000000; font-weight: bold;">/</span>wordpress<span style="color: #000000; font-weight: bold;">/</span>wp-content<span style="color: #000000; font-weight: bold;">/</span>themes<span style="color: #000000; font-weight: bold;">/</span>
<span style="color: #c20cb9; font-weight: bold;">mv</span> <span style="color: #7a0874; font-weight: bold;">&#123;</span>temp folder<span style="color: #7a0874; font-weight: bold;">&#125;</span><span style="color: #000000; font-weight: bold;">/</span>wp-content<span style="color: #000000; font-weight: bold;">/</span>plugins<span style="color: #000000; font-weight: bold;">/*</span> <span style="color: #7a0874; font-weight: bold;">&#123;</span>lib folder<span style="color: #7a0874; font-weight: bold;">&#125;</span><span style="color: #000000; font-weight: bold;">/</span>wordpress<span style="color: #000000; font-weight: bold;">/</span>wp-content<span style="color: #000000; font-weight: bold;">/</span>plugins<span style="color: #000000; font-weight: bold;">/</span></pre></div></div>


<p>At this point your web root folder should only have the index.php file, the wp-config.php file, and the .htaccess file (if you&#8217;re using one). You can delete the contents of the temp folder when you&#8217;re done with these steps.</p>

<p>You will need to repeat these steps in the web root directories of all the sites to which you wish to apply this method.</p>

<h4>The Easy PHP Hack</h4>

<p>Edit the {lib folder}/wordpress/wp-load.php file. Change line 20 from this:</p>


<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>20
</pre></td><td class="code"><pre class="php" style="font-family:monospace;"><span style="color: #990000;">define</span><span style="color: #009900;">&#40;</span> <span style="color: #0000ff;">'ABSPATH'</span><span style="color: #339933;">,</span> <span style="color: #990000;">dirname</span><span style="color: #009900;">&#40;</span><span style="color: #009900; font-weight: bold;">__FILE__</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">.</span> <span style="color: #0000ff;">'/'</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></td></tr></table></div>


<p>&#8230; to this (2 lines, for the line you commented out, but kept, just in case you need it later, savvy developer you):</p>


<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>20
21
</pre></td><td class="code"><pre class="php" style="font-family:monospace;"><span style="color: #666666; font-style: italic;">// define( 'ABSPATH', dirname(__FILE__) . '/' );</span>
<span style="color: #990000;">define</span><span style="color: #009900;">&#40;</span> <span style="color: #0000ff;">'ABSPATH'</span><span style="color: #339933;">,</span> <span style="color: #000088;">$_SERVER</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'DOCUMENT_ROOT'</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">.</span> <span style="color: #0000ff;">'/'</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></td></tr></table></div>


<p>That&#8217;s it. Crazy, huh? Let me know if you find this useful.</p>
]]></content:encoded>
			<wfw:commentRss>http://weblacarte.com/2009/11/serving-multiple-wordpress-blogs-from-a-single-installation-without-wp-mu/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Testing FeedWordPress Post Syndication</title>
		<link>http://weblacarte.com/2009/11/testing-feedwordpress-post-syndication/</link>
		<comments>http://weblacarte.com/2009/11/testing-feedwordpress-post-syndication/#comments</comments>
		<pubDate>Sun, 15 Nov 2009 10:07:28 +0000</pubDate>
		<dc:creator>Phillip</dc:creator>
				<category><![CDATA[Web Development]]></category>
		<category><![CDATA[Web Nerdism]]></category>
		<category><![CDATA[WebLaCarte]]></category>
		<category><![CDATA[wordpress]]></category>

		<guid isPermaLink="false">http://www.phillipharrington.com/?p=10</guid>
		<description><![CDATA[I am planning to use Phillip Harrington dot com to post multiple topics. I also want these topics fed to other sites.

To that end I found the amazing FeedWordPress plugin, and so far I am magnificently happy with it. It does everything I dreamed and more. The software is brilliant. Use it and donate handsomely [...]]]></description>
			<content:encoded><![CDATA[<p>I am planning to use <a href="http://www.phillipharrington.com/">Phillip Harrington dot com</a> to post multiple topics. I also want these topics fed to other sites.</p>

<p>To that end I found the amazing <a href="http://wordpress.org/extend/plugins/feedwordpress/">FeedWordPress</a> plugin, and so far I am magnificently happy with it. It does everything I dreamed and more. The software is brilliant. Use it and donate handsomely to the developer who wrote it.</p>

<p>This is a test post to see if this entry here filters into my business/programming specific site, <a href="http://weblacarte.com/">WebLaCarte</a>. Watch this category, or the WebLaCarte feed for posts on this topic. Fun, eh?</p>
]]></content:encoded>
			<wfw:commentRss>http://weblacarte.com/2009/11/testing-feedwordpress-post-syndication/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
