<?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>Albertech.net &#187; PHP</title>
	<atom:link href="http://albertech.net/category/php/feed/" rel="self" type="application/rss+xml" />
	<link>http://albertech.net</link>
	<description>Tips, Tricks, and Reviews in Linux, Apache, MySQL, PHP</description>
	<lastBuildDate>Wed, 28 Jul 2010 16:09:13 +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>WordPress MU: Fix broken images on 2.9 to 3.0 upgrade</title>
		<link>http://albertech.net/2010/07/wordpress-mu-fix-broken-images-on-2-9-to-3-0-upgrade/</link>
		<comments>http://albertech.net/2010/07/wordpress-mu-fix-broken-images-on-2-9-to-3-0-upgrade/#comments</comments>
		<pubDate>Wed, 28 Jul 2010 16:08:07 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[wordpress]]></category>
		<category><![CDATA[upgrade]]></category>
		<category><![CDATA[wordpress 3.0]]></category>

		<guid isPermaLink="false">http://albertech.net/?p=429</guid>
		<description><![CDATA[If you have noticed all your blog images breaking after upgrading to WordPress 3.0 from WordPress MU, you will need to make a simple change to the .htaccess file.

<span id="more-429"></span>
<ol>
	<li>Remove the wp-content/blogs.php file as it is no longer supported in WordPress 3.0. It has been replaced with wp-includes/ms-files.php</li>
	<li>Locate the .htaccess file in the root directory</li>
	<li>Find the following line: 
<code>RewriteRule ^(.*/)?files/(.*) wp-content/blogs.php?file=$2 [L]</code></li>
	<li>Replace it with:
<code>RewriteRule ^(.*/)?files/(.*) wp-includes/ms-files.php?file=$2 [L]</code>  
</li>
	<li>This should fix the problem with broken images/files not showing up in the WordPress MU blogs.</li>
</ol>]]></description>
			<content:encoded><![CDATA[
<div class="topsy_widget_data topsy_theme_blue" style="float: right;margin-left: 0.75em; background: url(data:,%7B%20%22url%22%3A%20%22http%253A%252F%252Falbertech.net%252F2010%252F07%252Fwordpress-mu-fix-broken-images-on-2-9-to-3-0-upgrade%252F%22%2C%20%22shorturl%22%3A%20%22http%3A%2F%2Fbit.ly%2Fa7Mt5O%22%2C%20%22style%22%3A%20%22big%22%2C%20%22title%22%3A%20%22WordPress%20MU%3A%20Fix%20broken%20images%20on%202.9%20to%203.0%20upgrade%22%20%7D);"></div>
<p>If you have noticed all your blog images breaking after upgrading to WordPress 3.0 from WordPress MU, you will need to make a simple change to the .htaccess file.</p>
<p><span id="more-429"></span></p>
<ol>
<li>Remove the wp-content/blogs.php file as it is no longer supported in WordPress 3.0. It has been replaced with wp-includes/ms-files.php</li>
<li>Locate the .htaccess file in the root directory</li>
<li>Find the following line: <br />
<code>RewriteRule ^(.*/)?files/(.*) wp-content/blogs.php?file=$2 [L]</code></li>
<li>Replace it with:<br />
<code>RewriteRule ^(.*/)?files/(.*) wp-includes/ms-files.php?file=$2 [L]</code>  
</li>
<li>This should fix the problem with broken images/files not showing up in the WordPress MU blogs.</li>
</ol>

]]></content:encoded>
			<wfw:commentRss>http://albertech.net/2010/07/wordpress-mu-fix-broken-images-on-2-9-to-3-0-upgrade/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>WordPress RSS Cache issue</title>
		<link>http://albertech.net/2010/05/wordpress-rss-cache-issue/</link>
		<comments>http://albertech.net/2010/05/wordpress-rss-cache-issue/#comments</comments>
		<pubDate>Wed, 12 May 2010 21:24:38 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[wordpress]]></category>
		<category><![CDATA[plugin]]></category>
		<category><![CDATA[reviews]]></category>
		<category><![CDATA[rss]]></category>

		<guid isPermaLink="false">http://albertech.net/?p=413</guid>
		<description><![CDATA[As an administrator for a WordPress MU install, I've been getting comments about the RSS feed in WordPress not fetching the latest feeds. The RSS feed information that appears on the page ranges from a fetch that is a few hours to a day old. I've confirmed this is an issue with 2.9. This is an issue for blogs that need to pull alerts from an RSS feed within a timely basis, e.g. every 10 minutes.

The workaround to this is to use the KB Advanced RSS feed plugin instead of the one that's in WordPress.
]]></description>
			<content:encoded><![CDATA[
<div class="topsy_widget_data topsy_theme_blue" style="float: right;margin-left: 0.75em; background: url(data:,%7B%20%22url%22%3A%20%22http%253A%252F%252Falbertech.net%252F2010%252F05%252Fwordpress-rss-cache-issue%252F%22%2C%20%22shorturl%22%3A%20%22http%3A%2F%2Fbit.ly%2F9QZJeF%22%2C%20%22style%22%3A%20%22big%22%2C%20%22title%22%3A%20%22WordPress%20RSS%20Cache%20issue%22%20%7D);"></div>
<p>As an administrator for a WordPress MU install, I&#8217;ve been getting comments about the RSS feed in WordPress not fetching the latest feeds. The RSS feed information that appears on the page ranges from a fetch that is a few hours to a day old. I&#8217;ve confirmed this is an issue with 2.9. This is an issue for blogs that need to pull alerts from an RSS feed within a timely basis, e.g. every 10 minutes.</p>
<p>The workaround to this is to use the <a href="http://wordpress.org/extend/plugins/kb-advanced-rss-widget/" target="_blank">KB Advanced RSS</a> feed plugin instead of the one that&#8217;s in WordPress. Replace the RSS Widget in Appearance -&gt;Widgets with the &#8220;KB Advanced RSS&#8221; widget.</p>
<p>If you are using WordPress 2.8+ and want to set the cache to refresh more frequently, go to /wp-content/plugins/kb-advanced-rss-widget/versions/wp-2.8.php</p>
<p><strong>Find this code:</strong><br />
// Regardless, we&#8217;ll flush the cache every hour. (WP should flush hourly on its own, though.)<br />
$cachetime = get_option( $this-&gt;md5_option_ts );<br />
 if ( $cachetime &lt; ( time() &#8211; <strong>3600</strong> ) ){</p>
<p>Change the <strong>3600</strong> to the number of seconds you want the cache to refresh. For instance, 600 for 10 minutes. The plugin uses its own RSS caching system.</p>
<p><strong>I give this plugin 5  out of 5 stars.</strong>  It works fine with WordPress 2.9.2 and WordPress 2.9.2 MU (even through the documentation states compatibility  up to 2.8) Formatting options, conversion to UTF-8, reverse listing option, and well commented code.</p>
<p><strong>References:<br />
</strong> <a href="http://wordpress.org/extend/plugins/kb-advanced-rss-widget/">http://wordpress.org/extend/plugins/kb-advanced-rss-widget/</a></p>

]]></content:encoded>
			<wfw:commentRss>http://albertech.net/2010/05/wordpress-rss-cache-issue/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>CodeIgniter: Reading Excel Files</title>
		<link>http://albertech.net/2010/04/codeigniter-reading-excel-files/</link>
		<comments>http://albertech.net/2010/04/codeigniter-reading-excel-files/#comments</comments>
		<pubDate>Tue, 20 Apr 2010 20:06:41 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Frameworks]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[codeigniter excel]]></category>

		<guid isPermaLink="false">http://albertech.net/?p=397</guid>
		<description><![CDATA[Reading Excel files in CodeIgniter is actually very easy once you have the right documentation. The first thing you will need to do is utilize the CodeIgniter "Upload" library and add in the Excel Reader library for reading the files. The documentation on the CodeIgniter website in regards to this Excel Reader library is missing some details in implementation. This tutorial will go through the steps of installing the Excel reader library and getting an example implementation working.
]]></description>
			<content:encoded><![CDATA[
<div class="topsy_widget_data topsy_theme_blue" style="float: right;margin-left: 0.75em; background: url(data:,%7B%20%22url%22%3A%20%22http%253A%252F%252Falbertech.net%252F2010%252F04%252Fcodeigniter-reading-excel-files%252F%22%2C%20%22shorturl%22%3A%20%22http%3A%2F%2Fbit.ly%2FcunpPl%22%2C%20%22style%22%3A%20%22big%22%2C%20%22title%22%3A%20%22CodeIgniter%3A%20Reading%20Excel%20Files%22%20%7D);"></div>
<p>Reading Excel files in CodeIgniter is actually very easy once you have the right documentation. The first thing you will need to do is utilize the CodeIgniter &#8220;Upload&#8221; library and add in the Excel Reader library for reading the files. The documentation on the CodeIgniter website in regards to this Excel Reader library is missing some details in implementation. This tutorial will go through the steps of installing the Excel reader library and getting an example implementation working.</p>
<p><strong>Step 1: Download the Excel Reader Library from CodeIgniter&#8217;s website</strong>.<br />
<a href="http://codeigniter.com/wiki/Excel_Reader_Class/" target="_new">http://codeigniter.com/wiki/Excel_Reader_Class/</a></p>
<p>Copy and paste the Excel_reader.php section into notepad or a text editor. Save the file in [CodeIgniter Folder]/system/application/libraries/ as Excel_reader.php</p>
<p><strong>Step 2: Load the Library from your CodeIgniter Application</strong><br />
<code>$this-&gt;load-&gt;library('excel_reader');</code></p>
<p><strong>Step 3: Set the load path of the Excel file that has been uploaded</strong><br />
For example:<br />
<code>$uploadpath = "/var/www/uploads/test.xls";</code></p>
<p><strong>Step 4: Run the Excel Reader Library</strong><br />
<code>$this-&gt;excel_reader-&gt;read($uploadpath);<br />
// Read the first workbook in the file<br />
$worksheetrows =$this-&gt;excel_reader-&gt;worksheets[0];</code></p>
<p><strong>Step 5: Set number of columns in your Excel file</strong><br />
<code>$worksheetcolumns = 5;</code></p>
<p><strong>Step 6: Run through the table and output the data<br />
</strong>I&#8217;ve created a quick function that will go through the entire worksheet and output the data for testing.<br />
<code><br />
echo "&lt;table&gt;";<br />
foreach($worksheetrows as $worksheetrow)<br />
{<br />
      echo "&lt;tr&gt;";<br />
     for($i=0; $i&lt;worksheetcolumns; $i++)<br />
    {<br />
           // if the field is not blank -- otherwise CI will throw warnings<br />
           if (isset($worksheetrow[$i]))<br />
                 echo "&lt;td&gt;".$worksheetrow[$i]."&lt;/td&gt;";<br />
           // empty field<br />
           else<br />
                 echo "&lt;td&gt;&amp;nbsp; &lt;/td&gt;";<br />
     }<br />
     echo "&lt;/tr&gt;";<br />
} <br />
echo "&lt;/table&gt;";<br />
</code></p>
<p>This should get you going with reading Excel files in CodeIgniter.</p>

]]></content:encoded>
			<wfw:commentRss>http://albertech.net/2010/04/codeigniter-reading-excel-files/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Fix: MySQL Error Illegal mix of collations</title>
		<link>http://albertech.net/2010/04/fix-mysql-error-illegal-mix-of-collations/</link>
		<comments>http://albertech.net/2010/04/fix-mysql-error-illegal-mix-of-collations/#comments</comments>
		<pubDate>Mon, 12 Apr 2010 20:00:49 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[MySQL]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[mysql character set]]></category>

		<guid isPermaLink="false">http://albertech.net/?p=395</guid>
		<description><![CDATA[<strong>The error message looked like:</strong>
"Illegal mix of collations (latin1_swedish_ci,COERCIBLE) and   (utf8_general_ci,IMPLICIT) for operation 'find_in_set'"

I ran into this problem today while importing text from a CSV file. Evidently, the text format of the document had UTF characters, which caused CodeIgniter to error out when it tried to insert it to the database. The line had French characters (The ç in Français) My database fields by default are set to "<dfn title="Swedish, case-insensitive">latin1_swedish_ci</dfn>" character set.

<strong>The fix?
</strong>I decided the best way to fix this was to set the Collation option for that specific field in the MySQL database to  "utf8_general_ci<dfn title="Unicode (multilingual), ... ]]></description>
			<content:encoded><![CDATA[
<div class="topsy_widget_data topsy_theme_blue" style="float: right;margin-left: 0.75em; background: url(data:,%7B%20%22url%22%3A%20%22http%253A%252F%252Falbertech.net%252F2010%252F04%252Ffix-mysql-error-illegal-mix-of-collations%252F%22%2C%20%22shorturl%22%3A%20%22http%3A%2F%2Fbit.ly%2FdaKy1N%22%2C%20%22style%22%3A%20%22big%22%2C%20%22title%22%3A%20%22Fix%3A%20MySQL%20Error%20Illegal%20mix%20of%20collations%22%20%7D);"></div>
<p><strong>The error message looked like:</strong><br />
&#8220;Illegal mix of collations (latin1_swedish_ci,COERCIBLE) and   (utf8_general_ci,IMPLICIT) for operation &#8216;find_in_set&#8217;&#8221;</p>
<p>I ran into this problem today while importing text from a CSV file. Evidently, the text format of the document had UTF characters, which caused CodeIgniter to error out when it tried to insert it to the database. The line had French characters (The ç in Français) My database fields by default are set to &#8220;<dfn title="Swedish, case-insensitive">latin1_swedish_ci</dfn>&#8221; character set.</p>
<p><strong>The fix?<br />
</strong>I decided the best way to fix this was to set the Collation option for that specific field in the MySQL database to  &#8220;utf8_general_ci<dfn title="Unicode (multilingual), case-insensitive"></dfn>&#8221; from &#8220;latin1_bin&#8221;. Re-import the data back into the database and it should preserve the character set. Its a good idea to set text fields to UTF-8, especially if you anticipate getting UTF characters.</p>

]]></content:encoded>
			<wfw:commentRss>http://albertech.net/2010/04/fix-mysql-error-illegal-mix-of-collations/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>WordPress: Sidebar not showing up on older themes with WordPress 2.9+</title>
		<link>http://albertech.net/2010/01/wordpress-sidebar-not-showing-up-on-wordpress-2-9/</link>
		<comments>http://albertech.net/2010/01/wordpress-sidebar-not-showing-up-on-wordpress-2-9/#comments</comments>
		<pubDate>Fri, 22 Jan 2010 21:07:59 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[sidebar not showing]]></category>
		<category><![CDATA[wordpress sidebar]]></category>

		<guid isPermaLink="false">http://albertech.net/?p=354</guid>
		<description><![CDATA[I noticed with the latest version of WordPress, an older template may not display the sidebar correctly. If you look at the source code, you notice a lot of HTML code is missing in the sidebar div. The easiest fix I found was to update the "sidebar.php" file in the template. Revised 4/28/2010 with a new fix.]]></description>
			<content:encoded><![CDATA[
<div class="topsy_widget_data topsy_theme_blue" style="float: right;margin-left: 0.75em; background: url(data:,%7B%20%22url%22%3A%20%22http%253A%252F%252Falbertech.net%252F2010%252F01%252Fwordpress-sidebar-not-showing-up-on-wordpress-2-9%252F%22%2C%20%22shorturl%22%3A%20%22http%3A%2F%2Fbit.ly%2FbRoV11%22%2C%20%22style%22%3A%20%22big%22%2C%20%22title%22%3A%20%22WordPress%3A%20Sidebar%20not%20showing%20up%20on%20older%20themes%20with%20WordPress%202.9%2B%22%20%7D);"></div>
<p><strong>Revised 4/28/2010 with a new fix.</strong></p>
<p>I noticed with the latest version of WordPress, an older template may not display the sidebar correctly. If you look at the source code, you notice a lot of HTML code is missing in the sidebar div. The easiest fix I found was to update the &#8220;sidebar.php&#8221; file in the template.</p>
<p>To get your old theme working, you will need to edit sidebar.php and have the following:<br />
<code><br />
&lt;div id="sidebar"&gt;<br />
&lt;?php if ( !function_exists('dynamic_sidebar') || !dynamic_sidebar('sidebar') ) : ?&gt;<br />
  &lt;?php endif; // end of sidebar1 ?&gt;<br />
&lt;/div&gt;</code></p>
<p>This must exist somewhere within your sidebar.php. Older themes don&#8217;t have a sidebar div and thus would break. I usually place this code after the first &#8220;&lt;div id=&#8221;content-right&#8221;&gt;&#8221; section.</p>

]]></content:encoded>
			<wfw:commentRss>http://albertech.net/2010/01/wordpress-sidebar-not-showing-up-on-wordpress-2-9/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>CakePHP Resources</title>
		<link>http://albertech.net/2010/01/cakephp-resources/</link>
		<comments>http://albertech.net/2010/01/cakephp-resources/#comments</comments>
		<pubDate>Wed, 06 Jan 2010 19:29:20 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Frameworks]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[CakePHP]]></category>
		<category><![CDATA[examples]]></category>
		<category><![CDATA[tutorials]]></category>

		<guid isPermaLink="false">http://albertech.net/?p=324</guid>
		<description><![CDATA[I've been noticing that a lot of documentation in CakePHP seems to be spread out onto  many different sites. In my opinion, the CakePHP manual isn't comprehensive enough for learning.

Here's a list of useful CakePHP resources I've used recently:

<strong>CakeForge</strong> - Great resource for Open Source CakePHP applications. This site has many more applications than the CakePHP Bakery.
<strong><a href="http://cakeforge.org/" target="_blank">http://cakeforge.org/</a></strong>

<strong>Bakery</strong> - How to use different CSS files in CakePHP<a href="http://bakery.cakephp.org/articles/view/some-ideas-to-organize-your-css-files-and-autoload-them-in-cakephp" target="_blank">
<strong>http://bakery.cakephp.org/articles/view/some-ideas-to-organize-your-css-files-and-autoload-them-in-cakephp</strong></a>

<strong>Giga Promoters</strong> - CakePHP tutorials and scripts:
<strong><a href="http://www.gigapromoters.com/blog/category/cakephp/" target="_blank">http://www.gigapromoters.com/blog/category/cakephp/</a></strong>

I'll be updating this list as I find more resources.]]></description>
			<content:encoded><![CDATA[
<div class="topsy_widget_data topsy_theme_blue" style="float: right;margin-left: 0.75em; background: url(data:,%7B%20%22url%22%3A%20%22http%253A%252F%252Falbertech.net%252F2010%252F01%252Fcakephp-resources%252F%22%2C%20%22style%22%3A%20%22big%22%2C%20%22title%22%3A%20%22CakePHP%20Resources%22%20%7D);"></div>
<p>I&#8217;ve been noticing that a lot of documentation in CakePHP seems to be spread out onto  many different sites. In my opinion, the CakePHP manual isn&#8217;t comprehensive enough for learning.</p>
<p>Here&#8217;s a list of useful CakePHP resources I&#8217;ve used recently:</p>
<p><strong>CakeForge</strong> &#8211; Great resource for Open Source CakePHP applications. This site has many more applications than the CakePHP Bakery.<br />
<strong><a href="http://cakeforge.org/" target="_blank">http://cakeforge.org/</a></strong></p>
<p><strong>Bakery</strong> &#8211; How to use different CSS files in CakePHP<a href="http://bakery.cakephp.org/articles/view/some-ideas-to-organize-your-css-files-and-autoload-them-in-cakephp" target="_blank"><br />
<strong>http://bakery.cakephp.org/articles/view/some-ideas-to-organize-your-css-files-and-autoload-them-in-cakephp</strong></a></p>
<p><strong>Giga Promoters</strong> &#8211; CakePHP tutorials and scripts:<br />
<strong><a href="http://www.gigapromoters.com/blog/category/cakephp/" target="_blank">http://www.gigapromoters.com/blog/category/cakephp/</a></strong></p>
<p>I&#8217;ll be updating this list as I find more resources.</p>

]]></content:encoded>
			<wfw:commentRss>http://albertech.net/2010/01/cakephp-resources/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>PHP: Cookies expiring too early in Safari (Win)</title>
		<link>http://albertech.net/2009/10/php-cookies-expiring-too-early-in-safari-win/</link>
		<comments>http://albertech.net/2009/10/php-cookies-expiring-too-early-in-safari-win/#comments</comments>
		<pubDate>Fri, 09 Oct 2009 20:36:40 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[cookies]]></category>
		<category><![CDATA[GMT]]></category>
		<category><![CDATA[Safari]]></category>
		<category><![CDATA[UTC]]></category>
		<category><![CDATA[Windows]]></category>

		<guid isPermaLink="false">http://albertech.net/?p=288</guid>
		<description><![CDATA[There appears to be an issue with cookies on Windows Safari that expires  at UTC time and not according to the time zone on your machine. 

I tested my PHP code

setcookie("mycookie", $sample_session_variable, time()+10000,'/mydirectory/','mysite.com');

I verified that the cookie expires at the correct time for the following browsers

    * Firefox 3.5
    * Internet Explorer 8
    * Safari (Apple OS X)
]]></description>
			<content:encoded><![CDATA[
<div class="topsy_widget_data topsy_theme_blue" style="float: right;margin-left: 0.75em; background: url(data:,%7B%20%22url%22%3A%20%22http%253A%252F%252Falbertech.net%252F2009%252F10%252Fphp-cookies-expiring-too-early-in-safari-win%252F%22%2C%20%22style%22%3A%20%22big%22%2C%20%22title%22%3A%20%22PHP%3A%20Cookies%20expiring%20too%20early%20in%20Safari%20%28Win%29%22%20%7D);"></div>
<p><strong>There appears to be an issue with cookies on Windows Safari that expires  at UTC time and <span style="text-decoration: underline;">not </span>according to the time zone on your machine.</strong></p>
<p>I tested my PHP code</p>
<p><code>setcookie("mycookie", $sample_session_variable, time()+10000,'/mydirectory/','mysite.com');</code></p>
<p><strong>I verified that the cookie expires at the correct time for the following browsers</strong></p>
<ul>
<li>Firefox 3.5</li>
<li>Internet Explorer 8</li>
<li>Safari (Apple OS X)</li>
</ul>
<p>However,  Safari 4 (Windows) have cookies are expiring at UTC time.</p>
<p>So if you have are using PHP cookies (or any other scripting language) and they don&#8217;t work in Safari, the cause may be the expiration date.</p>
<p><strong>If you plan to have you cookies expiring after more that 24 hours, its not an issue. Its best to set the time() + value to 86400 at the very minimum. This is to ensure Safari (Win) users will have functioning cookies.</strong></p>
<p><code>setcookie("mycookie", $sample_session_variable, time()+86400,'/mydirectory/','mysite.com');</code></p>

]]></content:encoded>
			<wfw:commentRss>http://albertech.net/2009/10/php-cookies-expiring-too-early-in-safari-win/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>WordPress 2.8.2 Released</title>
		<link>http://albertech.net/2009/07/wordpress-2-8-2-released/</link>
		<comments>http://albertech.net/2009/07/wordpress-2-8-2-released/#comments</comments>
		<pubDate>Wed, 22 Jul 2009 17:11:51 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[security]]></category>
		<category><![CDATA[wordpress]]></category>

		<guid isPermaLink="false">http://albertech.net/?p=220</guid>
		<description><![CDATA[<strong>WordPress 2.8.2 has been released. This affects both WordPress and WordPress MU. I recommend upgrading your current version since it contains a security fix. </strong>
<blockquote>WordPress 2.8.2 fixes an XSS vulnerability. Comment author URLs were not fully sanitized when displayed in the admin. This could be exploited to redirect you away from the admin to another site.</blockquote>
<strong>For more details, visit:</strong>
<a href="http://wordpress.org/development/2009/07/wordpress-2-8-2/" target="_blank">http://wordpress.org/development/2009/07/wordpress-2-8-2/
</a>
You can automatically upgrade WordPress within your control panel, or manually upgrade via:
<a href="http://wordpress.org/download/" target="_blank">http://wordpress.org/download/</a>

WordPress MU download:<a href=" http://mu.wordpress.org/download/" target="_blank">
http://mu.wordpress.org/download/</a>]]></description>
			<content:encoded><![CDATA[
<div class="topsy_widget_data topsy_theme_blue" style="float: right;margin-left: 0.75em; background: url(data:,%7B%20%22url%22%3A%20%22http%253A%252F%252Falbertech.net%252F2009%252F07%252Fwordpress-2-8-2-released%252F%22%2C%20%22style%22%3A%20%22big%22%2C%20%22title%22%3A%20%22WordPress%202.8.2%20Released%22%20%7D);"></div>
<p><strong>WordPress 2.8.2 has been released. This affects both WordPress and WordPress MU. I recommend upgrading your current version since it contains a security fix. </strong></p>
<blockquote><p>WordPress 2.8.2 fixes an XSS vulnerability. Comment author URLs were not fully sanitized when displayed in the admin. This could be exploited to redirect you away from the admin to another site.</p></blockquote>
<p><strong>For more details, visit:</strong><br />
<a href="http://wordpress.org/development/2009/07/wordpress-2-8-2/" target="_blank">http://wordpress.org/development/2009/07/wordpress-2-8-2/<br />
</a><br />
You can automatically upgrade WordPress within your control panel, or manually upgrade via:<br />
<a href="http://wordpress.org/download/" target="_blank">http://wordpress.org/download/</a></p>
<p>WordPress MU download:<a href=" http://mu.wordpress.org/download/" target="_blank"></p>
<p>http://mu.wordpress.org/download/</a></p>

]]></content:encoded>
			<wfw:commentRss>http://albertech.net/2009/07/wordpress-2-8-2-released/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>WordPress MU: Limit access to certain blogs</title>
		<link>http://albertech.net/2009/07/wordpress-mu-limit-access-to-certain-blogs/</link>
		<comments>http://albertech.net/2009/07/wordpress-mu-limit-access-to-certain-blogs/#comments</comments>
		<pubDate>Thu, 02 Jul 2009 20:22:45 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Apache]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[limit access]]></category>
		<category><![CDATA[wordpress mu]]></category>

		<guid isPermaLink="false">http://albertech.net/?p=203</guid>
		<description><![CDATA[I recently implemented a way to limit access by IP range on specific blogs on WordPress MU. As you know, WordPress MU uses Apache Rewrite engine to rewrite URLs. For instance, you have a blog on WordPress MU called "intranet". Apache Rewrite takes the "intranet" string in the URL and automatically rewrites it as a value in the PHP script. A side effect to Apache Rewrite is that "Directory" .htaccess parameters don't work. So, if you wanted only your company IPs to access an internal blog, you will need to use Apache Rewrite parameters instead. For the solution, read on...]]></description>
			<content:encoded><![CDATA[
<div class="topsy_widget_data topsy_theme_blue" style="float: right;margin-left: 0.75em; background: url(data:,%7B%20%22url%22%3A%20%22http%253A%252F%252Falbertech.net%252F2009%252F07%252Fwordpress-mu-limit-access-to-certain-blogs%252F%22%2C%20%22style%22%3A%20%22big%22%2C%20%22title%22%3A%20%22WordPress%20MU%3A%20Limit%20access%20to%20certain%20blogs%22%20%7D);"></div>
<p>I recently implemented a way to limit access by IP range on specific blogs on WordPress MU. As you know, WordPress MU uses Apache Rewrite engine to rewrite URLs. For instance, you have a blog on WordPress MU called &#8220;intranet&#8221;. Apache Rewrite takes the &#8220;intranet&#8221; string in the URL and automatically rewrites it as a value in the PHP script. A side effect to Apache Rewrite is that &#8220;Directory&#8221; .htaccess parameters don&#8217;t work. So, if you wanted only your company IPs to access an internal blog, you will need to use Apache Rewrite parameters instead.</p>
<p>Here&#8217;s how to limit access to an IP or subnet on a particular blog on your WordPress MU install:</p>
<p><strong>DISCLAIMER:</strong> <span style="text-decoration: underline;">Modifying .htaccess files can break your WordPress MU install. </span>ALWAYS backup your .htaccess file. Simply, copy .htaccess file and rename it to .htaccess-backup. (cp .htaccess .htaccess-backup)</p>
<p><strong>Step 1:</strong></p>
<p>Add a section <strong>after</strong> the &#8220;RewriteEngine On<br />
RewriteBase /&#8230;&#8221; section</p>
<p><code>RewriteCond %{REMOTE_ADDR} !^1\.2\.3\.4<br />
RewriteCond %{REMOTE_ADDR} !^1\.2\.3\.5<br />
RewriteCond %{REQUEST_URI} ^/BLOG1<br />
RewriteRule .* - [F]<br />
</code></p>
<p><strong>DO NOT SAVE YET. You will need edit the IP address info and blog info first:</strong></p>
<p><strong>Step 2: Replace the 1.2.3.4 number with your company IPs</strong> (its easier if you have an entire subnet or you can use internal IPs)</p>
<p><strong>For a class C,</strong> the part after {REMOTE ADDR} would be<br />
!^1\.2\3\.</p>
<p><strong>Step 3: Replace BLOG1</strong> with the blog you want to limit access to those IPs. So http://www.mysite.com/myfirstblog would be &#8220;^/blogs/</p>
<p><strong>Optional: </strong>If you have WordPressMU installed in a folder (e.g. not your root folder), you will need to append the directory in front of the blog name.</p>
<p>For instance, if you have http://mysite.com/blog (as your WordPress MU root folder) the ^/ BLOG1 would be</p>
<p>^/blog/BLOG1</p>
<p><strong>Optional: Multiple blogs with same access restrictions</strong><br />
By default, the Apache Rewrite treats every line as an AND statement. If you have multiple blogs, you will need to have an [OR] at the end of the line.</p>
<p><code>RewriteCond %{REQUEST_URI} ^/BLOG1 [OR]<br />
RewriteCond %{REQUEST_URI} ^/BLOG2</code></p>
<p><strong>Errors?</strong></p>
<ul>
<li>Make sure you have ^/ marks in front of the blog names</li>
<li>IP addresses must have a backslash before each dot. Regular expression for dot is concatenate by default, so it needs to be escaped</li>
<li>Make sure you don&#8217;t forget the !^ sign before the IP, otherwise you will be forbidden.</li>
</ul>
<p>If all else fails, if can&#8217;t fix the  error, just copy back the .htaccess-backup to the .htaccess file.</p>

]]></content:encoded>
			<wfw:commentRss>http://albertech.net/2009/07/wordpress-mu-limit-access-to-certain-blogs/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>PHP: Display page render time</title>
		<link>http://albertech.net/2009/06/php-display-page-render-time/</link>
		<comments>http://albertech.net/2009/06/php-display-page-render-time/#comments</comments>
		<pubDate>Fri, 12 Jun 2009 19:06:20 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[render time]]></category>
		<category><![CDATA[script]]></category>

		<guid isPermaLink="false">http://albertech.net/?p=191</guid>
		<description><![CDATA[Here's what I currently use to determine how long it takes to generate a page in PHP. Its only 8 lines of code. ]]></description>
			<content:encoded><![CDATA[
<div class="topsy_widget_data topsy_theme_blue" style="float: right;margin-left: 0.75em; background: url(data:,%7B%20%22url%22%3A%20%22http%253A%252F%252Falbertech.net%252F2009%252F06%252Fphp-display-page-render-time%252F%22%2C%20%22style%22%3A%20%22big%22%2C%20%22title%22%3A%20%22PHP%3A%20Display%20page%20render%20time%22%20%7D);"></div>
<p>Here&#8217;s what I currently use to determine how long it takes to generate a page in PHP. Its only 4 lines of code.</p>
<p><strong>PHP 5</strong></p>
<p><code>$time_start = microtime(true);<br />
$time_end = microtime(true);<br />
$time = $time_end - $time_start;<br />
echo "Displaying the render time: $time seconds\n";</code></p>
<p><strong>PHP 4 Version: (8 lines)</strong></p>
<p>Put this at the top of the PHP script:<br />
<code><br />
$render_time_start = microtime_float();<br />
</code></p>
<p>Put this at the end of the script:<br />
<code><br />
$render_time_end = microtime_float();<br />
$render_time = $render_time_end - $render_time_start;<br />
echo $render_time;</code></p>
<p><code>function microtime_float(){<br />
list($usec, $sec) = explode(" ", microtime());<br />
return ((float)$usec + (float)$sec);<br />
}</code></p>

]]></content:encoded>
			<wfw:commentRss>http://albertech.net/2009/06/php-display-page-render-time/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Quick tuning MySQL performance</title>
		<link>http://albertech.net/2009/06/quick-tuning-mysql-performance/</link>
		<comments>http://albertech.net/2009/06/quick-tuning-mysql-performance/#comments</comments>
		<pubDate>Fri, 12 Jun 2009 01:32:24 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[MySQL]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[performance]]></category>
		<category><![CDATA[throttle]]></category>
		<category><![CDATA[tuning]]></category>

		<guid isPermaLink="false">http://albertech.net/?p=186</guid>
		<description><![CDATA[I've been working on tuning my Apache/MySQL/PHP configuration lately to see how to improve the performance. Lately, I've been noticing some crawlers that have been ignoring my robots.txt file and hitting my server really hard with several page requests every second. So, I decided to run some tests to see where I could speed up my website in the code. ]]></description>
			<content:encoded><![CDATA[
<div class="topsy_widget_data topsy_theme_blue" style="float: right;margin-left: 0.75em; background: url(data:,%7B%20%22url%22%3A%20%22http%253A%252F%252Falbertech.net%252F2009%252F06%252Fquick-tuning-mysql-performance%252F%22%2C%20%22style%22%3A%20%22big%22%2C%20%22title%22%3A%20%22Quick%20tuning%20MySQL%20performance%22%20%7D);"></div>
<p>I&#8217;ve been working on tuning my Apache/MySQL/PHP configuration lately to see how to improve the performance. Lately, I&#8217;ve been noticing some crawlers (same IPs all the time) that have been ignoring my robots.txt file and hitting my server really hard with several page requests every second.</p>
<p>So, I decided to run some tests to see where I could speed up my website in the code.</p>
<p>One test was significant. I commented one update statement in my code and that sped up my page 3 times. Page display time went down from 0.15 second to 0.045 second! It seems as though my VMWARE server has slow write access times in comparison to reads, so this is a source of the cause. I decided to use this to my advantage.  So, basically create an array with the blacklisted IPs (but you can&#8217;t block them entirely since I need certain crawlers to index websites/etc. for searches)</p>
<p><code>$is_crawler = 0;<br />
$crawler_array = array("[CRAWLER IP]","[CRAWLER IP2]");<br />
foreach($crawler_array as $crawler_item)<br />
{<br />
if ($crawler_item == $current_ip)<br />
{<br />
$is_crawler = 1;<br />
break;<br />
}<br />
}</code></p>
<p>In using this, only run the update query if the source IP isn&#8217;t a crawler&#8230; so something like this:<br />
<code><br />
if ($is_crawler==0)<br />
{</code><code><br />
// Run MySQL Update command<br />
}  </code></p>
<p>Other ways to speed up your MySQL performance.</p>
<ul>
<li>Only use ORDER BY when necessary. Ordering is costly with large datasets</li>
<li>Joins are costly as well. Design a database table cache that has the union set if performance is a concern</li>
<li>Memcache is a viable option as well for pages that use many tables to generate the page.</li>
</ul>

]]></content:encoded>
			<wfw:commentRss>http://albertech.net/2009/06/quick-tuning-mysql-performance/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>WordCamp SF 2009</title>
		<link>http://albertech.net/2009/06/wordcamp-sf-2009/</link>
		<comments>http://albertech.net/2009/06/wordcamp-sf-2009/#comments</comments>
		<pubDate>Wed, 03 Jun 2009 20:04:31 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[CMS]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[wordcamp]]></category>
		<category><![CDATA[wordpress mu]]></category>

		<guid isPermaLink="false">http://albertech.net/?p=181</guid>
		<description><![CDATA[I attended WordCamp SF for the first time in 2009. There was some exciting news at the camp, especially with the news that WordPress MU functionality is going to get integrated with WordPress. This will be nice considering updates for WordPress MU are usually a month or so behind. What will this mean? Hopefully, it will bring a larger community in maintaining and adding new plugins for WordPress (MU).  The question will be whether it will be easy to convert an existing WordPress MU install over to the new WordPress. (Possibly WordPress 3.0?)
]]></description>
			<content:encoded><![CDATA[
<div class="topsy_widget_data topsy_theme_blue" style="float: right;margin-left: 0.75em; background: url(data:,%7B%20%22url%22%3A%20%22http%253A%252F%252Falbertech.net%252F2009%252F06%252Fwordcamp-sf-2009%252F%22%2C%20%22style%22%3A%20%22big%22%2C%20%22title%22%3A%20%22WordCamp%20SF%202009%22%20%7D);"></div>
<p> <img class="alignnone" title="WordCamp 2009" src="http://farm4.static.flickr.com/3601/3588572640_bf524f6fa5.jpg?v=0" alt="" width="500" height="333" /><br />
<strong>I attended WordCamp SF for the first time in 2009.</strong> There was some exciting news at the camp, especially with the news that WordPress MU functionality is going to get integrated with WordPress. This will be nice considering updates for WordPress MU are usually a month or so behind. What will this mean? Hopefully, it will bring a larger community in maintaining and adding new plugins for WordPress (MU).  The question will be whether it will be easy to convert an existing WordPress MU install over to the new WordPress. (Possibly WordPress 3.0?)</p>
<p><strong>Highlights of the conference:<br />
Timothy Ferriss</strong>, nominated as one of Fast Company’s “Most Innovative Business People of 2007,” is an angel investor and author of the #1 New York Times, Wall Street Journal, and BusinessWeek bestseller, <a href="http://www.amazon.com/gp/product/0307353133?ie=UTF8&amp;tag=offsitoftimfe-20&amp;linkCode=as2&amp;camp=1789&amp;creative=9325&amp;creativeASIN=0307353133" target="_blank">The 4-Hour Workweek</a>, which has been sold into 35 languages. He had a lot of good points on tweaking blogs to reach a larger audience.</p>
<p><strong>WordPress gear!</strong> I plan on sending out some stickers and buttons I got at the conference.. stay tuned.</p>
<p><strong>BuddyPress</strong> There&#8217;s a lot of potential with the community aspect of blogs. I&#8217;m hoping this functionality will be integrated with WordPress MU.</p>
<p><strong>Community Speakers and Authors</strong>: <a href="http://2009.sf.wordcamp.org/speakers/#chris">http://2009.sf.wordcamp.org/speakers/#chris</a> Chris Pirillo is an excellent speaker, had a lot of interesting points about the importance of the community.</p>
<p><a href="http://2009.sf.wordcamp.org/speakers/#tara">http://2009.sf.wordcamp.org/speakers/#tara</a> Tara Hunt&#8217;s book about the value of building community vs. buying a community.</p>
<p><a href="http://2009.sf.wordcamp.org/speakers/#cali">http://2009.sf.wordcamp.org/speakers/#cali</a> Cali Lewis (GeekBrief.TV) talked about building an interactive audience. Learned a lot about the challenges of video vs. audio cast.</p>
<p>Last but not least, the community! It was great meeting everyone at the after party.</p>
<p><strong>More info about the upcoming merge with WordPress MU and WordPress (see the comments below the post)</strong><br />
<a href="http://technosailor.com/2009/05/30/wordcamp-sf-announcement-wordpress-and-wordpress-mu-to-merge/">http://technosailor.com/2009/05/30/wordcamp-sf-announcement-wordpress-and-wordpress-mu-to-merge/</a></p>

]]></content:encoded>
			<wfw:commentRss>http://albertech.net/2009/06/wordcamp-sf-2009/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Wordpress MU: Add private blogs</title>
		<link>http://albertech.net/2009/04/wordpress-mu-add-private-blogs/</link>
		<comments>http://albertech.net/2009/04/wordpress-mu-add-private-blogs/#comments</comments>
		<pubDate>Tue, 21 Apr 2009 17:40:41 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[CMS]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[plugin]]></category>
		<category><![CDATA[privacy]]></category>
		<category><![CDATA[private blog]]></category>
		<category><![CDATA[wordpress mu]]></category>

		<guid isPermaLink="false">http://albertech.net/?p=145</guid>
		<description><![CDATA[I have found a really useful plugin in Wordpress MU for making a blog private. Sometimes, committees need a way to share information away from home and they don't want everything posted to be known by the world. Rather than using the "Password protect post" option, there is a way to only allow registered users that are members of the blog to view the post. 

By default, the privacy options in Wordpress MU is limited to 1) Public, allow search engines 2) Public, don't allow search engines.

http://wpmudev.org/project/More-Privacy-Options

This plugin adds functionality:
3) I would like my blog to be visible only to registered users from blog community
4) I would like my blog to be visible to registered members of this blog
5) I would like my blog to be visible only to administrators]]></description>
			<content:encoded><![CDATA[
<div class="topsy_widget_data topsy_theme_blue" style="float: right;margin-left: 0.75em; background: url(data:,%7B%20%22url%22%3A%20%22http%253A%252F%252Falbertech.net%252F2009%252F04%252Fwordpress-mu-add-private-blogs%252F%22%2C%20%22shorturl%22%3A%20%22http%3A%2F%2Fbit.ly%2FczS9U0%22%2C%20%22style%22%3A%20%22big%22%2C%20%22title%22%3A%20%22Wordpress%20MU%3A%20Add%20private%20blogs%22%20%7D);"></div>
<p>I have found a really useful plugin in Wordpress MU for making a blog private. Sometimes, committees need a way to share information away from home and they don&#8217;t want everything posted to be known by the world. Rather than using the &#8220;Password protect post&#8221; option, there is a way to only allow registered users that are members of the blog to view the post.</p>
<p>By default, the privacy options in Wordpress MU is limited to 1) Public, allow search engines 2) Public, don&#8217;t allow search engines.</p>
<p><a href="http://wpmudev.org/project/More-Privacy-Options">http://wpmudev.org/project/More-Privacy-Options</a></p>
<p><strong>This plugin adds functionality:</strong><br />
3) I would like my blog to be visible only to registered users from blog community<br />
4) <strong>I would like my blog to be visible to registered members of this blog<br />
</strong>5) I would like my blog to be visible only to administrators</p>
<p><strong>To install:</strong><br />
1) Download the plugin file.<br />
2) Copy the plugin file to the plugin folder in Wordpress MU<br />
3) In the Plugin interface in Wordpress MU, activate the &#8220;More Privacy Options&#8221; Plugin<br />
4) In the Privacy option of the blog (under Settings -&gt; Privacy) you will have the additional privacy options. Select the &#8220;I would like my blog to be visible to registered members of this blog<br />
I would like my blog to be visible to registered members of this blog&#8221; option.<br />
5) Note: AFAIK, this is on a site by site basis, so will need to enable this plugin for each blog you want to add it to.</p>
<p><strong>Update 4/28/2010:</strong><br />
If you upgrade WordPress MU to a newer version, you will need to set the &#8220;Privacy Settings&#8221; again. Occasionally, the WordPress upgrade will reset the privacy settings back to default.</p>

]]></content:encoded>
			<wfw:commentRss>http://albertech.net/2009/04/wordpress-mu-add-private-blogs/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>Wordpress MU 2.7 Review</title>
		<link>http://albertech.net/2009/03/wordpress-mu-27-review/</link>
		<comments>http://albertech.net/2009/03/wordpress-mu-27-review/#comments</comments>
		<pubDate>Wed, 18 Mar 2009 00:42:58 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[MySQL]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[review]]></category>
		<category><![CDATA[wordpress MU 2.7]]></category>

		<guid isPermaLink="false">http://albertech.net/?p=122</guid>
		<description><![CDATA[WordPress introduced a new version of its multi-user blog software in January 2009. I have been using version 2.6 for the past few months and it was working well, although the site management was very confusing to use. Version 2.7 fixes this problem by making the Site Admin menu more uniform with the main dashboard. 
]]></description>
			<content:encoded><![CDATA[
<div class="topsy_widget_data topsy_theme_blue" style="float: right;margin-left: 0.75em; background: url(data:,%7B%20%22url%22%3A%20%22http%253A%252F%252Falbertech.net%252F2009%252F03%252Fwordpress-mu-27-review%252F%22%2C%20%22style%22%3A%20%22big%22%2C%20%22title%22%3A%20%22Wordpress%20MU%202.7%20Review%22%20%7D);"></div>
<div id="attachment_123" class="wp-caption alignnone" style="width: 410px"><img class="size-full wp-image-123" title="wordpress_mu" src="http://albertech.net/wp-content/uploads/2009/03/wordpress_mu.jpg" alt="Wordpress Mu Control Panel" width="400" height="269" /><p class="wp-caption-text">Wordpress MU Control Panel</p></div>
<p>WordPress introduced a new version of its multi-user blog software in January 2009. I have been using version 2.6 for the past few months and it was working well, although the site management was very confusing to use. Version 2.7 fixes this problem by making the Site Admin menu more uniform with the main dashboard.</p>
<p>The Site Admin is now located on the left hand menu, which is much easier to access than 2.6. (previously on the right side of the control panel. There are six options: Admin, Blogs, Users, Themes, Options, and Upgrade. Pretty straight-forward.</p>
<p><strong>Admin: </strong>Create new blogs<br />
<strong>Blogs:</strong> View each of the blogs, its users, links to edit/de-activate<br />
<strong>Users:</strong> Manage what each of the users can see/edit/role<br />
<strong>Themes:</strong> Themes available for blogs.<br />
<strong>Site Options:</strong> Security/Global settings for WordPress<br />
<strong>Upgrade: </strong>This is used to upgrade the WordPress version on the individual blogs. You still need to manually copy the latest version of WordPress MU into the folder when a new version comes out. In contrast, the standalone WordPress has a button that will automatically fetch the source and install the latest version for you.</p>
<p><strong>What I like about the new version:</strong><br />
A lot of the things I like about WordPress 2.7, I like it on WordPress MU. Major Upgrades with 2.7 vs. 2.6 include: QuickPress publishing features for quick posting, 1 click upgrade, and all new navigation system on the dashboard.</p>
<div class="mceTemp">
<div id="attachment_128" class="wp-caption alignnone" style="width: 417px"><img class="size-full wp-image-128" title="sitethemes" src="http://albertech.net/wp-content/uploads/2009/03/sitethemes.jpg" alt="Site Themes Control Panel" width="407" height="214" /><p class="wp-caption-text">Site Themes Control Panel</p></div>
<p> </p>
<div id="attachment_126" class="wp-caption alignnone" style="width: 417px"><img class="size-full wp-image-126" title="quickpost" src="http://albertech.net/wp-content/uploads/2009/03/quickpost.jpg" alt="Quick Post Feature" width="407" height="242" /><p class="wp-caption-text">Quick Post Feature</p></div>
</div>
<p>There is also redundant menu options on the top menu in WordPress MU. This allows you to quickly switch between different blogs. So, switching between blogs is a one click process vs. a multiple click previously in 2.6. </p>
<div id="attachment_131" class="wp-caption alignnone" style="width: 413px"><img class="size-full wp-image-131" title="toptoolbar" src="http://albertech.net/wp-content/uploads/2009/03/toptoolbar.jpg" alt="Top Toolbar for WordPress MU" width="403" height="25" /><p class="wp-caption-text">Top Toolbar for WordPress MU</p></div>
<p><strong>Verdict:</strong><br />
WordPress MU 2.7 is definitely worth considering with the new dashboard layout. The main advantage of having MU is that you have the ability to control the settings of all blogs. You can control what themes can be used, ban certain email addresses from registering, control permissions, and set the default welcome email. There is a built-in quota manager for each blog, so you can limit the disk space usage of all blogs. You can also limit the types of files that a user can upload on a blog &#8212; such as limiting attachments to PDF, Word Documents, or images. Another advantage of the MU is that you only need to upgrade the blog software in 1 place for several blogs. User management is good, but there still needs to be a way to add a user to multiple blogs in one screen. </p>
<p>Overall, WordPress MU 2.7 is great resource if you need to support several blogs (blog network) and are a fan of the standalone WordPress software.<br />
WordPress MU Support Forums<br />
<a href="http://mu.wordpress.org/forums/">http://mu.wordpress.org/forums/</a></p>
<p>WordPress MU Download<br />
<a href="http://mu.wordpress.org/download/">http://mu.wordpress.org/download/</a></p>

]]></content:encoded>
			<wfw:commentRss>http://albertech.net/2009/03/wordpress-mu-27-review/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>Preventing MySQL injection with PHP</title>
		<link>http://albertech.net/2009/03/preventing-mysql-injection-with-php/</link>
		<comments>http://albertech.net/2009/03/preventing-mysql-injection-with-php/#comments</comments>
		<pubDate>Thu, 12 Mar 2009 22:13:14 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[MySQL]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[prevent injection]]></category>

		<guid isPermaLink="false">http://albertech.net/?p=110</guid>
		<description><![CDATA[<strong>A good practice is to check input strings to make sure users don't put in mySQL commands in your server.</strong> For instance, if a username or password POST variable isn't filtered, there is a potential for an injection like 'OR myusername='. In the past, I've been using my own PHP toolkit to "clean" the input variables. But recently, I began searching to see if there are a built-in solution in PHP for this, especially since I'm converting a script written in Python that had the filter <B>MySQLdb.escape_string</B>. Enter <a href="http://us2.php.net/manual/en/function.mysql-real-escape-string.php">mysql_real_escape_string()</a>]]></description>
			<content:encoded><![CDATA[
<div class="topsy_widget_data topsy_theme_blue" style="float: right;margin-left: 0.75em; background: url(data:,%7B%20%22url%22%3A%20%22http%253A%252F%252Falbertech.net%252F2009%252F03%252Fpreventing-mysql-injection-with-php%252F%22%2C%20%22style%22%3A%20%22big%22%2C%20%22title%22%3A%20%22Preventing%20MySQL%20injection%20with%20PHP%22%20%7D);"></div>
<p><strong>A good practice is to check input strings to make sure users don&#8217;t put in mySQL commands in your server.</strong> For instance, if a username or password POST variable isn&#8217;t filtered, there is a potential for an injection like &#8216;OR myusername=&#8217;. In the past, I&#8217;ve been using my own PHP toolkit to &#8220;clean&#8221; the input variables. But recently, I began searching to see if there are a built-in solution in PHP for this, especially since I&#8217;m converting a script written in Python that had the filter <B>MySQLdb.escape_string</B>. Enter <a href="http://us2.php.net/manual/en/function.mysql-real-escape-string.php">mysql_real_escape_string()</a></p>
<p>1) Step 1: Filter out the backtick character, ` which is often used in mySQL to denote field names<br />
<code><br />
$variable = str_replace("`","",$variable);<br />
</code></p>
<p>2) Step 2: If its a username or password field which does not have a space, you should use ctype_alnum  This will determine whether there is a character thats not alphanumeric or numeric. So, spaces will not work.<br />
<code><br />
if (ctype_alnum($variable))<br />
{<br />
   //allowed variable<br />
}<br />
</code></p>
<p>3) Step 3: Use the mysql_real_escape_string as long as it exists on your server. If it doesn&#8217;t exist, an error message will display. I suggest upgrading your PHP if possible since this function will take care of different character sets/etc. You can use this function after the mySQL connection has been initialized.<br />
<code><br />
if(function_exists("mysql_real_escape_string"))<br />
{<br />
   $variable = mysql_real_escape_string(htmlspecialchars($variable, ENT_QUOTES));<br />
}<br />
else<br />
{<br />
    echo "mysql_real_escpe_string does not exist on the server. Upgrade PHP to the latest version.";<br />
}<br />
</code></p>

]]></content:encoded>
			<wfw:commentRss>http://albertech.net/2009/03/preventing-mysql-injection-with-php/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Converting MySQL datetime to any format</title>
		<link>http://albertech.net/2009/03/converting-mysql-datetime-to-any-format/</link>
		<comments>http://albertech.net/2009/03/converting-mysql-datetime-to-any-format/#comments</comments>
		<pubDate>Sun, 01 Mar 2009 05:54:59 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[MySQL]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[datetime]]></category>
		<category><![CDATA[format]]></category>

		<guid isPermaLink="false">http://albertech.net/?p=95</guid>
		<description><![CDATA[Converting the datetime format is really simple if you let MySQL do the formatting for you.

<a title="MySQL 5.1 Date and Time Functions" href="http://dev.mysql.com/doc/refman/5.1/en/date-and-time-functions.html#function_date-format">MySQL 5.1 SELECT DATE_FORMAT manual</a>

For instance, if you wanted to convert the datetime into something that reads
<code>function ConvertNiceDateOnly($date)
{
// Convert mySQL date to nice formatted date
$normaldate = mysql_query("SELECT DATE_FORMAT('$date','%M %e, %Y')");
$normaldate = mysql_fetch_row($normaldate);
$normaldate = $normaldate[0];
return $normaldate;
}
</code>]]></description>
			<content:encoded><![CDATA[
<div class="topsy_widget_data topsy_theme_blue" style="float: right;margin-left: 0.75em; background: url(data:,%7B%20%22url%22%3A%20%22http%253A%252F%252Falbertech.net%252F2009%252F03%252Fconverting-mysql-datetime-to-any-format%252F%22%2C%20%22style%22%3A%20%22big%22%2C%20%22title%22%3A%20%22Converting%20MySQL%20datetime%20to%20any%20format%22%20%7D);"></div>
<p>Converting the datetime format is really simple if you let MySQL do the formatting for you.</p>
<p><a title="MySQL 5.1 Date and Time Functions" href="http://dev.mysql.com/doc/refman/5.1/en/date-and-time-functions.html#function_date-format">MySQL 5.1 SELECT DATE_FORMAT manual</a></p>
<p>For instance, if you wanted to convert the datetime into something that reads<br />
<code>function ConvertNiceDateOnly($date)<br />
{<br />
// Convert mySQL date to nice formatted date<br />
$normaldate = mysql_query("SELECT DATE_FORMAT('$date','%M %e, %Y')");<br />
$normaldate = mysql_fetch_row($normaldate);<br />
$normaldate = $normaldate[0];<br />
return $normaldate;<br />
}<br />
</code></p>

]]></content:encoded>
			<wfw:commentRss>http://albertech.net/2009/03/converting-mysql-datetime-to-any-format/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>PHP &#8211; MySQL datetime to seconds</title>
		<link>http://albertech.net/2009/01/php-mysql-datetime-to-seconds/</link>
		<comments>http://albertech.net/2009/01/php-mysql-datetime-to-seconds/#comments</comments>
		<pubDate>Tue, 27 Jan 2009 02:53:51 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[MySQL]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[datetime to seconds]]></category>

		<guid isPermaLink="false">http://albertech.net/?p=59</guid>
		<description><![CDATA[<strong>$unixseconds = strtotime($mysqldate);</strong>

For instance, you can use this to write a timeout script for login failures. Usually, a system should lock after 3-5 consecutive failed login attempts. I save the timestamp after the 5th consecutive login failure, then run a check on this timestamp if the current time is within the ~5-10 minute lockout window. 5 minutes is 300 seconds, 10 minutes is 600 seconds.]]></description>
			<content:encoded><![CDATA[
<div class="topsy_widget_data topsy_theme_blue" style="float: right;margin-left: 0.75em; background: url(data:,%7B%20%22url%22%3A%20%22http%253A%252F%252Falbertech.net%252F2009%252F01%252Fphp-mysql-datetime-to-seconds%252F%22%2C%20%22style%22%3A%20%22big%22%2C%20%22title%22%3A%20%22PHP%20-%20MySQL%20datetime%20to%20seconds%22%20%7D);"></div>
<p><strong>$unixseconds = strtotime($mysqldate);</strong></p>
<p>For instance, you can use this to write a timeout script for login failures. Usually, a system should lock after 3-5 consecutive failed login attempts. I save the timestamp after the 5th consecutive login failure, then run a check on this timestamp if the current time is within the ~5-10 minute lockout window. 5 minutes is 300 seconds, 10 minutes is 600 seconds.</p>

]]></content:encoded>
			<wfw:commentRss>http://albertech.net/2009/01/php-mysql-datetime-to-seconds/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Validate MySQL date format in PHP</title>
		<link>http://albertech.net/2009/01/validate-mysql-date-format-in-php/</link>
		<comments>http://albertech.net/2009/01/validate-mysql-date-format-in-php/#comments</comments>
		<pubDate>Wed, 07 Jan 2009 20:32:38 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[ereg]]></category>
		<category><![CDATA[mysql date validation]]></category>
		<category><![CDATA[php 6]]></category>
		<category><![CDATA[preg_match]]></category>

		<guid isPermaLink="false">http://albertech.net/?p=54</guid>
		<description><![CDATA[Validating the date in MySQL should be done using preg_match since ereg_* functions will be removed in PHP 6.

<strong>More info on PHP 6 changes</strong>: <a href="http://wiki.php.net/todo/php60">http://wiki.php.net/todo/php60</a> It appears there will be a module that you can use to utilize existing ereg expressions, so that'll buy some time to port code from ereg* to preg*.
function isValidDate($date){

if (preg_match ("/^([0-9]{4})-([0-9]{2})-([0-9]{2})$/", $date))
{

return true;
}
else{
return false;
}

}]]></description>
			<content:encoded><![CDATA[
<div class="topsy_widget_data topsy_theme_blue" style="float: right;margin-left: 0.75em; background: url(data:,%7B%20%22url%22%3A%20%22http%253A%252F%252Falbertech.net%252F2009%252F01%252Fvalidate-mysql-date-format-in-php%252F%22%2C%20%22style%22%3A%20%22big%22%2C%20%22title%22%3A%20%22Validate%20MySQL%20date%20format%20in%20PHP%22%20%7D);"></div>
<p>Validating the date in MySQL should be done using preg_match since ereg_* functions will be removed in PHP 6.</p>
<p><strong>More info on PHP 6 changes</strong>: <a href="http://wiki.php.net/todo/php60">http://wiki.php.net/todo/php60</a> It appears there will be a module that you can use to utilize existing ereg expressions, so that&#8217;ll buy some time to port code from ereg* to preg*.<br />
function isValidDate($date){</p>
<p>if (preg_match (&#8220;/^([0-9]{4})-([0-9]{2})-([0-9]{2})$/&#8221;, $date))<br />
{</p>
<p>return true;<br />
}<br />
else{<br />
return false;<br />
}</p>
<p>}</p>

]]></content:encoded>
			<wfw:commentRss>http://albertech.net/2009/01/validate-mysql-date-format-in-php/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Define variables in PHP 5</title>
		<link>http://albertech.net/2008/12/define-variables-in-php-5/</link>
		<comments>http://albertech.net/2008/12/define-variables-in-php-5/#comments</comments>
		<pubDate>Wed, 03 Dec 2008 23:46:35 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[define variables]]></category>

		<guid isPermaLink="false">http://albertech.net/?p=41</guid>
		<description><![CDATA[If you have older scripts, you may encounter warning messages such as "<strong>Notice:</strong> Undefined variable: "

As a standard practice, you should define variables in PHP by putting in the variable name = FALSE;
<code>$myvar = FALSE;</code>

This is primarily for local variable names that aren't passed in through a $_REQUEST or $_POST, etc.]]></description>
			<content:encoded><![CDATA[
<div class="topsy_widget_data topsy_theme_blue" style="float: right;margin-left: 0.75em; background: url(data:,%7B%20%22url%22%3A%20%22http%253A%252F%252Falbertech.net%252F2008%252F12%252Fdefine-variables-in-php-5%252F%22%2C%20%22style%22%3A%20%22big%22%2C%20%22title%22%3A%20%22Define%20variables%20in%20PHP%205%22%20%7D);"></div>
<p>If you have older scripts, you may encounter warning messages such as &#8220;<strong>Notice:</strong> Undefined variable: &#8221;</p>
<p>As a standard practice, you should define variables in PHP by putting in the variable name = FALSE;<br />
<code>$myvar = FALSE;</code></p>
<p>This is primarily for local variable names that aren&#8217;t passed in through a $_REQUEST or $_POST, etc.</p>

]]></content:encoded>
			<wfw:commentRss>http://albertech.net/2008/12/define-variables-in-php-5/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>PHP Uptime check</title>
		<link>http://albertech.net/2008/11/php-uptime-check/</link>
		<comments>http://albertech.net/2008/11/php-uptime-check/#comments</comments>
		<pubDate>Mon, 24 Nov 2008 21:49:33 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[script]]></category>
		<category><![CDATA[uptime]]></category>

		<guid isPermaLink="false">http://albertech.net/?p=38</guid>
		<description><![CDATA[I found a useful script in PHP that can be used for checking uptime of a server. It can be useful for checking when the servers have a such a significant load that pages can't be displayed. The benefit or running it locally is that I can configure the script to perform failover functionality if necessary. Online uptime services are good too, but most of them aren't free. Maybe I should force the server to show a <a href="http://www.urbandictionary.com/define.php?term=failwhale">failwhale</a> when the site gets too busy...  j/k :D

Here's the link to the script.
<a href="http://www.programmingtalk.com/showthread.php?t=34999">http://www.programmingtalk.com/showthread.php?t=34999</a>

<code>
<?php 

// the URL you want to ... ]]></description>
			<content:encoded><![CDATA[
<div class="topsy_widget_data topsy_theme_blue" style="float: right;margin-left: 0.75em; background: url(data:,%7B%20%22url%22%3A%20%22http%253A%252F%252Falbertech.net%252F2008%252F11%252Fphp-uptime-check%252F%22%2C%20%22style%22%3A%20%22big%22%2C%20%22title%22%3A%20%22PHP%20Uptime%20check%22%20%7D);"></div>
<p>I found a useful script in PHP that can be used for checking uptime of a server. It can be useful for checking when the servers have a such a significant load that pages can&#8217;t be displayed. The benefit or running it locally is that I can configure the script to perform failover functionality if necessary. Online uptime services are good too, but most of them aren&#8217;t free. Maybe I should force the server to show a <a href="http://www.urbandictionary.com/define.php?term=failwhale">failwhale</a> when the site gets too busy&#8230;  j/k <img src='http://albertech.net/wp-includes/images/smilies/icon_biggrin.gif' alt=':D' class='wp-smiley' /> </p>
<p>Here&#8217;s the link to the script.<br />
<a href="http://www.programmingtalk.com/showthread.php?t=34999">http://www.programmingtalk.com/showthread.php?t=34999</a></p>
<p><code><br />
<?php </p>
<p>// the URL you want to keep tabs on<br />
$url = 'http://www.somewebsite.com'; </p>
<p>// if not available, send email<br />
if ( url_exists( $url ) === FALSE )<br />
{<br />
    $to   = 'my@email.com';<br />
    $subj = $url . ' is down!';<br />
    $msg  = $url . ' was tested at ' . date( 'Y-m-d H:i:s' ) . ' and was inaccessible.';<br />
    @mail( $to, $subj, $msg );<br />
} </p>
<p>/**<br />
 * url_exists()<br />
 * Checks for the validity of a given URL<br />
 *<br />
 * @param string The http[s] URL you're checking for<br />
 * @return bool TRUE if online; FALSE if not; NULL if not an http(s):// URL<br />
 */<br />
function url_exists( $strURL = NULL )<br />
{<br />
    if ( !preg_match( '/^http(s?):\/\//i', $strURL, $m ) )<br />
        return NULL;<br />
    @$ch = curl_init();<br />
    curl_setopt( $ch, CURLOPT_URL, $strURL );<br />
    curl_setopt( $ch, CURLOPT_BINARYTRANSFER, 1 );<br />
    curl_setopt( $ch, CURLOPT_HEADERFUNCTION, 'curlHeaderCallback' );<br />
    curl_setopt( $ch, CURLOPT_FAILONERROR, 1 );<br />
    curl_setopt( $ch, CURLOPT_TIMEOUT, 5 );<br />
    // https?<br />
    if ( $m[1] == 's' )<br />
        curl_setopt( $ch, CURLOPT_SSL_VERIFYPEER, 0 );<br />
    @curl_exec( $ch );<br />
    $intReturnCode = curl_getinfo( $ch, CURLINFO_HTTP_CODE );<br />
    curl_close( $ch );<br />
    return ( $intReturnCode == 200 OR $intReturnCode == 302 OR $intReturnCode == 304 ) ? TRUE : FALSE;<br />
} </p>
<p>?><br />
</code></p>

]]></content:encoded>
			<wfw:commentRss>http://albertech.net/2008/11/php-uptime-check/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
