<?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>ReloadedPC Ashland, Ohio &#187; Code Igniter</title>
	<atom:link href="http://www.reloadedpc.com/category/code-igniter/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.reloadedpc.com</link>
	<description>Small Business Website Development</description>
	<lastBuildDate>Tue, 24 Jan 2012 18:36:27 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	
		<item>
		<title>WAMP + CodeIgniter + Sparks</title>
		<link>http://www.reloadedpc.com/code-igniter/wamp-codeigniter-sparks/</link>
		<comments>http://www.reloadedpc.com/code-igniter/wamp-codeigniter-sparks/#comments</comments>
		<pubDate>Tue, 12 Jul 2011 15:16:26 +0000</pubDate>
		<dc:creator>Joe</dc:creator>
				<category><![CDATA[Code Igniter]]></category>
		<category><![CDATA[codeigniter]]></category>
		<category><![CDATA[wamp]]></category>

		<guid isPermaLink="false">http://www.reloadedpc.com/?p=290</guid>
		<description><![CDATA[I was recently decided to give the Get Sparks project a try. If you are not familiar with the Get Sparks project for Codeigniter, it allows you to download packages/modules for quickly installing into your app. Similar to the idea with PEAR extensions for PHP. I am setting this up on my Windows box using [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.reloadedpc.com/wp-content/uploads/2009/07/ci_logo_flame.jpg"><img class="alignright size-full wp-image-41" title="CodeIgniter Logo" src="http://www.reloadedpc.com/wp-content/uploads/2009/07/ci_logo_flame.jpg" alt="WAMP + CodeIgniter + Sparks  ci logo flame " width="150" height="164" /></a>I was recently decided to give the <a title="Get Sparks" href="http://getsparks.org">Get Sparks</a> project a try. If you are not familiar with the Get Sparks project for Codeigniter, it allows you to download packages/modules for quickly installing into your app. Similar to the idea with PEAR extensions for PHP. I am setting this up on my Windows box using WAMP. I followed the setup instructions from the Get Sparks website, and everything went perfectly fine. I decided to download the popular spark &#8220;curl&#8221;, and kept getting the:</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">&quot;You have to install PECL ZipArchive or `unzip` to install this spark.&quot;</pre></div></div>

<p> I kept checking in my php.ini file that php_zip.dll was enabled.  Hmmm&#8230;..</p>
<p>So, I decided to create a test script to test the code that was creating this error message. Running the PHP script in the browser ran ZipArchive() successfully. Next, I ran this test PHP script from the command line (CLI). I got a &#8220;Fatal Error:  Class ZipArchive not found in &#8230;&#8221; error. I couldn&#8217;t quite figure out why PHP was throwing an error on the CLI and not when run in the browser. A little digging found that PHP run from the command line uses relative paths including php.ini. This the part where WAMP comes into play. For those using WAMP, your php.ini file that is used is located in<strong> C:\wamp\bin\apache\Apache2.2.11\bin</strong> not where PHP is being executed from. Ah ha! So I went and opened <strong>C:\wamp\bin\php\php5.2.9-2</strong> and scrolled down to find:</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">;extension=php_zip.dll</pre></div></div>

<p>So I changed this to:</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">extension=php_zip.dll</pre></div></div>


<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">php tools\spark install -v1.2.0 curl</pre></div></div>

<p>Enabling php_zip.dll in the PHP folder of WAMP, and ran the Sparks command again. Success! The spark was downloaded, unzipped, and installed with no more error.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.reloadedpc.com/code-igniter/wamp-codeigniter-sparks/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>CodeIgniter + UPS Worldship</title>
		<link>http://www.reloadedpc.com/code-igniter/codeigniter-ups-worldship/</link>
		<comments>http://www.reloadedpc.com/code-igniter/codeigniter-ups-worldship/#comments</comments>
		<pubDate>Tue, 09 Nov 2010 22:00:19 +0000</pubDate>
		<dc:creator>Joe</dc:creator>
				<category><![CDATA[Code Igniter]]></category>
		<category><![CDATA[codeigniter]]></category>
		<category><![CDATA[odbc]]></category>
		<category><![CDATA[ups worldship]]></category>

		<guid isPermaLink="false">http://www.reloadedpc.com/?p=259</guid>
		<description><![CDATA[This is a post I have been to get around to for quite awhile. At work we have UPS Worldship installed on our desktops for shipping out packages. I had written a small php script that could open the UPS Worldship database, and report all of our tracking numbers with links. UPS had switched from [...]]]></description>
			<content:encoded><![CDATA[<p>This is a post I have been to get around to for quite awhile. At work we have UPS Worldship<a href="http://codeigniter.com"><img class="alignright size-full wp-image-41" title="CodeIgniter Logo" src="http://www.reloadedpc.com/wp-content/uploads/2009/07/ci_logo_flame.jpg" alt="CodeIgniter + UPS Worldship ci logo flame " width="150" height="164" /></a> installed on our desktops for shipping out packages. I had written a small php script that could open the UPS Worldship database, and report all of our tracking numbers with links. UPS had switched from being an unprotected Microsoft Access database file, to using a Microsoft SQL (MSSQL database). This kind of broke my little php script I had written, but I was eventual able to work something together. Recently, I installed the latest update UPS Worldship 2010 Version 12. Wouldn&#8217;t you know it, broken again. I couldn&#8217;t get my little script working again. ODBC access had been removed from this version. I could no longer connect to the MS SQL  dabatabe for UPS Worldship.</p>
<p><span id="more-259"></span> It seemed the only option was to buy some 3rd party software USP authorizes to connect to the database. Digging through the internet, I found a nice little utility call <a href="http://www.microsoft.com/downloads/en/details.aspx?FamilyID=C243A5AE-4BD1-4E3D-94B8-5A0F62BF7796">Microsoft SQL Server Management Studio Express</a> that allows you to access the USP database instance. Once you install the software open the program.</p>
<p>Fill in the Server Name box (usually Servername\UPSWSDBSERVER), and click connect. In the left hand window, double click on the Security folder. You will see a list of logins. You now need to create a new user.</p>
<p>Right click on the right pane, and choose New Login. Type in your Login Name in the top, and now select the SQL Server Login radio box. Type in your password.</p>
<p>At the bottom for Default Database select &#8220;master&#8221; from the drop down box. In the left pane of the window, there is a link for Server Roles. Click on Server Roles, and check all boxes in the right pane to add all rights to your login. Hey you are into the database, you might as well give yourself full access right?</p>
<p>Save your login, and it&#8217;s time to setup an ODBC connection for Codeigniter to use. Open the Control Panel-&gt;Administrative Tools-&gt;Data Sources (ODBC).</p>
<p>Click on the System DSN tab, and then the Add button. Under Name type in a with no spaces. I used UPS_WS_12 for mine. In the description you can enter anything. In the server box click on the dropdown and select your UPS server databse instance. It should be something like ServerName\UPSWSDBSERVER. Click on the Next button.</p>
<p><a href="http://www.reloadedpc.com/wp-content/uploads/2010/11/codeigniter_ups_09112010_162448.jpg"><img class="aligncenter size-medium wp-image-266" title="codeigniter_ups_step1" src="http://www.reloadedpc.com/wp-content/uploads/2010/11/codeigniter_ups_09112010_162448-300x196.jpg" alt="CodeIgniter + UPS Worldship codeigniter ups 09112010 162448 300x196 " width="300" height="196" /></a>Now fill out the options as shown below. Fill in the login credentials as entered in the UPS database. Then, click on the Next button.</p>
<p><a href="http://www.reloadedpc.com/wp-content/uploads/2010/11/codeigniter_ups_09112010_162603.jpg"><img class="aligncenter size-medium wp-image-267" title="codeigniter_ups_step2" src="http://www.reloadedpc.com/wp-content/uploads/2010/11/codeigniter_ups_09112010_162603-300x196.jpg" alt="CodeIgniter + UPS Worldship codeigniter ups 09112010 162603 300x196 " width="300" height="196" /></a>Select upswsdb from the dropdown box as shown. Then, click on the Next button.</p>
<p><a href="http://www.reloadedpc.com/wp-content/uploads/2010/11/codeigniter_ups_09112010_162619.jpg"><img class="aligncenter size-medium wp-image-268" title="codeigniter_ups_step3" src="http://www.reloadedpc.com/wp-content/uploads/2010/11/codeigniter_ups_09112010_162619-300x196.jpg" alt="CodeIgniter + UPS Worldship codeigniter ups 09112010 162619 300x196 " width="300" height="196" /></a>The options show will probably be set by default. Click on Finish button. Your connection should now be created. You may click on Test Data Source button, and you should connect successfully.</p>
<p><a href="http://www.reloadedpc.com/wp-content/uploads/2010/11/codeigniter_ups_09112010_162628.jpg"><img class="aligncenter size-medium wp-image-265" title="codeigniter_ups_step4" src="http://www.reloadedpc.com/wp-content/uploads/2010/11/codeigniter_ups_09112010_162628-300x196.jpg" alt="CodeIgniter + UPS Worldship codeigniter ups 09112010 162628 300x196 " width="300" height="196" /></a>Close your the ODBC screen, and open up your codeigniter application folder. Here are the connections settings you will need to use for application/config/database.php</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000088;">$active_group</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;default&quot;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #000088;">$db</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'default'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'hostname'</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;UPS_WS_12&quot;</span><span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">//System DSN name you created</span>
<span style="color: #000088;">$db</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'default'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'username'</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;username&quot;</span><span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">//Username as entered in ODBC connection</span>
<span style="color: #000088;">$db</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'default'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'password'</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;password&quot;</span><span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">//Password as entered in ODBC connection</span>
<span style="color: #000088;">$db</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'default'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'database'</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;&quot;</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$db</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'default'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'dbdriver'</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;odbc&quot;</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$db</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'default'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'dbprefix'</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;&quot;</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$db</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'default'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'pconnect'</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> <span style="color: #009900; font-weight: bold;">FALSE</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$db</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'default'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'db_debug'</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> <span style="color: #009900; font-weight: bold;">TRUE</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$db</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'default'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'cache_on'</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> <span style="color: #009900; font-weight: bold;">FALSE</span><span style="color: #339933;">;</span></pre></div></div>

<p>If you are interested in a SQL query to view completed shipments with all the shipping details for you shipping log try out this query:</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000088;">$query</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">db</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">query</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;SELECT * FROM upswsdb.dbo.calPkgAgent a 
   JOIN upswsdb.dbo.calShipment s ON a.m_primaryKey=s.m_foreignKey00 
   JOIN upswsdb.dbo.calPackage p ON s.m_primaryKey=p.m_foreignKey 
   WHERE s.m_shipDataSet='eod' AND s.m_isVoid='0' 
   ORDER BY s.m_shipDateTime DESC&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

<p>To view pending shipments that have not been processed by End of Day, change s.m_shipDataSet=&#8217;eod&#8217; to s.m_shipDataSet != &#8216;eod&#8217;. I use this simple little codeigniter application to view all of my UPS Worldship data. This makes it very easy to paginate the results, and provide real time access to tracking data. Much easier than trying to open UPS Worldship on a workstation that does not have it open or security rights to view the shipping log.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.reloadedpc.com/code-igniter/codeigniter-ups-worldship/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>CodeIgniter + Chargify</title>
		<link>http://www.reloadedpc.com/code-igniter/codeigniter-chargify/</link>
		<comments>http://www.reloadedpc.com/code-igniter/codeigniter-chargify/#comments</comments>
		<pubDate>Sat, 18 Sep 2010 14:45:53 +0000</pubDate>
		<dc:creator>Joe</dc:creator>
				<category><![CDATA[Code Igniter]]></category>
		<category><![CDATA[chargify]]></category>
		<category><![CDATA[codeigniter]]></category>

		<guid isPermaLink="false">http://www.reloadedpc.com/?p=255</guid>
		<description><![CDATA[I recently began integrating the Chargify service into a web app I am coding for codeigniter. Chargify is seems to be a slick web service for creating subscription based services. They provide a strong API, and along with a slick web based dashboard (GUI). One of the points on using the API are Chargify postbacks. [...]]]></description>
			<content:encoded><![CDATA[<p>I recently began integrating the Chargify service into a web app I am coding for codeigniter. <a href="http://codeigniter.com"><img class="alignright size-full wp-image-41" title="CodeIgniter Logo" src="http://www.reloadedpc.com/wp-content/uploads/2009/07/ci_logo_flame.jpg" alt="CodeIgniter + Chargify ci logo flame " width="150" height="164" /></a> Chargify is seems to be a slick web service for creating subscription based services. They provide a strong API, and along with a slick web based dashboard (GUI). One of the points on using the API are Chargify postbacks. I did some quick googling and didn&#8217;t turn up much in the way of chargify and codeigniter. I did find a great library for integrating the API called <a href="http://chargeigniter.com/">ChargeIgniter</a>.</p>
<p>Chargify will send a json array back a POST var to your site. The docs for Chargify don&#8217;t state what variable they are submitted as. This is what I came up with.</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">function</span> post_back<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
&nbsp;
        <span style="color: #000088;">$body</span> <span style="color: #339933;">=</span> <span style="color: #990000;">file_get_contents</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;php://input&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
        <span style="color: #000088;">$replace</span> <span style="color: #339933;">=</span> <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'['</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">']'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        <span style="color: #000088;">$replacements</span> <span style="color: #339933;">=</span> <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">''</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">''</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
        <span style="color: #000088;">$body</span> <span style="color: #339933;">=</span> <span style="color: #990000;">explode</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">','</span><span style="color: #339933;">,</span> <span style="color: #990000;">str_replace</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$replace</span><span style="color: #339933;">,</span> <span style="color: #000088;">$replacements</span><span style="color: #339933;">,</span> <span style="color: #000088;">$body</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
       <span style="color: #666666; font-style: italic;">//$body now contains array of subscription ID's</span>
       <span style="color: #666666; font-style: italic;">//Iterate through returned subscription IDs</span>
       <span style="color: #b1b100;">foreach</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$body</span> <span style="color: #b1b100;">as</span> <span style="color: #000088;">$subscription_id</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
            <span style="color: #000088;">$subscription</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">chargify</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">get_subscription</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$subscription_id</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
            <span style="color: #666666; font-style: italic;">//Do something here with $subscription details</span>
      <span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#125;</span></pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://www.reloadedpc.com/code-igniter/codeigniter-chargify/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>CodeIgniter + Whitepages.com API Library</title>
		<link>http://www.reloadedpc.com/code-igniter/codeigniter-whitepagescom-api-library/</link>
		<comments>http://www.reloadedpc.com/code-igniter/codeigniter-whitepagescom-api-library/#comments</comments>
		<pubDate>Tue, 27 Apr 2010 13:51:22 +0000</pubDate>
		<dc:creator>Joe</dc:creator>
				<category><![CDATA[Code Igniter]]></category>
		<category><![CDATA[codeigniter]]></category>
		<category><![CDATA[php library]]></category>
		<category><![CDATA[whitepages.com]]></category>

		<guid isPermaLink="false">http://www.reloadedpc.com/?p=223</guid>
		<description><![CDATA[I was recently working on another Codeigniter project that I needed to grab some phone, address, &#38; map information for plotting on a map. After doing a little searching I found Whitepages.com has provided an API interface for retrieving data via REST. The methods seemed simple enough, and provided an easy way to create a [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://codeigniter.com"><img class="alignright size-full wp-image-41" title="CodeIgniter Logo" src="http://www.reloadedpc.com/wp-content/uploads/2009/07/ci_logo_flame.jpg" alt="CodeIgniter + Whitepages.com API Library ci logo flame " width="150" height="164" /></a>I was recently working on another Codeigniter project that I needed to grab some phone, address, &amp; map information for plotting on a map. After doing a little searching I found Whitepages.com has provided an API interface for retrieving data via REST. The methods seemed simple enough, and provided an easy way to create a CodeIgniter library to due the dirty work.<span id="more-223"></span>The library is pretty straightforward and includes good easy to read documentation.  You can receive data in either XML or in JSON format. I&#8217;ve included for demo purposes a SimpleXML codeigniter library to parse and convert the XML to an associative array. You can view the controller to see how this was implemented.</p>
<p>As shown in the readme docs, the class is easy to use. Example:</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000088;">$info</span> <span style="color: #339933;">=</span> <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'lastname'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'Smith'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'firstname'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'John'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$data</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'xml'</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">whitepages_lib</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">find_person</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$info</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

<p>This will search using the <strong>find_person</strong> method of the API for the name &#8220;John Smith&#8221;. You can pass any of the fields shown in the documentation in your associative array.</p>
<p>Download <a href='http://www.reloadedpc.com/wp-content/uploads/2010/04/whitepages.zip'>CodeIgniter Whitepages.com API Library</a></p>
<form action="https://www.paypal.com/cgi-bin/webscr" method="post">
<input type="hidden" name="cmd" value="_s-xclick">
<input type="hidden" name="hosted_button_id" value="8DNGYPD3WRZCQ">
<input type="image" src="https://www.paypal.com/en_US/i/btn/btn_donateCC_LG.gif" border="0" name="submit" alt="PayPal - The safer, easier way to pay online!">
<img alt="CodeIgniter + Whitepages.com API Library pixel " border="0" src="https://www.paypal.com/en_US/i/scr/pixel.gif" width="1" height="1" title="CodeIgniter + Whitepages.com API Library" /><br />
</form>
]]></content:encoded>
			<wfw:commentRss>http://www.reloadedpc.com/code-igniter/codeigniter-whitepagescom-api-library/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Codeigniter + Geshi</title>
		<link>http://www.reloadedpc.com/code-igniter/codeigniter-geshi/</link>
		<comments>http://www.reloadedpc.com/code-igniter/codeigniter-geshi/#comments</comments>
		<pubDate>Fri, 09 Apr 2010 14:23:49 +0000</pubDate>
		<dc:creator>Joe</dc:creator>
				<category><![CDATA[Code Igniter]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[codeigniter]]></category>
		<category><![CDATA[geshi]]></category>
		<category><![CDATA[php class]]></category>
		<category><![CDATA[php library]]></category>

		<guid isPermaLink="false">http://www.reloadedpc.com/?p=217</guid>
		<description><![CDATA[Geshi is a PHP class to do the heavy lifting for syntax highlighting output to your browswer. Geshi started originally to help users highlight code posted on bulletin board sites. I converted the standard Geshi class into a Codeigniter library. Just a simple as renaming the class and created a few methods to conform to [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://qbnz.com/highlighter/">Geshi</a> is a PHP class to do the heavy lifting for syntax highlighting output to your browswer. <a href="http://www.reloadedpc.com/wp-content/uploads/2009/07/ci_logo_flame.jpg"><img class="alignright size-full wp-image-41" title="CodeIgniter Logo" src="http://www.reloadedpc.com/wp-content/uploads/2009/07/ci_logo_flame.jpg" alt="Codeigniter + Geshi ci logo flame " width="150" height="164" /></a>Geshi started originally to help users highlight code posted on bulletin board sites. I converted the standard Geshi class into a Codeigniter library. Just a simple as renaming the class and created a few methods to conform to some of the options you&#8217;ll find in codeigniter.<br />
<span id="more-217"></span><br />
Download <a href="http://www.reloadedpc.com/wp-content/uploads/2010/04/geshi-CI-library.zip">Codeigniter Geshi Library</a></p>
<p>Here&#8217;s how you will use this library in Codeigniter. First, extract the zip file and place the contents into your /application/libraries folder within your codeigniter folder structure.</p>
<p>Example code:</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">load</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">library</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'geshi'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">//load geshi class</span>
&nbsp;
<span style="color: #000088;">$config</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'set_language'</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">'php'</span><span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">//REQUIRED set language to parse</span>
<span style="color: #000088;">$config</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'set_source'</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">'foreach($test as $item){ echo &quot;hello&quot;;}'</span><span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">//REQUIRED set source code to parse</span>
<span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">geshi</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">initialize</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$config</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #b1b100;">echo</span> <span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">geshi</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">output</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">//output from geshi alias of parse_code</span></pre></div></div>

<p>You can pass any geshi method or variable in the config array. Just name the key the same as the method or variable you are setting, and the value to what you would like to pass.</p>
<form action="https://www.paypal.com/cgi-bin/webscr" method="post">
<input type="hidden" name="cmd" value="_s-xclick">
<input type="hidden" name="hosted_button_id" value="8DNGYPD3WRZCQ">
<input type="image" src="https://www.paypal.com/en_US/i/btn/btn_donateCC_LG.gif" border="0" name="submit" alt="PayPal - The safer, easier way to pay online!">
<img alt="Codeigniter + Geshi pixel " border="0" src="https://www.paypal.com/en_US/i/scr/pixel.gif" width="1" height="1" title="Codeigniter + Geshi" /><br />
</form>
]]></content:encoded>
			<wfw:commentRss>http://www.reloadedpc.com/code-igniter/codeigniter-geshi/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>jQuery Uploadify 2 + CodeIgniter</title>
		<link>http://www.reloadedpc.com/code-igniter/jquery-uploadify-2-codeigniter/</link>
		<comments>http://www.reloadedpc.com/code-igniter/jquery-uploadify-2-codeigniter/#comments</comments>
		<pubDate>Thu, 01 Oct 2009 20:43:53 +0000</pubDate>
		<dc:creator>Joe</dc:creator>
				<category><![CDATA[Code Igniter]]></category>
		<category><![CDATA[jquery]]></category>
		<category><![CDATA[uploadify]]></category>

		<guid isPermaLink="false">http://www.reloadedpc.com/?p=123</guid>
		<description><![CDATA[Creating useful upload forms having become very popular on the web these days. Many people have found that flash based options create a more rich user experience. I was working on a project recently to allow a user to upload images to a CodeIgniter application. I enjoy using jQuery, and found an excellent flash based [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.uploadify.com"><img class="alignright size-medium wp-image-124" title="uploadify-logo" src="http://www.reloadedpc.com/wp-content/uploads/2009/10/uploadify-logo-300x48.jpg" alt="jQuery Uploadify 2 + CodeIgniter uploadify logo 300x48 " width="300" height="48" /></a>Creating useful upload forms having become very popular on the web these days. Many people have found that flash based options create a more rich user experience. I was working on a project recently to allow a user to upload images to a <a href="http://www.codeigniter.com">CodeIgniter</a> application. I enjoy using jQuery, and found an excellent flash based uploader in <a href="http://www.uploadify.com/">Uploadify</a>. <span id="more-123"></span>The most recent version added many new features over the previous version.  However, there seems to be a need for a quick tutorial for integrating Uploadify into CodeIgniter.  Here is a zip file that you can drop into your CodeIgniter application to see how it works.</p>
<p><a href="https://bitbucket.org/pickupman/codeigniter-uploadify">Download CodeIgniter Uploadify Demo</a> (updated 03/09/2011) (On right side, click click on get source)</p>
<p>The demo zip file contains the uploadify source files as well the controllers and views to get this to work. Just unzip the folder and drop into your CodeIgniter folder. The structure is:</p>
<blockquote>
<ul>
<li>/js/uploadify/ (uploadify files)</li>
<li>/system/application/controllers/upload.php</li>
<li>/system/application/views/upload/ (2 view files)</li>
<li>/uploads (blank folder where files are uploaded to)</li>
</ul>
</blockquote>
<p>The code is very simple and I have used it several different ways after getting this to work.  You will need to also add a standard upload form to the controller as well for users with Flash disabled. That&#8217;s part is pretty straight forward and is provide in the <a href="http://codeigniter.com/user_guide/libraries/file_uploading.html">CodeIgniter user guide</a>.  When I was first trying to integrate the two, I was trying too hard to find a solution using CI&#8217;s built in upload functions. I was reading in the documentation and found the onComplete callback.  I modified some of the code in the upload.php included in the uploadify source download. The file now echoes a JSON string back when the upload completes. The JSON string is then posted back to CodeIgniter using jQuery.</p>
<p>In /js/uploadify/uploadify.php where the upload is handled by the flash uploader, you will find the code creating the JSON string. You may add more values to the array where you would need them.</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000088;">$filearray</span> <span style="color: #339933;">=</span> <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
   <span style="color: #000088;">$filearray</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'file_name'</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$newf_name</span><span style="color: #339933;">;</span>
   <span style="color: #000088;">$filearray</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'real_name'</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$real_name</span><span style="color: #339933;">;</span>
   <span style="color: #000088;">$filearray</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'file_ext'</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$file_ext</span><span style="color: #339933;">;</span>
   <span style="color: #000088;">$filearray</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'file_size'</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$file_size</span><span style="color: #339933;">;</span>
   <span style="color: #000088;">$filearray</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'file_path'</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$targetFile</span><span style="color: #339933;">;</span>
   <span style="color: #000088;">$filearray</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'file_temp'</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$file_temp</span><span style="color: #339933;">;</span>
&nbsp;
   <span style="color: #000088;">$json_array</span> <span style="color: #339933;">=</span> <span style="color: #990000;">json_encode</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$filearray</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
   <span style="color: #b1b100;">echo</span> <span style="color: #000088;">$json_array</span><span style="color: #339933;">;</span></pre></div></div>

<p>Here is where the JSON string is handled in CodeIgniter</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #666666; font-style: italic;">//system/application/controllers/upload.php</span>
<span style="color: #000000; font-weight: bold;">function</span> uploadify<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>
	<span style="color: #009900;">&#123;</span>
&nbsp;
		<span style="color: #666666; font-style: italic;">//Decode JSON returned by /js/uploadify/upload.php</span>
		<span style="color: #000088;">$file</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">input</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">post</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'filearray'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		<span style="color: #000088;">$data</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'json'</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> <span style="color: #990000;">json_decode</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$file</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
		<span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">load</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">view</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'upload/uploadify'</span><span style="color: #339933;">,</span><span style="color: #000088;">$data</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #009900;">&#125;</span></pre></div></div>

<p>An additional note pointed out in the CI forums is to be sure to add in your /application/config/mimes.php file for each file type you will be uploading:</p>
<p><code><br />
'application/octet-stream'<br />
</code></p>
]]></content:encoded>
			<wfw:commentRss>http://www.reloadedpc.com/code-igniter/jquery-uploadify-2-codeigniter/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>CodeIgniter Shopping Cart Library</title>
		<link>http://www.reloadedpc.com/code-igniter/codeigniter-shopping-cart-library/</link>
		<comments>http://www.reloadedpc.com/code-igniter/codeigniter-shopping-cart-library/#comments</comments>
		<pubDate>Tue, 04 Aug 2009 18:22:20 +0000</pubDate>
		<dc:creator>Joe</dc:creator>
				<category><![CDATA[Code Igniter]]></category>
		<category><![CDATA[codeigniter]]></category>
		<category><![CDATA[shopping cart]]></category>
		<category><![CDATA[wfcart]]></category>

		<guid isPermaLink="false">http://www.reloadedpc.com/?p=44</guid>
		<description><![CDATA[CodeIgniter is a great PHP framework to work with. One of the items several developers have been asking to be included in the next CodeIgniter release, is a core library for a shopping cart. The library is being added for CI version 1.7.2, and is currently available via SVN on the CodeIgniter website. UPDATE 09/12/2009: [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.codeigniter.com">CodeIgniter</a> is a great PHP framework to work with. One of the items several <a rel="attachment wp-att-41" href="http://www.reloadedpc.com/code-igniter/open-flash-chart-2-codeigniter-2/attachment/ci_logo_flame/"><img class="alignright size-full wp-image-41" title="CodeIgniter Logo" src="http://www.reloadedpc.com/wp-content/uploads/2009/07/ci_logo_flame.jpg" alt="CodeIgniter Shopping Cart Library ci logo flame " width="150" height="164" /></a>developers have been asking to be included in the next CodeIgniter release, is a core library for a shopping cart. <span style="text-decoration: line-through;">The library is being added for CI version 1.7.2, and is currently available via <a href="http://dev.ellislab.com/svn/CodeIgniter/trunk">SVN on the CodeIgniter</a> website.</span></p>
<p><strong>UPDATE 09/12/2009: </strong>The shopping cart library has now been released as part of the Code Igniter stable release version 1.7.2. You can dowload it at  <a href="http://codeigniter.com/downloads/">CodeIgniter.com</a></p>
<p><span id="more-44"></span></p>
<p>I have used <a href="http://www.webforcecart.com/">wfCart</a> class in another CI project I worked on. It provides simple functionality: add, edit, delete products along with displaying the shopping cart contents. wfCart took a little hacking of the code and adding the CI object to the code in order to use some the builtin features of CI. It worked well, but lacked the naming conventions that make CI so great.</p>
<p>I decided to give the Cart library a try, so I put together some simple code to see the functionality of the Cart class. Posted below is download of files you can drop into your CodeIgniter application, and try it out for yourself.</p>
<p>I created a new controller and named it Cart.php.</p>
<p>The code in the controller offers simple functionality:</p>
<ul>
<li>View products</li>
<li>View shopping cart</li>
<li>Update shopping cart quantities</li>
<li>Delete products from shopping cart</li>
</ul>
<p>You will need a table to your database to store the product information.</p>
<p>[code]<br />
CREATE TABLE IF NOT EXISTS `product` (<br />
`product_id` int(10) NOT NULL AUTO_INCREMENT,<br />
`product_sku` varchar(100) NOT NULL,<br />
`product_description` varchar(200) NOT NULL,<br />
`product_family` varchar(250) NOT NULL,<br />
`product_quantity` double(10,4) NOT NULL,<br />
`product_price` double(10,2) NOT NULL,<br />
`vendor_id` int(10) NOT NULL,<br />
`user_id` int(10) NOT NULL,<br />
PRIMARY KEY (`product_id`),<br />
UNIQUE KEY `product_id` (`product_id`)<br />
) ENGINE=MyISAM  DEFAULT CHARSET=latin1 ;[/code]</p>
<p>Just add a couple products to the table, and you should be able to test this out.</p>
<p><a rel="attachment wp-att-59" href="http://www.reloadedpc.com/code-igniter/codeigniter-shopping-cart-library/attachment/cart/">Download Demo</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.reloadedpc.com/code-igniter/codeigniter-shopping-cart-library/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Open Flash Chart 2 + CodeIgniter</title>
		<link>http://www.reloadedpc.com/code-igniter/open-flash-chart-2-codeigniter-2/</link>
		<comments>http://www.reloadedpc.com/code-igniter/open-flash-chart-2-codeigniter-2/#comments</comments>
		<pubDate>Mon, 27 Jul 2009 15:00:03 +0000</pubDate>
		<dc:creator>Joe</dc:creator>
				<category><![CDATA[Code Igniter]]></category>
		<category><![CDATA[codeigniter]]></category>
		<category><![CDATA[ofc]]></category>
		<category><![CDATA[open flash chart]]></category>

		<guid isPermaLink="false">http://www.reloadedpc.com/?p=23</guid>
		<description><![CDATA[Many of you maybe familiar with the CodeIgniter (CI) PHP framework. I was asked by a client recently about creating a graph for some data in a report. Looking through several charting libraries at the CI website, I found a few options listed in the wiki. Open Flash Chart 2 (OFC) seemed like a nice [...]]]></description>
			<content:encoded><![CDATA[<p>Many of you maybe familiar with the <a href="http://www.codeigniter.com">CodeIgniter</a> (CI) PHP framework. I was asked by a client recently about creating a graph for some data in a report. <a rel="attachment wp-att-41" href="http://www.reloadedpc.com/code-igniter/open-flash-chart-2-codeigniter-2/attachment/ci_logo_flame/"><img class="alignright size-full wp-image-41" title="CodeIgniter Logo" src="http://www.reloadedpc.com/wp-content/uploads/2009/07/ci_logo_flame.jpg" alt="Open Flash Chart 2 + CodeIgniter ci logo flame " width="150" height="164" /></a>Looking through several charting libraries at the CI website, I found a few options listed in the wiki. <a href="http://teethgrinder.co.uk/open-flash-chart-2/">Open Flash Chart 2</a> (OFC) seemed like a nice option and was also open source. There was a couple libraries written for CI using Open Flash Chart, but the recent code for OFC has recently changed.<span id="more-23"></span></p>
<p>The new code for Open Flash Chart 2 has separated the PHP classes making it very difficult using in CodeIgniter. Thankfully <a href="http://codeigniter.com/forums/member/97515/">Mesozoic</a> had merged all of the classes back into a single file.</p>
<p>Here are the steps getting CodeIgniter and Open Flash Chart 2 to play nicely together. Download the <a href="http://www.reloadedpc.com/wp-content/uploads/2009/07/ofc.zip">Open Flash Chart 2</a> and extract the files. In this zip file you will need to extract open-flash-chart.swf to the root folder of your server. Then place the other files in the application folder into your CI application folder.</p>
<p>I&#8217;ve also coded  a CI helper for inserting the chart into your page that plays nicely with CI&#8217;s URL helper.  Here&#8217;s example of how to use Open Flash Chart 2:</p>
<p>In the controller of your application add the following code below.</p>
<p>[php]</p>
<p>$this-&amp;gt;load-&amp;gt;helper(&#8216;open-flash-chart&#8217;); // load helper function<br />
$this-&amp;gt;load-&amp;gt;library(&#8216;ofc&#8217;); //load Open Flash Chart<br />
[/php]</p>
<p>Now you can use the code that is shown on the Open Flash Chart website, execpt make a like change when building the chart. You will now use:</p>
<p>[php]</p>
<p>$this-&amp;gt;ofc-&amp;gt;open_flash_chart();<br />
$this-&amp;gt;ofc-&amp;gt;set_title( $title );<br />
$this-&amp;gt;ofc-&amp;gt;add_element( $line );<br />
$this-&amp;gt;ofc-&amp;gt;set_x_axis( $x_axis );<br />
$this-&amp;gt;ofc-&amp;gt;set_y_axis( $y_axis);<br />
return $this-&amp;gt;ofc-&amp;gt;toPrettyString();</p>
<p>[/php]</p>
<p>You can find more information on this on the <a href="http://codeigniter.com/forums/viewreply/605019/">CodeIgniter forums</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.reloadedpc.com/code-igniter/open-flash-chart-2-codeigniter-2/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

<!-- Performance optimized by W3 Total Cache. Learn more: http://www.w3-edge.com/wordpress-plugins/

Minified using disk: basic
Page Caching using disk: enhanced (User agent is rejected)
Database Caching 32/47 queries in 0.023 seconds using disk: basic
Object Caching 903/1020 objects using disk: basic

Served from: www.reloadedpc.com @ 2012-02-05 04:01:49 -->
