<?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>Robert Mullaney&#039;s Blog</title>
	<atom:link href="http://www.robertmullaney.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.robertmullaney.com</link>
	<description>PHP, MySQL, HTML, CSS, jQuery and More!</description>
	<lastBuildDate>Fri, 27 Jan 2012 21:10:56 +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>Reset Gallery3 Admin Password using phpMyAdmin</title>
		<link>http://www.robertmullaney.com/2012/01/27/reset-gallery3-admin-password-phpmyadmin/</link>
		<comments>http://www.robertmullaney.com/2012/01/27/reset-gallery3-admin-password-phpmyadmin/#comments</comments>
		<pubDate>Fri, 27 Jan 2012 21:05:05 +0000</pubDate>
		<dc:creator>Robert Mullaney</dc:creator>
				<category><![CDATA[Code Snippets]]></category>
		<category><![CDATA[gallery]]></category>
		<category><![CDATA[phpmyadmin]]></category>

		<guid isPermaLink="false">http://www.robertmullaney.com/?p=606</guid>
		<description><![CDATA[Just a quote note in case I need to find it again later&#8230; If you forgot your admin password for Gallery3 by Menalto, open the users table via phpMyAdmin and replace the existing encrypted password with the following. $P$DyhWrqfmMF/XKPf3CtPn0pIQDZpQKu Now, you can log in using 12345 as the password. Make sure you change this immediately [...]]]></description>
			<content:encoded><![CDATA[<p>Just a quote note in case I need to find it again later&#8230;</p>
<p>If you forgot your admin password for Gallery3 by Menalto, open the users table via phpMyAdmin and replace the existing encrypted password with the following.</p>
<pre>$P$DyhWrqfmMF/XKPf3CtPn0pIQDZpQKu</pre>
<p>Now, you can log in using 12345 as the password. Make sure you change this immediately after logging back in!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.robertmullaney.com/2012/01/27/reset-gallery3-admin-password-phpmyadmin/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Horizontal icon (footer) layout for Facebook chat contacts window&#8230; kind of like the Mac OSX app bar</title>
		<link>http://www.robertmullaney.com/2012/01/19/horizontal-footer-icon-layout-facebook-chat-contactswindow-like-mac/</link>
		<comments>http://www.robertmullaney.com/2012/01/19/horizontal-footer-icon-layout-facebook-chat-contactswindow-like-mac/#comments</comments>
		<pubDate>Fri, 20 Jan 2012 04:01:04 +0000</pubDate>
		<dc:creator>Robert Mullaney</dc:creator>
				<category><![CDATA[Code Snippets]]></category>
		<category><![CDATA[css]]></category>
		<category><![CDATA[facebook]]></category>
		<category><![CDATA[javascript]]></category>

		<guid isPermaLink="false">http://www.robertmullaney.com/?p=596</guid>
		<description><![CDATA[If you came here looking for the code, that will be a bit further down the road. Here is the plan&#8230; Take this&#8230; Note: The above screen has my hide offline users mod applied And make it look more like this&#8230; This is a &#8220;for fun&#8221; project and will be completed as time permits. So [...]]]></description>
			<content:encoded><![CDATA[<p>If you came here looking for the code, that will be a bit further down the road. Here is the plan&#8230;</p>
<p>Take this&#8230;</p>
<p><a href="http://www.robertmullaney.com/wp-content/uploads/2012/01/fb-chat.jpg"><img class="alignnone size-full wp-image-598" title="fb-chat" src="http://www.robertmullaney.com/wp-content/uploads/2012/01/fb-chat.jpg" alt="" width="203" height="243" /></a></p>
<p>Note: The above screen has my <a href="http://www.robertmullaney.com/2012/01/18/hide-offline-contacts-facebook-chat/">hide offline users</a> mod applied <img src='http://www.robertmullaney.com/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>
<p>And make it look more like this&#8230;</p>
<p><a href="http://www.robertmullaney.com/2012/01/19/horizontal-footer-icon-layout-facebook-chat-contactswindow-like-mac/ht3737-lion-desktop-003eee-en/" rel="attachment wp-att-597"><img class="alignnone size-medium wp-image-597" title="HT3737-Lion-Desktop-003eee-en" src="http://www.robertmullaney.com/wp-content/uploads/2012/01/HT3737-Lion-Desktop-003eee-en-300x244.png" alt="" width="300" height="244" /></a></p>
<p>This is a &#8220;for fun&#8221; project and will be completed as time permits. So check back soon for progress updates.</p>
<p>&nbsp;</p>
]]></content:encoded>
			<wfw:commentRss>http://www.robertmullaney.com/2012/01/19/horizontal-footer-icon-layout-facebook-chat-contactswindow-like-mac/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Hide offline contacts from Facebook chat</title>
		<link>http://www.robertmullaney.com/2012/01/18/hide-offline-contacts-facebook-chat/</link>
		<comments>http://www.robertmullaney.com/2012/01/18/hide-offline-contacts-facebook-chat/#comments</comments>
		<pubDate>Thu, 19 Jan 2012 01:42:21 +0000</pubDate>
		<dc:creator>Robert Mullaney</dc:creator>
				<category><![CDATA[Code Snippets]]></category>
		<category><![CDATA[css]]></category>
		<category><![CDATA[facebook]]></category>

		<guid isPermaLink="false">http://www.robertmullaney.com/?p=592</guid>
		<description><![CDATA[If you&#8217;re like me, you stay logged into Facebook throughout the day. I work online so this is not uncommon. One thing I have always hated is that there are no preferences for how you want to filter that list. Personally I find it pointless to show you offline contacts in an instant chat interface. [...]]]></description>
			<content:encoded><![CDATA[<p>If you&#8217;re like me, you stay logged into Facebook throughout the day. I work online so this is not uncommon.</p>
<p>One thing I have always hated is that there are no preferences for how you want to filter that list. Personally I find it pointless to show you offline contacts in an instant chat interface. I know some people use it to leave messages, but I am not one of them.</p>
<p>Assuming you know how to modify your browser&#8217;s custom style sheet, this is all you need to add and those offline users will no longer be visible!</p>
<pre>.fbChatOrderedList li.item,
.fbChatOrderedList li.separator {
    display: none !important;
}
.fbChatOrderedList li.active,
.fbChatOrderedList li.mobile {
    display: block !important;
}</pre>
<p>Feel free to post questions, comments or even improvements.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.robertmullaney.com/2012/01/18/hide-offline-contacts-facebook-chat/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>IMPROVED: Open all external links in a new window using jQuery</title>
		<link>http://www.robertmullaney.com/2012/01/17/improved-open-external-links-new-window-jquery/</link>
		<comments>http://www.robertmullaney.com/2012/01/17/improved-open-external-links-new-window-jquery/#comments</comments>
		<pubDate>Tue, 17 Jan 2012 18:29:21 +0000</pubDate>
		<dc:creator>Robert Mullaney</dc:creator>
				<category><![CDATA[Code Snippets]]></category>
		<category><![CDATA[html]]></category>
		<category><![CDATA[jquery]]></category>

		<guid isPermaLink="false">http://www.robertmullaney.com/?p=589</guid>
		<description><![CDATA[In the original post I covered how to use jQuery to automatically make external links open in a new window. The method however was slightly flawed in my opinion since&#8230; It did not check form action attributes It assumed ANY link starting with &#8220;http[s]://&#8221; was external Here is my new and improved method for making [...]]]></description>
			<content:encoded><![CDATA[<p>In the <a href="http://www.robertmullaney.com/2010/11/08/open-all-external-links-in-a-new-window-using-jquery/">original post</a> I covered how to use jQuery to automatically make external links open in a new window. The method however was slightly flawed in my opinion since&#8230;</p>
<ol>
<li>It did not check form action attributes</li>
<li>It assumed ANY link starting with &#8220;http[s]://&#8221; was external</li>
</ol>
<p>Here is my new and improved method for making all external site links open in a new window. It now includes form tags, one less selector for secure and non-secure link urls, AND excludes any of those which link to an internal page where the full url may have been specified.</p>
<pre>$('a[href*="://"], form[action*="://"]').not($('a[href*="://'+location.host+'"]')).attr('target','_blank');</pre>
<p>A quick breakdown&#8230;</p>
<ol>
<li>a[href*="<span style="color: #ff0000;">://</span>"] and form[action*="<span style="color: #ff0000;">://</span>"] matches the elements where a full url has been specified</li>
<li>.not($(&#8216;a[href*="://'+location.host+'"]&#8216;)) excludes all matched items that include the current host (eg: http://<span style="color: #ff0000;">www.robertmullaney.com</span>/)</li>
<li>finally we update the target attribute of the the remaining links open in a new window</li>
</ol>
<p>Why this is important:</p>
<p style="padding-left: 30px;">Once you have a user on your site, the worst thing you can do is send them away. Also, you will easily annoy them if all links open in new windows and cause them to leave anyhow. This way, only the links that pull them away from site site are opened in new windows. When they are done on the external sites, they close the browser and there your site remains.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.robertmullaney.com/2012/01/17/improved-open-external-links-new-window-jquery/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Calculate the total height of child elements of a clipped (overflow: hidden) parent tag</title>
		<link>http://www.robertmullaney.com/2012/01/03/calculate-total-height-child-elements-clipped-parent-tag/</link>
		<comments>http://www.robertmullaney.com/2012/01/03/calculate-total-height-child-elements-clipped-parent-tag/#comments</comments>
		<pubDate>Tue, 03 Jan 2012 17:41:19 +0000</pubDate>
		<dc:creator>Robert Mullaney</dc:creator>
				<category><![CDATA[Code Snippets]]></category>
		<category><![CDATA[calculation]]></category>
		<category><![CDATA[css]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[jquery]]></category>
		<category><![CDATA[manipulation]]></category>

		<guid isPermaLink="false">http://www.robertmullaney.com/?p=578</guid>
		<description><![CDATA[Ever have an element with clipped content and wanted to know the total height of the elements contained therein? I have a client who wants the height of the main content to be clipped to a preset height (don&#8217;t ask me why). Which means I need to dynamically add a &#8220;read more&#8221; link to expand [...]]]></description>
			<content:encoded><![CDATA[<p>Ever have an element with clipped content and wanted to know the total height of the elements contained therein? I have a client who wants the height of the main content to be clipped to a preset height (don&#8217;t ask me why). Which means I need to dynamically add a &#8220;read more&#8221; link to expand the container and show all the content.</p>
<p>Well, here&#8217;s how you calculate the combined height of the children with jQuery&#8230;<span id="more-578"></span></p>
<p><strong>HTML</strong></p>
<pre>&lt;div id="container" style="height: 1em; overflow: hidden"&gt;
    &lt;p&gt;content&lt;br /&gt;content&lt;br /&gt;content&lt;br /&gt;
    content&lt;br /&gt;content&lt;br /&gt;content&lt;br /&gt;
    content&lt;br /&gt;content&lt;br /&gt;content&lt;/p&gt;
    &lt;p&gt;content&lt;br /&gt;content&lt;br /&gt;content&lt;br /&gt;
    content&lt;br /&gt;content&lt;br /&gt;content&lt;br /&gt;
    content&lt;br /&gt;content&lt;br /&gt;content&lt;/p&gt;
&lt;/div&gt;</pre>
<p><strong>JavaScript</strong></p>
<pre>var totalHeight = 0;
$("#container").children().each(function(){
    totalHeight += $(this).outerHeight(true); // true = include margins
});
alert("Total Height: " + totalHeight + "px");</pre>
<p><strong>Result</strong></p>
<pre>Total Height: 360px</pre>
<p>All you have to do is loop over each child element inside the parent element, adding its outerHeight (which includes margins, borders and padding) to the totalHeight variable.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.robertmullaney.com/2012/01/03/calculate-total-height-child-elements-clipped-parent-tag/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Remove www prefix from domain using PHP</title>
		<link>http://www.robertmullaney.com/2012/01/01/remove-www-prefix-from-domain-using-php/</link>
		<comments>http://www.robertmullaney.com/2012/01/01/remove-www-prefix-from-domain-using-php/#comments</comments>
		<pubDate>Sun, 01 Jan 2012 20:47:49 +0000</pubDate>
		<dc:creator>Robert Mullaney</dc:creator>
				<category><![CDATA[Code Snippets]]></category>
		<category><![CDATA[manipulation]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[regex]]></category>
		<category><![CDATA[regular expressions]]></category>

		<guid isPermaLink="false">http://www.robertmullaney.com/?p=573</guid>
		<description><![CDATA[I see this question a lot and usually it comes down to getting the current host name for use with cookies. Lets say I want to make a domain-wide cookie, that does not include the standard www prefix such as www.robertmullaney.com. In order for the cookie to work with or without the www prefix, it [...]]]></description>
			<content:encoded><![CDATA[<p>I see this question a lot and usually it comes down to getting the current host name for use with cookies. Lets say I want to make a domain-wide cookie, that does not include the standard www prefix such as www.robertmullaney.com. In order for the cookie to work with or without the www prefix, it needs to become &#8216;.robertmullaney.com&#8217;.</p>
<pre>preg_replace('/^www\./i', '.', $_SERVER['HTTP_HOST'])</pre>
<p>Now, some of you may be looking for a way to determine the top-level domain for something like this.subdomain.robertmullaney.com. That is not an easy solution (since many TLDs have multiple suffixes like .co.uk). If that&#8217;s what you&#8217;re looking for, check back later and see if I have come up with a good solution&#8230; that one&#8217;s tricky.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.robertmullaney.com/2012/01/01/remove-www-prefix-from-domain-using-php/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Happy New Year 2012</title>
		<link>http://www.robertmullaney.com/2012/01/01/happy-new-year-2012/</link>
		<comments>http://www.robertmullaney.com/2012/01/01/happy-new-year-2012/#comments</comments>
		<pubDate>Sun, 01 Jan 2012 08:19:07 +0000</pubDate>
		<dc:creator>Robert Mullaney</dc:creator>
				<category><![CDATA[General]]></category>

		<guid isPermaLink="false">http://www.robertmullaney.com/?p=571</guid>
		<description><![CDATA[I&#8217;d like to wish all of my visitors and fellow coders a happy and prosperous new year. Keep checking out my blog in 2012 for some new sections included but not limited to java, c++ and iphone/android app development. This should be a good year.]]></description>
			<content:encoded><![CDATA[<p>I&#8217;d like to wish all of my visitors and fellow coders a happy and prosperous new year. Keep checking out my blog in 2012 for some new sections included but not limited to java, c++ and iphone/android app development. This should be a good year.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.robertmullaney.com/2012/01/01/happy-new-year-2012/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Calculator: Convert Xbox Live Microsoft Points (MSP) to USD</title>
		<link>http://www.robertmullaney.com/2011/12/07/calculator-convert-xbox-live-microsoft-points-to-usd/</link>
		<comments>http://www.robertmullaney.com/2011/12/07/calculator-convert-xbox-live-microsoft-points-to-usd/#comments</comments>
		<pubDate>Thu, 08 Dec 2011 04:02:22 +0000</pubDate>
		<dc:creator>Robert Mullaney</dc:creator>
				<category><![CDATA[Gaming]]></category>
		<category><![CDATA[calculation]]></category>
		<category><![CDATA[conversion]]></category>
		<category><![CDATA[microsoft points]]></category>
		<category><![CDATA[xbox]]></category>
		<category><![CDATA[xbox live]]></category>

		<guid isPermaLink="false">http://www.robertmullaney.com/?p=526</guid>
		<description><![CDATA[Here is a calculator (requires JavaScript) to convert Xbox Live Microsoft Points into USD (dollars) and vice versa. Microsoft Point Converter USD MSP Simply enter an amount into either field and the conversion is automatic. PS: If you leech my code, at least link to me for credit]]></description>
			<content:encoded><![CDATA[<p>Here is a calculator (requires JavaScript) to convert Xbox Live Microsoft Points into USD (dollars) and vice versa.</p>
<form>
<fieldset>
<legend>Microsoft Point Converter</legend>
<input id="usd" type="text" value="0" /> USD<br />
<input id="msp" type="text" value="0" /> MSP</fieldset>
</form>
<p>Simply enter an amount into either field and the conversion is automatic.</p>
<p>PS: If you leech my code, at least link to me for credit <img src='http://www.robertmullaney.com/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>
<p><script type="text/javascript">// <![CDATA[
 jQuery(function() { ratio = 0.0125; jQuery('#usd').keyup(function(event) { result = parseInt(jQuery(this).val().replace(/[^0-9\.]+/g, '')) / ratio; if (isNaN(result)) result = 0; jQuery('#msp').val(result); }); jQuery('#msp').keyup(function(event) { result = parseFloat(jQuery(this).val().replace(/[^0-9\.]+/g, '')) * ratio; if (isNaN(result)) result = 0; jQuery('#usd').val(result.toFixed(2)); }); });
// ]]&gt;</script></p>
]]></content:encoded>
			<wfw:commentRss>http://www.robertmullaney.com/2011/12/07/calculator-convert-xbox-live-microsoft-points-to-usd/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>My HTML5 base template (skeleton file) with jQuery from Google CDN</title>
		<link>http://www.robertmullaney.com/2011/11/18/my-html5-base-template-skeleton-file-jquery-google-cdn/</link>
		<comments>http://www.robertmullaney.com/2011/11/18/my-html5-base-template-skeleton-file-jquery-google-cdn/#comments</comments>
		<pubDate>Fri, 18 Nov 2011 19:09:24 +0000</pubDate>
		<dc:creator>Robert Mullaney</dc:creator>
				<category><![CDATA[Code Snippets]]></category>
		<category><![CDATA[html5]]></category>
		<category><![CDATA[jquery]]></category>
		<category><![CDATA[jquery ui]]></category>

		<guid isPermaLink="false">http://www.robertmullaney.com/?p=471</guid>
		<description><![CDATA[Below is the standard HTML5 template I start most of my projects with. It includes the latest 1.x version of jQuery, jQuery UI, and the desired jQuery UI theme. It also has a conditional comment that checks to see if the current browser older than IE9 and includes HTML5Shiv to make sure new elements are [...]]]></description>
			<content:encoded><![CDATA[<p>Below is the standard HTML5 template I start most of my projects with. It includes the latest 1.x version of jQuery, jQuery UI, and the desired jQuery UI theme. It also has a conditional comment that checks to see if the current browser older than IE9 and includes HTML5Shiv to make sure new elements are rendered properly in older IE browsers.</p>
<p>While I don&#8217;t claim this is the best skeleton HTML5 template, I think it is a very solid foundation to start from <img src='http://www.robertmullaney.com/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>
<pre>&lt;!DOCTYPE html&gt;
&lt;html lang="en"&gt;
&lt;head&gt;
&lt;meta charset="utf-8"&gt;
&lt;title&gt;Untitled&lt;/title&gt;
&lt;meta name="keywords" content=""&gt;
&lt;meta name="description" content=""&gt;
&lt;script src="//ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"&gt;&lt;/script&gt;
&lt;script src="//ajax.googleapis.com/ajax/libs/jqueryui/1/jquery-ui.min.js"&gt;&lt;/script&gt;
&lt;link rel="stylesheet" href="//ajax.googleapis.com/ajax/libs/jqueryui/1/themes/ui-lightness/jquery-ui.css"&gt;
&lt;!--[if lt IE 9]&gt;&lt;script src="//html5shiv.googlecode.com/svn/trunk/html5.js"&gt;&lt;/script&gt;&lt;![endif]--&gt;
&lt;script&gt;
$(function() {
    //DOM is Ready
});
&lt;/script&gt;
&lt;/head&gt;
&lt;body&gt;

&lt;/body&gt;
&lt;/html&gt;</pre>
]]></content:encoded>
			<wfw:commentRss>http://www.robertmullaney.com/2011/11/18/my-html5-base-template-skeleton-file-jquery-google-cdn/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>PHP: Incrementing/decrementing a numeric string that has letter (alpha) prefixes</title>
		<link>http://www.robertmullaney.com/2011/11/16/php-increment-decrement-numeric-string-letteralpha-prefixes/</link>
		<comments>http://www.robertmullaney.com/2011/11/16/php-increment-decrement-numeric-string-letteralpha-prefixes/#comments</comments>
		<pubDate>Wed, 16 Nov 2011 19:02:49 +0000</pubDate>
		<dc:creator>Robert Mullaney</dc:creator>
				<category><![CDATA[Code Snippets]]></category>
		<category><![CDATA[numbers]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[strings]]></category>

		<guid isPermaLink="false">http://www.robertmullaney.com/?p=468</guid>
		<description><![CDATA[I see this question quite a bit in programming discussions and forums. I&#8217;ll be linking to this post from now on to avoid re-posting the same replies every time someone asks. String Value: XYZ123 Desired Result: XYZ124 The majority of solutions I have read regarding this problem require splitting the string or using regular expressions [...]]]></description>
			<content:encoded><![CDATA[<p>I see this question quite a bit in programming discussions and forums. I&#8217;ll be linking to this post from now on to avoid re-posting the same replies every time someone asks.</p>
<p><strong>String Value:</strong> XYZ123</p>
<p><strong>Desired Result:</strong> XYZ124</p>
<p>The majority of solutions I have read regarding this problem require splitting the string or using regular expressions to manipulate the numeric portion. The overhead for complex solutions for such a simple problem are simply overkill. The example below shows the easiest way to increment the string  and requires minimal overhead&#8230;<span id="more-468"></span></p>
<pre>$str = 'XYZ123';
echo $str++; // Output: XYZ124</pre>
<p>It couldn&#8217;t be any easier. To decrement, simply modify the &#8216;++&#8217; operator as follows&#8230;</p>
<pre>$str = 'XYZ123';
echo $str--; // Output: XYZ122</pre>
<p>Now, if your numeric string ends with a letter, this method will perform differently than you might expect.</p>
<pre>$str = '123ABC';
echo $str++; // Output: 123ABD</pre>
<p>Here as an example performed using a for loop.</p>
<pre>&lt;?php
$str = '35A990';
for ($i = 0; $i &lt; 16; $i++) {
    echo $str++ . ' ';
}
// Output: 35<span style="color: #ff0000;">A</span>990 35<span style="color: #ff0000;">A</span>991 35<span style="color: #ff0000;">A</span>992 35<span style="color: #ff0000;">A</span>993 35<span style="color: #ff0000;">A</span>994 35<span style="color: #ff0000;">A</span>995 35<span style="color: #ff0000;">A</span>996 35<span style="color: #ff0000;">A</span>997 35<span style="color: #ff0000;">A</span>998 35A999 35<strong><span style="color: #ff0000;">B</span></strong>000 35<strong><span style="color: #ff0000;">B</span></strong>001 35<strong><span style="color: #ff0000;">B</span></strong>002 35<strong><span style="color: #ff0000;">B</span></strong>003 35<strong><span style="color: #ff0000;">B</span></strong>004 35<strong><span style="color: #ff0000;">B</span></strong>005
?&gt;</pre>
<p>Note: Since we exceeded the upper limit of the numeric portion, the preceding alpha character &#8216;A&#8217; is incremented to &#8216;B&#8217; (in <span style="color: #ff0000;">red</span> above). Be sure you understand this behavior before implementing this method.</p>
<p>Feel free to comment if you have any questions.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.robertmullaney.com/2011/11/16/php-increment-decrement-numeric-string-letteralpha-prefixes/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Bookmarklet: Submit a login form using javascript within a bookmark</title>
		<link>http://www.robertmullaney.com/2011/10/23/bookmarklet-submit-login-form-javascript-bookmark/</link>
		<comments>http://www.robertmullaney.com/2011/10/23/bookmarklet-submit-login-form-javascript-bookmark/#comments</comments>
		<pubDate>Sun, 23 Oct 2011 14:38:41 +0000</pubDate>
		<dc:creator>Robert Mullaney</dc:creator>
				<category><![CDATA[Code Snippets]]></category>
		<category><![CDATA[bookmark]]></category>
		<category><![CDATA[bookmarklet]]></category>
		<category><![CDATA[forms]]></category>
		<category><![CDATA[javascript]]></category>

		<guid isPermaLink="false">http://www.robertmullaney.com/?p=449</guid>
		<description><![CDATA[If you&#8217;re like me, you have many bookmarks to administration areas that require authentication. For you, this script is a priceless time-saver. Let&#8217;s say your login page has a form similar to the following&#8230; &#60;form action="/login.php" method="post"&#62;     &#60;label&#62;Username: &#60;input type="text" name="user"&#62;&#60;/label&#62;     &#60;label&#62;Password: &#60;input type="password" name="pass"&#62;&#60;/label&#62;     &#60;input type="submit" value="Log In"&#62; &#60;/form&#62; Some logins [...]]]></description>
			<content:encoded><![CDATA[<p>If you&#8217;re like me, you have many bookmarks to administration areas that require authentication. For you, this script is a priceless time-saver.</p>
<p>Let&#8217;s say your login page has a form similar to the following&#8230;</p>
<pre>&lt;form action="/login.php" method="post"&gt;
    &lt;label&gt;Username: &lt;input type="text" name="user"&gt;&lt;/label&gt;
    &lt;label&gt;Password: &lt;input type="password" name="pass"&gt;&lt;/label&gt;
    &lt;input type="submit" value="Log In"&gt;
&lt;/form&gt;</pre>
<p>Some logins simply cannot be stored in the browser&#8217;s password system. So, to save you the extra effort of manually logging in on each visit to such pages, create a bookmark that automatically logs you into the system.</p>
<p>Here&#8217;s the code to submit that form using a bookmarklet&#8230;<span id="more-449"></span></p>
<p><span style="color: #ff0000;">Red</span> text indicates what <strong>should</strong> be changed&#8230;</p>
<pre>javascript:'&lt;html&gt;&lt;body onload="document.forms[0].submit()"&gt;&lt;form method="post" action="<span style="color: #ff0000;">http://yourdomain.com/login.php</span>"&gt;&lt;input type="hidden" name="<span style="color: #ff0000;">user</span>" value="<span style="color: #ff0000;">yourusername</span>"&gt;&lt;input type="hidden" name="<span style="color: #ff0000;">pass</span>" value="<span style="color: #ff0000;">yourpassword</span>"&gt;&lt;/form&gt;&lt;/body&gt;&lt;/html&gt;'</pre>
<p>As long as you have a basic understanding of HTML forms and JavaScript, you should be able to modify the above code to suit your specific needs <img src='http://www.robertmullaney.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p><strong>Warning:</strong> Since your username and password are stored in plain-text within the bookmark, you should <span style="text-decoration: underline;">never</span> implement this script on a computer or device accessible by other users.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.robertmullaney.com/2011/10/23/bookmarklet-submit-login-form-javascript-bookmark/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>jQuery Add Bookmark to Favorites Script</title>
		<link>http://www.robertmullaney.com/2011/10/18/jquery-add-bookmark-to-favorites-script/</link>
		<comments>http://www.robertmullaney.com/2011/10/18/jquery-add-bookmark-to-favorites-script/#comments</comments>
		<pubDate>Tue, 18 Oct 2011 18:40:43 +0000</pubDate>
		<dc:creator>Robert Mullaney</dc:creator>
				<category><![CDATA[Code Snippets]]></category>
		<category><![CDATA[bookmark]]></category>
		<category><![CDATA[dialog]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[jquery]]></category>
		<category><![CDATA[jquery ui]]></category>

		<guid isPermaLink="false">http://www.robertmullaney.com/?p=440</guid>
		<description><![CDATA[Here is a quick example of how to use jQuery along with traditional browser sniffing techniques to create a dynamic &#8220;Bookmark Us&#8221; link. Google CDN (latest 1.x version, theme)&#8230; &#60;script type="text/javascript" src="//ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"&#62;&#60;/script&#62; &#60;script type="text/javascript" src="//ajax.googleapis.com/ajax/libs/jqueryui/1/jquery-ui.min.js"&#62;&#60;/script&#62; &#60;link type="text/css" rel="stylesheet" href="//ajax.googleapis.com/ajax/libs/jqueryui/1/themes/blitzer/jquery-ui.css" /&#62; The javascript&#8230; $(function() {     $('&#60;div id="dialog"&#62;&#60;/div&#62;').dialog({         modal: true,         autoOpen: false,         buttons: [...]]]></description>
			<content:encoded><![CDATA[<p>Here is a quick example of how to use jQuery along with traditional browser sniffing techniques to create a dynamic &#8220;Bookmark Us&#8221; link.</p>
<p>Google CDN (<strong><span style="color: #ff0000;">latest 1.x version</span></strong>, <span style="color: #008000;"><strong>theme</strong></span>)&#8230;</p>
<pre>&lt;script type="text/javascript" src="//ajax.googleapis.com/ajax/libs/jquery/<strong><span style="color: #ff0000;">1</span></strong>/jquery.min.js"&gt;&lt;/script&gt;
&lt;script type="text/javascript" src="//ajax.googleapis.com/ajax/libs/jqueryui/<strong><span style="color: #ff0000;">1</span></strong>/jquery-ui.min.js"&gt;&lt;/script&gt;
&lt;link type="text/css" rel="stylesheet" href="//ajax.googleapis.com/ajax/libs/jqueryui/<strong><span style="color: #ff0000;">1</span></strong>/themes/<strong><span style="color: #008000;">blitzer</span></strong>/jquery-ui.css" /&gt;</pre>
<p>The javascript&#8230;<span id="more-440"></span></p>
<pre>$(function() {
    $('&lt;div id="dialog"&gt;&lt;/div&gt;').dialog({
        modal: true,
        autoOpen: false,
        buttons: {
            Ok: function() {
                $(this).dialog('close');
            }
        }
    });
    var faveMetaKey = (navigator.appVersion.indexOf('Mac') != -1) ? 'CMD' : 'CTRL';
    var faveLetter = 'D';
    var faveText = 'Bookmark Us';
    if ($.browser.opera) {
        $('#addBookmark').attr('rel', 'sidebar');
        if (parseInt($.browser.version, 10) &lt; 9) {
            faveLetter = 'T';
            $('#addBookmark').text(faveText + ' (' + faveMetaKey + '+' + faveLetter + ')');
        }
    } else if (/konqueror/.test(navigator.userAgent.toLowerCase())) {
        faveLetter = 'B';
        $('#addBookmark').text(faveText + ' (' + faveMetaKey + '+' + faveLetter + ')');
    } else if (window.external || window.sidebar) {
        $('#addBookmark').text(faveText);
    }
    $('#addBookmark').click(function(event) {
        event.preventDefault();
        if (window.external) { // IE
            window.external.AddFavorite(window.location.href, document.title);
        } else if (window.sidebar) { // FireFox
            window.sidebar.addPanel(document.title, window.location.href, '');
        } else {
            if ($.browser.opera &amp;&amp; parseInt($.browser.version, 10) &gt;= 9) {
                // do nothing (added rel="sidebar" above)
            } else {
                $('#dialog').dialog('option', 'title', faveText);
                $('#dialog').html('Press ' + faveMetaKey + '+' + faveLetter + ' to ' + faveText + '.');
                $('#dialog').dialog('open');
            }
        }
    });
});</pre>
<p>The HTML anchor (link)&#8230;</p>
<pre>&lt;a id="addBookmark" href="#"&gt;Bookmark Us (CTRL + D)&lt;/a&gt;</pre>
<p>You can see from the HTML above that we set our link using generic defaults in case the user&#8217;s browser doesn&#8217;t process the script correctly.</p>
<p>In our JavaScript, we first add a generic dialog to the DOM in case automated bookmarks are not supported. Next we set our defaults: <em>faveMetaKey</em>, <em>faveLetter</em> key, and <em>faveText</em>. Only the <em>rel=&#8221;sidebar&#8221;</em> attribute is required for this to work with Opera, but we also have to check the Opera version to re-assign the letter key for older versions. The check for Konqueror was required since it uses a letter key that no other browser is known to use. Then, if we know that automated bookmarking is allowed, we can just omit the key combination since the link should work (IE &amp; FF).</p>
<p>Now for our almighty <a href="http://api.jquery.com/click/" target="_blank">click()</a> function. First, we kill the event with <a href="http://api.jquery.com/event.preventDefault/" target="_blank">preventDefault()</a>. Then we do our conditional checks for Internet Explorer and FireFox (both of which can be automated). If all else fails, we make sure it&#8217;s not Opera 9+, then tell the user which key combination to press within the <a href="http://jqueryui.com/demos/dialog/" target="_blank">jQuery-UI Dialog</a>.</p>
<p>Let me know if you run into any browser/OS combinations with which this method fails. Try to limit concerns regarding browser versions to those released within the last 5 years, thanks <img src='http://www.robertmullaney.com/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>
<p>I would also appreciate feedback regarding key combinations not included in my script. I&#8217;m pretty sure I covered them all, but one can never be sure.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.robertmullaney.com/2011/10/18/jquery-add-bookmark-to-favorites-script/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Easily prevent Flash of Unstyled Content (FOUC) with jQuery</title>
		<link>http://www.robertmullaney.com/2011/08/29/prevent-flash-of-unstyled-content-fouc-jquery/</link>
		<comments>http://www.robertmullaney.com/2011/08/29/prevent-flash-of-unstyled-content-fouc-jquery/#comments</comments>
		<pubDate>Mon, 29 Aug 2011 19:27:27 +0000</pubDate>
		<dc:creator>Robert Mullaney</dc:creator>
				<category><![CDATA[Code Snippets]]></category>
		<category><![CDATA[fouc]]></category>
		<category><![CDATA[jquery]]></category>
		<category><![CDATA[jquery ui]]></category>
		<category><![CDATA[unstyled content]]></category>

		<guid isPermaLink="false">http://www.robertmullaney.com/?p=424</guid>
		<description><![CDATA[I have a project which uses jQuery UI for tables (formatting), buttons, tabs, etc. Even though my local resources and remotely hosted ones are saved in the browser&#8217;s cache, I still have situations where a FOUC (Flash of Unstyled Content) occurs. Here is a simple solution&#8230; $(function() { $('body').hide(); $(window).load(function(){ $('body').show(); }); }); Adjust the [...]]]></description>
			<content:encoded><![CDATA[<p>I have a project which uses <a href="http://jqueryui.com/" target="_blank">jQuery UI</a> for tables (formatting), buttons, tabs, etc. Even though my local resources and <a href="http://code.google.com/apis/libraries/devguide.html#jquery" target="_blank">remotely hosted</a> ones are saved  in the browser&#8217;s cache, I still have situations where a FOUC (Flash of Unstyled Content) occurs.<span id="more-424"></span></p>
<p>Here is a simple solution&#8230;</p>
<pre>$(function() {
    $('<span style="color: #ff0000;">body</span>').hide();
    $(window).load(function(){
        $('<span style="color: #ff0000;">body</span>').show();
    });
});</pre>
<p>Adjust the <span style="color: #ff0000;">selector</span> to your needs of course <img src='http://www.robertmullaney.com/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://www.robertmullaney.com/2011/08/29/prevent-flash-of-unstyled-content-fouc-jquery/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Make the jQuery UI Datepicker use a jQuery Button</title>
		<link>http://www.robertmullaney.com/2011/08/26/make-jquery-ui-datepicker-use-jquery-button/</link>
		<comments>http://www.robertmullaney.com/2011/08/26/make-jquery-ui-datepicker-use-jquery-button/#comments</comments>
		<pubDate>Fri, 26 Aug 2011 20:35:06 +0000</pubDate>
		<dc:creator>Robert Mullaney</dc:creator>
				<category><![CDATA[Code Snippets]]></category>
		<category><![CDATA[button]]></category>
		<category><![CDATA[datepicker]]></category>
		<category><![CDATA[forms]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[jquery]]></category>
		<category><![CDATA[jquery ui]]></category>

		<guid isPermaLink="false">http://www.robertmullaney.com/?p=414</guid>
		<description><![CDATA[It has been bugging me for some time that the datepicker widget uses a normal button unless you tell it to use an image. Seeing that we are using the jQuery-UI framework, it makes sense to me that the button should be styled as such. After playing with the selectors and trying it a few [...]]]></description>
			<content:encoded><![CDATA[<p>It has been bugging me for some time that the datepicker widget uses a normal button unless you tell it to use an image. Seeing that we are using the jQuery-UI framework, it makes sense to me that the button should be styled as such. After playing with the selectors and trying it a few different ways, here is how I made that boring datepicker button become a jQuery-UI button (with calendar icon).<span id="more-414"></span></p>
<pre>$(function() {
    $('input[name="some_date_field"]').datepicker({
        showOn: 'button'
    });
    $('button.ui-datepicker-trigger').button({
        text: false,
        icons: {
            primary: 'ui-icon-calendar',
            secondary: ''
        }
    });
});</pre>
<p>Note: Since my datepicker button was displayed inside a  jQuery-UI Dialog, some extra CSS rules were required to make it look right. You may not need them, but if you end up with a huge unsightly button, adjust the following rules.</p>
<pre>button.ui-datepicker-trigger {
    font-size: 65% !important;
    vertical-align: top !important;
    margin-left: 3px !important;
}</pre>
<p>Comments and questions are always welcome <img src='http://www.robertmullaney.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://www.robertmullaney.com/2011/08/26/make-jquery-ui-datepicker-use-jquery-button/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Submit ajax form in jQuery-UI Dialog with Enter Key</title>
		<link>http://www.robertmullaney.com/2011/08/26/submit-ajax-form-jquery-ui-dialog-enter-key/</link>
		<comments>http://www.robertmullaney.com/2011/08/26/submit-ajax-form-jquery-ui-dialog-enter-key/#comments</comments>
		<pubDate>Fri, 26 Aug 2011 08:34:49 +0000</pubDate>
		<dc:creator>Robert Mullaney</dc:creator>
				<category><![CDATA[Code Snippets]]></category>
		<category><![CDATA[ajax]]></category>
		<category><![CDATA[dialog]]></category>
		<category><![CDATA[form]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[jquery]]></category>
		<category><![CDATA[jquery ui]]></category>
		<category><![CDATA[keyup]]></category>
		<category><![CDATA[submit]]></category>

		<guid isPermaLink="false">http://www.robertmullaney.com/?p=410</guid>
		<description><![CDATA[This question is posted quite a bit and nobody seems to be able to provide a good solution that won&#8217;t behave questionably. So here&#8217;s my take on it&#8230; $('&#60;div id="myDialog"&#62;&#60;/div&#62;').appendTo('body').dialog({ autoOpen: false, modal: true, closeOnEscape: true, buttons: { OK: function() { $.ajax({ type: 'POST', url: 'save.php', data: $('#myDialog :input').serialize(), error: function(xml, status, error) { $('#myDialog').html('&#60;p&#62;&#60;strong&#62;Error [...]]]></description>
			<content:encoded><![CDATA[<p>This question is posted quite a bit and nobody seems to be able to provide a good solution that won&#8217;t behave questionably. So here&#8217;s my take on it&#8230;</p>
<pre>$('&lt;div id="myDialog"&gt;&lt;/div&gt;').appendTo('body').dialog({
    autoOpen: false,
    modal: true,
    closeOnEscape: true,
    buttons: {
        OK: function() {
            $.ajax({
                type: 'POST',
                url: 'save.php',
                data: $('#myDialog :input').serialize(),
                error: function(xml, status, error) {
                    $('#myDialog').html('&lt;p&gt;&lt;strong&gt;Error Code:&lt;/strong&gt; '+status+'&lt;/p&gt;&lt;p&gt;&lt;strong&gt;Explanation:&lt;/strong&gt; '+error+'&lt;/p&gt;');
                }
            });
        },
        Cancel: function() {
            $(this).dialog('close');
        }
    },
    open: function() {
        $(this).html('').load('form.php');
    },
    focus: function() {
        <span style="color: #ff0000;">$(':input', this)</span>.keyup(function(event) {
            if (event.keyCode == 13) {
                $('.ui-dialog-buttonpane button:first').click();
            }
        });
    }
});</pre>
<p><span style="color: #ff0000;">Note:</span> You can also trigger the event on any element (not just form fields) by using $(this) as the selector.</p>
<p>That&#8217;s it, enjoy <img src='http://www.robertmullaney.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://www.robertmullaney.com/2011/08/26/submit-ajax-form-jquery-ui-dialog-enter-key/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Change CodeIgniter&#8217;s Form_validation error delimiters globally!</title>
		<link>http://www.robertmullaney.com/2011/08/21/change-codeigniters-form_validation-error-delimiters-globally/</link>
		<comments>http://www.robertmullaney.com/2011/08/21/change-codeigniters-form_validation-error-delimiters-globally/#comments</comments>
		<pubDate>Sun, 21 Aug 2011 07:22:53 +0000</pubDate>
		<dc:creator>Robert Mullaney</dc:creator>
				<category><![CDATA[Code Snippets]]></category>
		<category><![CDATA[codeigniter]]></category>
		<category><![CDATA[errors]]></category>
		<category><![CDATA[extend]]></category>
		<category><![CDATA[forms]]></category>
		<category><![CDATA[validation]]></category>

		<guid isPermaLink="false">http://www.robertmullaney.com/?p=401</guid>
		<description><![CDATA[I have seen this question all over the web and am surprised that nobody has actually offered such a simple solution. Anyway, here is a quick, simple and painless way to set CodeIgniter&#8217;s error delimiters (used by the Form_validation library) one time for your entire application. Create &#8220;application/libraries/MY_Form_validation.php&#8221; with the following contents&#8230; class MY_Form_validation extends [...]]]></description>
			<content:encoded><![CDATA[<p>I have seen this question all over the web and am surprised that nobody has actually offered such a simple solution.</p>
<p>Anyway, here is a quick, simple and painless way to set CodeIgniter&#8217;s error delimiters (used by the Form_validation library) one time for your entire application. Create &#8220;application/libraries/MY_Form_validation.php&#8221; with the following contents&#8230;<span id="more-401"></span></p>
<pre>class MY_Form_validation extends CI_Form_validation {
    public function __construct()
    {
        parent::__construct();
        $this-&gt;_error_prefix    = '&lt;div class="ui-widget"&gt;&lt;div class="ui-state-error ui-corner-all" style="display: inline-block; padding: 2px 4px"&gt;&lt;span style="float: left; margin-right: 2px"&gt;&lt;/span&gt; ';
        $this-&gt;_error_suffix    = '&lt;/div&gt;&lt;/div&gt;';
    }
}</pre>
<p>No more setting the delimiters every time you load the Form_validation library!</p>
<p>You can still override the new delimiters by using<br />
<code><code>$this-&gt;form_validation-&gt;s</code>et_error_delimiters()</code><br />
in your controllers as needed.</p>
<p><strong>Note:</strong> If you&#8217;re curious about the HTML I used above, it was adapted from the <a href="http://jqueryui.com/themeroller/" target="_blank">jQueryUI &#8211; Themeroller</a> page source.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.robertmullaney.com/2011/08/21/change-codeigniters-form_validation-error-delimiters-globally/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Easily load multiple views with CodeIgniter</title>
		<link>http://www.robertmullaney.com/2011/08/20/easily-load-multiple-views-with-codeigniter/</link>
		<comments>http://www.robertmullaney.com/2011/08/20/easily-load-multiple-views-with-codeigniter/#comments</comments>
		<pubDate>Sat, 20 Aug 2011 15:57:29 +0000</pubDate>
		<dc:creator>Robert Mullaney</dc:creator>
				<category><![CDATA[Code Snippets]]></category>
		<category><![CDATA[codeigniter]]></category>
		<category><![CDATA[core]]></category>
		<category><![CDATA[extend]]></category>
		<category><![CDATA[views]]></category>

		<guid isPermaLink="false">http://www.robertmullaney.com/?p=390</guid>
		<description><![CDATA[It is not uncommon to load a common header, footer and other views in each controller. While this can be achieved like so&#8230; $this-&#62;load-&#62;view('header', $header_data); $this-&#62;load-&#62;view('content', $content_data); $this-&#62;load-&#62;view('footer', $footer_data); I wanted the ability to do the same thing with a single line of code. So I decided to extend the core Loader library by creating [...]]]></description>
			<content:encoded><![CDATA[<p>It is not uncommon to load a common header, footer and other views in each controller. While this can be achieved like so&#8230;</p>
<pre>$this-&gt;load-&gt;view('header', $header_data);
$this-&gt;load-&gt;view('content', $content_data);
$this-&gt;load-&gt;view('footer', $footer_data);</pre>
<p>I wanted the ability to do the same thing with a single line of code. So I decided to extend the core Loader library by creating &#8220;application/core/MY_Loader.php&#8221; with the following code&#8230;<span id="more-390"></span></p>
<pre>class MY_Loader extends CI_Loader {
    /**
     * Load Multiple Views
     *
     * This function is used to load multiple "view" files.  It has three parameters:
     *
     * 1. An array of the "view" file to be included.
     * 2. An associative array of data to be extracted for use in the views.
     * 3. TRUE/FALSE - whether to return the data or load it.  In
     * some cases it's advantageous to be able to return data so that
     * a developer can process it in some way.
     *
     * @access   public
     * @param    mixed
     * @param    array
     * @param    bool
     * @return   mixed
     */
    function multiview($view = array(), $vars = array(), $return = FALSE)
    {
        $return_value = '';
        if (is_array($view)) {
            foreach ($view as $current_index =&gt; $current_view) {
                $current_vars = $vars;
                if (is_array($vars[$current_index])) {
                    $current_vars = $vars[$current_index];
                }
                $result = $this-&gt;view($current_view, $current_vars, $return);
                if (is_string($result)) {
                    $return_value .= $result;
                }
            }
            return $result;
        } else {
            return $this-&gt;view($view, $vars, $return);
        }
    }
}
/* End of file MY_Loader.php */
/* Location: ./application/core/MY_Loader.php */</pre>
<p>Now I can load multiple views with a single call&#8230;</p>
<pre>$this-&gt;load-&gt;multiview(array('header','content','footer'), array($header_data, $content_data, $footer_data));</pre>
<p>Or simplify the call with all of the data combined (though CI technically does this in the core Loader anyhow).</p>
<pre>$this-&gt;load-&gt;multiview(array('header','content','footer'), $combined_data);</pre>
<p>Feel free to use my example in your own project or post up some questions/comments below <img src='http://www.robertmullaney.com/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>
<pre></pre>
]]></content:encoded>
			<wfw:commentRss>http://www.robertmullaney.com/2011/08/20/easily-load-multiple-views-with-codeigniter/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Disable browser cache easily with CodeIgniter</title>
		<link>http://www.robertmullaney.com/2011/08/13/disable-browser-cache-easily-with-codeigniter/</link>
		<comments>http://www.robertmullaney.com/2011/08/13/disable-browser-cache-easily-with-codeigniter/#comments</comments>
		<pubDate>Sat, 13 Aug 2011 17:50:23 +0000</pubDate>
		<dc:creator>Robert Mullaney</dc:creator>
				<category><![CDATA[Code Snippets]]></category>
		<category><![CDATA[cache]]></category>
		<category><![CDATA[codeigniter]]></category>
		<category><![CDATA[disable]]></category>
		<category><![CDATA[extend]]></category>
		<category><![CDATA[library]]></category>
		<category><![CDATA[output]]></category>
		<category><![CDATA[php]]></category>

		<guid isPermaLink="false">http://www.robertmullaney.com/?p=385</guid>
		<description><![CDATA[I have a project where users are validated by session data. When the user logs out I destroy the session and redirect them to the log-in page, but this does not prevent them from clicking the browser&#8217;s &#8220;back&#8221; button, in which case they still see the data. My first solution was to set headers with [...]]]></description>
			<content:encoded><![CDATA[<p>I have a project where users are validated by session data. When the user logs out I destroy the session and redirect them to the log-in page, but this does not prevent them from clicking the browser&#8217;s &#8220;back&#8221; button, in which case they still see the data.</p>
<p>My first solution was to set headers with PHP&#8217;s header() function. Then I decided to use CodeIgniter&#8217;s setheader() function from the Output library (no real difference, just using CI methods when possible). Finally, I decided the best way to do this would be to extend the Output library itself. This way I am not repeating multiple function calls in each controller. Here is end-result&#8230;<span id="more-385"></span></p>
<p>Create MY_Output.php in &#8220;application/libraries&#8221; containing the following code&#8230;</p>
<pre>&lt;?php  if ( ! defined('BASEPATH')) exit('No direct script access allowed');

class MY_Output extends CI_Output {

    function nocache()
    {
        $this-&gt;set_header('Expires: Sat, 26 Jul 1997 05:00:00 GMT');
        $this-&gt;set_header('Cache-Control: no-cache, no-store, must-revalidate, max-age=0');
        $this-&gt;set_header('Cache-Control: post-check=0, pre-check=0', FALSE);
        $this-&gt;set_header('Pragma: no-cache');
    }

}

/* End of File */</pre>
<p>Now, all you have to do is call the method with the following code before you send any data to the browser.</p>
<pre>$this-&gt;output-&gt;nocache();</pre>
<p>I usually place this in my controller&#8217;s constructor for pages where user validation is required.</p>
<p>Happy coding <img src='http://www.robertmullaney.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://www.robertmullaney.com/2011/08/13/disable-browser-cache-easily-with-codeigniter/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Reset fields to default values using jQuery</title>
		<link>http://www.robertmullaney.com/2011/07/14/reset-fields-to-default-values-using-jquery/</link>
		<comments>http://www.robertmullaney.com/2011/07/14/reset-fields-to-default-values-using-jquery/#comments</comments>
		<pubDate>Thu, 14 Jul 2011 17:27:05 +0000</pubDate>
		<dc:creator>Robert Mullaney</dc:creator>
				<category><![CDATA[Code Snippets]]></category>
		<category><![CDATA[forms]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[jquery]]></category>

		<guid isPermaLink="false">http://www.robertmullaney.com/?p=372</guid>
		<description><![CDATA[Have you ever wanted to reset only fields in a particular section of the form without resetting all of the fields? Here is how you can achieve this with jQuery $('#reset_address').click(function (event) { event.preventDefault(); $('#address_details :input').each(function() { if ($(this).is('select')) { $(this).val($(this).find('option[selected]').val()); } else { $(this).val(this.defaultValue); } }); }); #address_details represents a &#60;fieldset&#62; within my &#60;form&#62;. [...]]]></description>
			<content:encoded><![CDATA[<p>Have you ever wanted to reset only fields in a particular section of the form without resetting all of the fields?</p>
<p>Here is how you can achieve this with jQuery <img src='http://www.robertmullaney.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<pre>$('#reset_address').click(function (event) {
 event.preventDefault();
 $('#address_details :input').each(function() {
  if ($(this).is('select')) {
   $(this).val($(this).find('option[selected]').val());
  } else {
   $(this).val(this.defaultValue);
  }
 });
});</pre>
<p><em>#address_details</em> represents a <em>&lt;fieldset&gt;</em> within my <em>&lt;form&gt;</em>. When the user clicks the <em>#reset_address</em> link I revert the fields within the <em>&lt;fieldset&gt;</em> (not the entire form) back to their original values.</p>
<p>Note: <em>defaultValue</em> is a core <em>JavaScript</em> property. A conditional check for <em>&lt;select&gt;</em> was necessary since <em>defaultValue</em> only applies to <em>&lt;input&gt;</em> and <em>&lt;textarea&gt;</em> fields.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.robertmullaney.com/2011/07/14/reset-fields-to-default-values-using-jquery/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>My ultimate .htaccess file for CodeIgniter 2.0</title>
		<link>http://www.robertmullaney.com/2011/03/16/ultimate-htaccess-codeigniter/</link>
		<comments>http://www.robertmullaney.com/2011/03/16/ultimate-htaccess-codeigniter/#comments</comments>
		<pubDate>Wed, 16 Mar 2011 14:53:52 +0000</pubDate>
		<dc:creator>Robert Mullaney</dc:creator>
				<category><![CDATA[Code Snippets]]></category>
		<category><![CDATA[codeigniter]]></category>
		<category><![CDATA[htaccess]]></category>
		<category><![CDATA[mod_rewrite]]></category>

		<guid isPermaLink="false">http://www.robertmullaney.com/?p=368</guid>
		<description><![CDATA[#Initialize mod_rewrite RewriteEngine On RewriteBase / #Force "www" subdomain RewriteCond %{HTTP_HOST} !^www\. RewriteRule ^(.*)$ http://www.%{HTTP_HOST}/$1 [R=301,L] #Re-route forbidden urls RewriteCond %{REQUEST_URI} ^(system&#124;application).* [OR] RewriteRule ^(.*)$ index.php?/$1 [L] #Re-route urls if file/directory does not exist RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^(.*)$ index.php?/$1 [L]]]></description>
			<content:encoded><![CDATA[<pre>#Initialize mod_rewrite
RewriteEngine On
RewriteBase /

#Force "www" subdomain
RewriteCond %{HTTP_HOST} !^www\.
RewriteRule ^(.*)$ http://www.%{HTTP_HOST}/$1 [R=301,L]

#Re-route forbidden urls
RewriteCond %{REQUEST_URI} ^(system|application).* [OR]
RewriteRule ^(.*)$ index.php?/$1 [L]

#Re-route urls if file/directory does not exist
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php?/$1 [L]</pre>
]]></content:encoded>
			<wfw:commentRss>http://www.robertmullaney.com/2011/03/16/ultimate-htaccess-codeigniter/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>

