<?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>Sniptools &#187; PHP</title>
	<atom:link href="http://sniptools.com/tag/php/feed" rel="self" type="application/rss+xml" />
	<link>http://sniptools.com</link>
	<description>Design &#38; Technology Observations</description>
	<lastBuildDate>Fri, 11 Dec 2009 18:00:40 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<item>
		<title>WordPress Revision Control: Manage or Disable edit history in WP</title>
		<link>http://sniptools.com/vault/manage-or-disable-revisions-in-wordpress</link>
		<comments>http://sniptools.com/vault/manage-or-disable-revisions-in-wordpress#comments</comments>
		<pubDate>Wed, 23 Jul 2008 06:59:15 +0000</pubDate>
		<dc:creator>Shanx</dc:creator>
				<category><![CDATA[Miscellaneous]]></category>
		<category><![CDATA[Wordpress]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[plugins]]></category>

		<guid isPermaLink="false">http://sniptools.com/?p=320</guid>
		<description><![CDATA[Among many new exciting features, WordPress 2.6 released the ability to store each and every revision of your posts, like an elaborate update history. Now this can be a pretty useful feature if you are only making substantive changes to &#8230; <a href="http://sniptools.com/vault/manage-or-disable-revisions-in-wordpress">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Among many new exciting features, <a href="http://wordpress.org">WordPress 2.6</a> released the ability to store each and every revision of your posts, like an elaborate update history. Now this can be a pretty useful feature if you are only making substantive changes to your articles, but if you change a &#8220;the&#8221; or a preposition, this can be overkill.</p>
<p>The suggested workaround to disable this revision function is to enter a variable in your wp_config.php file. But this takes away the functionality from the entire blog.</p>
<div id="attachment_323" class="wp-caption alignnone" style="width: 310px"><a href="http://dd32.id.au/wordpress-plugins/revision-control/"><img class="size-medium wp-image-323" title="Revision Control plugin for WordPress" src="http://sniptools.com/cms/wp-content/uploads/2008/07/revision-control-wordpress-300x177.gif" alt="Revision Control plugin for WordPress" width="300" height="177" /></a><p class="wp-caption-text">Revision Control plugin for WordPress</p></div>
<p>I discovered a superb plugin today that makes this process very simple. It allows you to define the setting from the WordPress aministration interface on a Global basis. That is, to</p>
<ul>
<li>Disable All revisions for all posts/pages</li>
<li>And override on a per-page/post basis.</li>
</ul>
<p>For example, I can set Revisions to Disabled globally, and then enable it to store say 5 revisions for a Specific page(Without affecting any other pages).</p>
<p>You&#8217;ll find some Info ( &amp; Download link) on it here:<br />
<a href="http://dd32.id.au/wordpress-plugins/revision-control/">http://dd32.id.au/wordpress-plugins/revision-control/</a></p>
<p>This is not MU compatible yet (untested).</p>
]]></content:encoded>
			<wfw:commentRss>http://sniptools.com/vault/manage-or-disable-revisions-in-wordpress/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Upgrade Zend Optimizer on Cpanel WHM</title>
		<link>http://sniptools.com/system-maintenance/upgrade-zend-optimizer-on-cpanel-whm</link>
		<comments>http://sniptools.com/system-maintenance/upgrade-zend-optimizer-on-cpanel-whm#comments</comments>
		<pubDate>Sat, 12 May 2007 05:22:32 +0000</pubDate>
		<dc:creator>Shanx</dc:creator>
				<category><![CDATA[System Maintenance]]></category>
		<category><![CDATA[cpanel]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[SSH]]></category>
		<category><![CDATA[Tips/Tricks]]></category>
		<category><![CDATA[Zend]]></category>

		<guid isPermaLink="false">http://sniptools.com/cms/?p=147</guid>
		<description><![CDATA[upgrade zend optimizer on cpanel
 <a href="http://sniptools.com/system-maintenance/upgrade-zend-optimizer-on-cpanel-whm">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Simple little trick to get to the latest version.</p>
<p>Most <a href="http://www.cpanel.net/products/cPanelandWHM/linux/try_cp_whm.htm">Cpanel/WHM</a> servers come with <a href="http://www.php.net">PHP</a> and <a href="http://www.zend.com">Zend</a> installed. With the recent (and important) update of PHP 5.2.1, the <a href="http://www.zend.com/products/zend_optimizer">Zend Optimizer</a> that is installed by default (version 3.0.1 as of this writing) breaks.</p>
<p>You might begin to see a message like this:</p>
<div class="code">[26-Apr-2007 10:32:49] PHP Warning: Zend Optimizer does not support this version of PHP &#8211; please upgrade to the latest version of Zend Optimizer in Unknown on line</div>
<p>To fix this, simply login to your SSH as root and execute the following command to upgrade Zend Optimiser:</p>
<blockquote><p><code>/scripts/installzendopt <span style="color: #ee0000;">3.2.8</span></code></p></blockquote>
<p>Note that if you skip the version number, Zend Optimizer 3.0.1 will be installed by default. The trick is to specify the version as above. This will also work in the future, so as long as you know the latest released version of Zend Optimizer, just replace the red text above with that number.</p>
]]></content:encoded>
			<wfw:commentRss>http://sniptools.com/system-maintenance/upgrade-zend-optimizer-on-cpanel-whm/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Dynamic Thumbnailing with Imagemagick in PHP</title>
		<link>http://sniptools.com/vault/dynamic-thumbnailing-with-imagemagick-in-php</link>
		<comments>http://sniptools.com/vault/dynamic-thumbnailing-with-imagemagick-in-php#comments</comments>
		<pubDate>Tue, 27 May 2003 18:21:21 +0000</pubDate>
		<dc:creator>Shanx</dc:creator>
				<category><![CDATA[Miscellaneous]]></category>
		<category><![CDATA[imagemagick]]></category>
		<category><![CDATA[imaging]]></category>
		<category><![CDATA[PEAR]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Tutorials]]></category>

		<guid isPermaLink="false">http://sniptools.com/cms/?p=22</guid>
		<description><![CDATA[Dynamic Thumbnailing with Imagemagick in PHP
 <a href="http://sniptools.com/vault/dynamic-thumbnailing-with-imagemagick-in-php">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Here is some sample code that allows you to create a thumbnail automatically (assuming ImageMagick is already installed and functional) (based on the <a href="http://pear.sourceforge.net/en/packages.imagick.php">imagick</a> PEAR module).</p>
<h2></h2>
<h2>Code for dynamic thumbnails using PHP</h2>
<blockquote>
<pre>&lt;?php
<span style="color: #ff9900;">
<span style="color: #008000;">// Specify your file details</span></span>
$current_file = 'image.jpg';
$max_width = '150';
<span style="color: #ff9900;">
<span style="color: #008000;">// Get the current info on the file</span></span>
$current_size = getimagesize($current_file);
$current_img_width = $current_size[0];
$current_img_height = $current_size[1];
$image_base = explode('.', $current_file);
<span style="color: #ff9900;"><span style="color: #008000;">
</span><span style="color: #008000;">// This part gets the new thumbnail name</span></span>
$image_basename = $image_base[0];
$image_ext = $image_base[1];
$thumb_name = $image_basename.'-th.'.$image_ext;
<span style="color: #ff9900;"><span style="color: #008000;">
// Determine if the image actually needs to be resized
// and if it does, get the new height for it</span>
</span>if ($current_img_width &gt; $max_width)
{
  $too_big_diff_ratio = $current_img_width/$max_width;
  $new_img_width = $max_width;
  $new_img_height = round($current_img_height/$too_big_diff_ratio);
  <span style="color: #008000;">// Convert the file</span>
  $make_magick = system("convert -geometry $new_img_width x $new_img_height $current_file $thumb_name", $retval);
  <span style="color: #008000;">// Did it work?</span>
  if (!($retval)) {
    echo 'Thumbnail created: &lt;img src="' .$thumb_name .'"&gt;';
  }
  else {
    echo 'Error: Please try again.';
  }
}
else
{
  echo 'No need to resize.';
}</pre>
<p>?&gt;</p></blockquote>
]]></content:encoded>
			<wfw:commentRss>http://sniptools.com/vault/dynamic-thumbnailing-with-imagemagick-in-php/feed</wfw:commentRss>
		<slash:comments>11</slash:comments>
		</item>
	</channel>
</rss>
