<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/rss2full.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.feedburner.com/~d/styles/itemcontent.css"?><rss 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/" xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" version="2.0">

<channel>
	<title>Chris Gmyr</title>
	
	<link>http://www.chrisgmyr.com</link>
	<description>Web Development, Business, and other cool stuff</description>
	<lastBuildDate>Sat, 17 Sep 2011 16:16:23 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" type="application/rss+xml" href="http://feeds.feedburner.com/chrisgmyr" /><feedburner:info uri="chrisgmyr" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com/" /><feedburner:emailServiceId>chrisgmyr</feedburner:emailServiceId><feedburner:feedburnerHostname>http://feedburner.google.com</feedburner:feedburnerHostname><item>
		<title>Batch renaming files in windows</title>
		<link>http://feedproxy.google.com/~r/chrisgmyr/~3/r-6IoF7GTpA/</link>
		<comments>http://www.chrisgmyr.com/2011/09/batch-renaming-files-in-windows/#comments</comments>
		<pubDate>Sat, 17 Sep 2011 16:16:23 +0000</pubDate>
		<dc:creator>Chris</dc:creator>
				<category><![CDATA[Random]]></category>
		<category><![CDATA[CMD]]></category>
		<category><![CDATA[REN]]></category>
		<category><![CDATA[Rename]]></category>

		<guid isPermaLink="false">http://www.chrisgmyr.com/?p=58</guid>
		<description><![CDATA[I always have clients sending me images and other assets for their web projects. Sometimes they send them over in a nice format, other times not so much. I&#8217;ve been using the REN command in windows to do a lot of the automated work. First you will want to CD (Change Directory) to the one [...]
No related posts.]]></description>
			<content:encoded><![CDATA[<p>I always have clients sending me images and other assets for their web projects. Sometimes they send them over in a nice format, other times not so much. I&#8217;ve been using the REN command in windows to do a lot of the automated work.<span id="more-58"></span></p>
<p>First you will want to CD (Change Directory) to the one that you want to work within. In windows 7 this is pretty easy, just hold down the SHIFT key and RIGHT click on the folder you want to work in. You will then see a &#8220;Open Command Window Here&#8221; option, or you can always just go to Run > cmd, then go to the specific directory.</p>
<p>The REN (Rename) command is pretty simple, it&#8217;s just:
<div class="hl-container">
<div class="hl-main">
<pre><span class="hl-code">REN oldname newname
REN old_image.jpg new_image.jpg</span></pre>
</div>
</div>
<p>You can also use * as a wildcard and ? for a space, as well as putting quotes around text.</p>
<h2>Change Uppercase Extension to Lowercase</h2>
<p>This is probably the most common one that I use. All of our websites we create all reference the lower case extension, our Linux box views uppercase and lowercase as different files, so if an uppercase one gets uploaded, it won&#8217;t show. So the simple command is just:
<div class="hl-container">
<div class="hl-main">
<pre><span class="hl-code">REN *.JPG *.jpg</span></pre>
</div>
</div>
<h2>Remove Certain Text</h2>
<p>One client sent me some files like: 0134-009_s1 copy.jpg, 0134-009_s2 copy.jpg, 0134-009_s3 copy.jpg, 0134-009_s4 copy.jpg, 0134-009_L1 copy.jpg, 0134-009_L2 copy.jpg, 0134-009_L3 copy.jpg, 0134-009_L4 copy.jpg. I had to remove the &#8221; copy&#8221; part of the file, and there were about 800 of these images with the same naming convention. Luckily they all had either 1-4 before the space and &#8220;copy&#8221; so I was able to use that to my benefit. 4 commends later, they were all renamed:
<div class="hl-container">
<div class="hl-main">
<pre><span class="hl-code">REN &quot;*1?copy.jpg&quot; *1.jpg
REN &quot;*2?copy.jpg&quot; *3.jpg
REN &quot;*3?copy.jpg&quot; *3.jpg
REN &quot;*4?copy.jpg&quot; *4.jpg</span></pre>
</div>
</div>
<p>This saves a bunch of time when you have a lot of files to rename. It sure beats manually renaming 800 files one by one. What other REN commands have you used?</p>
<p>No related posts.</p><img src="http://feeds.feedburner.com/~r/chrisgmyr/~4/r-6IoF7GTpA" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.chrisgmyr.com/2011/09/batch-renaming-files-in-windows/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		<feedburner:origLink>http://www.chrisgmyr.com/2011/09/batch-renaming-files-in-windows/</feedburner:origLink></item>
		<item>
		<title>Advertising Tip #1: Advertise!</title>
		<link>http://feedproxy.google.com/~r/chrisgmyr/~3/c-7DULmv1vA/</link>
		<comments>http://www.chrisgmyr.com/2011/09/advertising-tip-1-advertise/#comments</comments>
		<pubDate>Thu, 15 Sep 2011 15:37:38 +0000</pubDate>
		<dc:creator>Chris</dc:creator>
				<category><![CDATA[Business]]></category>
		<category><![CDATA[Advertising]]></category>
		<category><![CDATA[Marketing]]></category>

		<guid isPermaLink="false">http://www.chrisgmyr.com/?p=55</guid>
		<description><![CDATA[So as most of you probably know, I run a web design and development company, but we also deal with a lot of advertising on the web. SEO, PPC, Social Media to name a few. Around this time of year a lot of people want to redesign their site, make some changes, or do some [...]
No related posts.]]></description>
			<content:encoded><![CDATA[<p>So as most of you probably know, I run a <a href="http://www.modomediagroup.com" target="_blank">web design and development company</a>, but we also deal with a lot of advertising on the web. SEO, PPC, Social Media to name a few. Around this time of year a lot of people want to redesign their site, make some changes, or do some sort of advertising. <span id="more-55"></span>I started sending out some emails/notes to some clients that I haven&#8217;t heard from in a while to see if they would be interested in doing something for the upcoming holiday season. I was pretty surprised with some of the responses.</p>
<p>Yes, I understand this is still a down economy and times are tough for a lot of businesses. Yes, I understand it&#8217;s the end of the year and you might have used your website budget already. But, what I don&#8217;t understand is why business people don&#8217;t want to advertise MORE when times are tough. Let&#8217;s put this into perspective&#8230;</p>
<p>Your company sells widgets, and there are 4 other companies in your local area that also sells widgets similar to yours that you conciser your competition. The widget market has been down for the past few years with a few good spikes up here and there. Currently the 5 widget companies are just working off of referral and current customer business. Some of them might be doing small amounts of advertising themselves but not nearly enough and the results are questionable at best.</p>
<p>Now, let&#8217;s say that one of these widget companies (Company A) does do some significant advertising for the upcoming holiday season. Company A makes some changes to their website to make it more appealing for potential customers and have systems set up to convert visitors to customers. Company A looks at what keywords and phrases in the search engines that they want to go for (SEO). Company A looks at keywords and phrases that would be harder to get into within the next few months, and buy ads for those (PPC). Company A creates a social media campaign on Facebook, Twitter, and other sites to get the word out about their new products and special offers.</p>
<p>If you were in the market for a widget, which company would you go to? You&#8217;ve seen Company A online and visited their fresh looking and very informative website. You even have a 10% off coupon that they gave you from their Facebook page. Do you even know that there is a widget company Company B, C, D, and E? No, probably not. Even if you did know Company B, and went to their website, what would you see? Would you see that their blog hasn&#8217;t been updated since 2009 or that they still have an animated GIF as their main image? Who would you feel more comfortable with fulfilling your order?</p>
<p>My point is simply this &#8211; If everyone else is in the backseat &#8220;playing it safe&#8221;, why wouldn&#8217;t you want to jump ahead with little to no competition and reap the rewards? Your investment to do this work will be quickly forgotten once you see that you are now getting new customers, new orders, and getting better name recognition in the market place.</p>
<p>No related posts.</p><img src="http://feeds.feedburner.com/~r/chrisgmyr/~4/c-7DULmv1vA" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.chrisgmyr.com/2011/09/advertising-tip-1-advertise/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://www.chrisgmyr.com/2011/09/advertising-tip-1-advertise/</feedburner:origLink></item>
		<item>
		<title>Dynamically load modules, models, and configurations in Yii</title>
		<link>http://feedproxy.google.com/~r/chrisgmyr/~3/xTVscisYcb8/</link>
		<comments>http://www.chrisgmyr.com/2011/09/dynamically-load-modules-models-and-configurations-in-yii/#comments</comments>
		<pubDate>Mon, 12 Sep 2011 16:54:45 +0000</pubDate>
		<dc:creator>Chris</dc:creator>
				<category><![CDATA[Yii]]></category>
		<category><![CDATA[Admin]]></category>
		<category><![CDATA[Module]]></category>

		<guid isPermaLink="false">http://www.chrisgmyr.com/?p=40</guid>
		<description><![CDATA[As I stated in a previous post I have started to play around with the Yii Framework, and I really love it so far. I&#8217;m moving over from CodeIgniter, and even though the 2 frameworks are very different, I haven&#8217;t had too much trouble getting up and going with it. I have built a pretty [...]
No related posts.]]></description>
			<content:encoded><![CDATA[<p>As I stated in a <a href="http://www.chrisgmyr.com/2011/09/checking-out-the-yii-framework/" target="_blank">previous post</a> I have started to play around with the <a href="http://www.yiiframework.com/" target="_blank">Yii Framework</a>, and I really love it so far. I&#8217;m moving over from CodeIgniter, and even though the 2 frameworks are very different, I haven&#8217;t had too much trouble getting up and going with it. I have built a pretty large CMS on top of CI and I&#8217;m now working on porting that over to Yii. I&#8217;m trying to mimic as much as I had before without affecting the workflow that I had previously. So far so good.<span id="more-40"></span></p>
<p>What I had in CodeIgniter:</p>
<ul>
<li><a href="http://codeigniter.com" target="_blank">CodeIgniter 2.0.3</a></li>
<li><a href="https://bitbucket.org/wiredesignz/codeigniter-modular-extensions-hmvc/wiki/Home" target="_blank">HMVC</a></li>
<li>One main controller called &#8220;admin&#8221; to handle a few functions/pages</li>
<li>Everything else in application/modules</li>
</ul>
<p>In routes.php I had:</p>
<div class="hl-container">
<div class="hl-main">
<pre><span class="hl-inlinetags">&lt;?php</span><span class="hl-code">
</span><span class="hl-var">$route</span><span class="hl-brackets">[</span><span class="hl-quotes">'</span><span class="hl-string">admin/logout</span><span class="hl-quotes">'</span><span class="hl-brackets">]</span><span class="hl-code"> = </span><span class="hl-quotes">'</span><span class="hl-string">admin/logout</span><span class="hl-quotes">'</span><span class="hl-code">;
</span><span class="hl-var">$route</span><span class="hl-brackets">[</span><span class="hl-quotes">'</span><span class="hl-string">admin/forgot</span><span class="hl-quotes">'</span><span class="hl-brackets">]</span><span class="hl-code"> = </span><span class="hl-quotes">'</span><span class="hl-string">admin/forgot</span><span class="hl-quotes">'</span><span class="hl-code">;
</span><span class="hl-var">$route</span><span class="hl-brackets">[</span><span class="hl-quotes">'</span><span class="hl-string">admin/dashboard</span><span class="hl-quotes">'</span><span class="hl-brackets">]</span><span class="hl-code"> = </span><span class="hl-quotes">'</span><span class="hl-string">admin/dashboard</span><span class="hl-quotes">'</span><span class="hl-code">;
</span><span class="hl-var">$route</span><span class="hl-brackets">[</span><span class="hl-quotes">'</span><span class="hl-string">admin/([a-zA-Z_-]+)/(:any)</span><span class="hl-quotes">'</span><span class="hl-brackets">]</span><span class="hl-code"> = </span><span class="hl-quotes">'</span><span class="hl-string">$1/admin/$2</span><span class="hl-quotes">'</span><span class="hl-code">;
</span><span class="hl-var">$route</span><span class="hl-brackets">[</span><span class="hl-quotes">'</span><span class="hl-string">admin/([a-zA-Z_-]+)</span><span class="hl-quotes">'</span><span class="hl-brackets">]</span><span class="hl-code"> = </span><span class="hl-quotes">'</span><span class="hl-string">$1/admin/index</span><span class="hl-quotes">'</span><span class="hl-code">;
</span><span class="hl-var">$route</span><span class="hl-brackets">[</span><span class="hl-quotes">'</span><span class="hl-string">admin</span><span class="hl-quotes">'</span><span class="hl-brackets">]</span><span class="hl-code"> = </span><span class="hl-quotes">'</span><span class="hl-string">admin</span><span class="hl-quotes">'</span><span class="hl-code">;</span></pre>
</div>
</div>
<p>So if you go to domain.com/admin/users you would be in application/modules/users/controller/admin.php and anything like domain.com/admin/users/edit/1/ would work and find it&#8217;s place. On the front end there would be something like domain.com/users/view/1 which would go to application/modules/users/controller/users.php</p>
<p>Now moving over to Yii&#8230;<br />
1. Create &#8220;admin&#8221; controller in Gii with dashboard, logout, and forgot actions<br />
2. Create &#8220;user&#8221; module in Gii<br />
3. Create the following urlManager rules in /protected/config/main.php:</p>
<div class="hl-container">
<div class="hl-main">
<pre><span class="hl-inlinetags">&lt;?php</span><span class="hl-code">
</span><span class="hl-var">$config</span><span class="hl-code"> = </span><span class="hl-reserved">array</span><span class="hl-brackets">(</span><span class="hl-code">
    </span><span class="hl-quotes">'</span><span class="hl-string">components</span><span class="hl-quotes">'</span><span class="hl-code"> =&gt; </span><span class="hl-reserved">array</span><span class="hl-brackets">(</span><span class="hl-code">
        </span><span class="hl-quotes">'</span><span class="hl-string">urlManager</span><span class="hl-quotes">'</span><span class="hl-code"> =&gt; </span><span class="hl-reserved">array</span><span class="hl-brackets">(</span><span class="hl-code">
            </span><span class="hl-quotes">'</span><span class="hl-string">urlFormat</span><span class="hl-quotes">'</span><span class="hl-code"> =&gt; </span><span class="hl-quotes">'</span><span class="hl-string">path</span><span class="hl-quotes">'</span><span class="hl-code">,
            </span><span class="hl-quotes">'</span><span class="hl-string">showScriptName</span><span class="hl-quotes">'</span><span class="hl-code"> =&gt; </span><span class="hl-reserved">false</span><span class="hl-code">,
            </span><span class="hl-quotes">'</span><span class="hl-string">rules</span><span class="hl-quotes">'</span><span class="hl-code"> =&gt; </span><span class="hl-reserved">array</span><span class="hl-brackets">(</span><span class="hl-code">
                </span><span class="hl-comment">//</span><span class="hl-comment">admin rules</span><span class="hl-comment"></span><span class="hl-code">
                </span><span class="hl-quotes">'</span><span class="hl-string">admin/&lt;action:(dashboard|forgot|logout)&gt;</span><span class="hl-quotes">'</span><span class="hl-code"> =&gt; </span><span class="hl-quotes">'</span><span class="hl-string">admin/&lt;action&gt;</span><span class="hl-quotes">'</span><span class="hl-code">,
                </span><span class="hl-quotes">'</span><span class="hl-string">admin/&lt;module:\w+&gt;/&lt;action:\w+&gt;/&lt;id:\d+&gt;</span><span class="hl-quotes">'</span><span class="hl-code"> =&gt; </span><span class="hl-quotes">'</span><span class="hl-string">&lt;module&gt;/admin/&lt;action&gt;</span><span class="hl-quotes">'</span><span class="hl-code">,
                </span><span class="hl-quotes">'</span><span class="hl-string">admin/&lt;module:\w+&gt;/&lt;action:\w+&gt;</span><span class="hl-quotes">'</span><span class="hl-code"> =&gt; </span><span class="hl-quotes">'</span><span class="hl-string">&lt;module&gt;/admin/&lt;action&gt;</span><span class="hl-quotes">'</span><span class="hl-code">,
                </span><span class="hl-quotes">'</span><span class="hl-string">admin/&lt;module:\w+&gt;</span><span class="hl-quotes">'</span><span class="hl-code"> =&gt; </span><span class="hl-quotes">'</span><span class="hl-string">&lt;module&gt;/admin</span><span class="hl-quotes">'</span><span class="hl-code">,
            </span><span class="hl-brackets">)</span><span class="hl-code">,
        </span><span class="hl-brackets">)</span><span class="hl-code">,
</span><span class="hl-brackets">)</span><span class="hl-code">;</span></pre>
</div>
</div>
<p>4. Instead of just returning the config array, assign it to $config, and at the bottom of main.php enter:
<div class="hl-container">
<div class="hl-main">
<pre><span class="hl-code">return $config;</span></pre>
</div>
</div>
<p> Your basic webapp should work as it did before at this point.</p>
<p>5. In /protected/modules/user/controllers/DefaultController.php have something like:</p>
<div class="hl-container">
<div class="hl-main">
<pre><span class="hl-inlinetags">&lt;?php</span><span class="hl-code">
</span><span class="hl-reserved">class</span><span class="hl-code"> </span><span class="hl-identifier">DefaultController</span><span class="hl-code"> </span><span class="hl-reserved">extends</span><span class="hl-code"> </span><span class="hl-identifier">Controller</span><span class="hl-code"> </span><span class="hl-brackets">{</span><span class="hl-code">

    </span><span class="hl-reserved">public</span><span class="hl-code"> </span><span class="hl-reserved">function</span><span class="hl-code"> </span><span class="hl-identifier">actionIndex</span><span class="hl-brackets">(</span><span class="hl-brackets">)</span><span class="hl-code"> </span><span class="hl-brackets">{</span><span class="hl-code">
        </span><span class="hl-var">$this</span><span class="hl-code">-&gt;</span><span class="hl-identifier">render</span><span class="hl-brackets">(</span><span class="hl-quotes">'</span><span class="hl-string">index</span><span class="hl-quotes">'</span><span class="hl-brackets">)</span><span class="hl-code">;
    </span><span class="hl-brackets">}</span><span class="hl-code">

    </span><span class="hl-reserved">public</span><span class="hl-code"> </span><span class="hl-reserved">function</span><span class="hl-code"> </span><span class="hl-identifier">actionCreate</span><span class="hl-brackets">(</span><span class="hl-brackets">)</span><span class="hl-code"> </span><span class="hl-brackets">{</span><span class="hl-code">
        </span><span class="hl-reserved">die</span><span class="hl-brackets">(</span><span class="hl-quotes">'</span><span class="hl-string">this is default create</span><span class="hl-quotes">'</span><span class="hl-brackets">)</span><span class="hl-code">;
    </span><span class="hl-brackets">}</span><span class="hl-code">

    </span><span class="hl-reserved">public</span><span class="hl-code"> </span><span class="hl-reserved">function</span><span class="hl-code"> </span><span class="hl-identifier">actionEdit</span><span class="hl-brackets">(</span><span class="hl-var">$id</span><span class="hl-brackets">)</span><span class="hl-code"> </span><span class="hl-brackets">{</span><span class="hl-code">
        </span><span class="hl-reserved">die</span><span class="hl-brackets">(</span><span class="hl-quotes">'</span><span class="hl-string">this is default edit = </span><span class="hl-quotes">'</span><span class="hl-code">.</span><span class="hl-var">$id</span><span class="hl-brackets">)</span><span class="hl-code">;
    </span><span class="hl-brackets">}</span><span class="hl-code">

</span><span class="hl-brackets">}</span></pre>
</div>
</div>
<p>6. Copy that file and rename it &#8220;AdminController.php&#8221;, then just change the &#8220;default&#8221; text to &#8220;admin&#8221;:</p>
<div class="hl-container">
<div class="hl-main">
<pre><span class="hl-inlinetags">&lt;?php</span><span class="hl-code">
</span><span class="hl-reserved">class</span><span class="hl-code"> </span><span class="hl-identifier">AdminController</span><span class="hl-code"> </span><span class="hl-reserved">extends</span><span class="hl-code"> </span><span class="hl-identifier">Controller</span><span class="hl-code"> </span><span class="hl-brackets">{</span><span class="hl-code">

    </span><span class="hl-reserved">public</span><span class="hl-code"> </span><span class="hl-reserved">function</span><span class="hl-code"> </span><span class="hl-identifier">actionIndex</span><span class="hl-brackets">(</span><span class="hl-brackets">)</span><span class="hl-code"> </span><span class="hl-brackets">{</span><span class="hl-code">
        </span><span class="hl-var">$this</span><span class="hl-code">-&gt;</span><span class="hl-identifier">render</span><span class="hl-brackets">(</span><span class="hl-quotes">'</span><span class="hl-string">index</span><span class="hl-quotes">'</span><span class="hl-brackets">)</span><span class="hl-code">;
    </span><span class="hl-brackets">}</span><span class="hl-code">

    </span><span class="hl-reserved">public</span><span class="hl-code"> </span><span class="hl-reserved">function</span><span class="hl-code"> </span><span class="hl-identifier">actionCreate</span><span class="hl-brackets">(</span><span class="hl-brackets">)</span><span class="hl-code"> </span><span class="hl-brackets">{</span><span class="hl-code">
        </span><span class="hl-reserved">die</span><span class="hl-brackets">(</span><span class="hl-quotes">'</span><span class="hl-string">this is admin create</span><span class="hl-quotes">'</span><span class="hl-brackets">)</span><span class="hl-code">;
    </span><span class="hl-brackets">}</span><span class="hl-code">

    </span><span class="hl-reserved">public</span><span class="hl-code"> </span><span class="hl-reserved">function</span><span class="hl-code"> </span><span class="hl-identifier">actionEdit</span><span class="hl-brackets">(</span><span class="hl-var">$id</span><span class="hl-brackets">)</span><span class="hl-code"> </span><span class="hl-brackets">{</span><span class="hl-code">
        </span><span class="hl-reserved">die</span><span class="hl-brackets">(</span><span class="hl-quotes">'</span><span class="hl-string">this is admin edit = </span><span class="hl-quotes">'</span><span class="hl-code">. </span><span class="hl-var">$id</span><span class="hl-brackets">)</span><span class="hl-code">;
    </span><span class="hl-brackets">}</span><span class="hl-code">

</span><span class="hl-brackets">}</span></pre>
</div>
</div>
<p>7. Copy and rename /protected/modules/user/views/default to /protected/modules/user/views/admin for your admin only views.</p>
<p>8. Create a /protected/modules/user/config directory and add a main.php file with something like:</p>
<div class="hl-container">
<div class="hl-main">
<pre><span class="hl-inlinetags">&lt;?php</span><span class="hl-code">
</span><span class="hl-var">$module_name</span><span class="hl-code"> = </span><span class="hl-identifier">basename</span><span class="hl-brackets">(</span><span class="hl-identifier">dirname</span><span class="hl-brackets">(</span><span class="hl-identifier">dirname</span><span class="hl-brackets">(</span><span class="hl-reserved">__FILE__</span><span class="hl-brackets">)</span><span class="hl-brackets">)</span><span class="hl-brackets">)</span><span class="hl-code">;
</span><span class="hl-var">$default_controller</span><span class="hl-code"> = </span><span class="hl-quotes">'</span><span class="hl-string">default</span><span class="hl-quotes">'</span><span class="hl-code">;

</span><span class="hl-reserved">return</span><span class="hl-code"> </span><span class="hl-reserved">array</span><span class="hl-brackets">(</span><span class="hl-code">
    </span><span class="hl-quotes">'</span><span class="hl-string">import</span><span class="hl-quotes">'</span><span class="hl-code"> =&gt; </span><span class="hl-reserved">array</span><span class="hl-brackets">(</span><span class="hl-code">
        </span><span class="hl-quotes">'</span><span class="hl-string">application.modules.</span><span class="hl-quotes">'</span><span class="hl-code"> . </span><span class="hl-var">$module_name</span><span class="hl-code"> . </span><span class="hl-quotes">'</span><span class="hl-string">.models.*</span><span class="hl-quotes">'</span><span class="hl-code">,
    </span><span class="hl-brackets">)</span><span class="hl-code">,

    </span><span class="hl-quotes">'</span><span class="hl-string">modules</span><span class="hl-quotes">'</span><span class="hl-code"> =&gt; </span><span class="hl-reserved">array</span><span class="hl-brackets">(</span><span class="hl-code">
        </span><span class="hl-var">$module_name</span><span class="hl-code"> =&gt; </span><span class="hl-reserved">array</span><span class="hl-brackets">(</span><span class="hl-code">
            </span><span class="hl-quotes">'</span><span class="hl-string">defaultController</span><span class="hl-quotes">'</span><span class="hl-code"> =&gt; </span><span class="hl-var">$default_controller</span><span class="hl-code">,
        </span><span class="hl-brackets">)</span><span class="hl-code">,
    </span><span class="hl-brackets">)</span><span class="hl-code">,

    </span><span class="hl-quotes">'</span><span class="hl-string">components</span><span class="hl-quotes">'</span><span class="hl-code"> =&gt; </span><span class="hl-reserved">array</span><span class="hl-brackets">(</span><span class="hl-code">
        </span><span class="hl-quotes">'</span><span class="hl-string">urlManager</span><span class="hl-quotes">'</span><span class="hl-code"> =&gt; </span><span class="hl-reserved">array</span><span class="hl-brackets">(</span><span class="hl-code">
            </span><span class="hl-quotes">'</span><span class="hl-string">rules</span><span class="hl-quotes">'</span><span class="hl-code"> =&gt; </span><span class="hl-reserved">array</span><span class="hl-brackets">(</span><span class="hl-code">
                </span><span class="hl-var">$module_name</span><span class="hl-code"> . </span><span class="hl-quotes">'</span><span class="hl-string">/&lt;action:\w+&gt;/&lt;id:\d+&gt;</span><span class="hl-quotes">'</span><span class="hl-code"> =&gt; </span><span class="hl-var">$module_name</span><span class="hl-code"> . </span><span class="hl-quotes">'</span><span class="hl-string">/</span><span class="hl-quotes">'</span><span class="hl-code"> . </span><span class="hl-var">$default_controller</span><span class="hl-code"> . </span><span class="hl-quotes">'</span><span class="hl-string">/&lt;action&gt;</span><span class="hl-quotes">'</span><span class="hl-code">,
                </span><span class="hl-var">$module_name</span><span class="hl-code"> . </span><span class="hl-quotes">'</span><span class="hl-string">/&lt;action:\w+&gt;</span><span class="hl-quotes">'</span><span class="hl-code"> =&gt; </span><span class="hl-var">$module_name</span><span class="hl-code"> . </span><span class="hl-quotes">'</span><span class="hl-string">/</span><span class="hl-quotes">'</span><span class="hl-code"> . </span><span class="hl-var">$default_controller</span><span class="hl-code"> . </span><span class="hl-quotes">'</span><span class="hl-string">/&lt;action&gt;</span><span class="hl-quotes">'</span><span class="hl-code">,
            </span><span class="hl-brackets">)</span><span class="hl-code">,
        </span><span class="hl-brackets">)</span><span class="hl-code">,
    </span><span class="hl-brackets">)</span><span class="hl-code">,
</span><span class="hl-brackets">)</span><span class="hl-code">;</span></pre>
</div>
</div>
<p> and you can add more rules and config settings if you want&#8230;</p>
<p>9. Go back to your /protected/config/main.php file and right before you return $config, add this:</p>
<div class="hl-container">
<div class="hl-main">
<pre><span class="hl-inlinetags">&lt;?php</span><span class="hl-code">
</span><span class="hl-var">$modules_dir</span><span class="hl-code"> = </span><span class="hl-identifier">dirname</span><span class="hl-brackets">(</span><span class="hl-identifier">dirname</span><span class="hl-brackets">(</span><span class="hl-reserved">__FILE__</span><span class="hl-brackets">)</span><span class="hl-brackets">)</span><span class="hl-code"> . </span><span class="hl-reserved">DIRECTORY_SEPARATOR</span><span class="hl-code"> . </span><span class="hl-quotes">'</span><span class="hl-string">modules</span><span class="hl-quotes">'</span><span class="hl-code"> . </span><span class="hl-reserved">DIRECTORY_SEPARATOR</span><span class="hl-code">;
</span><span class="hl-var">$handle</span><span class="hl-code"> = </span><span class="hl-identifier">opendir</span><span class="hl-brackets">(</span><span class="hl-var">$modules_dir</span><span class="hl-brackets">)</span><span class="hl-code">;
</span><span class="hl-reserved">while</span><span class="hl-code"> </span><span class="hl-brackets">(</span><span class="hl-reserved">false</span><span class="hl-code"> !== </span><span class="hl-brackets">(</span><span class="hl-var">$file</span><span class="hl-code"> = </span><span class="hl-identifier">readdir</span><span class="hl-brackets">(</span><span class="hl-var">$handle</span><span class="hl-brackets">)</span><span class="hl-brackets">)</span><span class="hl-brackets">)</span><span class="hl-code"> </span><span class="hl-brackets">{</span><span class="hl-code">
    </span><span class="hl-reserved">if</span><span class="hl-code"> </span><span class="hl-brackets">(</span><span class="hl-var">$file</span><span class="hl-code"> != </span><span class="hl-quotes">&quot;</span><span class="hl-string">.</span><span class="hl-quotes">&quot;</span><span class="hl-code"> &amp;&amp; </span><span class="hl-var">$file</span><span class="hl-code"> != </span><span class="hl-quotes">&quot;</span><span class="hl-string">..</span><span class="hl-quotes">&quot;</span><span class="hl-code"> &amp;&amp; </span><span class="hl-identifier">is_dir</span><span class="hl-brackets">(</span><span class="hl-var">$modules_dir</span><span class="hl-code"> . </span><span class="hl-var">$file</span><span class="hl-brackets">)</span><span class="hl-brackets">)</span><span class="hl-code"> </span><span class="hl-brackets">{</span><span class="hl-code">
        </span><span class="hl-var">$config</span><span class="hl-code"> = </span><span class="hl-identifier">CMap</span><span class="hl-code">::</span><span class="hl-identifier">mergeArray</span><span class="hl-brackets">(</span><span class="hl-var">$config</span><span class="hl-code">, </span><span class="hl-reserved">require</span><span class="hl-brackets">(</span><span class="hl-var">$modules_dir</span><span class="hl-code"> . </span><span class="hl-var">$file</span><span class="hl-code"> . </span><span class="hl-reserved">DIRECTORY_SEPARATOR</span><span class="hl-code"> . </span><span class="hl-quotes">'</span><span class="hl-string">config</span><span class="hl-quotes">'</span><span class="hl-code"> . </span><span class="hl-reserved">DIRECTORY_SEPARATOR</span><span class="hl-code"> . </span><span class="hl-quotes">'</span><span class="hl-string">main.php</span><span class="hl-quotes">'</span><span class="hl-brackets">)</span><span class="hl-brackets">)</span><span class="hl-code">;
    </span><span class="hl-brackets">}</span><span class="hl-code">
</span><span class="hl-brackets">}</span><span class="hl-code">
</span><span class="hl-identifier">closedir</span><span class="hl-brackets">(</span><span class="hl-var">$handle</span><span class="hl-brackets">)</span><span class="hl-code">;</span></pre>
</div>
</div>
<p> which will scan your modules directory and automatically add your module config to the main application config array.</p>
<p>Now you can have nice admin URLs that correspond with your modules: domain.com/admin, domain.com/admin/dashboard, domain.com/admin/user/create, domain.com/admin/user/edit/1 , domain.com/user/create, domain.com/user/edit/1 (instead of domain.com/user/default/edit/1 &#8211; you do not want &#8220;default&#8221; in the URL)</p>
<p>Note 1: You want to make sure you load the URL rules at the bootstrap so your whole application knows to redirect your module to the &#8220;default&#8221; controller without stating it. If you use the UserModule.php init() it will NOT work since you will already have to be in the module to load those rules, by that time it&#8217;s too late and you will get an error.</p>
<p>Note 2: You will obviously not want to use domain.com/user/create or domain.com/user/edit/1 on the front end of your site. I just put those as examples to show that everything is working.</p>
<p>Note 3: By adding the import statement for each module model you can now access all of your models throughout your whole application and other modules like:
<div class="hl-container">
<div class="hl-main">
<pre><span class="hl-code">$model = User::model()-&gt;findByPK(1);</span></pre>
</div>
</div>
<p>I hope this helps some people who are looking to move over to Yii from CodeIgniter.</p>
<p>No related posts.</p><img src="http://feeds.feedburner.com/~r/chrisgmyr/~4/xTVscisYcb8" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.chrisgmyr.com/2011/09/dynamically-load-modules-models-and-configurations-in-yii/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://www.chrisgmyr.com/2011/09/dynamically-load-modules-models-and-configurations-in-yii/</feedburner:origLink></item>
		<item>
		<title>Checking out the Yii Framework</title>
		<link>http://feedproxy.google.com/~r/chrisgmyr/~3/8xdBsHyNDhc/</link>
		<comments>http://www.chrisgmyr.com/2011/09/checking-out-the-yii-framework/#comments</comments>
		<pubDate>Fri, 09 Sep 2011 12:55:03 +0000</pubDate>
		<dc:creator>Chris</dc:creator>
				<category><![CDATA[Yii]]></category>
		<category><![CDATA[CodeIgniter]]></category>
		<category><![CDATA[Framework]]></category>
		<category><![CDATA[PHP]]></category>

		<guid isPermaLink="false">http://www.chrisgmyr.com/?p=35</guid>
		<description><![CDATA[Sorry, I know that I haven&#8217;t posted in a while. I&#8217;ve just been pretty busy with client projects, personal projects, music, stuff around the house, and general &#8220;summer&#8221; stuff. I&#8217;m going to try to make it a point to write some more in the very near future. For the past few months I&#8217;ve been keeping [...]
No related posts.]]></description>
			<content:encoded><![CDATA[<p>Sorry, I know that I haven&#8217;t posted in a while. I&#8217;ve just been pretty busy with client projects, personal projects, music, stuff around the house, and general &#8220;summer&#8221; stuff. I&#8217;m going to try to make it a point to write some more in the very near future.<span id="more-35"></span></p>
<p>For the past few months I&#8217;ve been keeping my eye on the <a href="http://www.yiiframework.com/" target="_blank">Yii framework</a>. I&#8217;ve read a lot of great reviews of it and a lot of developers of all levels really like it a lot. I started looking into it more over the past week or so and started playing around with it. Between going through the <a href="http://www.yiiframework.com/screencasts/" target="_blank">video tutorials</a> and their <a href="http://www.yiiframework.com/doc/guide/" target="_blank">intro guide</a>, it&#8217;s very easy to see that this framework is VERY powerful. I immediately saw a huge (positive) difference between Yii and CodeIgniter, which I have been using for the past 5 years or so.</p>
<p>CodeIgniter has been great to me, but I think it&#8217;s time to move on. It was very easy to learn and the community has been fairly helpful over the time that I&#8217;ve been with the framework. I feel that it hasn&#8217;t been moving forward fast enough compared to other frameworks and the &#8220;large scale&#8221; features are lacking. I&#8217;ll still be maintaining my current CI sites and scripts, but I&#8217;ve pretty much decided to move over to Yii.</p>
<p>I have a good deal of work ahead of my in order to port all of my CI code over to Yii, but it will be worth it once I&#8217;m done. Over the past week I&#8217;ve hit some bumps in the road trying to get Yii to function similarly to what I have in CI, but it&#8217;s coming along. I should have a lot of great posts soon about what I&#8217;m working on. In the mean time, here are some great pro&#8217;s of the Yii framework:</p>
<ul>
<li>Full MVC design with PHP 5 support</li>
<li>Database Access Objects (DAO), Query Builder, Active Record, DB Migration</li>
<li>AJAX-enabled widgets</li>
<li>Authentication and authorization</li>
<li>Skinning and theming</li>
<li>Layered caching scheme</li>
<li>Automatic code generation</li>
<li>Great Security</li>
<li>Super <a href="http://www.yiiframework.com/performance/" target="_blank">Performance</a>!</li>
<li>and much, much more.</li>
</ul>
<p>Please stay tuned for more Yii blog posts. If you want to know anything specific about converting your CodeIgniter site to Yii, please leave a comment and let me know about it.</p>
<p>No related posts.</p><img src="http://feeds.feedburner.com/~r/chrisgmyr/~4/8xdBsHyNDhc" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.chrisgmyr.com/2011/09/checking-out-the-yii-framework/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		<feedburner:origLink>http://www.chrisgmyr.com/2011/09/checking-out-the-yii-framework/</feedburner:origLink></item>
		<item>
		<title>Easy Password Handling in PHP</title>
		<link>http://feedproxy.google.com/~r/chrisgmyr/~3/2h3wSMlfkzA/</link>
		<comments>http://www.chrisgmyr.com/2011/05/easy-password-handling-in-php/#comments</comments>
		<pubDate>Wed, 18 May 2011 16:00:07 +0000</pubDate>
		<dc:creator>Chris</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[Password]]></category>
		<category><![CDATA[Security]]></category>

		<guid isPermaLink="false">http://www.chrisgmyr.com/?p=30</guid>
		<description><![CDATA[There are many ways to handle passwords in your application, and a lot of different thoughts on it. You want to make sure your users are protected, but you also want to make sure that you are able to easily work with the data through the application. Here is how I handle passwords. Let&#8217;s start [...]
Related posts:<ol>
<li><a href='http://www.chrisgmyr.com/2011/04/encrypt-and-decrypt-secure-data-with-php/' rel='bookmark' title='Encrypt/Decrypt Secure Data with PHP'>Encrypt/Decrypt Secure Data with PHP</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>There are many ways to handle passwords in your application, and a lot of different thoughts on it. You want to make sure your users are protected, but you also want to make sure that you are able to easily work with the data through the application. Here is how I handle passwords.<span id="more-30"></span></p>
<p><strong>Let&#8217;s start with the basic functions:</strong></p>
<div class="hl-container">
<div class="hl-main">
<pre><span class="hl-inlinetags">&lt;?php</span><span class="hl-code">
</span><span class="hl-reserved">function</span><span class="hl-code"> </span><span class="hl-identifier">pass_rand</span><span class="hl-brackets">(</span><span class="hl-var">$min</span><span class="hl-code"> = </span><span class="hl-reserved">null</span><span class="hl-code">, </span><span class="hl-var">$max</span><span class="hl-code"> = </span><span class="hl-reserved">null</span><span class="hl-brackets">)</span><span class="hl-code">
</span><span class="hl-brackets">{</span><span class="hl-code">
    </span><span class="hl-reserved">static</span><span class="hl-code"> </span><span class="hl-var">$seeded</span><span class="hl-code">;

    </span><span class="hl-reserved">if</span><span class="hl-brackets">(</span><span class="hl-code">!</span><span class="hl-reserved">isset</span><span class="hl-brackets">(</span><span class="hl-var">$seeded</span><span class="hl-brackets">)</span><span class="hl-brackets">)</span><span class="hl-code">
    </span><span class="hl-brackets">{</span><span class="hl-code">
        </span><span class="hl-identifier">mt_srand</span><span class="hl-brackets">(</span><span class="hl-brackets">(</span><span class="hl-identifier">double</span><span class="hl-brackets">)</span><span class="hl-identifier">microtime</span><span class="hl-brackets">(</span><span class="hl-brackets">)</span><span class="hl-code">*</span><span class="hl-number">1000000</span><span class="hl-brackets">)</span><span class="hl-code">;
        </span><span class="hl-var">$seeded</span><span class="hl-code"> = </span><span class="hl-reserved">true</span><span class="hl-code">;
    </span><span class="hl-brackets">}</span><span class="hl-code">

    </span><span class="hl-reserved">if</span><span class="hl-brackets">(</span><span class="hl-reserved">isset</span><span class="hl-brackets">(</span><span class="hl-var">$min</span><span class="hl-brackets">)</span><span class="hl-code"> &amp;&amp; </span><span class="hl-reserved">isset</span><span class="hl-brackets">(</span><span class="hl-var">$max</span><span class="hl-brackets">)</span><span class="hl-brackets">)</span><span class="hl-code">
    </span><span class="hl-brackets">{</span><span class="hl-code">
        </span><span class="hl-reserved">if</span><span class="hl-brackets">(</span><span class="hl-var">$min</span><span class="hl-code"> &gt;= </span><span class="hl-var">$max</span><span class="hl-brackets">)</span><span class="hl-code">
        </span><span class="hl-brackets">{</span><span class="hl-code">
            </span><span class="hl-reserved">return</span><span class="hl-code"> </span><span class="hl-var">$min</span><span class="hl-code">;
        </span><span class="hl-brackets">}</span><span class="hl-code">
        </span><span class="hl-reserved">else</span><span class="hl-code">
        </span><span class="hl-brackets">{</span><span class="hl-code">
            </span><span class="hl-reserved">return</span><span class="hl-code"> </span><span class="hl-identifier">mt_rand</span><span class="hl-brackets">(</span><span class="hl-var">$min</span><span class="hl-code">, </span><span class="hl-var">$max</span><span class="hl-brackets">)</span><span class="hl-code">;
        </span><span class="hl-brackets">}</span><span class="hl-code">
    </span><span class="hl-brackets">}</span><span class="hl-code">
    </span><span class="hl-reserved">else</span><span class="hl-code">
    </span><span class="hl-brackets">{</span><span class="hl-code">
        </span><span class="hl-reserved">return</span><span class="hl-code"> </span><span class="hl-identifier">mt_rand</span><span class="hl-brackets">(</span><span class="hl-brackets">)</span><span class="hl-code">;
    </span><span class="hl-brackets">}</span><span class="hl-code">
</span><span class="hl-brackets">}</span><span class="hl-code">

</span><span class="hl-reserved">function</span><span class="hl-code"> </span><span class="hl-identifier">validate_password</span><span class="hl-brackets">(</span><span class="hl-var">$plain</span><span class="hl-code">, </span><span class="hl-var">$encrypted</span><span class="hl-brackets">)</span><span class="hl-code">
</span><span class="hl-brackets">{</span><span class="hl-code">
    </span><span class="hl-var">$stack</span><span class="hl-code"> = </span><span class="hl-identifier">explode</span><span class="hl-brackets">(</span><span class="hl-quotes">'</span><span class="hl-string">:</span><span class="hl-quotes">'</span><span class="hl-code">, </span><span class="hl-var">$encrypted</span><span class="hl-brackets">)</span><span class="hl-code">;

    </span><span class="hl-reserved">if</span><span class="hl-brackets">(</span><span class="hl-identifier">sizeof</span><span class="hl-brackets">(</span><span class="hl-var">$stack</span><span class="hl-brackets">)</span><span class="hl-code"> != </span><span class="hl-number">2</span><span class="hl-brackets">)</span><span class="hl-code"> </span><span class="hl-reserved">return</span><span class="hl-code"> </span><span class="hl-reserved">false</span><span class="hl-code">;

    </span><span class="hl-reserved">if</span><span class="hl-brackets">(</span><span class="hl-identifier">md5</span><span class="hl-brackets">(</span><span class="hl-var">$stack</span><span class="hl-brackets">[</span><span class="hl-number">1</span><span class="hl-brackets">]</span><span class="hl-code">.</span><span class="hl-var">$plain</span><span class="hl-brackets">)</span><span class="hl-code"> == </span><span class="hl-var">$stack</span><span class="hl-brackets">[</span><span class="hl-number">0</span><span class="hl-brackets">]</span><span class="hl-brackets">)</span><span class="hl-code">
    </span><span class="hl-brackets">{</span><span class="hl-code">
        </span><span class="hl-reserved">return</span><span class="hl-code"> </span><span class="hl-reserved">true</span><span class="hl-code">;
    </span><span class="hl-brackets">}</span><span class="hl-code">

    </span><span class="hl-reserved">return</span><span class="hl-code"> </span><span class="hl-reserved">false</span><span class="hl-code">;
</span><span class="hl-brackets">}</span><span class="hl-code">

</span><span class="hl-reserved">function</span><span class="hl-code"> </span><span class="hl-identifier">encrypt_password</span><span class="hl-brackets">(</span><span class="hl-var">$plain</span><span class="hl-brackets">)</span><span class="hl-code">
</span><span class="hl-brackets">{</span><span class="hl-code">
    </span><span class="hl-var">$password</span><span class="hl-code"> = </span><span class="hl-quotes">'</span><span class="hl-quotes">'</span><span class="hl-code">;

    </span><span class="hl-reserved">for</span><span class="hl-brackets">(</span><span class="hl-var">$i</span><span class="hl-code">=</span><span class="hl-number">0</span><span class="hl-code">; </span><span class="hl-var">$i</span><span class="hl-code">&lt;</span><span class="hl-number">10</span><span class="hl-code">; </span><span class="hl-var">$i</span><span class="hl-code">++</span><span class="hl-brackets">)</span><span class="hl-code">
    </span><span class="hl-brackets">{</span><span class="hl-code">
        </span><span class="hl-var">$password</span><span class="hl-code"> .= </span><span class="hl-identifier">pass_rand</span><span class="hl-brackets">(</span><span class="hl-brackets">)</span><span class="hl-code">;
    </span><span class="hl-brackets">}</span><span class="hl-code">

    </span><span class="hl-var">$salt</span><span class="hl-code"> = </span><span class="hl-identifier">substr</span><span class="hl-brackets">(</span><span class="hl-identifier">md5</span><span class="hl-brackets">(</span><span class="hl-var">$password</span><span class="hl-brackets">)</span><span class="hl-code">, </span><span class="hl-number">0</span><span class="hl-code">, </span><span class="hl-number">2</span><span class="hl-brackets">)</span><span class="hl-code">;

    </span><span class="hl-var">$password</span><span class="hl-code"> = </span><span class="hl-identifier">md5</span><span class="hl-brackets">(</span><span class="hl-var">$salt</span><span class="hl-code">.</span><span class="hl-var">$plain</span><span class="hl-brackets">)</span><span class="hl-code">.</span><span class="hl-quotes">'</span><span class="hl-string">:</span><span class="hl-quotes">'</span><span class="hl-code">.</span><span class="hl-var">$salt</span><span class="hl-code">;

    </span><span class="hl-reserved">return</span><span class="hl-code"> </span><span class="hl-var">$password</span><span class="hl-code">;
</span><span class="hl-brackets">}</span></pre>
</div>
</div>
<p>After your user registers you will need to encrypt and save their password to your database. You can easily do this by sending their password to the encrypt_password() function:</p>
<div class="hl-container">
<div class="hl-main">
<pre><span class="hl-inlinetags">&lt;?php</span><span class="hl-code">

</span><span class="hl-var">$new_password</span><span class="hl-code"> = </span><span class="hl-identifier">encrypt_password</span><span class="hl-brackets">(</span><span class="hl-var">$_POST</span><span class="hl-brackets">[</span><span class="hl-quotes">'</span><span class="hl-string">password</span><span class="hl-quotes">'</span><span class="hl-brackets">]</span><span class="hl-brackets">)</span><span class="hl-code">;

</span><span class="hl-comment">//</span><span class="hl-comment">&quot;password123&quot; becomes something like &quot;3be870c699b09266b3b86c98aeb31022:43&quot;</span><span class="hl-comment"></span></pre>
</div>
</div>
<p>When your user tries to log into your application you will need to do some initial validation to get their record from the database, but the result will look something similar to:</p>
<div class="hl-container">
<div class="hl-main">
<pre><span class="hl-inlinetags">&lt;?php</span><span class="hl-code">

</span><span class="hl-var">$sql</span><span class="hl-code"> = </span><span class="hl-quotes">&quot;</span><span class="hl-string">SELECT `id`, `password` FROM `users` WHERE `email` = </span><span class="hl-quotes">&quot;</span><span class="hl-code">.</span><span class="hl-identifier">mysql_escape_string</span><span class="hl-brackets">(</span><span class="hl-var">$_POST</span><span class="hl-brackets">[</span><span class="hl-quotes">'</span><span class="hl-string">email</span><span class="hl-quotes">'</span><span class="hl-brackets">]</span><span class="hl-brackets">)</span><span class="hl-code">;
</span><span class="hl-var">$result</span><span class="hl-code"> = </span><span class="hl-identifier">mysql_query</span><span class="hl-brackets">(</span><span class="hl-var">$sql</span><span class="hl-brackets">)</span><span class="hl-code">;
</span><span class="hl-var">$row</span><span class="hl-code"> = </span><span class="hl-identifier">mysql_fetch_row</span><span class="hl-brackets">(</span><span class="hl-var">$result</span><span class="hl-brackets">)</span><span class="hl-code">;
</span><span class="hl-reserved">if</span><span class="hl-brackets">(</span><span class="hl-identifier">validate_password</span><span class="hl-brackets">(</span><span class="hl-var">$_POST</span><span class="hl-brackets">[</span><span class="hl-quotes">'</span><span class="hl-string">password</span><span class="hl-quotes">'</span><span class="hl-brackets">]</span><span class="hl-code">, </span><span class="hl-var">$row</span><span class="hl-brackets">[</span><span class="hl-quotes">'</span><span class="hl-string">password</span><span class="hl-quotes">'</span><span class="hl-brackets">]</span><span class="hl-brackets">)</span><span class="hl-brackets">)</span><span class="hl-code">
</span><span class="hl-brackets">{</span><span class="hl-code">
    </span><span class="hl-comment">//</span><span class="hl-comment">continue with login process</span><span class="hl-comment"></span><span class="hl-code">
</span><span class="hl-brackets">}</span><span class="hl-code">
</span><span class="hl-reserved">else</span><span class="hl-code">
</span><span class="hl-brackets">{</span><span class="hl-code">
    </span><span class="hl-reserved">die</span><span class="hl-brackets">(</span><span class="hl-quotes">'</span><span class="hl-string">Login Failed</span><span class="hl-quotes">'</span><span class="hl-brackets">)</span><span class="hl-code">;
</span><span class="hl-brackets">}</span></pre>
</div>
</div>
<p>And that&#8217;s pretty much it. Easy right?</p>
<p>Note: You will want to do a lot more security checking than this especially with the database interaction. This is only for demonstration ;) I recommend you use a solid framework like <a href="http://codeigniter.com">CodeIgniter</a> which has a lot already built into it.</p>
<p>Related posts:<ol>
<li><a href='http://www.chrisgmyr.com/2011/04/encrypt-and-decrypt-secure-data-with-php/' rel='bookmark' title='Encrypt/Decrypt Secure Data with PHP'>Encrypt/Decrypt Secure Data with PHP</a></li>
</ol></p><img src="http://feeds.feedburner.com/~r/chrisgmyr/~4/2h3wSMlfkzA" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.chrisgmyr.com/2011/05/easy-password-handling-in-php/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		<feedburner:origLink>http://www.chrisgmyr.com/2011/05/easy-password-handling-in-php/</feedburner:origLink></item>
		<item>
		<title>Encrypt/Decrypt Secure Data with PHP</title>
		<link>http://feedproxy.google.com/~r/chrisgmyr/~3/w3BAH0afh2Q/</link>
		<comments>http://www.chrisgmyr.com/2011/04/encrypt-and-decrypt-secure-data-with-php/#comments</comments>
		<pubDate>Tue, 05 Apr 2011 12:30:53 +0000</pubDate>
		<dc:creator>Chris</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[mcrypt]]></category>
		<category><![CDATA[Security]]></category>

		<guid isPermaLink="false">http://www.chrisgmyr.com/?p=20</guid>
		<description><![CDATA[Mcrypt is a very powerful library in PHP that can give you a number of ways to encrypt then decrypt data in a secure way. If you need to keep sensitive data in your database like credit cards, social security numbers, bank account numbers, etc &#8211; this library is a must for you. Let&#8217;s start [...]
No related posts.]]></description>
			<content:encoded><![CDATA[<p>Mcrypt is a very powerful library in PHP that can give you a number of ways to encrypt then decrypt data in a secure way. If you need to keep sensitive data in your database like credit cards, social security numbers, bank account numbers, etc &#8211; this library is a must for you.<span id="more-20"></span></p>
<p><strong>Let&#8217;s start with the basic functions:</strong></p>
<div class="hl-container">
<div class="hl-main">
<pre><span class="hl-inlinetags">&lt;?php</span><span class="hl-code">
</span><span class="hl-reserved">function</span><span class="hl-code"> </span><span class="hl-identifier">encrypt_text</span><span class="hl-brackets">(</span><span class="hl-var">$value</span><span class="hl-brackets">)</span><span class="hl-code">
</span><span class="hl-brackets">{</span><span class="hl-code">
   </span><span class="hl-reserved">if</span><span class="hl-brackets">(</span><span class="hl-code">!</span><span class="hl-var">$value</span><span class="hl-brackets">)</span><span class="hl-code"> </span><span class="hl-reserved">return</span><span class="hl-code"> </span><span class="hl-reserved">false</span><span class="hl-code">;

   </span><span class="hl-var">$crypttext</span><span class="hl-code"> = </span><span class="hl-identifier">mcrypt_encrypt</span><span class="hl-brackets">(</span><span class="hl-identifier">MCRYPT_RIJNDAEL_256</span><span class="hl-code">, </span><span class="hl-quotes">'</span><span class="hl-string">SECURE_STRING_1</span><span class="hl-quotes">'</span><span class="hl-code">, </span><span class="hl-var">$value</span><span class="hl-code">, </span><span class="hl-identifier">MCRYPT_MODE_ECB</span><span class="hl-code">, </span><span class="hl-quotes">'</span><span class="hl-string">SECURE_STRING_2</span><span class="hl-quotes">'</span><span class="hl-brackets">)</span><span class="hl-code">;
   </span><span class="hl-reserved">return</span><span class="hl-code"> </span><span class="hl-identifier">trim</span><span class="hl-brackets">(</span><span class="hl-identifier">base64_encode</span><span class="hl-brackets">(</span><span class="hl-var">$crypttext</span><span class="hl-brackets">)</span><span class="hl-brackets">)</span><span class="hl-code">;
</span><span class="hl-brackets">}</span><span class="hl-code">

</span><span class="hl-reserved">function</span><span class="hl-code"> </span><span class="hl-identifier">decrypt_text</span><span class="hl-brackets">(</span><span class="hl-var">$value</span><span class="hl-brackets">)</span><span class="hl-code">
</span><span class="hl-brackets">{</span><span class="hl-code">
   </span><span class="hl-reserved">if</span><span class="hl-brackets">(</span><span class="hl-code">!</span><span class="hl-var">$value</span><span class="hl-brackets">)</span><span class="hl-code"> </span><span class="hl-reserved">return</span><span class="hl-code"> </span><span class="hl-reserved">false</span><span class="hl-code">;

   </span><span class="hl-var">$crypttext</span><span class="hl-code"> = </span><span class="hl-identifier">base64_decode</span><span class="hl-brackets">(</span><span class="hl-var">$value</span><span class="hl-brackets">)</span><span class="hl-code">;
   </span><span class="hl-var">$decrypttext</span><span class="hl-code"> = </span><span class="hl-identifier">mcrypt_decrypt</span><span class="hl-brackets">(</span><span class="hl-identifier">MCRYPT_RIJNDAEL_256</span><span class="hl-code">, </span><span class="hl-quotes">'</span><span class="hl-string">SECURE_STRING_1</span><span class="hl-quotes">'</span><span class="hl-code">, </span><span class="hl-var">$crypttext</span><span class="hl-code">, </span><span class="hl-identifier">MCRYPT_MODE_ECB</span><span class="hl-code">, </span><span class="hl-quotes">'</span><span class="hl-string">SECURE_STRING_2</span><span class="hl-quotes">'</span><span class="hl-brackets">)</span><span class="hl-code">;
   </span><span class="hl-reserved">return</span><span class="hl-code"> </span><span class="hl-identifier">trim</span><span class="hl-brackets">(</span><span class="hl-var">$decrypttext</span><span class="hl-brackets">)</span><span class="hl-code">;
</span><span class="hl-brackets">}</span></pre>
</div>
</div>
<p>In addition to using the <a href="http://us.php.net/mcrypt">mcrypt</a> library we are also going to use the base64 encode/decode functions for an extra level of protection. You will want to choose 2 random string values before you run these and update <strong>SECURE_STRING_1</strong> and <strong>SECURE_STRING_2</strong>. You want to make sure these are the same every time you call these functions or else these will not encrypt/decrypt correctly. Once you have updated these values, you can test using something like this:</p>
<div class="hl-container">
<div class="hl-main">
<pre><span class="hl-inlinetags">&lt;?php</span><span class="hl-code">
</span><span class="hl-var">$my_credit_card</span><span class="hl-code"> = </span><span class="hl-quotes">'</span><span class="hl-string">5105105105105100</span><span class="hl-quotes">'</span><span class="hl-code">;
</span><span class="hl-var">$secure_credit_card</span><span class="hl-code"> = </span><span class="hl-identifier">encrypt_text</span><span class="hl-brackets">(</span><span class="hl-var">$my_credit_card</span><span class="hl-brackets">)</span><span class="hl-code">;
</span><span class="hl-reserved">echo</span><span class="hl-code"> </span><span class="hl-var">$secure_credit_card</span><span class="hl-code">; </span><span class="hl-comment">//</span><span class="hl-comment">JIkkfj6yzQqMTZoUufuyI8FL1isqH/QXblQk90IIuqA=</span><span class="hl-comment"></span><span class="hl-code">

</span><span class="hl-var">$unsecure_credit_card</span><span class="hl-code"> = </span><span class="hl-identifier">decrypt_text</span><span class="hl-brackets">(</span><span class="hl-var">$secure_credit_card</span><span class="hl-brackets">)</span><span class="hl-code">;
</span><span class="hl-reserved">echo</span><span class="hl-code"> </span><span class="hl-var">$unsecure_credit_card</span><span class="hl-code">; </span><span class="hl-comment">//</span><span class="hl-comment">5105105105105100 (original card number)</span><span class="hl-comment"></span></pre>
</div>
</div>
<p>All you have to do is save $secure_credit_card to your database and you are all set.</p>
<h2>Taking this to the next level</h2>
<p>If you are interested in kicking the security up a notch you can always come up with some random strings on the fly and also save these to your database. You want to be careful to save the correct keys per user so that you can decrypt the information correctly at a later time. Let&#8217;s say for example that when your user registers they enter a first name, last name, email address, and password. You can take this information and create the user&#8217;s encryption keys by doing something like this:</p>
<div class="hl-container">
<div class="hl-main">
<pre><span class="hl-inlinetags">&lt;?php</span><span class="hl-code">
</span><span class="hl-var">$first_name</span><span class="hl-code"> = </span><span class="hl-quotes">'</span><span class="hl-string">Chris</span><span class="hl-quotes">'</span><span class="hl-code">;
</span><span class="hl-var">$last_name</span><span class="hl-code"> = </span><span class="hl-quotes">'</span><span class="hl-string">Gmyr</span><span class="hl-quotes">'</span><span class="hl-code">;
</span><span class="hl-var">$email</span><span class="hl-code"> = </span><span class="hl-quotes">'</span><span class="hl-string">email@domain.com</span><span class="hl-quotes">'</span><span class="hl-code">;
</span><span class="hl-var">$password</span><span class="hl-code"> = </span><span class="hl-quotes">'</span><span class="hl-string">mypassword123</span><span class="hl-quotes">'</span><span class="hl-code">;

</span><span class="hl-var">$secure_string_1</span><span class="hl-code"> = </span><span class="hl-identifier">md5</span><span class="hl-brackets">(</span><span class="hl-var">$first_name</span><span class="hl-code">.</span><span class="hl-quotes">'</span><span class="hl-string">|</span><span class="hl-quotes">'</span><span class="hl-code">.</span><span class="hl-var">$email</span><span class="hl-brackets">)</span><span class="hl-code">;
</span><span class="hl-reserved">echo</span><span class="hl-code"> </span><span class="hl-var">$secure_string_1</span><span class="hl-code">; </span><span class="hl-comment">//</span><span class="hl-comment">9c46de8e3b1f557c20c964be2b54d4d9</span><span class="hl-comment"></span><span class="hl-code">

</span><span class="hl-var">$secure_string_2</span><span class="hl-code"> = </span><span class="hl-identifier">md5</span><span class="hl-brackets">(</span><span class="hl-var">$last_name</span><span class="hl-code">.</span><span class="hl-quotes">'</span><span class="hl-string">|</span><span class="hl-quotes">'</span><span class="hl-code">.</span><span class="hl-var">$password</span><span class="hl-brackets">)</span><span class="hl-code">;
</span><span class="hl-reserved">echo</span><span class="hl-code"> </span><span class="hl-var">$secure_string_2</span><span class="hl-code">; </span><span class="hl-comment">//</span><span class="hl-comment">131d88ad82d9c94c65ba3945c38b06e1</span><span class="hl-comment"></span></pre>
</div>
</div>
<p>Even though the user could change their information in the future, you do not want to change the encryption keys in your database. After some slight modifications to pass the 2 keys to the functions, you have something like:</p>
<div class="hl-container">
<div class="hl-main">
<pre><span class="hl-inlinetags">&lt;?php</span><span class="hl-code">
</span><span class="hl-reserved">function</span><span class="hl-code"> </span><span class="hl-identifier">encrypt_text</span><span class="hl-brackets">(</span><span class="hl-var">$value</span><span class="hl-code">, </span><span class="hl-var">$key1</span><span class="hl-code">, </span><span class="hl-var">$key2</span><span class="hl-brackets">)</span><span class="hl-code">
</span><span class="hl-brackets">{</span><span class="hl-code">
   </span><span class="hl-reserved">if</span><span class="hl-brackets">(</span><span class="hl-code">!</span><span class="hl-var">$value</span><span class="hl-code"> || !</span><span class="hl-var">$key1</span><span class="hl-code"> || !</span><span class="hl-var">$key2</span><span class="hl-brackets">)</span><span class="hl-code"> </span><span class="hl-reserved">return</span><span class="hl-code"> </span><span class="hl-reserved">false</span><span class="hl-code">;

   </span><span class="hl-var">$crypttext</span><span class="hl-code"> = </span><span class="hl-identifier">mcrypt_encrypt</span><span class="hl-brackets">(</span><span class="hl-identifier">MCRYPT_RIJNDAEL_256</span><span class="hl-code">, </span><span class="hl-var">$key1</span><span class="hl-code">, </span><span class="hl-var">$value</span><span class="hl-code">, </span><span class="hl-identifier">MCRYPT_MODE_ECB</span><span class="hl-code">, </span><span class="hl-var">$key2</span><span class="hl-brackets">)</span><span class="hl-code">;
   </span><span class="hl-reserved">return</span><span class="hl-code"> </span><span class="hl-identifier">trim</span><span class="hl-brackets">(</span><span class="hl-identifier">base64_encode</span><span class="hl-brackets">(</span><span class="hl-var">$crypttext</span><span class="hl-brackets">)</span><span class="hl-brackets">)</span><span class="hl-code">;
</span><span class="hl-brackets">}</span><span class="hl-code">

</span><span class="hl-reserved">function</span><span class="hl-code"> </span><span class="hl-identifier">decrypt_text</span><span class="hl-brackets">(</span><span class="hl-var">$value</span><span class="hl-code">, </span><span class="hl-var">$key1</span><span class="hl-code">, </span><span class="hl-var">$key2</span><span class="hl-brackets">)</span><span class="hl-code">
</span><span class="hl-brackets">{</span><span class="hl-code">
   </span><span class="hl-reserved">if</span><span class="hl-brackets">(</span><span class="hl-code">!</span><span class="hl-var">$value</span><span class="hl-code"> || !</span><span class="hl-var">$key1</span><span class="hl-code"> || !</span><span class="hl-var">$key2</span><span class="hl-brackets">)</span><span class="hl-code"> </span><span class="hl-reserved">return</span><span class="hl-code"> </span><span class="hl-reserved">false</span><span class="hl-code">;

   </span><span class="hl-var">$crypttext</span><span class="hl-code"> = </span><span class="hl-identifier">base64_decode</span><span class="hl-brackets">(</span><span class="hl-var">$value</span><span class="hl-brackets">)</span><span class="hl-code">;
   </span><span class="hl-var">$decrypttext</span><span class="hl-code"> = </span><span class="hl-identifier">mcrypt_decrypt</span><span class="hl-brackets">(</span><span class="hl-identifier">MCRYPT_RIJNDAEL_256</span><span class="hl-code">, </span><span class="hl-var">$key1</span><span class="hl-code">, </span><span class="hl-var">$crypttext</span><span class="hl-code">, </span><span class="hl-identifier">MCRYPT_MODE_ECB</span><span class="hl-code">, </span><span class="hl-var">$key2</span><span class="hl-brackets">)</span><span class="hl-code">;
   </span><span class="hl-reserved">return</span><span class="hl-code"> </span><span class="hl-identifier">trim</span><span class="hl-brackets">(</span><span class="hl-var">$decrypttext</span><span class="hl-brackets">)</span><span class="hl-code">;
</span><span class="hl-brackets">}</span><span class="hl-code">

</span><span class="hl-var">$my_credit_card</span><span class="hl-code"> = </span><span class="hl-quotes">'</span><span class="hl-string">5105105105105100</span><span class="hl-quotes">'</span><span class="hl-code">;
</span><span class="hl-var">$secure_credit_card</span><span class="hl-code"> = </span><span class="hl-identifier">encrypt_text</span><span class="hl-brackets">(</span><span class="hl-var">$my_credit_card</span><span class="hl-code">, </span><span class="hl-var">$secure_string_1</span><span class="hl-code">, </span><span class="hl-var">$secure_string_2</span><span class="hl-brackets">)</span><span class="hl-code">;
</span><span class="hl-var">$unsecure_credit_card</span><span class="hl-code"> = </span><span class="hl-identifier">decrypt_text</span><span class="hl-brackets">(</span><span class="hl-var">$secure_credit_card</span><span class="hl-code">, </span><span class="hl-var">$secure_string_1</span><span class="hl-code">, </span><span class="hl-var">$secure_string_2</span><span class="hl-brackets">)</span><span class="hl-code">;</span></pre>
</div>
</div>
<h2>Your Turn</h2>
<p>How do you secure data in your applications? Do you have any other tips that you would like to share?</p>
<p>No related posts.</p><img src="http://feeds.feedburner.com/~r/chrisgmyr/~4/w3BAH0afh2Q" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.chrisgmyr.com/2011/04/encrypt-and-decrypt-secure-data-with-php/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://www.chrisgmyr.com/2011/04/encrypt-and-decrypt-secure-data-with-php/</feedburner:origLink></item>
		<item>
		<title>CodeIgniter Rackspace Cloudfiles Library</title>
		<link>http://feedproxy.google.com/~r/chrisgmyr/~3/645lfC1CJug/</link>
		<comments>http://www.chrisgmyr.com/2011/02/codeigniter-rackspace-cloudfiles-library/#comments</comments>
		<pubDate>Wed, 23 Feb 2011 22:19:50 +0000</pubDate>
		<dc:creator>Chris</dc:creator>
				<category><![CDATA[CodeIgniter]]></category>
		<category><![CDATA[Code]]></category>
		<category><![CDATA[Rackspace]]></category>

		<guid isPermaLink="false">http://www.chrisgmyr.com/?p=15</guid>
		<description><![CDATA[I made this as an extension to the Rackspace Cloudfiles API along with some changes to it. You can read the original blog post here. Right now this is just some basic functions, but I will be actively supporting this and adding things as I go along. If you have any requests or changes, please [...]
Related posts:<ol>
<li><a href='http://www.chrisgmyr.com/2011/02/codeigniter-pagination-library/' rel='bookmark' title='CodeIgniter Pagination Library'>CodeIgniter Pagination Library</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>I made this as an extension to the Rackspace Cloudfiles API along with some changes to it. <span id="more-15"></span>You can read the original blog post <a href="http://www.syracusecs.com/rackspace-cloud-files-api-with-codeigniter/" target="_blank">here</a>.</p>
<p>Right now this is just some basic functions, but I will be actively supporting this and adding things as I go along. If you have any requests or changes, please feel free to leave me a request in the &#8220;issues&#8221; tab for me.</p>
<p>I&#8217;ve made an easy to follow controller with a number of examples. If you need any other ones, please let me know.</p>
<h2>Installation</h2>
<ol>
<li>Drop everything into your application folder</li>
<li>Edit the config file</li>
<li>Go to the controller and start playing around.</li>
</ol>
<p>If you run into any problems with running it on your localhost or server, please make sure you check out the original API documentation <a href="https://github.com/rackspace/php-cloudfiles" target="_blank">here</a>.</p>
<p style="text-align: center;"><a href="https://bitbucket.org/modomg/codeigniter-rackspace-cloudfiles/" target="_blank"><img class="size-full wp-image-8 aligncenter" title="download" src="http://www.chrisgmyr.com/wp-content/uploads/2011/02/download.jpg" alt="Download Now" width="200" height="77" /></a></p>
<p>Feel free to leave any feedback or feature requests. Thanks for checking out my library.</p>
<p>Related posts:<ol>
<li><a href='http://www.chrisgmyr.com/2011/02/codeigniter-pagination-library/' rel='bookmark' title='CodeIgniter Pagination Library'>CodeIgniter Pagination Library</a></li>
</ol></p><img src="http://feeds.feedburner.com/~r/chrisgmyr/~4/645lfC1CJug" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.chrisgmyr.com/2011/02/codeigniter-rackspace-cloudfiles-library/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		<feedburner:origLink>http://www.chrisgmyr.com/2011/02/codeigniter-rackspace-cloudfiles-library/</feedburner:origLink></item>
		<item>
		<title>CodeIgniter Pagination Library</title>
		<link>http://feedproxy.google.com/~r/chrisgmyr/~3/yIPgtAa4g7Q/</link>
		<comments>http://www.chrisgmyr.com/2011/02/codeigniter-pagination-library/#comments</comments>
		<pubDate>Tue, 22 Feb 2011 05:19:33 +0000</pubDate>
		<dc:creator>Chris</dc:creator>
				<category><![CDATA[CodeIgniter]]></category>
		<category><![CDATA[Code]]></category>
		<category><![CDATA[Library]]></category>

		<guid isPermaLink="false">http://www.chrisgmyr.com/?p=6</guid>
		<description><![CDATA[Over the last few years I&#8217;ve been using my own version of pagination for CodeIgniter. The default one is pretty weak for my purposes, so I created one for all of my projects that has been very handy. There has been a number of posts on the CodeIgniter forums and their UserVoice account about updating [...]
No related posts.]]></description>
			<content:encoded><![CDATA[<p>Over the last few years I&#8217;ve been using my own version of pagination for CodeIgniter. The default one is pretty weak for my purposes, so I created one for all of my projects that has been very handy. <span id="more-6"></span>There has been a number of posts on the CodeIgniter <a href="http://codeigniter.com/forums/" target="_blank">forums</a> and their <a href="http://codeigniter.uservoice.com/forums/40508-codeigniter-reactor" target="_blank">UserVoice</a> account about updating their included pagination library, so I decided to <a href="https://bitbucket.org/modomg/codeigniter-pagination" target="_blank">share mine</a>.</p>
<h2>Installation</h2>
<ol>
<li>Drop everything into your application folder (assets folder is just for demo purposes)</li>
<li>Use: $config['uri_protocol'] = &#8216;PATH_INFO&#8217;;</li>
<li>Go to the test controller and start working with it. You will have to make your own SQL queries/models.</li>
</ol>
<h2>Features</h2>
<ul>
<li>Handles a directory structure or by using the $_GET array. (Ex: domain.com/users/5/ or domain.com/users/?page=5)</li>
<li>Directory structure can add a trailing slash or not, which is good for SEO (Ex: domain.com/users/5/ or domain.com/users/5)</li>
<li>Page 1 links will not show a pagination number. Search engines will look at domain.com/users/ and domain.com/users/1/ as duplicate content, so the pagination is dropped.</li>
<li>Handles regular links or AJAX update links</li>
<li>Automatically builds sorting links</li>
<li>Handles different HTML tags (li, div, etc) for pagination links and additional HTML/CSS options.</li>
<li>Handles additional search/sorting parameters and will add to the $_GET array</li>
<li>Page stats output (Ex: Displaying 1 to 25 (of 115 users))</li>
</ul>
<p style="text-align: center;"><a href="https://bitbucket.org/modomg/codeigniter-pagination" target="_blank"><img class="size-full wp-image-8 aligncenter" title="download" src="http://www.chrisgmyr.com/wp-content/uploads/2011/02/download.jpg" alt="Download Now" width="200" height="77" /></a></p>
<p>Feel free to leave any feedback or feature requests. Thanks for checking out my library.</p>
<p>No related posts.</p><img src="http://feeds.feedburner.com/~r/chrisgmyr/~4/yIPgtAa4g7Q" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.chrisgmyr.com/2011/02/codeigniter-pagination-library/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		<feedburner:origLink>http://www.chrisgmyr.com/2011/02/codeigniter-pagination-library/</feedburner:origLink></item>
	</channel>
</rss>

