<?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>SolidlyStated.com</title>
	<atom:link href="http://solidlystated.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://solidlystated.com</link>
	<description>Hardware. Software. Solid.</description>
	<lastBuildDate>Fri, 18 May 2012 18:56:38 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Call of Cthulhu: Dark Corners of the Earth</title>
		<link>http://solidlystated.com/software/call-of-cthulhu-dark-corners-of-the-earth/</link>
		<comments>http://solidlystated.com/software/call-of-cthulhu-dark-corners-of-the-earth/#comments</comments>
		<pubDate>Fri, 18 May 2012 18:56:38 +0000</pubDate>
		<dc:creator>SolidlyStated</dc:creator>
				<category><![CDATA[Software]]></category>
		<category><![CDATA[crashes]]></category>
		<category><![CDATA[Cthulhu]]></category>
		<category><![CDATA[PC Games]]></category>
		<category><![CDATA[Windows]]></category>

		<guid isPermaLink="false">http://solidlystated.com/?p=3784</guid>
		<description><![CDATA[As a PC gamer, dusting off old games can be as entertaining as buying new ones. Unfortunately, you always run the risk of the old stuff not working on new hardware. While Call of Cthulhu: DCoTE is not MS-DOS ancient, it still has some issues with Windows 7. In this quick article, I will cover [...]]]></description>
			<content:encoded><![CDATA[<p>As a PC gamer, dusting off old games can be as entertaining as buying new ones. Unfortunately, you always run the risk of the old stuff not working on new hardware. While Call of Cthulhu: DCoTE is not MS-DOS ancient, it still has some issues with Windows 7. In this quick article, I will cover a couple issues I had off the bat trying to replay this gem that I never finished years ago. <span id="more-3784"></span></p>
<p><script type="text/javascript"><!--
google_ad_client = "pub-0090340920588945";
/* 728x90, SSD v1 - Software */
google_ad_slot = "1907377491";
google_ad_width = 728;
google_ad_height = 90;
//-->
</script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script></p>
<h4>Installation Errors</h4>
<p>During installation of Dark Corners of the Earth, Windows 7 pops up the below compatibility issue. It says the program name is &#8220;Windows Media Technologies.&#8221; </p>
<p>This error can be completely ignored and has had no impact on the game or videos. It is simply trying to install an older version of Windows Media Player.</p>
<div id="attachment_3787" class="wp-caption aligncenter" style="width: 572px"><img src="http://solidlystated.com/content/2012/05/darkcornersoftheearth.jpg" alt="Dark Corners of the Earth install" title="darkcornersoftheearth" width="562" height="270" class="size-full wp-image-3787" /><p class="wp-caption-text">Windows 7 Compatibility Assistant</p></div>
<h4>Game Crashes during Prologue</h4>
<div class="alignright" style="margin-left:20px"><script type="text/javascript"><!--
google_ad_client = "pub-0090340920588945";
/* 300x250-textandimages-middle */
google_ad_slot = "4982255467";
google_ad_width = 300;
google_ad_height = 250;
//-->
</script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script></div>
<p>Of the multiple times this game will crash, this is likely the first one that people will encounter. Be sure to read below about other crashes.</p>
<p>During the opening prologue, the game tends to crash as you open the trap door in the library. Thanks to the Wikipedia, there is a simple solution. </p>
<p>As soon as you open the trap door, <strong>immediately hold forward to move down the ladder</strong>. </p>
<p>It worked for me the first time, but I would suggest saving around the corner before you try.</p>
<div id="attachment_3788" class="wp-caption aligncenter" style="width: 728px"><img src="http://solidlystated.com/content/2012/05/cthulhu-crash.jpg" alt="crash at trap door" title="cthulhu-crash" width="718" height="452" class="size-full wp-image-3788" /><p class="wp-caption-text">Crash at trap door</p></div>
<h4>More Cthulhu Crashes</h4>
<p>Windows 7 has other crashing issues with DCoTE also. <strong>Avoid hitting ALT+Tab</strong>. There is another instance like the trap door crash where you have to slide a cabinet to expose a hidden safe. The game tends to crash here also. One GameFAQs user says the fix to this is to (temporarily, at least) &#8220;Turn the resolution to 800&#215;600 and Anti-Aliasing to x2.&#8221;</p>
<h4>Widescreen Monitors</h4>
<p>Widescreen resolutions have long been the bane of enjoying old games. Sadly, Call of Cthulhu does not support widescreen resolutions, but it does do high resolutions. </p>
<p>If you select 1920&#215;1080, for instance, it will do a stretched high res picture. I would recommend doing a 1600&#215;1200 and the aspect will be correct with black bars on the side.</p>
]]></content:encoded>
			<wfw:commentRss>http://solidlystated.com/software/call-of-cthulhu-dark-corners-of-the-earth/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to Lock Word and Excel Documents</title>
		<link>http://solidlystated.com/software/how-to-lock-word-and-excel-documents/</link>
		<comments>http://solidlystated.com/software/how-to-lock-word-and-excel-documents/#comments</comments>
		<pubDate>Mon, 07 May 2012 02:46:35 +0000</pubDate>
		<dc:creator>SolidlyStated</dc:creator>
				<category><![CDATA[Software]]></category>
		<category><![CDATA[Excel]]></category>
		<category><![CDATA[Microsoft]]></category>
		<category><![CDATA[Office]]></category>
		<category><![CDATA[Word]]></category>

		<guid isPermaLink="false">http://solidlystated.com/?p=3765</guid>
		<description><![CDATA[Ever need to keep your sneaky coworkers from modifying or editing your Office documents? Both Microsoft Word and Microsoft Excel have a quick way of protecting your docs and spreadsheets from deliberate and/or accidental changes. Solid Tip: Password protection in Word and Excel has been around since Office 2000. You have multiple options for restricting [...]]]></description>
			<content:encoded><![CDATA[<p>Ever need to keep your sneaky coworkers from modifying or editing your Office documents? Both Microsoft Word and Microsoft Excel have a quick way of protecting your docs and spreadsheets from deliberate and/or accidental changes. <span id="more-3765"></span></p>
<p><script type="text/javascript"><!--
google_ad_client = "pub-0090340920588945";
/* 728x90, SSD v1 - Software */
google_ad_slot = "1907377491";
google_ad_width = 728;
google_ad_height = 90;
//-->
</script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script></p>
<p><span class="solid">Solid Tip:</span> Password protection in Word and Excel has been around since Office 2000.</p>
<p>You have multiple options for restricting access in Word or Excel. In fact, Word 2010 has three different places where you can enter passwords.</p>
<h4>Microsoft Excel 2007 and 2010 (Method 1)</h4>
<p><img src="http://solidlystated.com/content/2012/05/excel.jpg" alt="" title="excel" width="718" height="120" class="aligncenter size-full wp-image-3773" /></p>
<p>Click Review, then click Protect Sheet or Protect Workbook. You can hover over the two options for more details about the difference between the two. Each dialog box will have a password box. You can select individual actions that people without the password can do to the document.</p>
<h4>Microsoft Word 2007 and 2010 (Method 1)</h4>
<p><img src="http://solidlystated.com/content/2012/05/word.jpg" alt="word-protect" title="word-protect" width="718" height="120" class="aligncenter size-full wp-image-3767" /></p>
<p>Click Review, then click Restrict Editing. The restriction options will pop up. If you want to simply lock your document and be done with it, click the checkbox under section 2 and hit the button under section 3. You will then be prompted for a password.</p>
<p><img src="http://solidlystated.com/content/2012/05/word-password.jpg" alt="Word Password Protection" title="word-password" width="338" height="232" class="aligncenter size-full wp-image-3768" /></p>
<p>If you enter the password in the boxes above, it mentions that &#8220;malicious users can edit the file and remove the password.&#8221; <strong>This method does not encrypt</strong> the password and anyone could open the document in a script editor and view the password info stored as XML. </p>
<p>If you select &#8220;User Authentication,&#8221; then only the Windows users that you specify in the restriction options will be allowed to modify the file. You can add users under &#8220;Exceptions.&#8221;</p>
<p><script type="text/javascript"><!--
google_ad_client = "pub-0090340920588945";
/* 728x90, SSD v1 - Software */
google_ad_slot = "1907377491";
google_ad_width = 728;
google_ad_height = 90;
//-->
</script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script></p>
<h4>Word 2007, 2010 and Excel 2007, 2010 (Method 2)</h4>
<p>When saving your document or sheet, there is a &#8220;Tools&#8221; button next to the &#8220;Save&#8221; and &#8220;Cancel&#8221; buttons. Click on &#8220;Tools&#8221; and then &#8220;General Options.&#8221; This box will pop up:</p>
<p><img src="http://solidlystated.com/content/2012/05/word-password2.jpg" alt="word password save box" title="word-password2" width="420" height="318" class="aligncenter size-full wp-image-3769" /></p>
<p>This method allows you to use an encrypted password for opening the document and also for editing. If you lose the password with this method, you are out of luck.</p>
<h4>Word 2007, 2010 and Excel 2007, 2010 (Method 3)</h4>
<p>The third method for blocking changes to your Word document are under the main program menu. In Word/Excel 2007, you hit the round pizza button > Prepare > Encrypt Document. In Word/Excel 2010, you hit the &#8220;File&#8221; tab > Permissions > Encrypt with a Password.</p>
<p><img src="http://solidlystated.com/content/2012/05/word-password3.jpg" alt="" title="word-password3" width="420" height="318" class="aligncenter size-full wp-image-3770" /></p>
<p>If you lose the password with this method, you are out of luck. If you just want to protect the document or sheet against accidental changes, you can use the options next to this one, called &#8220;Mark As Final.&#8221; This simply sets the file to a read-only state.</p>
<p><script type="text/javascript"><!--
google_ad_client = "pub-0090340920588945";
/* 728x90, SSD v1 - Software */
google_ad_slot = "1907377491";
google_ad_width = 728;
google_ad_height = 90;
//-->
</script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script></p>
]]></content:encoded>
			<wfw:commentRss>http://solidlystated.com/software/how-to-lock-word-and-excel-documents/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>What does STD HRC IRC cable mean?</title>
		<link>http://solidlystated.com/hardware/what-does-std-hrc-irc-cable-mean/</link>
		<comments>http://solidlystated.com/hardware/what-does-std-hrc-irc-cable-mean/#comments</comments>
		<pubDate>Sat, 05 May 2012 20:04:27 +0000</pubDate>
		<dc:creator>SolidlyStated</dc:creator>
				<category><![CDATA[Hardware]]></category>
		<category><![CDATA[HDTV]]></category>
		<category><![CDATA[Samsung]]></category>
		<category><![CDATA[Sharp]]></category>

		<guid isPermaLink="false">http://solidlystated.com/?p=3743</guid>
		<description><![CDATA[STD, HRC, and IRC are cable television formats. Since most people don&#8217;t read the manual (always RTFM!), they would never know what this means and will end up reading this very sentence for help in scanning (auto programming) channels for their HDTV. STD HRC and IRC Reference While the terms HRC and IRC are slowly [...]]]></description>
			<content:encoded><![CDATA[<p>STD, HRC, and IRC are cable television formats. Since most people don&#8217;t read the manual (always RTFM!), they would never know what this means and will end up reading this very sentence for help in scanning (auto programming) channels for their HDTV. <span id="more-3743"></span></p>
<div class="alignright" style="margin-left:20px"><script type="text/javascript"><!--
google_ad_client = "pub-0090340920588945";
/* 300x250-textandimages-middle */
google_ad_slot = "4982255467";
google_ad_width = 300;
google_ad_height = 250;
//-->
</script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script></div>
<h4>STD HRC and IRC Reference</h4>
<p>While the terms HRC and IRC are slowly phasing out, many TVs still allow the option of setting up your tuner to one of these 3 formats.</p>
<table class='graytable'>
<tr>
<td width="100">STD</td>
<td width="200">Standard</td>
</tr>
<tr>
<td>HRC</td>
<td>Harmonically Related Carriers</td>
</tr>
<tr>
<td>IRC</td>
<td>Incrementally Related Carriers</td>
</tr>
</table>
<p>Additionally you might have the option to select analog vs digital. You want digital if available, but it likely won&#8217;t matter as analog cable is going the way of the dinosaur and if you have a &#8220;digital cable box,&#8221; all your programming is coming into the house digitally already (and then converted to analog by the box).</p>
<h4>What&#8217;s the Difference</h4>
<p>Older cable trunk lines suffer from signal degradation over and distance and require amplifiers to maintain signal strength. This amplification introduces noise into the cable signal. HRC and IRC are formats that the cable companies use in an attempt to clean up signals and improve audio/video quality. They slightly alter the frequency in order to make interference less noticeable, but most people would be hard pressed to tell the difference.</p>
<p>Modern cable installations run fiber optic lines and do not require signal improvements. <strong>Today, most cable systems use STD</strong>.</p>
<p>Cable signals are sent through lines with a frequency, measured in MHz (megahertz) like cordless phones or computer CPUs. <strong>HRC and IRC</strong> try to eliminate interference, which comes in the form of &#8220;beat noise&#8221;- a term describing &#8220;concentrations of energy in the frequency domain.&#8221; Ya, that&#8217;s not too technical! We don&#8217;t care about all that. We just need to know which one to use&#8230;</p>
<p><script type="text/javascript"><!--
google_ad_client = "pub-0090340920588945";
/* 728x90, 4/13/10, SSD v1 */
google_ad_slot = "7570072383";
google_ad_width = 728;
google_ad_height = 90;
//-->
</script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script></p>
<h4>Which do I Choose?</h4>
<p>This is an <a rel="nofollow" href="http://support.brighthouse.com/Article/Input-TV-Remote-STD-HRC-IRC-5967/" target="_blank">official position</a> from Brighthouse Networks and also our Solid Recommendation:</p>
<blockquote><p>Always select STD (standard) if your TV offers this setting. Choosing the others could result in reception problems or missing channels.</p></blockquote>
<p>If you have cable TV and live in a major city, or if you have satellite television like DISH Network or DirecTV, then you want to always select STD standard. </p>
<p>If you live in a rural community that is running an older cable system, then you might benefit from trying HRC or IRC. Results will vary as it is not an exact science, but you should take notes of the number of channels found and your opinion of quality between each. After comparing, choose which one you like.</p>
<p>For you worry warts- your TV set does not care which format you choose and it cannot hurt anything.</p>
]]></content:encoded>
			<wfw:commentRss>http://solidlystated.com/hardware/what-does-std-hrc-irc-cable-mean/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Call of Duty: Black Ops 2 trailer</title>
		<link>http://solidlystated.com/software/call-of-duty-black-ops-2-trailer/</link>
		<comments>http://solidlystated.com/software/call-of-duty-black-ops-2-trailer/#comments</comments>
		<pubDate>Wed, 02 May 2012 00:52:06 +0000</pubDate>
		<dc:creator>SolidlyStated</dc:creator>
				<category><![CDATA[Software]]></category>
		<category><![CDATA[Call of Duty]]></category>
		<category><![CDATA[PC Games]]></category>

		<guid isPermaLink="false">http://solidlystated.com/?p=3730</guid>
		<description><![CDATA[Just a quick update, thanks to IGN. The very first look at Treyarch&#8217;s Call of Duty Black Ops 2 has arrived. Check out the video below The reveal trailer, highlighting a refreshingly different concept of war in the near future, examining what happens when man places too much faith in war machines and technology. The [...]]]></description>
			<content:encoded><![CDATA[<p>Just a quick update, thanks to <a rel="nofollow" href="http://www.ign.com/videos/2012/05/01/call-of-duty-black-ops-2-reveal-trailer">IGN</a>. The very first look at Treyarch&#8217;s Call of Duty Black Ops 2 has arrived. Check out the video below <span id="more-3730"></span></p>
<p><script type="text/javascript"><!--
google_ad_client = "pub-0090340920588945";
/* 728x90, SSD v1 - Software */
google_ad_slot = "1907377491";
google_ad_width = 728;
google_ad_height = 90;
//-->
</script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script></p>
<p>The reveal trailer, highlighting a refreshingly different concept of war in the near future, examining what happens when man places too much faith in war machines and technology. </p>
<div style="width:470px;margin:0 auto">
<strong>The Future is Black</strong><br />
<object id="vid_af7836a5181993ba36058046022ea770" class="ign-videoplayer" width="468" height="293" data="http://oystatic.ignimgs.com/src/core/swf/IGNPlayer.swf" type="application/x-shockwave-flash"><param name="movie" value="http://oystatic.ignimgs.com/src/core/swf/IGNPlayer.swf" /><param name="allowfullscreen" value="true" /><param name="allowscriptaccess" value="always" /><param name="bgcolor" value="#000000" /><param name="flashvars" value="url=http://www.ign.com/videos/2012/05/01/call-of-duty-black-ops-2-reveal-trailer"/></object>
</div>
<p>Hopefully, this can breath some new life into a brand that is taking a nose dive for cookie-cutter first person shooters. Looks intriguing in concept. If there is one thing that CoD games can get right, it&#8217;s grandiose plot lines.</p>
<p><script type="text/javascript"><!--
google_ad_client = "pub-0090340920588945";
/* 728x90, SSD v1 - Software */
google_ad_slot = "1907377491";
google_ad_width = 728;
google_ad_height = 90;
//-->
</script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script></p>
<p><img src="http://solidlystated.com/content/2012/05/blackop2-poster1.jpg" alt="" title="blackop2" width="728" height="805" class="aligncenter size-full wp-image-3740" /></p>
]]></content:encoded>
			<wfw:commentRss>http://solidlystated.com/software/call-of-duty-black-ops-2-trailer/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>PHP What are Constants and Why Do I Care?</title>
		<link>http://solidlystated.com/scripting/php-what-are-constants-and-why-do-i-care/</link>
		<comments>http://solidlystated.com/scripting/php-what-are-constants-and-why-do-i-care/#comments</comments>
		<pubDate>Mon, 30 Apr 2012 01:49:26 +0000</pubDate>
		<dc:creator>SolidlyStated</dc:creator>
				<category><![CDATA[Scripting]]></category>
		<category><![CDATA[Constants]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[variables]]></category>

		<guid isPermaLink="false">http://solidlystated.com/?p=3707</guid>
		<description><![CDATA[Almost every good PHP application will be need to access some global values at some point. Constants are a programming pattern that you can access anywhere, at anytime and be sure that it won&#8217;t be overwritten. You will find this universal concept in almost every programming language. In this article, I will consolidate some great [...]]]></description>
			<content:encoded><![CDATA[<p>Almost every good PHP application will be need to access some global values at some point. Constants are a programming pattern that you can access anywhere, at anytime and be sure that it won&#8217;t be overwritten. You will find this universal concept in almost every programming language. In this article, I will consolidate some great tips for working with constants in PHP and the specifics to keep an eye on.<span id="more-3707"></span></p>
<p><script type="text/javascript"><!--
google_ad_client = "pub-0090340920588945";
/* 728x90, SSD v1 - Scripting */
google_ad_slot = "7110832439";
google_ad_width = 728;
google_ad_height = 90;
//-->
</script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script></p>
<h4>It&#8217;s just a global variable right?</h4>
<p>Nope. Variables change. Constants wouldn&#8217;t be very constant if they kept changing, would they? This is the most important aspect of a constant is that it <strong>cannot change once you have defined it</strong>. If you simply want a global variable that you can transform throughout your program, you do not want a constant. That being said, you can access a constant anywhere without regard to scope.</p>
<p>You will find that constants can be very helpful at the top of scripts/classes as default or configuration values. They do not take the overhead of other methods of accessing global variables and you don&#8217;t have to worry about them being changed elsewhere in your code.</p>
<h4>Tips for Creating Constants</h4>

<div class="wp_codebox_msgheader"><span class="right"></span><span class="left">PHP<a href="javascript:;" onclick="javascript:showCodeTxt('p3707code5'); return false;">view code</a> </span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p37075"><td class="code" id="p3707code5"><pre class="php" style="font-family:monospace;"><span style="color: #666666; font-style: italic;">// Valid constant names</span>
<a href="http://www.php.net/define"><span style="color: #990000;">define</span></a><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;FOO&quot;</span><span style="color: #339933;">,</span>     <span style="color: #0000ff;">&quot;solid&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<a href="http://www.php.net/define"><span style="color: #990000;">define</span></a><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;FOO2&quot;</span><span style="color: #339933;">,</span>    <span style="color: #0000ff;">&quot;solid state&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<a href="http://www.php.net/define"><span style="color: #990000;">define</span></a><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;FOO_BAR&quot;</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">&quot;solidlystated&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #666666; font-style: italic;">// Invalid constant names</span>
<a href="http://www.php.net/define"><span style="color: #990000;">define</span></a><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;2FOO&quot;</span><span style="color: #339933;">,</span>    <span style="color: #0000ff;">&quot;solid&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #666666; font-style: italic;">// Check for, then set a constant</span>
<a href="http://www.php.net/defined"><span style="color: #990000;">defined</span></a><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;FOO&quot;</span><span style="color: #009900;">&#41;</span> or <a href="http://www.php.net/define"><span style="color: #990000;">define</span></a><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;FOO&quot;</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">&quot;solid&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></td></tr></table></div>

<p>These examples are similar to those seen in the <a rel="nofollow" href="http://php.net/manual/en/language.constants.php" title="PHP manual" target="_blank">PHP manual</a> website.</p>
<div class="alignright" style="margin-left:20px"><script type="text/javascript"><!--
google_ad_client = "pub-0090340920588945";
/* 300x250-textandimages-middle */
google_ad_slot = "4982255467";
google_ad_width = 300;
google_ad_height = 250;
//-->
</script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script></div>
<ul>
<li>PHP constants are case-sensitive</li>
<li>By convention, use all uppercase characters</li>
<li>By convention, use underscores as spaces</li>
<li>Constant names can only start with letter or underscore</li>
<li>Numbers can be used after the first character</li>
<li>Constant name must be quoted when defined</li>
<li>Constant names cannot be reserved PHP keywords</li>
</ul>
<h4>Difference between a Constant and a Singleton</h4>
<p>Singletons are a pattern of programming that most developers write with one hand, while shaking a fist at in the other hand. Singletons are frowned upon for various debatable reasons, but those are outside the scope of this article (pun intended).</p>
<p>Singletons get their name from the idea that they only exist as a single instance of a class, allowing you to reliably access them to manage consistent data. Some applications, especially larger ones, use a singleton class to manage data that could normally be handled with constants. Of course, there is a major difference- <strong>singletons are mutable at run-time</strong>.</p>
<p>A singleton is useful because it&#8217;s a globally accessible class (with variables and methods) that, when done right, only allows one instance to be created.</p>
<h4>Global Constants Versus Class Constants</h4>
<p>Class constants also exist in PHP, giving you the immutable power of a constant with the scope of a class. Instead of using <code>define()</code>, you simply assign a class constant with the keyword <code>const</code>.</p>
<p><span class="solid">Solid Tip:</span> Until PHP 5.3, <code>const</code> could not be used in the global scope and had to be used in a class. </p>
<p>As of PHP 5.3, you CAN use <code>const</code> globally, and it will work fine, but your IDE will insist that it is an error (As of this article Dreamweaver CS5 still thinks this is an error outside a class). <strong>Don&#8217;t defy convention</strong>. Use <code>define()</code> for your global constants and, if you must, use <code>const</code> inside classes. You can access class constants in the following manner:</p>

<div class="wp_codebox_msgheader"><span class="right"></span><span class="left">PHP<a href="javascript:;" onclick="javascript:showCodeTxt('p3707code6'); return false;">view code</a> </span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p37076"><td class="code" id="p3707code6"><pre class="php" style="font-family:monospace;"><span style="color: #666666; font-style: italic;">// inside your class</span>
<span style="color: #000000; font-weight: bold;">class</span> MyFOO
<span style="color: #009900;">&#123;</span>
    <span style="color: #000000; font-weight: bold;">const</span> FOO <span style="color: #339933;">=</span> <span style="color: #0000ff;">'solid'</span><span style="color: #339933;">;</span>
&nbsp;
    <span style="color: #000000; font-weight: bold;">function</span> somefunc<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>
    <span style="color: #009900;">&#123;</span>
        <span style="color: #b1b100;">echo</span> <span style="color: #000000; font-weight: bold;">self</span><span style="color: #339933;">::</span><span style="color: #004000;">FOO</span><span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #666666; font-style: italic;">//outside your class</span>
<span style="color: #000088;">$myfoo</span> <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> MyFOO<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #b1b100;">echo</span> <span style="color: #000088;">$myfoo</span><span style="color: #339933;">::</span><span style="color: #004000;">FOO</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #666666; font-style: italic;">// Note that FOO could be defined as a global also</span></pre></td></tr></table></div>

<p><code>Const </code>is a language construct and not a method, having many other minor differences compared to <code>define()</code>, such as the values it can be assigned. Most notably, it <strong>cannot be assigned inside a conditional block</strong>.</p>

<div class="wp_codebox_msgheader"><span class="right"></span><span class="left">PHP<a href="javascript:;" onclick="javascript:showCodeTxt('p3707code7'); return false;">view code</a> </span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p37077"><td class="code" id="p3707code7"><pre class="php" style="font-family:monospace;"><span style="color: #666666; font-style: italic;">// Invalid before PHP 5.3 outside of a class</span>
<span style="color: #000000; font-weight: bold;">const</span> FOO <span style="color: #339933;">=</span> <span style="color: #cc66cc;">1</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #666666; font-style: italic;">// Invalid EVERYWHERE</span>
<span style="color: #000000; font-weight: bold;">const</span> FOO <span style="color: #339933;">=</span> <span style="color: #cc66cc;">1</span><span style="color: #339933;">+</span><span style="color: #cc66cc;">1</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #666666; font-style: italic;">// Invalid EVERYWHERE also</span>
<span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span><span style="color: #339933;">...</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span> <span style="color: #000000; font-weight: bold;">const</span> FOO <span style="color: #339933;">=</span> <span style="color: #cc66cc;">1</span><span style="color: #339933;">;</span> <span style="color: #009900;">&#125;</span></pre></td></tr></table></div>

<p><script type="text/javascript"><!--
google_ad_client = "pub-0090340920588945";
/* 728x90, SSD v1 - Scripting */
google_ad_slot = "7110832439";
google_ad_width = 728;
google_ad_height = 90;
//-->
</script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script></p>
<h4>Tips for Retrieving Constants</h4>
<p>It is good habit to use <code>defined()</code> along with <code>define()</code> (as seen in the final example below). If you have already defined a constant, <strong>PHP will throw a Notice</strong>. You could also wrap other conditionals around <code>define()</code> to suit your needs.</p>
<p>The bullet points up top remind you that constant names must be quoted when being defined. Don&#8217;t get confused when trying to echo the constant back to the screen, though. If you put a constant inside a quote, then its just an uppercase word in quote (maybe someone is shouting).</p>

<div class="wp_codebox_msgheader"><span class="right"></span><span class="left">PHP<a href="javascript:;" onclick="javascript:showCodeTxt('p3707code8'); return false;">view code</a> </span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p37078"><td class="code" id="p3707code8"><pre class="php" style="font-family:monospace;"><a href="http://www.php.net/defined"><span style="color: #990000;">defined</span></a><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'FOO'</span><span style="color: #009900;">&#41;</span> or <a href="http://www.php.net/define"><span style="color: #990000;">define</span></a><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'FOO'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'solid'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #b1b100;">echo</span> <span style="color: #0000ff;">&quot;FOO state&quot;</span><span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">// echoes FOO state</span>
<span style="color: #b1b100;">echo</span> <span style="color: #0000ff;">'FOO state'</span><span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">// echoes FOO state</span>
<span style="color: #b1b100;">echo</span> FOO<span style="color: #339933;">.</span><span style="color: #0000ff;">&quot; state&quot;</span><span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">// echoes solid state</span></pre></td></tr></table></div>

<p>Hopefully, these tips and examples have helped you decide whether constants are what you are looking for, or cleared up any confusion about a couple of the alternatives. Got a question or concern about something I did or didn&#8217;t cover? Let me know with a comment below.</p>
]]></content:encoded>
			<wfw:commentRss>http://solidlystated.com/scripting/php-what-are-constants-and-why-do-i-care/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>WordPress Get All Post Tags By Count</title>
		<link>http://solidlystated.com/scripting/wordpress-get-all-post-tags-by-count/</link>
		<comments>http://solidlystated.com/scripting/wordpress-get-all-post-tags-by-count/#comments</comments>
		<pubDate>Sat, 28 Apr 2012 21:00:01 +0000</pubDate>
		<dc:creator>SolidlyStated</dc:creator>
				<category><![CDATA[Scripting]]></category>
		<category><![CDATA[tags]]></category>
		<category><![CDATA[Wordpress]]></category>

		<guid isPermaLink="false">http://solidlystated.com/?p=3686</guid>
		<description><![CDATA[WordPress has helpful functions tag clouds, terms, categories and more inside your blog. I find it helpful to be able to monitor my data outside of WP occasionally with direct database queries. There are some legacy (old) queries floating around the internet regarding the topic, but WordPress has continuously changed over the years making some [...]]]></description>
			<content:encoded><![CDATA[<p>WordPress has helpful functions tag clouds, terms, categories and more <i>inside</i> your blog. I find it helpful to be able to monitor my data outside of WP occasionally with direct database queries. <span id="more-3686"></span></p>
<div class="alignright" style="margin-left:20px"><script type="text/javascript"><!--
google_ad_client = "pub-0090340920588945";
/* 300x250-textandimages-middle */
google_ad_slot = "4982255467";
google_ad_width = 300;
google_ad_height = 250;
//-->
</script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script></div>
<p>There are some legacy (old) queries floating around the internet regarding the topic, but WordPress has continuously changed over the years making some of them obsolete. These newer queries take advantage of the WordPress 3.x database.</p>
<p>What&#8217;s most exciting is the fact that the database now keeps an updated count of your tag/term usage. Whenever an article gets published, it updates the count for the post tags in it. It also correctly handles that count in regards to draft and future published articles.</p>
<p><span class="solid">Solid Tip:</span> These queries use the default &#8216;wp_&#8217; database table prefix. Be sure to modify if you changed it.</p>
<h4>Get Tag Count</h4>

<div class="wp_codebox_msgheader"><span class="right"></span><span class="left">MYSQL<a href="javascript:;" onclick="javascript:showCodeTxt('p3686code12'); return false;">view code</a> </span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p368612"><td class="code" id="p3686code12"><pre class="mysql" style="font-family:monospace;"><a href="http://search.mysql.com/search?site=refman-%35%31&amp;q=SELECT"><span style="color: #990099; font-weight: bold;">SELECT</span></a> term.name<span style="color: #000033;">,</span> term.slug<span style="color: #000033;">,</span> tax.<a href="http://dev.mysql.com/doc/refman/%35%2E%31/en/group-by-functions-and-modifiers.html"><span style="color: #000099;">count</span></a> <a href="http://search.mysql.com/search?site=refman-%35%31&amp;q=FROM"><span style="color: #990099; font-weight: bold;">FROM</span></a> wp_term_taxonomy tax 
<a href="http://dev.mysql.com/doc/refman/%35%2E%31/en/string-functions.html"><span style="color: #000099;">LEFT</span></a> <a href="http://search.mysql.com/search?site=refman-%35%31&amp;q=JOIN"><span style="color: #990099; font-weight: bold;">JOIN</span></a> wp_terms term <a href="http://search.mysql.com/search?site=refman-%35%31&amp;q=ON"><span style="color: #990099; font-weight: bold;">ON</span></a> term.term_id <span style="color: #CC0099;">=</span> tax.term_id <a href="http://search.mysql.com/search?site=refman-%35%31&amp;q=WHERE"><span style="color: #990099; font-weight: bold;">WHERE</span></a> tax.taxonomy <span style="color: #CC0099;">=</span> <span style="color: #008000;">'post<span style="color: #008080; font-weight: bold;">_</span>tag'</span> 
<a href="http://search.mysql.com/search?site=refman-%35%31&amp;q=ORDER%20BY"><span style="color: #990099; font-weight: bold;">ORDER BY</span></a> tax.<a href="http://dev.mysql.com/doc/refman/%35%2E%31/en/group-by-functions-and-modifiers.html"><span style="color: #000099;">count</span></a> <a href="http://search.mysql.com/search?site=refman-%35%31&amp;q=DESC"><span style="color: #990099; font-weight: bold;">DESC</span></a></pre></td></tr></table></div>

<h4>Get Category Count</h4>

<div class="wp_codebox_msgheader"><span class="right"></span><span class="left">MYSQL<a href="javascript:;" onclick="javascript:showCodeTxt('p3686code13'); return false;">view code</a> </span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p368613"><td class="code" id="p3686code13"><pre class="mysql" style="font-family:monospace;"><a href="http://search.mysql.com/search?site=refman-%35%31&amp;q=SELECT"><span style="color: #990099; font-weight: bold;">SELECT</span></a> term.name<span style="color: #000033;">,</span> term.slug<span style="color: #000033;">,</span> tax.<a href="http://dev.mysql.com/doc/refman/%35%2E%31/en/group-by-functions-and-modifiers.html"><span style="color: #000099;">count</span></a> <a href="http://search.mysql.com/search?site=refman-%35%31&amp;q=FROM"><span style="color: #990099; font-weight: bold;">FROM</span></a> wp_term_taxonomy tax 
<a href="http://dev.mysql.com/doc/refman/%35%2E%31/en/string-functions.html"><span style="color: #000099;">LEFT</span></a> <a href="http://search.mysql.com/search?site=refman-%35%31&amp;q=JOIN"><span style="color: #990099; font-weight: bold;">JOIN</span></a> wp_terms term <a href="http://search.mysql.com/search?site=refman-%35%31&amp;q=ON"><span style="color: #990099; font-weight: bold;">ON</span></a> term.term_id <span style="color: #CC0099;">=</span> tax.term_id <a href="http://search.mysql.com/search?site=refman-%35%31&amp;q=WHERE"><span style="color: #990099; font-weight: bold;">WHERE</span></a> tax.taxonomy <span style="color: #CC0099;">=</span> <span style="color: #008000;">'category'</span> 
<a href="http://search.mysql.com/search?site=refman-%35%31&amp;q=ORDER%20BY"><span style="color: #990099; font-weight: bold;">ORDER BY</span></a> tax.<a href="http://dev.mysql.com/doc/refman/%35%2E%31/en/group-by-functions-and-modifiers.html"><span style="color: #000099;">count</span></a> <a href="http://search.mysql.com/search?site=refman-%35%31&amp;q=DESC"><span style="color: #990099; font-weight: bold;">DESC</span></a></pre></td></tr></table></div>

<p><script type="text/javascript"><!--
google_ad_client = "pub-0090340920588945";
/* 728x90, SSD v1 - Scripting */
google_ad_slot = "7110832439";
google_ad_width = 728;
google_ad_height = 90;
//-->
</script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script></p>
<h4>Legacy WordPress 2.x Queries</h4>
<p>I did not write these queries, but they are still useful for examining dates.</p>

<div class="wp_codebox_msgheader"><span class="right"></span><span class="left">MYSQL<a href="javascript:;" onclick="javascript:showCodeTxt('p3686code14'); return false;">view code</a> </span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p368614"><td class="code" id="p3686code14"><pre class="mysql" style="font-family:monospace;"><span style="color: #808000; font-style: italic;">/* Get all tags and their last usage date */</span>
<a href="http://search.mysql.com/search?site=refman-%35%31&amp;q=SELECT"><span style="color: #990099; font-weight: bold;">SELECT</span></a> name<span style="color: #000033;">,</span> slug<span style="color: #000033;">,</span> <a href="http://dev.mysql.com/doc/refman/%35%2E%31/en/group-by-functions-and-modifiers.html"><span style="color: #000099;">count</span></a><span style="color: #FF00FF;">&#40;</span>history.tagId<span style="color: #FF00FF;">&#41;</span> <a href="http://search.mysql.com/search?site=refman-%35%31&amp;q=AS"><span style="color: #990099; font-weight: bold;">AS</span></a> total<span style="color: #000033;">,</span> tagdate <a href="http://search.mysql.com/search?site=refman-%35%31&amp;q=FROM"><span style="color: #990099; font-weight: bold;">FROM</span></a>
<span style="color: #FF00FF;">&#40;</span><a href="http://search.mysql.com/search?site=refman-%35%31&amp;q=SELECT"><span style="color: #990099; font-weight: bold;">SELECT</span></a> rel.term_taxonomy_id <a href="http://search.mysql.com/search?site=refman-%35%31&amp;q=AS"><span style="color: #990099; font-weight: bold;">AS</span></a> tagid<span style="color: #000033;">,</span> substr<span style="color: #FF00FF;">&#40;</span>p.post_date_gmt<span style="color: #000033;">,</span><span style="color: #008080;">1</span><span style="color: #000033;">,</span><span style="color: #008080;">10</span><span style="color: #FF00FF;">&#41;</span> <a href="http://search.mysql.com/search?site=refman-%35%31&amp;q=AS"><span style="color: #990099; font-weight: bold;">AS</span></a> tagdate <a href="http://search.mysql.com/search?site=refman-%35%31&amp;q=FROM"><span style="color: #990099; font-weight: bold;">FROM</span></a> wp_term_relationships rel
<a href="http://search.mysql.com/search?site=refman-%35%31&amp;q=INNER"><span style="color: #990099; font-weight: bold;">INNER</span></a> <a href="http://search.mysql.com/search?site=refman-%35%31&amp;q=JOIN"><span style="color: #990099; font-weight: bold;">JOIN</span></a> wp_term_taxonomy tax <a href="http://search.mysql.com/search?site=refman-%35%31&amp;q=ON"><span style="color: #990099; font-weight: bold;">ON</span></a> tax.term_taxonomy_id<span style="color: #CC0099;">=</span>rel.term_taxonomy_id
<a href="http://search.mysql.com/search?site=refman-%35%31&amp;q=INNER"><span style="color: #990099; font-weight: bold;">INNER</span></a> <a href="http://search.mysql.com/search?site=refman-%35%31&amp;q=JOIN"><span style="color: #990099; font-weight: bold;">JOIN</span></a> wp_posts p <a href="http://search.mysql.com/search?site=refman-%35%31&amp;q=ON"><span style="color: #990099; font-weight: bold;">ON</span></a> p.ID<span style="color: #CC0099;">=</span>rel.object_id <a href="http://search.mysql.com/search?site=refman-%35%31&amp;q=WHERE"><span style="color: #990099; font-weight: bold;">WHERE</span></a> taxonomy<span style="color: #CC0099;">=</span><span style="color: #008000;">'post<span style="color: #008080; font-weight: bold;">_</span>tag'</span>
<a href="http://dev.mysql.com/doc/refman/%35%2E%31/en/non-typed-operators.html"><span style="color: #CC0099; font-weight: bold;">AND</span></a> post_status<span style="color: #CC0099;">=</span><span style="color: #008000;">'publish'</span> <a href="http://search.mysql.com/search?site=refman-%35%31&amp;q=ORDER%20BY"><span style="color: #990099; font-weight: bold;">ORDER BY</span></a> post_date_gmt <a href="http://search.mysql.com/search?site=refman-%35%31&amp;q=DESC"><span style="color: #990099; font-weight: bold;">DESC</span></a><span style="color: #FF00FF;">&#41;</span> <a href="http://search.mysql.com/search?site=refman-%35%31&amp;q=AS"><span style="color: #990099; font-weight: bold;">AS</span></a> history
<a href="http://search.mysql.com/search?site=refman-%35%31&amp;q=INNER"><span style="color: #990099; font-weight: bold;">INNER</span></a> <a href="http://search.mysql.com/search?site=refman-%35%31&amp;q=JOIN"><span style="color: #990099; font-weight: bold;">JOIN</span></a> wp_terms t <a href="http://search.mysql.com/search?site=refman-%35%31&amp;q=ON"><span style="color: #990099; font-weight: bold;">ON</span></a> t.term_id<span style="color: #CC0099;">=</span>history.tagid <a href="http://search.mysql.com/search?site=refman-%35%31&amp;q=GROUP%20BY"><span style="color: #990099; font-weight: bold;">GROUP BY</span></a> history.tagid <a href="http://search.mysql.com/search?site=refman-%35%31&amp;q=ORDER%20BY"><span style="color: #990099; font-weight: bold;">ORDER BY</span></a> total <a href="http://search.mysql.com/search?site=refman-%35%31&amp;q=DESC"><span style="color: #990099; font-weight: bold;">DESC</span></a>
&nbsp;
<span style="color: #808000; font-style: italic;">/* Get history for every tag */</span>
<a href="http://search.mysql.com/search?site=refman-%35%31&amp;q=SELECT"><span style="color: #990099; font-weight: bold;">SELECT</span></a>  t.name<span style="color: #000033;">,</span> substr<span style="color: #FF00FF;">&#40;</span>p.post_date_gmt<span style="color: #000033;">,</span><span style="color: #008080;">1</span><span style="color: #000033;">,</span><span style="color: #008080;">10</span><span style="color: #FF00FF;">&#41;</span> <a href="http://search.mysql.com/search?site=refman-%35%31&amp;q=AS"><span style="color: #990099; font-weight: bold;">AS</span></a> <a href="http://search.mysql.com/search?site=refman-%35%31&amp;q=DATE"><span style="color: #999900; font-weight: bold;">date</span></a> <a href="http://search.mysql.com/search?site=refman-%35%31&amp;q=FROM"><span style="color: #990099; font-weight: bold;">FROM</span></a> wp_term_relationships rel
<a href="http://search.mysql.com/search?site=refman-%35%31&amp;q=INNER"><span style="color: #990099; font-weight: bold;">INNER</span></a> <a href="http://search.mysql.com/search?site=refman-%35%31&amp;q=JOIN"><span style="color: #990099; font-weight: bold;">JOIN</span></a> wp_term_taxonomy tax <a href="http://search.mysql.com/search?site=refman-%35%31&amp;q=ON"><span style="color: #990099; font-weight: bold;">ON</span></a> tax.term_taxonomy_id<span style="color: #CC0099;">=</span>rel.term_taxonomy_id
<a href="http://search.mysql.com/search?site=refman-%35%31&amp;q=INNER"><span style="color: #990099; font-weight: bold;">INNER</span></a> <a href="http://search.mysql.com/search?site=refman-%35%31&amp;q=JOIN"><span style="color: #990099; font-weight: bold;">JOIN</span></a> wp_terms t <a href="http://search.mysql.com/search?site=refman-%35%31&amp;q=ON"><span style="color: #990099; font-weight: bold;">ON</span></a> tax.term_id <span style="color: #CC0099;">=</span> t.term_id
<a href="http://search.mysql.com/search?site=refman-%35%31&amp;q=INNER"><span style="color: #990099; font-weight: bold;">INNER</span></a> <a href="http://search.mysql.com/search?site=refman-%35%31&amp;q=JOIN"><span style="color: #990099; font-weight: bold;">JOIN</span></a> wp_posts p <a href="http://search.mysql.com/search?site=refman-%35%31&amp;q=ON"><span style="color: #990099; font-weight: bold;">ON</span></a> p.ID<span style="color: #CC0099;">=</span>rel.object_id <a href="http://search.mysql.com/search?site=refman-%35%31&amp;q=WHERE"><span style="color: #990099; font-weight: bold;">WHERE</span></a> taxonomy<span style="color: #CC0099;">=</span><span style="color: #008000;">'post<span style="color: #008080; font-weight: bold;">_</span>tag'</span>
<a href="http://dev.mysql.com/doc/refman/%35%2E%31/en/non-typed-operators.html"><span style="color: #CC0099; font-weight: bold;">AND</span></a> post_status<span style="color: #CC0099;">=</span><span style="color: #008000;">'publish'</span> <a href="http://search.mysql.com/search?site=refman-%35%31&amp;q=ORDER%20BY"><span style="color: #990099; font-weight: bold;">ORDER BY</span></a> post_date_gmt <a href="http://search.mysql.com/search?site=refman-%35%31&amp;q=DESC"><span style="color: #990099; font-weight: bold;">DESC</span></a></pre></td></tr></table></div>

<p>The last query can be simply modified to show you the history a single particular tag also.<br />
Simply add <code>AND t.name = 'zucchini'</code> between lines 4 and 5. This would pull a list of dates that &#8216;zucchini&#8217; was used as a post tag.</p>
]]></content:encoded>
			<wfw:commentRss>http://solidlystated.com/scripting/wordpress-get-all-post-tags-by-count/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>What is Progressive Enhancement?</title>
		<link>http://solidlystated.com/design/what-is-progressive-enhancement/</link>
		<comments>http://solidlystated.com/design/what-is-progressive-enhancement/#comments</comments>
		<pubDate>Wed, 25 Apr 2012 03:58:01 +0000</pubDate>
		<dc:creator>SolidlyStated</dc:creator>
				<category><![CDATA[Design]]></category>
		<category><![CDATA[Flash]]></category>
		<category><![CDATA[HTML]]></category>
		<category><![CDATA[Javascript]]></category>
		<category><![CDATA[progressive enhancement]]></category>
		<category><![CDATA[semantic web]]></category>
		<category><![CDATA[Semantics]]></category>
		<category><![CDATA[Validation]]></category>

		<guid isPermaLink="false">http://solidlystated.com/?p=3662</guid>
		<description><![CDATA[Like most web developers who publish articles, I always preach about standards and best practices (which, incidentally, makes me wonder why we don&#8217;t see more loud-mouthed naysayers who try to get recognition by writing about how all that is a big joke.) This article will be no different, except this time no one can argue [...]]]></description>
			<content:encoded><![CDATA[<p>Like most web developers who publish articles, I always preach about standards and best practices (which, incidentally, makes me wonder why we don&#8217;t see more loud-mouthed naysayers who try to get recognition by writing about how all that is a big joke.) This article will be no different, except this time no one can argue about whether it makes a real difference. Today, I will be talking about progressive enhancement. <span id="more-3662"></span></p>
<p><script type="text/javascript"><!--
google_ad_client = "pub-0090340920588945";
/* 728x90, SSD v1 - Design */
google_ad_slot = "6413944124";
google_ad_width = 728;
google_ad_height = 90;
//-->
</script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script></p>
<p>What is progressive enhancement? More importantly, why should you care? Wikipedia can define terms way better than I can, but it&#8217;s exactly what it sounds like. It&#8217;s about progressively enhancing your website where those enhancements are available, which <strong>usually refers to JavaScript</strong>.</p>
<h4>Why Should You Care?</h4>
<p>This whole concept came about because of the technique of &#8220;graceful degradation,&#8221; a technique to make web pages break less instead of work better. Both techniques are answers to developers <strong>cutting corners</strong> and not building things the right way from the ground up. Progressive enhancement is about doing it the right way.</p>
<p>I can&#8217;t say I blame anyone for it or even that I am not guilty of it. After all, you can get a site or project 90% of the way there for 50% of the time and effort. That last 10% is a high cost, low reward situation that is always the first thing to go when deadlines loom or clients make demands. Nevertheless, you can still ruin your pages for various groups of people.</p>
<p>While progressive enhancement technically includes cascading style sheets (<strong>CSS</strong>), I am not here to make the argument that you should write your pages as semantic HTML without a style sheet at first. It is still a good idea, though, and occasionally looking at your pages without CSS during development can show you any glaring issues with your document structure.</p>
<p><strong>Adobe Flash</strong> is now more of a consideration than ever in this era of iPhone dominance. I can&#8217;t count how many sites I have not been able to view a page on my phone because it &#8220;requires&#8221; Adobe Flash. Progressive enhancement would mean that content is made available without Flash, then later &#8220;enhanced&#8221; with Flash on devices and browsers that display it.</p>
<p><img src="http://solidlystated.com/content/2012/04/progressive-enhancement-flash.jpg" alt="Dont make Flash required" title="progressive-enhancement-flash" width="470" height="285" class="aligncenter size-full wp-image-3671" /></p>
<p>The top offender is how developers and designers treat <strong>JavaScript</strong>. As a developer, you cannot take for granted whether or not visitors have JavaScript enabled or speculate on what their reasons are regarding it. </p>
<p>The problems caused by cutting corners with JS are all over, from missing content blocks (failed AJAX calls for example) to forms that cannot be submitted. </p>
<p><span class="solid">Solid Tip:</span> Take advantage of the noscript tag. It will make your life easier and your pages more accessible.</p>
<h4>How About Some Example?</h4>
<div class="alignright" style="margin-left:20px"><script type="text/javascript"><!--
google_ad_client = "pub-0090340920588945";
/* 300x250-textandimages-middle */
google_ad_slot = "4982255467";
google_ad_width = 300;
google_ad_height = 250;
//-->
</script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script></div>
<p>I have been developing a nice new complete application UI from scratch. </p>
<p>There have been multiple instances from the very beginning that have been obvious forks in the road where it would be very easy to take the easy way out and skip &#8220;progressive enhancement,&#8221; such as with sorting and paginating table results or showing modal box pop-ups for tidbits of information.</p>
<p>Take my nifty pagination bar below. It encompasses the all the functionality a user could want in navigating results, and it does so without any JavaScript. That doesn&#8217;t mean I shouldn&#8217;t take advantage of JS. You should always <strong>make things as easy for users as possible</strong>. </p>
<p>In this case, I use the <code>&lt;noscript&gt;</code> tag that holds a Submit button. This allows the viewer to use the page select drop down without JavaScript. For everyone else who has scripting enabled, the page form will automatically submit on change.</p>
<p><img src="http://solidlystated.com/content/2012/04/progressive-enhancement-noscript.jpg" alt="Noscript proper usage" title="progressive-enhancement-noscript" width="471" height="115" class="aligncenter size-full wp-image-3668" caption="With and without JS" /></p>
<p>Over the last 6-7 years, JavaScript frameworks have become popular, making it dangerously easy for people to abuse JavaScript with nifty effects and widgets that fail hard without JS, such as flyout navigation menus and accordion boxes.</p>
<p>A lack of proper learning is to blame. <strong>Most novice designers simply copy the tutorial</strong> for existing pieces and change just enough to get it working on their own page. If another method of navigation is provided, users can be cut off from sections of your site. This is another situation where the noscript tag would be helpful. Non-JS links could be placed inside to accommodate users.</p>
<p>A good menu, however, will be built as plain HTML first, and then progressively enhanced to make the user experience better. Take the Newegg.com navigation menu, for example.<br />
<img src="http://solidlystated.com/content/2012/04/newegg-menu.jpg" alt="newegg flyout menu" title="newegg-menu" width="470" height="285" class="aligncenter size-full wp-image-3678" /></p>
<h4>Build First, Then Enhance</h4>
<p>While we could put on some smoking jackets and have some in-depth poetic discussions around all that &#8220;progressive enhancement&#8221; means, the above situations are a simple problem. Some people will read about the topics and continue to take the quick and easy route, never spending the extra time to build up the basics and follow up later with enhancement. Usability and accessibility should come first. </p>
<p>As with anything in life- if it&#8217;s worth doing, it&#8217;s worth doing right.</p>
<p><script type="text/javascript"><!--
google_ad_client = "pub-0090340920588945";
/* 728x90, SSD v1 - Design */
google_ad_slot = "6413944124";
google_ad_width = 728;
google_ad_height = 90;
//-->
</script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script></p>
]]></content:encoded>
			<wfw:commentRss>http://solidlystated.com/design/what-is-progressive-enhancement/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Logitech G27 and F1 2011</title>
		<link>http://solidlystated.com/software/logitech-g27-and-f1-2011/</link>
		<comments>http://solidlystated.com/software/logitech-g27-and-f1-2011/#comments</comments>
		<pubDate>Wed, 28 Mar 2012 02:20:59 +0000</pubDate>
		<dc:creator>SolidlyStated</dc:creator>
				<category><![CDATA[Hardware]]></category>
		<category><![CDATA[Software]]></category>
		<category><![CDATA[F1 2011]]></category>
		<category><![CDATA[G27]]></category>
		<category><![CDATA[Logitech]]></category>
		<category><![CDATA[Peripherals]]></category>

		<guid isPermaLink="false">http://solidlystated.com/?p=3637</guid>
		<description><![CDATA[F1 2011 Force Feedback: Full Pedals: Separate Shift Lights: Yes Released: Sep 20, 2011 Buy Now at Amazon Yet another piece on our long-running series: The Logitech G27 Racing Wheel for Casual Racing Gamers. Here, I cover setting up your G27 racing wheel to play Formula 1 2011 PC. Developed and published by Codemasters, F1 [...]]]></description>
			<content:encoded><![CDATA[<div class="g27-info">
<a href="http://www.amazon.com/gp/product/0700026711/ref=as_li_ss_tl?ie=UTF8&#038;tag=solistat-20&#038;linkCode=as2&#038;camp=1789&#038;creative=390957&#038;creativeASIN=0700026711" rel="nofollow"><img src="http://solidlystated.com/content/2012/03/f12011-box.gif" /></a></p>
<div class="g27-info1">F1 2011</div>
<div class="g27-info2">Force Feedback: Full</div>
<div class="g27-info3">Pedals:  Separate</div>
<div class="g27-info4">Shift Lights: Yes</div>
<div class="g27-info5">Released: Sep 20, 2011</div>
<div class="g27-info6"><a href="http://www.amazon.com/gp/product/0700026711/ref=as_li_ss_tl?ie=UTF8&#038;tag=solistat-20&#038;linkCode=as2&#038;camp=1789&#038;creative=390957&#038;creativeASIN=0700026711" rel="nofollow">Buy Now at Amazon</a></div>
<div class="g27-info7"></div>
<div class="g27-info8"></div>
</div>
<div class="clear"></div>
<p>Yet another piece on our long-running series: <strong>The Logitech G27 Racing Wheel for Casual Racing Gamers</strong>. Here, I cover setting up your G27 racing wheel to play Formula 1 2011 PC. Developed and published by Codemasters, F1 2011 is a sequel to F1 2010 and features simulator-type open-wheel racing among all official F1 teams and drivers of the 2011 season. <span id="more-3637"></span></p>
<p><script type="text/javascript"><!--
google_ad_client = "pub-0090340920588945";
/* 728x90, SSD v1 - Software */
google_ad_slot = "1907377491";
google_ad_width = 728;
google_ad_height = 90;
//-->
</script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script></p>
<p>F1 2011 races include dynamic weather and day/night cycles to add to single- and multi-player racing. The Logitech G27 quality sequential paddle shifters design are your only choice of gearbox, but that&#8217;s simply part of Formula 1 cars. No H-shifter usage here.</p>
<p>Force feedback and shift lights are always welcome, but I feel that both left me disappointed as a casual racing gamer. The force feedback effects were anemic by default, and turning them up in the game options felt like someone constantly banging a hammer on my car chassis at all times. </p>
<p>As for shift lights, the gears change so fast, they are either off or flashing at the red-line all the time.</p>
<p><span class="solid">Solid Tip:</span> Looking for G27 drivers or Logitech Profiler software? Get it <a href="http://www.logitech.com/en-us/441/5184?section=downloads&#038;bit=&#038;osid=13" rel="nofollow">here</a>.</p>
<table class="graytable" width="100%">
<thead>
<tr>
<th colspan="2">Logitech G27 Solid Series Articles</th>
</tr>
</thead>
<tbody>
<tr>
<td width="50%">1. <a href="http://solidlystated.com/hardware/logitech-g27-racing-wheel-for-casual-gamers/">Casual Gamer vs Simulation Gamer</a></td>
<td>10. <a href="http://solidlystated.com/software/logitech-g27-test-drive-unlimited/">Test Drive Unlimited</a></td>
</tr>
<tr>
<td>2. <a href="http://solidlystated.com/hardware/logitech-g27-best-settings/">Setting Up Your G27, Made Easy</a></td>
<td>11. <a href="http://solidlystated.com/software/logitech-g27-test-drive-unlimited-2/">Test Drive Unlimited 2</a></td>
</tr>
<tr>
<td>3. <a href="http://solidlystated.com/software/logitech-g27-need-for-speed-carbon/">Need For Speed: Carbon</a></td>
<td>12. <a href="http://solidlystated.com/software/logitech-g27-burnout-paradise/">Burnout Paradise</a></td>
</tr>
<tr>
<td>4. <a href="http://solidlystated.com/software/logitech-g27-need-for-speed-pro-street/">Need For Speed: Pro Street</a></td>
<td>13. <a href="http://solidlystated.com/software/logitech-g27-race-driver-grid/">Race Driver: GRID</a></td>
</tr>
<tr>
<td>5. <a href="http://solidlystated.com/software/logitech-g27-need-for-speed-undercover/">Need For Speed: Undercover</a></td>
<td>14. <a href="http://solidlystated.com/software/logitech-g27-split-second/">Split Second</a></td>
</tr>
<tr>
<td>6. <a href="http://solidlystated.com/software/logitech-g27-need-for-speed-shift/">Need For Speed: Shift</a></td>
<td>15. <a href="http://solidlystated.com/software/logitech-g27-gtr-evolution/">GTR Evolution</a></td>
</tr>
<tr>
<td>7. <a href="http://solidlystated.com/software/logitech-g27-need-for-speed-shift-2-unleashed/">Need For Speed: Shift 2</a></td>
<td>16. <a href="http://solidlystated.com/software/logitech-g27-dirt-2/">DiRT 2</a></td>
</tr>
<tr>
<td>8. <a href="http://solidlystated.com/software/logitech-g27-and-need-for-speed-hot-pursuit/">Need For Speed: Hot Pursuit</a></td>
<td>17. <a href="http://solidlystated.com/software/logitech-g27-and-dirt-3/">DiRT 3</a></td>
</tr>
<tr>
<td>9. <a href="http://solidlystated.com/software/logitech-g27-and-need-for-speed-the-run/">Need For Speed: The Run</a></td>
<td>18. <a href="http://solidlystated.com/software/logitech-g27-and-blur/">Blur</a></td>
</tr>
</tbody>
</table>
<div style="height:10px;line-height:10px;clear:both">&nbsp;</div>
<h4>F1 2011 G27 Settings</h4>
<div class="alignright" style="margin-left:20px"><script type="text/javascript"><!--
google_ad_client = "pub-0090340920588945";
/* 300x250-textandimages-middle */
google_ad_slot = "4982255467";
google_ad_width = 300;
google_ad_height = 250;
//-->
</script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script></div>
<ul>
<li>Plug in the wheel, of course</li>
<li>Open the <strong>Logitech Profiler</strong></li>
<li>Select New > Profile</li>
<li>Add <strong>F1_2011.exe</strong> as a new game</li>
<li>Open Specific Game Settings</li>
<li>Check &#8216;Use Special Force Feedback Device Settings&#8217;</li>
<li>Raise &#8216;Overall Effects Strength&#8217; to 150% (optional)</li>
<li>Check &#8216;Use Special Steering Wheel Settings&#8217;</li>
<li>Set &#8216;Degrees of Rotation&#8217; to your liking</li>
<li>Set &#8216;Report Combined Pedals&#8217; unchecked</li>
<li>Launch Game</li>
<li>In game, go to MYF1 > Driving Controls</li>
<li>switch &#8216;Keyboard&#8217; to &#8216;Logitech G27&#8242; preset</li>
</ul>
<p>While F1 2011 has a G27 preset in its control options, it <strong>does require some extra tweaks to enjoy</strong> before playing. As always, I have you make a G27 profile above for your wheel. Not required, but it gives you more control. With a profile, you can have better force feedback response and customize your degrees of rotation.</p>
<h4>Button Mappings</h4>
<p>You can edit your buttons (and pedals if you are nuts) under Edit/Customise Profile. Once you change a button, the preset for the G27 will change to the word &#8220;custom.&#8221; This is normal.</p>
<p>The <strong>gearbox is set to automatic</strong> by default. Switch it left to Sequential to enjoy your paddle shifters. This setting is directly tied to the intrusive &#8220;Driving Assists&#8221; section also. For example, turning off all assists forces your gearbox to manual and easy forces it to auto.</p>
<p><span class="solid">Solid Tip:</span> The gearbox setting can only be set during a race, and not in the game&#8217;s normal options menu. Don&#8217;t ask me why.</p>
<p><img src="http://solidlystated.com/content/2012/03/f1-2011-g27preset.jpg" alt="G27 preset" title="f1-2011-g27preset" width="718" height="226" class="aligncenter size-full wp-image-3640" /></p>
<p><script type="text/javascript"><!--
google_ad_client = "pub-0090340920588945";
/* 728x90, SSD v1 - Software */
google_ad_slot = "1907377491";
google_ad_width = 728;
google_ad_height = 90;
//-->
</script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script></p>
<h4>FFB off by default</h4>
<p>You will want to enter the Force Feedback options before you race and turn it on. <strong>FFB is off by default</strong>. Additionally, the default effects were pretty weak. If you increase the sliders in the pic shown below, the result is unpleasant. That&#8217;s why I recommend the optional setting up above for Overall Effects Strength.</p>
<p><img src="http://solidlystated.com/content/2012/03/f1-2011-ffb.jpg" alt="Force Feedback settings" title="f1-2011-ffb" width="718" height="194" class="aligncenter size-full wp-image-3642" /></p>
<h4>Driving Assists</h4>
<p>All driving assists are fully on by default. This means you will have a big glowing line on the track everywhere you go, your car will shift itself, and you never have to break. That last &#8216;assist&#8217; is the most maddening to your fun level. Your first inclination might be to turn all that junk off. Just remember that this isn&#8217;t Need for Speed, and will be much harder.</p>
<p>This menu is available in a race, not at the title screen. It is also where you set your transmission to auto or manual.</p>
<p><img src="http://solidlystated.com/content/2012/03/f1-2011-assists.jpg" alt="Driving Assists" title="f1-2011-assists" width="718" height="300" class="aligncenter size-full wp-image-3641" /></p>
<div style="height:10px;line-height:10px;clear:both">&nbsp;</div>
<p>

<div class='youmightlike games'><!--Other Games You Might Like-->
<div class='items'>
<table cellpadding="0" cellspacing="0"><thead></thead><tbody>
<tr><td><div>
<a target='_blank' rel='nofollow' href="http://www.amazon.com/gp/product/B004FYKWZU/ref=as_li_qf_sp_asin_tl?ie=UTF8&tag=solistat-20&linkCode=as2&camp=217145&creative=399381&creativeASIN=B004FYKWZU">Mass Effect 3</a><img src="http://www.assoc-amazon.com/e/ir?t=solistat-20&l=as2&o=1&a=B004FYKWZU&camp=217145&creative=399381" width="1" height="1" border="0" alt="" style="border:none !important; margin:0px !important;" /></div></td></tr>
<tr><td><div>
<a target='_blank' rel='nofollow' href="http://www.amazon.com/gp/product/B0050SZ7LO/ref=as_li_qf_sp_asin_tl?ie=UTF8&tag=solistat-20&linkCode=as2&camp=217145&creative=399373&creativeASIN=B0050SZ7LO">Elder Scrolls V: Skyrim</a><img src="http://www.assoc-amazon.com/e/ir?t=solistat-20&l=as2&o=1&a=B0050SZ7LO&camp=217145&creative=399373" width="1" height="1" border="0" alt="" style="border:none !important; margin:0px !important;" /></div></td></tr>
<tr><td><div>
<a target='_blank' rel='nofollow' href="http://www.amazon.com/gp/product/B0050SZ836/ref=as_li_qf_sp_asin_tl?ie=UTF8&tag=solistat-20&linkCode=as2&camp=217145&creative=399373&creativeASIN=B0050SZ836">Borderlands 2</a><img src="http://www.assoc-amazon.com/e/ir?t=solistat-20&l=as2&o=1&a=B0050SZ836&camp=217145&creative=399373" width="1" height="1" border="0" alt="" style="border:none !important; margin:0px !important;" /></div></td></tr>
<tr><td><div>
<a target='_blank' rel='nofollow' href="http://www.amazon.com/gp/product/B002I0IHIM/ref=as_li_qf_sp_asin_tl?ie=UTF8&tag=solistat-20&linkCode=as2&camp=217145&creative=399373&creativeASIN=B002I0IHIM">Assassin's Creed 4</a><img src="http://www.assoc-amazon.com/e/ir?t=solistat-20&l=as2&o=1&a=B002I0IHIM&camp=217145&creative=399373" width="1" height="1" border="0" alt="" style="border:none !important; margin:0px !important;" /></div></td></tr>
<tr><td><div>
<a target='_blank' rel='nofollow' href="http://www.amazon.com/gp/product/B002I0HJZO/ref=as_li_qf_sp_asin_tl?ie=UTF8&tag=solistat-20&linkCode=as2&camp=217145&creative=399373&creativeASIN=B002I0HJZO">Battlefield 3 LE</a><img src="http://www.assoc-amazon.com/e/ir?t=solistat-20&l=as2&o=1&a=B002I0HJZO&camp=217145&creative=399373" width="1" height="1" border="0" alt="" style="border:none !important; margin:0px !important;" />
</div></td></tr>
</tbody></table>
</div>
<div class='pics'>
<table cellpadding="0" cellspacing="0"><thead></thead><tbody><tr>
<td><a target='_blank' rel='nofollow'  href="http://www.amazon.com/gp/product/B004FYKWZU/ref=as_li_qf_sp_asin_il?ie=UTF8&tag=solistat-20&linkCode=as2&camp=217145&creative=399377&creativeASIN=B004FYKWZU"><img title='Mass Effect 3' alt='Mass Effect 3' src="http://solidlystated.com/content/2011/10/masseffect3box.gif" /></a>
</td><td>
<a target='_blank' rel='nofollow'  href="http://www.amazon.com/gp/product/B0050SZ7LO/ref=as_li_qf_sp_asin_tl?ie=UTF8&tag=solistat-20&linkCode=as2&camp=217145&creative=399373&creativeASIN=B0050SZ7LO"><img title='Elder Scrolls V: Skyrim' alt='Elder Scrolls V: Skyrim' src="http://solidlystated.com/content/2011/10/skyrimbox.gif" /></a>
</td><td>
<a target='_blank' rel='nofollow'  href="http://www.amazon.com/gp/product/B0050SZ836/ref=as_li_qf_sp_asin_tl?ie=UTF8&tag=solistat-20&linkCode=as2&camp=217145&creative=399373&creativeASIN=B0050SZ836"><img title='Borderlands 2' alt='Borderlands 2' src="http://solidlystated.com/content/2011/10/borderlands2box.gif" /></a>
</td><td>
<a target='_blank' rel='nofollow'  href="http://www.amazon.com/gp/product/B002I0IHIM/ref=as_li_qf_sp_asin_tl?ie=UTF8&tag=solistat-20&linkCode=as2&camp=217145&creative=399373&creativeASIN=B002I0IHIM"><img title='Assassins Creed Revelations' alt='Assassins Creed Revelations' src="http://solidlystated.com/content/2011/10/assassinscreedbox.gif" /></a>
</td><td>
<a target='_blank' rel='nofollow'  href="http://www.amazon.com/gp/product/B002I0HJZO/ref=as_li_qf_sp_asin_tl?ie=UTF8&tag=solistat-20&linkCode=as2&camp=217145&creative=399373&creativeASIN=B002I0HJZO"><img title='Battlefield 3' alt='Battlefield 3' src="http://solidlystated.com/content/2011/10/bf3box.gif" /></a>
</td></tr>
</tbody>
</table>
</div>
</div></p>
]]></content:encoded>
			<wfw:commentRss>http://solidlystated.com/software/logitech-g27-and-f1-2011/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>MechWarrior Online PC Gameplay Trailer</title>
		<link>http://solidlystated.com/software/mechwarrior-online-pc-gameplay-trailer/</link>
		<comments>http://solidlystated.com/software/mechwarrior-online-pc-gameplay-trailer/#comments</comments>
		<pubDate>Sat, 10 Mar 2012 18:01:34 +0000</pubDate>
		<dc:creator>SolidlyStated</dc:creator>
				<category><![CDATA[Software]]></category>
		<category><![CDATA[Microsoft]]></category>
		<category><![CDATA[PC Games]]></category>
		<category><![CDATA[Piranha]]></category>
		<category><![CDATA[Windows]]></category>

		<guid isPermaLink="false">http://solidlystated.com/?p=3630</guid>
		<description><![CDATA[MWO &#8211; MechWarrior Online developer Piranha Games revealed a new gameplay trailer at the Game Developers Conference. Nearly 10 years of waiting is finally over for fans of this great series. MechWarrior Online gets back to tactical fundamentals where smaller mechs can and do matter- a place where its not simply the biggest mech with [...]]]></description>
			<content:encoded><![CDATA[<p>MWO &#8211; MechWarrior Online developer Piranha Games revealed a new gameplay trailer at the Game Developers Conference. <span id="more-3630"></span> Nearly 10 years of waiting is finally over for fans of this great series.</p>
<p>MechWarrior Online gets back to tactical fundamentals where smaller mechs can and do matter- a place where its not simply the biggest mech with the most lasers, PPCs, and LRMs.</p>
<p><script type="text/javascript"><!--
google_ad_client = "pub-0090340920588945";
/* 728x90, SSD v1 - Software */
google_ad_slot = "1907377491";
google_ad_width = 728;
google_ad_height = 90;
//-->
</script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script></p>
<p>Be sure to register for this free-to-play game at <a href="http://mwomercs.com/" title="MWO" target="_blank">http://mwomercs.com/</a></p>
<h4>View the Mechs in Action</h4>
<div style="margin:0 auto;width:640px;margin-top:10px" ><iframe width="560" height="315" src="http://www.youtube.com/embed/LbC7w9SN3oE" frameborder="0" allowfullscreen></iframe></div>
<p><br/></p>
<p>

<div class='youmightlike games'><!--Other Games You Might Like-->
<div class='items'>
<table cellpadding="0" cellspacing="0"><thead></thead><tbody>
<tr><td><div>
<a target='_blank' rel='nofollow' href="http://www.amazon.com/gp/product/B004FYKWZU/ref=as_li_qf_sp_asin_tl?ie=UTF8&tag=solistat-20&linkCode=as2&camp=217145&creative=399381&creativeASIN=B004FYKWZU">Mass Effect 3</a><img src="http://www.assoc-amazon.com/e/ir?t=solistat-20&l=as2&o=1&a=B004FYKWZU&camp=217145&creative=399381" width="1" height="1" border="0" alt="" style="border:none !important; margin:0px !important;" /></div></td></tr>
<tr><td><div>
<a target='_blank' rel='nofollow' href="http://www.amazon.com/gp/product/B0050SZ7LO/ref=as_li_qf_sp_asin_tl?ie=UTF8&tag=solistat-20&linkCode=as2&camp=217145&creative=399373&creativeASIN=B0050SZ7LO">Elder Scrolls V: Skyrim</a><img src="http://www.assoc-amazon.com/e/ir?t=solistat-20&l=as2&o=1&a=B0050SZ7LO&camp=217145&creative=399373" width="1" height="1" border="0" alt="" style="border:none !important; margin:0px !important;" /></div></td></tr>
<tr><td><div>
<a target='_blank' rel='nofollow' href="http://www.amazon.com/gp/product/B0050SZ836/ref=as_li_qf_sp_asin_tl?ie=UTF8&tag=solistat-20&linkCode=as2&camp=217145&creative=399373&creativeASIN=B0050SZ836">Borderlands 2</a><img src="http://www.assoc-amazon.com/e/ir?t=solistat-20&l=as2&o=1&a=B0050SZ836&camp=217145&creative=399373" width="1" height="1" border="0" alt="" style="border:none !important; margin:0px !important;" /></div></td></tr>
<tr><td><div>
<a target='_blank' rel='nofollow' href="http://www.amazon.com/gp/product/B002I0IHIM/ref=as_li_qf_sp_asin_tl?ie=UTF8&tag=solistat-20&linkCode=as2&camp=217145&creative=399373&creativeASIN=B002I0IHIM">Assassin's Creed 4</a><img src="http://www.assoc-amazon.com/e/ir?t=solistat-20&l=as2&o=1&a=B002I0IHIM&camp=217145&creative=399373" width="1" height="1" border="0" alt="" style="border:none !important; margin:0px !important;" /></div></td></tr>
<tr><td><div>
<a target='_blank' rel='nofollow' href="http://www.amazon.com/gp/product/B002I0HJZO/ref=as_li_qf_sp_asin_tl?ie=UTF8&tag=solistat-20&linkCode=as2&camp=217145&creative=399373&creativeASIN=B002I0HJZO">Battlefield 3 LE</a><img src="http://www.assoc-amazon.com/e/ir?t=solistat-20&l=as2&o=1&a=B002I0HJZO&camp=217145&creative=399373" width="1" height="1" border="0" alt="" style="border:none !important; margin:0px !important;" />
</div></td></tr>
</tbody></table>
</div>
<div class='pics'>
<table cellpadding="0" cellspacing="0"><thead></thead><tbody><tr>
<td><a target='_blank' rel='nofollow'  href="http://www.amazon.com/gp/product/B004FYKWZU/ref=as_li_qf_sp_asin_il?ie=UTF8&tag=solistat-20&linkCode=as2&camp=217145&creative=399377&creativeASIN=B004FYKWZU"><img title='Mass Effect 3' alt='Mass Effect 3' src="http://solidlystated.com/content/2011/10/masseffect3box.gif" /></a>
</td><td>
<a target='_blank' rel='nofollow'  href="http://www.amazon.com/gp/product/B0050SZ7LO/ref=as_li_qf_sp_asin_tl?ie=UTF8&tag=solistat-20&linkCode=as2&camp=217145&creative=399373&creativeASIN=B0050SZ7LO"><img title='Elder Scrolls V: Skyrim' alt='Elder Scrolls V: Skyrim' src="http://solidlystated.com/content/2011/10/skyrimbox.gif" /></a>
</td><td>
<a target='_blank' rel='nofollow'  href="http://www.amazon.com/gp/product/B0050SZ836/ref=as_li_qf_sp_asin_tl?ie=UTF8&tag=solistat-20&linkCode=as2&camp=217145&creative=399373&creativeASIN=B0050SZ836"><img title='Borderlands 2' alt='Borderlands 2' src="http://solidlystated.com/content/2011/10/borderlands2box.gif" /></a>
</td><td>
<a target='_blank' rel='nofollow'  href="http://www.amazon.com/gp/product/B002I0IHIM/ref=as_li_qf_sp_asin_tl?ie=UTF8&tag=solistat-20&linkCode=as2&camp=217145&creative=399373&creativeASIN=B002I0IHIM"><img title='Assassins Creed Revelations' alt='Assassins Creed Revelations' src="http://solidlystated.com/content/2011/10/assassinscreedbox.gif" /></a>
</td><td>
<a target='_blank' rel='nofollow'  href="http://www.amazon.com/gp/product/B002I0HJZO/ref=as_li_qf_sp_asin_tl?ie=UTF8&tag=solistat-20&linkCode=as2&camp=217145&creative=399373&creativeASIN=B002I0HJZO"><img title='Battlefield 3' alt='Battlefield 3' src="http://solidlystated.com/content/2011/10/bf3box.gif" /></a>
</td></tr>
</tbody>
</table>
</div>
</div></p>
]]></content:encoded>
			<wfw:commentRss>http://solidlystated.com/software/mechwarrior-online-pc-gameplay-trailer/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>PHP Get Next Work Day or Work Week</title>
		<link>http://solidlystated.com/scripting/php-get-next-work-day-or-work-week/</link>
		<comments>http://solidlystated.com/scripting/php-get-next-work-day-or-work-week/#comments</comments>
		<pubDate>Fri, 09 Mar 2012 04:57:05 +0000</pubDate>
		<dc:creator>SolidlyStated</dc:creator>
				<category><![CDATA[Scripting]]></category>
		<category><![CDATA[date]]></category>
		<category><![CDATA[date format]]></category>
		<category><![CDATA[PHP]]></category>

		<guid isPermaLink="false">http://solidlystated.com/?p=3578</guid>
		<description><![CDATA[I created some nice work week-related functions in PHP that will calculate and return the next available work day, based on any particular date and number days from that date. These were helpful for me in scheduling,appointments, or deadlines for users and clients that are open only Monday-Friday for a 5 day work week. My [...]]]></description>
			<content:encoded><![CDATA[<p>I created some nice work week-related functions in PHP that will calculate and return the next available work day, based on any particular date and number days from that date. These were <strong>helpful for me in scheduling,appointments, or deadlines</strong> for users and clients that are open only Monday-Friday for a 5 day work week. <span id="more-3578"></span></p>
<div class="alignright" style="margin-left:20px"><script type="text/javascript"><!--
google_ad_client = "pub-0090340920588945";
/* 300x250-textandimages-middle */
google_ad_slot = "4982255467";
google_ad_width = 300;
google_ad_height = 250;
//-->
</script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script></div>
<p>My latest usage of these functions was to assign tasks to users of the application and give them one full work week to complete the task. </p>
<p>Therefore, I needed my PHP code to calculate one full work week and return the date that would be their deadline.</p>
<p>This script <strong>counts through days, ignoring weekends and US holidays</strong> (optional). My database holds both federal and banking holidays (we have a lot of banking clients), but other users may just want federal holidays or not at all. </p>
<p>Therefore, the holiday function is separate. If you do not wish to include holidays in your calculations, simply remove all the dates from the array down at the bottom.</p>
<p><br/></p>
<h4>Using this script</h4>
<p><strong>This script is a single PHP class</strong> that uses <code>public static</code> functions, meaning that they can be called directly from anywhere, without having to instantiate an object. This PHP code has been tested in both PHP 5.2.0 and PHP 5.3.9.</p>
<p><strong>Download this script: <a href="http://solidlystated.com/content/2012/03/WorkDays.class.php" title="WorkDays.class.php" target="_blank">WorkDays.class.php</a></strong></p>
<h4>Some Useful Examples</h4>
<p>All methods count today! If today is Wednesday and not a holiday, then WorkDays::getNextWorkDay() will return today&#8217;s date.</p>

<div class="wp_codebox_msgheader"><span class="right"></span><span class="left">PHP<a href="javascript:;" onclick="javascript:showCodeTxt('p3578code17'); return false;">view code</a> </span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p357817"><td class="code" id="p3578code17"><pre class="php" style="font-family:monospace;">&nbsp;
<span style="color: #666666; font-style: italic;">// Get next available work day from now, as a timestamp</span>
WorkDays<span style="color: #339933;">::</span><span style="color: #004000;">getNextWorkDay</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #666666; font-style: italic;">// Get next available work day from now, as a formatted date</span>
WorkDays<span style="color: #339933;">::</span><span style="color: #004000;">getNextWorkDay</span><span style="color: #009900;">&#40;</span><span style="color: #009900; font-weight: bold;">NULL</span><span style="color: #339933;">,</span><span style="color: #0000ff;">&quot;Y-m-d&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #666666; font-style: italic;">// Get next available work day from a specific day, as a formatted date</span>
WorkDays<span style="color: #339933;">::</span><span style="color: #004000;">getNextWorkDay</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;Wednesday July 4th, 2012&quot;</span><span style="color: #339933;">,</span><span style="color: #0000ff;">&quot;Y-m-d&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>  <span style="color: #666666; font-style: italic;">// returns '2012-07-05'</span>
&nbsp;
<span style="color: #666666; font-style: italic;">// Get one extra work week from now, as a timestamp</span>
WorkDays<span style="color: #339933;">::</span><span style="color: #004000;">getExtraWorkWeek</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #666666; font-style: italic;">// Get one extra work week from a specific day, as a formatted date</span>
WorkDays<span style="color: #339933;">::</span><span style="color: #004000;">getExtraWorkWeek</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;2013-06-07&quot;</span><span style="color: #339933;">,</span><span style="color: #0000ff;">&quot;D M d, Y&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">// returns 'Thu Jun 13, 2013'</span>
&nbsp;
<span style="color: #666666; font-style: italic;">// Get 3 extra work days from now, as a formatted date</span>
WorkDays<span style="color: #339933;">::</span><span style="color: #004000;">getExtraWorkWeek</span><span style="color: #009900;">&#40;</span><span style="color: #009900; font-weight: bold;">NULL</span><span style="color: #339933;">,</span><span style="color: #0000ff;">&quot;Y-m-d&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #666666; font-style: italic;">// Get 6 extra work days from Christmas Day 2012, as a formatted date</span>
WorkDays<span style="color: #339933;">::</span><span style="color: #004000;">getExtraWorkDays</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;2012-12-25&quot;</span><span style="color: #339933;">,</span><span style="color: #0000ff;">&quot;D M d, Y&quot;</span><span style="color: #339933;">,</span><span style="color: #cc66cc;">6</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">// returns 'Thu Jan 03, 2013'</span></pre></td></tr></table></div>

<p><script type="text/javascript"><!--
google_ad_client = "pub-0090340920588945";
/* 728x90, SSD v1 - Scripting */
google_ad_slot = "7110832439";
google_ad_width = 728;
google_ad_height = 90;
//-->
</script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script></p>
<h4>The Script</h4>

<div class="wp_codebox_msgheader"><span class="right"></span><span class="left">PHP<a href="javascript:;" onclick="javascript:showCodeTxt('p3578code18'); return false;">view code</a> </span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p357818"><td class="code" id="p3578code18"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;?php</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">class</span> WorkDays
<span style="color: #009900;">&#123;</span>
	<span style="color: #009933; font-style: italic;">/**
	* @static getNextWorkDay()
	* @param string|int $date OPTIONAL a date string or Unix timestamp 
	* @param string $format OPTIONAL desired format of return value
	* @return int|string either a Unix timestamp or formatted date
	*
	* Gets next available work date (COULD BE SAME DAY)
	**/</span>
&nbsp;
	<span style="color: #000000; font-weight: bold;">public</span> static <span style="color: #000000; font-weight: bold;">function</span> getNextWorkDay<span style="color: #009900;">&#40;</span><span style="color: #000088;">$date</span><span style="color: #339933;">=</span><span style="color: #009900; font-weight: bold;">false</span><span style="color: #339933;">,</span><span style="color: #000088;">$format</span><span style="color: #339933;">=</span><span style="color: #009900; font-weight: bold;">false</span><span style="color: #009900;">&#41;</span>
	<span style="color: #009900;">&#123;</span> 	
		<span style="color: #000088;">$time</span> <span style="color: #339933;">=</span> <a href="http://www.php.net/is_string"><span style="color: #990000;">is_string</span></a><span style="color: #009900;">&#40;</span><span style="color: #000088;">$date</span><span style="color: #009900;">&#41;</span> ? <a href="http://www.php.net/strtotime"><span style="color: #990000;">strtotime</span></a><span style="color: #009900;">&#40;</span><span style="color: #000088;">$date</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">:</span> <span style="color: #009900;">&#40;</span><a href="http://www.php.net/is_int"><span style="color: #990000;">is_int</span></a><span style="color: #009900;">&#40;</span><span style="color: #000088;">$date</span><span style="color: #009900;">&#41;</span> ? <span style="color: #000088;">$date</span> <span style="color: #339933;">:</span> <a href="http://www.php.net/time"><span style="color: #990000;">time</span></a><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		<span style="color: #000088;">$holidays</span> <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">self</span><span style="color: #339933;">::</span><span style="color: #004000;">getHolidays</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
		<span style="color: #b1b100;">for</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$i</span><span style="color: #339933;">=</span><span style="color: #cc66cc;">0</span><span style="color: #339933;">;</span> <span style="color: #000088;">$i</span><span style="color: #339933;">&lt;</span><span style="color: #cc66cc;">5</span><span style="color: #339933;">;</span> <span style="color: #000088;">$i</span><span style="color: #339933;">++,</span> <span style="color: #000088;">$time</span><span style="color: #339933;">+=</span><span style="color: #cc66cc;">86400</span><span style="color: #009900;">&#41;</span>
		<span style="color: #009900;">&#123;</span> 
			<span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><a href="http://www.php.net/in_array"><span style="color: #990000;">in_array</span></a><span style="color: #009900;">&#40;</span><a href="http://www.php.net/date"><span style="color: #990000;">date</span></a><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'w'</span><span style="color: #339933;">,</span> <span style="color: #000088;">$time</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span> <a href="http://www.php.net/array"><span style="color: #990000;">array</span></a><span style="color: #009900;">&#40;</span><span style="color: #cc66cc;">0</span><span style="color: #339933;">,</span> <span style="color: #cc66cc;">6</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #b1b100;">continue</span><span style="color: #339933;">;</span>
			<span style="color: #b1b100;">foreach</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$holidays</span> <span style="color: #b1b100;">as</span> <span style="color: #000088;">$h</span><span style="color: #009900;">&#41;</span>
			<span style="color: #009900;">&#123;</span>
				<span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$time</span><span style="color: #339933;">&gt;=</span><span style="color: #000088;">$h</span> <span style="color: #339933;">&amp;&amp;</span> <span style="color: #000088;">$time</span><span style="color: #339933;">&lt;</span><span style="color: #000088;">$h</span><span style="color: #339933;">+</span><span style="color: #cc66cc;">86400</span><span style="color: #009900;">&#41;</span> <span style="color: #b1b100;">continue</span> <span style="color: #cc66cc;">2</span><span style="color: #339933;">;</span>			
			<span style="color: #009900;">&#125;</span>
			<span style="color: #b1b100;">break</span><span style="color: #339933;">;</span>
		<span style="color: #009900;">&#125;</span>
		<span style="color: #b1b100;">return</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$format</span><span style="color: #009900;">&#41;</span> ? <a href="http://www.php.net/date"><span style="color: #990000;">date</span></a><span style="color: #009900;">&#40;</span><span style="color: #000088;">$format</span><span style="color: #339933;">,</span><span style="color: #000088;">$time</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">:</span> <span style="color: #000088;">$time</span><span style="color: #339933;">;</span>
	<span style="color: #009900;">&#125;</span> 
&nbsp;
	<span style="color: #009933; font-style: italic;">/**
	* @static getExtraWorkWeek()
	* @param string|int $date OPTIONAL a date string or Unix timestamp 
	* @param string $format OPTIONAL desired format of return value
	* @return int|string either a Unix timestamp or formatted date
	*
	* A shortcut to call getExtraWorkDays() with 5 days as a param 
	**/</span>
&nbsp;
	<span style="color: #000000; font-weight: bold;">public</span> static <span style="color: #000000; font-weight: bold;">function</span> getExtraWorkWeek<span style="color: #009900;">&#40;</span><span style="color: #000088;">$date</span><span style="color: #339933;">=</span><span style="color: #009900; font-weight: bold;">false</span><span style="color: #339933;">,</span><span style="color: #000088;">$format</span><span style="color: #339933;">=</span><span style="color: #009900; font-weight: bold;">false</span><span style="color: #009900;">&#41;</span>
	<span style="color: #009900;">&#123;</span> 	
		<span style="color: #b1b100;">return</span> <span style="color: #000000; font-weight: bold;">self</span><span style="color: #339933;">::</span><span style="color: #004000;">getExtraWorkDays</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$date</span><span style="color: #339933;">,</span><span style="color: #000088;">$format</span><span style="color: #339933;">,</span><span style="color: #cc66cc;">5</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #009900;">&#125;</span>
&nbsp;
	<span style="color: #009933; font-style: italic;">/**
	* @static getExtraWorkDays()
	* @param string|int $date OPTIONAL a date string or Unix timestamp 
	* @param string $format OPTIONAL desired format of return value
	* @param int $numdays OPTIONAL number of additional work days to add to date
	* @return int|string either a Unix timestamp or formatted date
	*
	* Gets the date after a specific number of work days. accounts for weekends and holidays 
	* Includes today by default
	* If you want to skip today, provide tomorrow's date as the argument
	**/</span>
&nbsp;
	<span style="color: #000000; font-weight: bold;">public</span> static <span style="color: #000000; font-weight: bold;">function</span> getExtraWorkDays<span style="color: #009900;">&#40;</span><span style="color: #000088;">$date</span><span style="color: #339933;">=</span><span style="color: #009900; font-weight: bold;">false</span><span style="color: #339933;">,</span><span style="color: #000088;">$format</span><span style="color: #339933;">=</span><span style="color: #009900; font-weight: bold;">false</span><span style="color: #339933;">,</span><span style="color: #000088;">$numdays</span><span style="color: #339933;">=</span><span style="color: #cc66cc;">1</span><span style="color: #009900;">&#41;</span>
	<span style="color: #009900;">&#123;</span>
		<span style="color: #000088;">$time</span> <span style="color: #339933;">=</span> <a href="http://www.php.net/is_string"><span style="color: #990000;">is_string</span></a><span style="color: #009900;">&#40;</span><span style="color: #000088;">$date</span><span style="color: #009900;">&#41;</span> ? <a href="http://www.php.net/strtotime"><span style="color: #990000;">strtotime</span></a><span style="color: #009900;">&#40;</span><span style="color: #000088;">$date</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">:</span> <span style="color: #009900;">&#40;</span><a href="http://www.php.net/is_int"><span style="color: #990000;">is_int</span></a><span style="color: #009900;">&#40;</span><span style="color: #000088;">$date</span><span style="color: #009900;">&#41;</span> ? <span style="color: #000088;">$date</span> <span style="color: #339933;">:</span> <a href="http://www.php.net/time"><span style="color: #990000;">time</span></a><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		<span style="color: #000088;">$count</span> <span style="color: #339933;">=</span> <span style="color: #cc66cc;">0</span><span style="color: #339933;">;</span>
		<span style="color: #000088;">$finaldate</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;&quot;</span><span style="color: #339933;">;</span>
&nbsp;
		<span style="color: #000088;">$holidays</span> <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">self</span><span style="color: #339933;">::</span><span style="color: #004000;">getHolidays</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
		<span style="color: #000088;">$range</span> <span style="color: #339933;">=</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$numdays</span> <span style="color: #339933;">&gt;</span> <span style="color: #cc66cc;">5</span><span style="color: #009900;">&#41;</span> ? <span style="color: #009900;">&#40;</span><span style="color: #000088;">$numdays</span> <span style="color: #339933;">*</span> <span style="color: #cc66cc;">2</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">:</span> <span style="color: #cc66cc;">10</span><span style="color: #339933;">;</span>
&nbsp;
		<span style="color: #b1b100;">for</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$i</span><span style="color: #339933;">=</span><span style="color: #cc66cc;">0</span><span style="color: #339933;">;</span> <span style="color: #000088;">$i</span><span style="color: #339933;">&lt;</span><span style="color: #000088;">$range</span><span style="color: #339933;">;</span> <span style="color: #000088;">$i</span><span style="color: #339933;">++,</span> <span style="color: #000088;">$time</span><span style="color: #339933;">+=</span><span style="color: #cc66cc;">86400</span><span style="color: #009900;">&#41;</span>
		<span style="color: #009900;">&#123;</span>
			<span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><a href="http://www.php.net/in_array"><span style="color: #990000;">in_array</span></a><span style="color: #009900;">&#40;</span><a href="http://www.php.net/date"><span style="color: #990000;">date</span></a><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'w'</span><span style="color: #339933;">,</span> <span style="color: #000088;">$time</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span> <a href="http://www.php.net/array"><span style="color: #990000;">array</span></a><span style="color: #009900;">&#40;</span><span style="color: #cc66cc;">0</span><span style="color: #339933;">,</span> <span style="color: #cc66cc;">6</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #b1b100;">continue</span><span style="color: #339933;">;</span>
			<span style="color: #b1b100;">foreach</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$holidays</span> <span style="color: #b1b100;">as</span> <span style="color: #000088;">$h</span><span style="color: #009900;">&#41;</span>
			<span style="color: #009900;">&#123;</span>
				<span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$time</span><span style="color: #339933;">&gt;=</span><span style="color: #000088;">$h</span> <span style="color: #339933;">&amp;&amp;</span> <span style="color: #000088;">$time</span><span style="color: #339933;">&lt;</span><span style="color: #000088;">$h</span><span style="color: #339933;">+</span><span style="color: #cc66cc;">86400</span><span style="color: #009900;">&#41;</span> <span style="color: #b1b100;">continue</span> <span style="color: #cc66cc;">2</span><span style="color: #339933;">;</span>
			<span style="color: #009900;">&#125;</span>
			<span style="color: #000088;">$count</span><span style="color: #339933;">++;</span> 
			<span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$count</span> <span style="color: #339933;">==</span> <span style="color: #000088;">$numdays</span><span style="color: #009900;">&#41;</span>
			<span style="color: #009900;">&#123;</span>
				<span style="color: #000088;">$finaldate</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$time</span><span style="color: #339933;">;</span>
				<span style="color: #b1b100;">break</span><span style="color: #339933;">;</span>
			<span style="color: #009900;">&#125;</span>
		<span style="color: #009900;">&#125;</span>
		<span style="color: #b1b100;">return</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$format</span><span style="color: #009900;">&#41;</span> ? <a href="http://www.php.net/date"><span style="color: #990000;">date</span></a><span style="color: #009900;">&#40;</span><span style="color: #000088;">$format</span><span style="color: #339933;">,</span><span style="color: #000088;">$finaldate</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">:</span> <span style="color: #000088;">$finaldate</span><span style="color: #339933;">;</span>
	<span style="color: #009900;">&#125;</span>
&nbsp;
	<span style="color: #009933; font-style: italic;">/**
	* @return mixed
	*
	* Returns an array of holiday dates
	**/</span>	
&nbsp;
	<span style="color: #000000; font-weight: bold;">public</span> static <span style="color: #000000; font-weight: bold;">function</span> getHolidays<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>
	<span style="color: #009900;">&#123;</span>
		<span style="color: #000088;">$holidays</span> <span style="color: #339933;">=</span> <a href="http://www.php.net/array"><span style="color: #990000;">array</span></a><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		<span style="color: #000088;">$harr</span> <span style="color: #339933;">=</span> <a href="http://www.php.net/array"><span style="color: #990000;">array</span></a><span style="color: #009900;">&#40;</span>
		<span style="color: #0000ff;">&quot;2012-01-02&quot;</span><span style="color: #339933;">,</span><span style="color: #0000ff;">&quot;2012-01-16&quot;</span><span style="color: #339933;">,</span><span style="color: #0000ff;">&quot;2012-02-20&quot;</span><span style="color: #339933;">,</span><span style="color: #0000ff;">&quot;2012-05-28&quot;</span><span style="color: #339933;">,</span><span style="color: #0000ff;">&quot;2012-07-04&quot;</span><span style="color: #339933;">,</span><span style="color: #0000ff;">&quot;2012-09-03&quot;</span><span style="color: #339933;">,</span>
		<span style="color: #0000ff;">&quot;2012-10-08&quot;</span><span style="color: #339933;">,</span><span style="color: #0000ff;">&quot;2012-11-12&quot;</span><span style="color: #339933;">,</span><span style="color: #0000ff;">&quot;2012-11-22&quot;</span><span style="color: #339933;">,</span><span style="color: #0000ff;">&quot;2012-12-25&quot;</span><span style="color: #339933;">,</span><span style="color: #0000ff;">&quot;2013-01-01&quot;</span><span style="color: #339933;">,</span><span style="color: #0000ff;">&quot;2013-01-21&quot;</span><span style="color: #339933;">,</span>
		<span style="color: #0000ff;">&quot;2013-02-18&quot;</span><span style="color: #339933;">,</span><span style="color: #0000ff;">&quot;2013-05-27&quot;</span><span style="color: #339933;">,</span><span style="color: #0000ff;">&quot;2013-07-04&quot;</span><span style="color: #339933;">,</span><span style="color: #0000ff;">&quot;2013-09-02&quot;</span><span style="color: #339933;">,</span><span style="color: #0000ff;">&quot;2013-10-14&quot;</span><span style="color: #339933;">,</span><span style="color: #0000ff;">&quot;2013-11-11&quot;</span><span style="color: #339933;">,</span>
		<span style="color: #0000ff;">&quot;2013-11-28&quot;</span><span style="color: #339933;">,</span><span style="color: #0000ff;">&quot;2013-12-25&quot;</span><span style="color: #339933;">,</span><span style="color: #0000ff;">&quot;2014-01-01&quot;</span><span style="color: #339933;">,</span><span style="color: #0000ff;">&quot;2014-01-20&quot;</span><span style="color: #339933;">,</span><span style="color: #0000ff;">&quot;2014-02-17&quot;</span><span style="color: #339933;">,</span><span style="color: #0000ff;">&quot;2014-05-26&quot;</span><span style="color: #339933;">,</span>
		<span style="color: #0000ff;">&quot;2014-07-04&quot;</span><span style="color: #339933;">,</span><span style="color: #0000ff;">&quot;2014-09-01&quot;</span><span style="color: #339933;">,</span><span style="color: #0000ff;">&quot;2014-10-13&quot;</span><span style="color: #339933;">,</span><span style="color: #0000ff;">&quot;2014-11-11&quot;</span><span style="color: #339933;">,</span><span style="color: #0000ff;">&quot;2014-11-27&quot;</span><span style="color: #339933;">,</span><span style="color: #0000ff;">&quot;2014-12-25&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
		<span style="color: #666666; font-style: italic;">// OPTIONALLY fill $harr from your own database table.</span>
&nbsp;
		<span style="color: #b1b100;">foreach</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$harr</span> <span style="color: #b1b100;">as</span> <span style="color: #000088;">$hitem</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
			<span style="color: #000088;">$h</span> <span style="color: #339933;">=</span> <a href="http://www.php.net/explode"><span style="color: #990000;">explode</span></a><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'-'</span><span style="color: #339933;">,</span> <span style="color: #000088;">$hitem</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>        
			<span style="color: #000088;">$htime</span> <span style="color: #339933;">=</span> <a href="http://www.php.net/mktime"><span style="color: #990000;">mktime</span></a><span style="color: #009900;">&#40;</span><span style="color: #cc66cc;">0</span><span style="color: #339933;">,</span> <span style="color: #cc66cc;">0</span><span style="color: #339933;">,</span> <span style="color: #cc66cc;">0</span><span style="color: #339933;">,</span> <span style="color: #000088;">$h</span><span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">1</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">,</span> <span style="color: #000088;">$h</span><span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">2</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">,</span> <span style="color: #000088;">$h</span><span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">0</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
			<span style="color: #000088;">$weekday</span> <span style="color: #339933;">=</span> <a href="http://www.php.net/date"><span style="color: #990000;">date</span></a><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'w'</span><span style="color: #339933;">,</span> <span style="color: #000088;">$htime</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
			<span style="color: #000088;">$htime</span> <span style="color: #339933;">+=</span> <span style="color: #000088;">$weekday</span><span style="color: #339933;">==</span><span style="color: #cc66cc;">0</span> ? <span style="color: #cc66cc;">86400</span> <span style="color: #339933;">:</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$weekday</span><span style="color: #339933;">==</span><span style="color: #cc66cc;">6</span> ? <span style="color: #339933;">-</span><span style="color: #cc66cc;">86400</span> <span style="color: #339933;">:</span> <span style="color: #cc66cc;">0</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
			<span style="color: #000088;">$holidays</span><span style="color: #009900;">&#91;</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$htime</span><span style="color: #339933;">;</span>
		<span style="color: #009900;">&#125;</span>
		<span style="color: #b1b100;">return</span> <span style="color: #000088;">$holidays</span><span style="color: #339933;">;</span>
	<span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">?&gt;</span></pre></td></tr></table></div>

<p>If you have any questions about using these methods or want to see an addition for your needs, leave a comment below.</p>
]]></content:encoded>
			<wfw:commentRss>http://solidlystated.com/scripting/php-get-next-work-day-or-work-week/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

