<?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>Joshua McGinnis</title>
	
	<link>http://joshuamcginnis.com</link>
	<description />
	<lastBuildDate>Tue, 07 May 2013 00:22:01 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.5.1</generator>
		<atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" type="application/rss+xml" href="http://feeds.feedburner.com/joshuamcginnis" /><feedburner:info uri="joshuamcginnis" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com/" /><item>
		<title>Automating Table-to-Table Imports in QuickBase</title>
		<link>http://feedproxy.google.com/~r/joshuamcginnis/~3/7AEVKIgq5Cs/</link>
		<comments>http://joshuamcginnis.com/2011/04/12/automating-table-to-table-imports-in-quickbase/#comments</comments>
		<pubDate>Tue, 12 Apr 2011 15:09:05 +0000</pubDate>
		<dc:creator>Joshua McGinnis</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[QuickBase]]></category>

		<guid isPermaLink="false">http://joshuamcginnis.com/?p=2939</guid>
		<description><![CDATA[So you want to automate a table-to-table import in QuickBase. Well, here&#8217;s a nifty little command-line script that uses the QuickBase PHP SDK to do just that. How it works When run from the command-line, the php scripts accepts two paramaters: dbID of the table with the saved import, and then the importID of the [...]]]></description>
				<content:encoded><![CDATA[<p>So you want to automate a table-to-table import in QuickBase. Well, here&#8217;s a nifty little command-line script that uses the <a href="http://joshuamcginnis.com/2010/07/07/php-sdk-quickbase-api/">QuickBase PHP SDK</a> to do just that.</p>
<h2>How it works</h2>
<p>When run from the command-line, the php scripts accepts two paramaters: dbID of the table with the saved import, and then the importID of the import you wish to run. With these two params, the script can execute the <a href="http://www.quickbase.com/api-guide/runimport.html">QuickBase API_RunImport</a> api call.</p>
<h2>How to setup the import as a cron</h2>
<p>This script can be setup just as any other cron you may run. The example below outputs the results of the cron (success or fail) to a log file. If you&#8217;ve got multiple imports you want to automate, you&#8217;ll just duplicate the call to the import script with different dbIDs and importIDs.</p>
<div class="codecolorer-container bash twitlight" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br />3<br />4<br />5<br />6<br />7<br /></div></td><td><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #666666; font-style: italic;"># +---------------- minute (0 - 59)</span><br />
<span style="color: #666666; font-style: italic;"># | &nbsp;+------------- hour (0 - 23)</span><br />
<span style="color: #666666; font-style: italic;"># | &nbsp;| &nbsp;+---------- day of month (1 - 31)</span><br />
<span style="color: #666666; font-style: italic;"># | &nbsp;| &nbsp;| &nbsp;+------- month (1 - 12)</span><br />
<span style="color: #666666; font-style: italic;"># | &nbsp;| &nbsp;| &nbsp;| &nbsp;+---- day of week (0 - 7) (Sunday=0 or 7)</span><br />
<span style="color: #666666; font-style: italic;"># | &nbsp;| &nbsp;| &nbsp;| &nbsp;|</span><br />
&nbsp; <span style="color: #000000;">0</span> <span style="color: #000000;">17</span> &nbsp;<span style="color: #000000; font-weight: bold;">*</span> &nbsp;<span style="color: #000000; font-weight: bold;">*</span> &nbsp;<span style="color: #000000; font-weight: bold;">*</span> <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>bin<span style="color: #000000; font-weight: bold;">/</span>php <span style="color: #000000; font-weight: bold;">/</span>path<span style="color: #000000; font-weight: bold;">/</span>to<span style="color: #000000; font-weight: bold;">/</span>import-script.php DBID_HERE IMPORT_ID <span style="color: #000000; font-weight: bold;">&gt;&gt;</span> <span style="color: #000000; font-weight: bold;">/</span>var<span style="color: #000000; font-weight: bold;">/</span>log<span style="color: #000000; font-weight: bold;">/</span>www-cron-log</div></td></tr></tbody></table></div>
<div class="codecolorer-container php twitlight" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br />3<br />4<br />5<br />6<br />7<br />8<br />9<br />10<br />11<br />12<br />13<br />14<br /></div></td><td><div class="php codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #666666; font-style: italic;">// include the php sdk</span><br />
<span style="color: #b1b100;">include</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'library/qb.php'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
<br />
<span style="color: #000088;">$quickbase</span> <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> QuickBase<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'YOUR_USER'</span><span style="color: #339933;">,</span><span style="color: #0000ff;">'YOUR_PASS'</span><span style="color: #339933;">,</span> <span style="color: #009900; font-weight: bold;">false</span><span style="color: #339933;">,</span> <span style="color: #000088;">$argv</span><span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">1</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
<br />
<span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$quickbase</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">errcode</span> <span style="color: #339933;">&lt;</span> <span style="color: #cc66cc;">1</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; <span style="color: #000088;">$results</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$quickbase</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">api_run_import</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$argv</span><span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">2</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; <br />
&nbsp; &nbsp; <span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$results</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">errcode</span> <span style="color: #339933;">&lt;</span> <span style="color: #cc66cc;">1</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #b1b100;">echo</span> <span style="color: #0000ff;">&quot;Successful Import at &quot;</span> <span style="color: #339933;">.</span> <a href="http://www.php.net/date"><span style="color: #990000;">date</span></a><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;F j, Y, g:i a&quot;</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">.</span> <span style="color: #0000ff;">&quot;<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; <span style="color: #009900;">&#125;</span> <span style="color: #b1b100;">else</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #b1b100;">echo</span> <span style="color: #0000ff;">&quot;Error: &quot;</span> <span style="color: #339933;">.</span> <span style="color: #000088;">$results</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">errdetail</span> <span style="color: #339933;">.</span> <span style="color: #0000ff;">&quot; at &quot;</span> <span style="color: #339933;">.</span> <a href="http://www.php.net/date"><span style="color: #990000;">date</span></a><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;F j, Y, g:i a&quot;</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">.</span> <span style="color: #0000ff;">&quot;<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; <span style="color: #009900;">&#125;</span><br />
<span style="color: #009900;">&#125;</span></div></td></tr></tbody></table></div>
<img src="http://feeds.feedburner.com/~r/joshuamcginnis/~4/7AEVKIgq5Cs" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://joshuamcginnis.com/2011/04/12/automating-table-to-table-imports-in-quickbase/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://joshuamcginnis.com/2011/04/12/automating-table-to-table-imports-in-quickbase/</feedburner:origLink></item>
		<item>
		<title>How to: Disable Same-Origin Policy in Chrome</title>
		<link>http://feedproxy.google.com/~r/joshuamcginnis/~3/asqRrlNlb9A/</link>
		<comments>http://joshuamcginnis.com/2011/02/28/how-to-disable-same-origin-policy-in-chrome/#comments</comments>
		<pubDate>Mon, 28 Feb 2011 14:36:55 +0000</pubDate>
		<dc:creator>Joshua McGinnis</dc:creator>
				<category><![CDATA[Chrome Extensions]]></category>
		<category><![CDATA[Google]]></category>

		<guid isPermaLink="false">http://joshuamcginnis.com/?p=2930</guid>
		<description><![CDATA[I&#8217;ve been doing some Chrome extension development in the past week and as you may or may not know, chrome extensions are allowed to make cross-domain ajax calls. This is allowed because of the Chrome extension permission model which requires a user installing an extension to agree to that the installed application may access your [...]]]></description>
				<content:encoded><![CDATA[<p>I&#8217;ve been doing some Chrome extension development in the past week and as you may or may not know, <a href="http://code.google.com/chrome/extensions/xhr.html">chrome extensions are allowed to make cross-domain ajax calls</a>. This is allowed because of the Chrome extension permission model which requires a user installing an extension to agree to that the installed application may access your data on the domain in question.</p>
<p>However, by default, the extension only has this capability when the extension is installed and activated (say by clicking on the app icon on the chrome toolbar).</p>
<p>If you&#8217;re developing an extension, this means you have to constantly refresh the extension and click the button in order to test your XHR requests.</p>
<p>It turns out, you can start Chrome with a couple of flags that will allow you to simply browse to your files directly and execute cross-domain XMLHttpRequest calls.</p>
<p>For additional ease, I&#8217;ve created a shortcut on my desktop with the flags appended. Your shortcut should look something like this:</p>
<div class="codecolorer-container php twitlight" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br /></div></td><td><div class="php codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">C<span style="color: #339933;">:</span>\Users\YOUR_USER\AppData\Local\Google\Chrome\Application\chrome<span style="color: #339933;">.</span>exe <span style="color: #339933;">--</span>allow<span style="color: #339933;">-</span>file<span style="color: #339933;">-</span>access<span style="color: #339933;">-</span>from<span style="color: #339933;">-</span>files <span style="color: #339933;">--</span>disable<span style="color: #339933;">-</span>web<span style="color: #339933;">-</span>security</div></td></tr></tbody></table></div>
<h3>The Flags</h3>
<p>You&#8217;ll notice the two flags appended to the shortcut path.</p>
<p><strong>&#8211;allow-file-access-from-files </strong></p>
<p><strong>&#8211;disable-web-security</strong></p>
<p>Together, both of these flags will allow a developer to test cross-domain ajax requests from a local file.</p>
<p>P.S. I labeled the extension &#8220;UNSECURED CHROME&#8221; so that I don&#8217;t risk always running Chrome with these flags.</p>
<img src="http://feeds.feedburner.com/~r/joshuamcginnis/~4/asqRrlNlb9A" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://joshuamcginnis.com/2011/02/28/how-to-disable-same-origin-policy-in-chrome/feed/</wfw:commentRss>
		<slash:comments>8</slash:comments>
		<feedburner:origLink>http://joshuamcginnis.com/2011/02/28/how-to-disable-same-origin-policy-in-chrome/</feedburner:origLink></item>
		<item>
		<title>Dynamic robots.txt with Zend Framework</title>
		<link>http://feedproxy.google.com/~r/joshuamcginnis/~3/XynxSzEmPAc/</link>
		<comments>http://joshuamcginnis.com/2010/11/29/dynamic-robots-txt-with-zend-framework/#comments</comments>
		<pubDate>Mon, 29 Nov 2010 16:33:39 +0000</pubDate>
		<dc:creator>Joshua McGinnis</dc:creator>
				<category><![CDATA[Google]]></category>
		<category><![CDATA[SEO]]></category>
		<category><![CDATA[Web Development]]></category>
		<category><![CDATA[Zend Framework]]></category>

		<guid isPermaLink="false">http://joshuamcginnis.com/?p=2890</guid>
		<description><![CDATA[Here&#8217;s a quick little tutorial to show you how you can create a dynamic robots.txt file with the Zend Framework. My robot files aren&#8217;t usually complex since I&#8217;m really careful about not putting anything that could be indexed in the web root, but there are some cases where you may want to have more control [...]]]></description>
				<content:encoded><![CDATA[<p>Here&#8217;s a quick little tutorial to show you how you can create a dynamic robots.txt file with the Zend Framework. </p>
<p>My robot files aren&#8217;t usually complex since I&#8217;m really careful about not putting anything that could be indexed in the web root, but there are some cases where you may want to have more control over the robots file at the application level. In the example below, we&#8217;ll be serving up different robots content depending on if the file is accessed from HTTPS or not. </p>
<p>You may also want to put your robot settings in your application ini file or control what gets indexed at the Controller level where the other business for your application logic lives. </p>
<h2>Step 1 &#8211; Create a custom route in your bootstrap</h2>
<p>This route will catch requests from robots.txt and route them to the robots action of the RobotsController.</p>
<div class="codecolorer-container php twitlight" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br />3<br />4<br /></div></td><td><div class="php codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #000088;">$router</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">addRoute</span><span style="color: #009900;">&#40;</span><br />
&nbsp; &nbsp; <span style="color: #0000ff;">'robots'</span><span style="color: #339933;">,</span><br />
&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">new</span> Zend_Controller_Router_Route<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'/robots.txt'</span><span style="color: #339933;">,</span> <a href="http://www.php.net/array"><span style="color: #990000;">array</span></a><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'controller'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'Robots'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'action'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'robots'</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><br />
<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></div></td></tr></tbody></table></div>
<h2>Step 2 &#8211; Create the robots.txt Controller</h2>
<p>I opted to not use the default indexAction for my robots.txt action. This would to try and avoid any chance of Google indexing additional versions of the robots controller/action urls. In the controller below, /robots redirects to /robots.txt. It still leaves /robots/robots open, but that&#8217;s less likely to get hit that just /robots.</p>
<p>Notice that I&#8217;ve also set the content-type to text/plain which is what it would have been had this been an actual text file. I&#8217;m not sure it makes any difference to Google, but this will make the page resemble as close as possible an actual robots.txt file.</p>
<div class="codecolorer-container php twitlight" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br />3<br />4<br />5<br />6<br />7<br />8<br />9<br />10<br />11<br />12<br />13<br />14<br />15<br />16<br />17<br />18<br />19<br />20<br /></div></td><td><div class="php codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #000000; font-weight: bold;">class</span> RobotsController <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; <br />
&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">function</span> indexAction<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <br />
&nbsp; &nbsp; <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span>_redirect<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;/robots.txt&quot;</span><span style="color: #339933;">,</span> <a href="http://www.php.net/array"><span style="color: #990000;">array</span></a><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'code'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #cc66cc;">301</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; <span style="color: #009900;">&#125;</span><br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">function</span> robotsAction<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span>_helper<span style="color: #339933;">-&gt;</span><span style="color: #004000;">getHelper</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'layout'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">disableLayout</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">getResponse</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #339933;">-&gt;</span><span style="color: #004000;">setHeader</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'Content-type'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'text/plain'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">view</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">sslEnabled</span> <span style="color: #339933;">=</span> <span style="color: #009900; font-weight: bold;">false</span><span style="color: #339933;">;</span><br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span><a href="http://www.php.net/isset"><span style="color: #990000;">isset</span></a><span style="color: #009900;">&#40;</span><span style="color: #000088;">$_SERVER</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'HTTPS'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">view</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">sslEnabled</span> <span style="color: #339933;">=</span> <span style="color: #009900; font-weight: bold;">true</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&#125;</span><br />
&nbsp; &nbsp; <br />
<span style="color: #009900;">&#125;</span></div></td></tr></tbody></table></div>
<h2>Step 3 &#8211; Create the robots.txt view</h2>
<p>In the controller above, I assigned a boolean to the view so that I could render a different robots.txt if the page is accessed via SSL. In this case, I want to completely remove the HTTPS site from Google&#8217;s index to avoid duplicate content issues.</p>
<div class="codecolorer-container php twitlight" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br />3<br />4<br />5<br />6<br />7<br /></div></td><td><div class="php codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">sslEnabled</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">:</span><span style="color: #000000; font-weight: bold;">?&gt;</span><br />
User-agent: *<br />
Disallow: /<br />
<span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">else</span><span style="color: #339933;">:</span><span style="color: #000000; font-weight: bold;">?&gt;</span><br />
User-agent: *<br />
Allow: /<br />
<span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">endif</span><span style="color: #339933;">;</span><span style="color: #000000; font-weight: bold;">?&gt;</span></div></td></tr></tbody></table></div>
<img src="http://feeds.feedburner.com/~r/joshuamcginnis/~4/XynxSzEmPAc" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://joshuamcginnis.com/2010/11/29/dynamic-robots-txt-with-zend-framework/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		<feedburner:origLink>http://joshuamcginnis.com/2010/11/29/dynamic-robots-txt-with-zend-framework/</feedburner:origLink></item>
		<item>
		<title>Vtrenz (EngageB2B) SOAP API PHP Library</title>
		<link>http://feedproxy.google.com/~r/joshuamcginnis/~3/ETsKGexezcA/</link>
		<comments>http://joshuamcginnis.com/2010/08/31/vtrenz-engageb2b-soap-api-php-library/#comments</comments>
		<pubDate>Tue, 31 Aug 2010 17:58:37 +0000</pubDate>
		<dc:creator>Joshua McGinnis</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[Portfolio]]></category>
		<category><![CDATA[Web Development]]></category>
		<category><![CDATA[XML]]></category>

		<guid isPermaLink="false">http://joshuamcginnis.com/?p=2841</guid>
		<description><![CDATA[Below you will find a class for using the Vtrenz Web Services API with PHP. This class abstracts a few of the individual methods available via the soap-based api and takes care of writing all of the XML in your request for you (ala SimpleXML). Here are the supported methods: insertCampaignParticipant sendOneOffEmail insertContact getEmailMessageStatus getContactData [...]]]></description>
				<content:encoded><![CDATA[<p>Below you will find a class for using the Vtrenz Web Services API with PHP. This class abstracts a few of the individual methods available via the soap-based api and takes care of writing all of the XML in your request for you (ala SimpleXML). </p>
<p>Here are the supported methods:</p>
<ul>
<li><strong>insertCampaignParticipant</strong></li>
<li><strong>sendOneOffEmail</strong></li>
<li><strong>insertContact</strong></li>
<li><strong>getEmailMessageStatus</strong></li>
<li><strong>getContactData</strong></li>
</ul>
<p>I&#8217;ve even written a debug method that when turned on, while display the request, the response and both the response and request times (for proving how incredibly slow Vtrenz is). </p>
<p>Here&#8217;s a basic example:</p>
<h4>Get a users iMarketingSyncID using their email address</h4>
<div class="codecolorer-container php twitlight" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br />3<br />4<br />5<br />6<br />7<br />8<br />9<br />10<br />11<br /></div></td><td><div class="php codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #000088;">$options</span> <span style="color: #339933;">=</span> <a href="http://www.php.net/array"><span style="color: #990000;">array</span></a><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'debug'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #009900; font-weight: bold;">true</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
<span style="color: #000088;">$databaseID</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">''</span><span style="color: #339933;">;</span><br />
<br />
<span style="color: #000088;">$vtrenz</span> <span style="color: #339933;">=</span> &nbsp;<span style="color: #000000; font-weight: bold;">new</span> Vtrenz_Api<span style="color: #009900;">&#40;</span><span style="color: #000088;">$options</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
<br />
<span style="color: #000088;">$contact</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$vtrenz</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">getContactData</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$databaseID</span><span style="color: #339933;">,</span><span style="color: #0000ff;">''</span><span style="color: #339933;">,</span><span style="color: #0000ff;">''</span><span style="color: #339933;">,</span> <span style="color: #000088;">$usersEmailAddress</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
<span style="color: #b1b100;">return</span> <span style="color: #000088;">$contact</span><span style="color: #339933;">-&gt;</span><span style="color: #009900;">&#123;</span><span style="color: #0000ff;">'single-response'</span><span style="color: #009900;">&#125;</span><br />
&nbsp; &nbsp; &nbsp;<span style="color: #339933;">-&gt;</span><span style="color: #009900;">&#123;</span><span style="color: #0000ff;">'outgoing-responses'</span><span style="color: #009900;">&#125;</span><br />
&nbsp; &nbsp; &nbsp;<span style="color: #339933;">-&gt;</span><span style="color: #004000;">response</span><br />
&nbsp; &nbsp; &nbsp;<span style="color: #339933;">-&gt;</span><span style="color: #009900;">&#123;</span><span style="color: #0000ff;">'outgoing-data'</span><span style="color: #009900;">&#125;</span><br />
&nbsp; &nbsp; &nbsp;<span style="color: #339933;">-&gt;</span><span style="color: #009900;">&#123;</span><span style="color: #0000ff;">'contact'</span><span style="color: #009900;">&#125;</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">field</span><span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">1</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">//returns the iMarketingSyncID field</span></div></td></tr></tbody></table></div>
<p>Below is the actual source for the library. Be sure to fill in your own credentials. </p>
<h2>The Vtrenz PHP Class</h2>
<div class="codecolorer-container php twitlight" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br />3<br />4<br />5<br />6<br />7<br />8<br />9<br />10<br />11<br />12<br />13<br />14<br />15<br />16<br />17<br />18<br />19<br />20<br />21<br />22<br />23<br />24<br />25<br />26<br />27<br />28<br />29<br />30<br />31<br />32<br />33<br />34<br />35<br />36<br />37<br />38<br />39<br />40<br />41<br />42<br />43<br />44<br />45<br />46<br />47<br />48<br />49<br />50<br />51<br />52<br />53<br />54<br />55<br />56<br />57<br />58<br />59<br />60<br />61<br />62<br />63<br />64<br />65<br />66<br />67<br />68<br />69<br />70<br />71<br />72<br />73<br />74<br />75<br />76<br />77<br />78<br />79<br />80<br />81<br />82<br />83<br />84<br />85<br />86<br />87<br />88<br />89<br />90<br />91<br />92<br />93<br />94<br />95<br />96<br />97<br />98<br />99<br />100<br />101<br />102<br />103<br />104<br />105<br />106<br />107<br />108<br />109<br />110<br />111<br />112<br />113<br />114<br />115<br />116<br />117<br />118<br />119<br />120<br />121<br />122<br />123<br />124<br />125<br />126<br />127<br />128<br />129<br />130<br />131<br />132<br />133<br />134<br />135<br />136<br />137<br />138<br />139<br />140<br />141<br />142<br />143<br />144<br />145<br />146<br />147<br />148<br />149<br />150<br />151<br />152<br />153<br />154<br />155<br />156<br />157<br />158<br />159<br />160<br />161<br />162<br />163<br />164<br />165<br />166<br />167<br />168<br />169<br />170<br />171<br />172<br />173<br />174<br />175<br />176<br />177<br />178<br />179<br />180<br />181<br />182<br />183<br />184<br />185<br />186<br />187<br />188<br />189<br />190<br />191<br />192<br />193<br />194<br />195<br />196<br />197<br />198<br />199<br />200<br />201<br />202<br />203<br />204<br />205<br />206<br />207<br />208<br />209<br /></div></td><td><div class="php codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #000000; font-weight: bold;">class</span> Vtrenz_Api <span style="color: #009900;">&#123;</span><br />
<br />
&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">private</span> <span style="color: #000088;">$username</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">''</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">private</span> <span style="color: #000088;">$password</span> <span style="color: #339933;">=</span> &nbsp;<span style="color: #0000ff;">''</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">private</span> <span style="color: #000088;">$wsdl</span><span style="color: #339933;">=</span> <span style="color: #0000ff;">'http://services.vtrenz.net/receiver.cfc?wsdl'</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">private</span> <span style="color: #000088;">$xml</span> <span style="color: #339933;">=</span> <span style="color: #009900; font-weight: bold;">NULL</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">private</span> <span style="color: #000088;">$incomingData</span> <span style="color: #339933;">=</span> <span style="color: #009900; font-weight: bold;">NULL</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">private</span> <span style="color: #000088;">$request</span> <span style="color: #339933;">=</span> <span style="color: #009900; font-weight: bold;">NULL</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">private</span> <span style="color: #000088;">$_debugMode</span> <span style="color: #339933;">=</span> <span style="color: #009900; font-weight: bold;">false</span><span style="color: #339933;">;</span><br />
<br />
&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">function</span> &nbsp;__construct<span style="color: #009900;">&#40;</span><span style="color: #000088;">$options</span> <span style="color: #339933;">=</span> <span style="color: #009900; font-weight: bold;">null</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$options</span> <span style="color: #339933;">!==</span> <span style="color: #009900; font-weight: bold;">null</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">setOptions</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$options</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&#125;</span><br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">xml</span> <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> SimpleXMLElement<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'&lt;incoming-requests&gt;&lt;/incoming-requests&gt;'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">request</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">xml</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">addChild</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'request'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">incomingData</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">request</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">addChild</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'incoming-data'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; <span style="color: #009900;">&#125;</span><br />
<br />
&nbsp; &nbsp; <span style="color: #009933; font-style: italic;">/**<br />
&nbsp; &nbsp; &nbsp;* Set Options<br />
&nbsp; &nbsp; &nbsp;*<br />
&nbsp; &nbsp; &nbsp;* Allows setting options as an associative array of option =&gt; value pairs.<br />
&nbsp; &nbsp; &nbsp;*<br />
&nbsp; &nbsp; &nbsp;* @param array $options<br />
&nbsp; &nbsp; &nbsp;*/</span><br />
&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">private</span> <span style="color: #000000; font-weight: bold;">function</span> setOptions<span style="color: #009900;">&#40;</span><span style="color: #000088;">$options</span><span style="color: #009900;">&#41;</span><br />
&nbsp; &nbsp; <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #b1b100;">foreach</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$options</span> <span style="color: #b1b100;">as</span> <span style="color: #000088;">$key</span> <span style="color: #339933;">=&gt;</span> <span style="color: #000088;">$value</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #b1b100;">switch</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$key</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #b1b100;">case</span> <span style="color: #0000ff;">'debug'</span><span style="color: #339933;">:</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">setDebugMode</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$value</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #b1b100;">break</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&#125;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&#125;</span><br />
&nbsp; &nbsp; <span style="color: #009900;">&#125;</span><br />
<br />
&nbsp; &nbsp; <span style="color: #009933; font-style: italic;">/**<br />
&nbsp; &nbsp; &nbsp;* Set debug mode<br />
&nbsp; &nbsp; &nbsp;*<br />
&nbsp; &nbsp; &nbsp;* @param &nbsp;bool $value<br />
&nbsp; &nbsp; &nbsp;*/</span><br />
&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">private</span> <span style="color: #000000; font-weight: bold;">function</span> setDebugMode<span style="color: #009900;">&#40;</span><span style="color: #000088;">$value</span><span style="color: #009900;">&#41;</span><br />
&nbsp; &nbsp; <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span>_debugMode <span style="color: #339933;">=</span> <span style="color: #000088;">$value</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; <span style="color: #009900;">&#125;</span><br />
<br />
&nbsp; &nbsp; <span style="color: #009933; font-style: italic;">/**<br />
&nbsp; &nbsp; &nbsp;* Self destruct then re-instantiate<br />
&nbsp; &nbsp; &nbsp;*/</span><br />
&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">private</span> <span style="color: #000000; font-weight: bold;">function</span> destruct<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <a href="http://www.php.net/unset"><span style="color: #990000;">unset</span></a><span style="color: #009900;">&#40;</span><span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">xml</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span>__construct<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; <span style="color: #009900;">&#125;</span><br />
<br />
&nbsp; &nbsp; <span style="color: #009933; font-style: italic;">/**<br />
&nbsp; &nbsp; &nbsp;* Transmit SOAP Call<br />
&nbsp; &nbsp; &nbsp;*<br />
&nbsp; &nbsp; &nbsp;* @param string $method<br />
&nbsp; &nbsp; &nbsp;* @return SimpleXMLElement <br />
&nbsp; &nbsp; &nbsp;*/</span><br />
&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">private</span> <span style="color: #000000; font-weight: bold;">function</span> transmit<span style="color: #009900;">&#40;</span><span style="color: #000088;">$method</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">request</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">addAttribute</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'description'</span><span style="color: #339933;">,</span> <span style="color: #000088;">$method</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000088;">$startTime</span> <span style="color: #339933;">=</span> <a href="http://www.php.net/date"><span style="color: #990000;">date</span></a><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'r'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">client</span> <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> Zend_Soap_Client<span style="color: #009900;">&#40;</span><span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">wsdl</span><span style="color: #339933;">,</span> <a href="http://www.php.net/array"><span style="color: #990000;">array</span></a><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'soap_version'</span> <span style="color: #339933;">=&gt;</span> SOAP_1_1<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000088;">$result</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">client</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">incomingRequest</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">username</span><span style="color: #339933;">,</span> <span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">password</span><span style="color: #339933;">,</span> <span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">xml</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">asXML</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span>_debugMode<span style="color: #009900;">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">printDebug</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$method</span><span style="color: #339933;">,</span> <span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">client</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">getLastRequest</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span> <span style="color: #000088;">$result</span><span style="color: #339933;">,</span> <span style="color: #000088;">$startTime</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">destruct</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #b1b100;">return</span> <span style="color: #000000; font-weight: bold;">new</span> SimpleXMLElement<span style="color: #009900;">&#40;</span><span style="color: #000088;">$result</span><span style="color: #339933;">,</span>LIBXML_NOCDATA<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
<br />
&nbsp; &nbsp; <span style="color: #009900;">&#125;</span><br />
<br />
&nbsp; &nbsp; <span style="color: #009933; font-style: italic;">/**<br />
&nbsp; &nbsp; &nbsp;* Print debug info<br />
&nbsp; &nbsp; &nbsp;* <br />
&nbsp; &nbsp; &nbsp;* @param string $method<br />
&nbsp; &nbsp; &nbsp;* @param string $lastRequest<br />
&nbsp; &nbsp; &nbsp;* @param string $result<br />
&nbsp; &nbsp; &nbsp;* @param string $startTime<br />
&nbsp; &nbsp; &nbsp;*/</span><br />
&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">private</span> <span style="color: #000000; font-weight: bold;">function</span> printDebug<span style="color: #009900;">&#40;</span><span style="color: #000088;">$method</span><span style="color: #339933;">,</span> <span style="color: #000088;">$lastRequest</span><span style="color: #339933;">,</span> <span style="color: #000088;">$result</span><span style="color: #339933;">,</span> <span style="color: #000088;">$startTime</span><span style="color: #009900;">&#41;</span><br />
&nbsp; &nbsp; <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #b1b100;">echo</span> <span style="color: #0000ff;">&quot;&lt;h1&gt;Vtrend Debug Info&lt;/h1&gt;<span style="color: #000099; font-weight: bold;">\n</span><span style="color: #000099; font-weight: bold;">\r</span>&quot;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #b1b100;">echo</span> <span style="color: #0000ff;">&quot;&lt;h2&gt;&quot;</span><span style="color: #339933;">.</span> <span style="color: #000088;">$method</span> <span style="color: #339933;">.</span><span style="color: #0000ff;">&quot;&lt;/h2&gt;<span style="color: #000099; font-weight: bold;">\n</span><span style="color: #000099; font-weight: bold;">\r</span>&quot;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #b1b100;">echo</span> <span style="color: #0000ff;">&quot;&lt;h4&gt;Request&lt;/h4&gt;<span style="color: #000099; font-weight: bold;">\n</span><span style="color: #000099; font-weight: bold;">\r</span>&quot;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #b1b100;">echo</span> <span style="color: #000088;">$lastRequest</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #b1b100;">echo</span> <span style="color: #0000ff;">&quot;&lt;h4&gt;Response&lt;/h4&gt;<span style="color: #000099; font-weight: bold;">\n</span><span style="color: #000099; font-weight: bold;">\r</span>&quot;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #b1b100;">echo</span> <span style="color: #000088;">$result</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #b1b100;">echo</span> <span style="color: #0000ff;">&quot;&lt;h4&gt;Timestamp&lt;/h4&gt;<span style="color: #000099; font-weight: bold;">\n</span><span style="color: #000099; font-weight: bold;">\r</span>&quot;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #b1b100;">echo</span> <span style="color: #0000ff;">&quot;&lt;h5&gt;Start Time&lt;/h5&gt;<span style="color: #000099; font-weight: bold;">\n</span><span style="color: #000099; font-weight: bold;">\r</span>&quot;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #b1b100;">echo</span> <span style="color: #000088;">$startTime</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #b1b100;">echo</span> <span style="color: #0000ff;">&quot;&lt;h5&gt;Stop Time&lt;/h5&gt;<span style="color: #000099; font-weight: bold;">\n</span><span style="color: #000099; font-weight: bold;">\r</span>&quot;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #b1b100;">echo</span> <a href="http://www.php.net/date"><span style="color: #990000;">date</span></a><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'r'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; <span style="color: #009900;">&#125;</span><br />
<br />
&nbsp; &nbsp; <span style="color: #009933; font-style: italic;">/**<br />
&nbsp; &nbsp; &nbsp;* Inserts a contact to an active campaign in the Vtrenz marketing database<br />
&nbsp; &nbsp; &nbsp;* <br />
&nbsp; &nbsp; &nbsp;* @param string $campaignID<br />
&nbsp; &nbsp; &nbsp;* @param string $contacts<br />
&nbsp; &nbsp; &nbsp;* @return SimpleXMLElement<br />
&nbsp; &nbsp; &nbsp;*/</span><br />
&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">function</span> insertCampaignParticipant<span style="color: #009900;">&#40;</span><span style="color: #000088;">$campaignID</span><span style="color: #339933;">,</span> &nbsp;<span style="color: #000088;">$contacts</span> <span style="color: #339933;">=</span> <a href="http://www.php.net/array"><span style="color: #990000;">array</span></a><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000088;">$campaign</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">incomingData</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">addChild</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'campaign'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000088;">$campaign</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">addAttribute</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'campaignID'</span><span style="color: #339933;">,</span> <span style="color: #000088;">$campaignID</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000088;">$i</span> <span style="color: #339933;">=</span> <span style="color: #cc66cc;">0</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #b1b100;">foreach</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$contacts</span> <span style="color: #b1b100;">as</span> <span style="color: #000088;">$contact</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000088;">$contactNode</span><span style="color: #009900;">&#91;</span><span style="color: #000088;">$i</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$campaign</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">addChild</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'contact'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #b1b100;">foreach</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$contact</span> <span style="color: #b1b100;">as</span> <span style="color: #000088;">$key</span> <span style="color: #339933;">=&gt;</span> <span style="color: #000088;">$val</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000088;">$contactNode</span><span style="color: #009900;">&#91;</span><span style="color: #000088;">$i</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">addAttribute</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$key</span><span style="color: #339933;">,</span> <span style="color: #000088;">$val</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&#125;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000088;">$i</span><span style="color: #339933;">++;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&#125;</span><br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #b1b100;">return</span> <span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">transmit</span><span style="color: #009900;">&#40;</span><span style="color: #009900; font-weight: bold;">__FUNCTION__</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; <span style="color: #009900;">&#125;</span><br />
<br />
&nbsp; &nbsp; <span style="color: #009933; font-style: italic;">/**<br />
&nbsp; &nbsp; &nbsp;* Sends a one time email from from Vtrenz<br />
&nbsp; &nbsp; &nbsp;*<br />
&nbsp; &nbsp; &nbsp;* @param string $messageID<br />
&nbsp; &nbsp; &nbsp;* @param array $contacts<br />
&nbsp; &nbsp; &nbsp;* @param array $settings<br />
&nbsp; &nbsp; &nbsp;* @param array $linkOptions<br />
&nbsp; &nbsp; &nbsp;* @return SimpleXMLElement<br />
&nbsp; &nbsp; &nbsp;*/</span><br />
&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">function</span> sendOneOffEmail<span style="color: #009900;">&#40;</span><span style="color: #000088;">$messageID</span><span style="color: #339933;">,</span> <span style="color: #000088;">$contacts</span> <span style="color: #339933;">=</span> <a href="http://www.php.net/array"><span style="color: #990000;">array</span></a><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span> <span style="color: #000088;">$settings</span> <span style="color: #339933;">=</span> <span style="color: #009900; font-weight: bold;">NULL</span><span style="color: #339933;">,</span> <span style="color: #000088;">$linkOptions</span> <span style="color: #339933;">=</span> <span style="color: #009900; font-weight: bold;">NULL</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000088;">$email</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">incomingData</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">addChild</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'email-message'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000088;">$email</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">addAttribute</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'messageID'</span><span style="color: #339933;">,</span> <span style="color: #000088;">$messageID</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span><a href="http://www.php.net/isset"><span style="color: #990000;">isset</span></a><span style="color: #009900;">&#40;</span><span style="color: #000088;">$settings</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000088;">$settingsNode</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$email</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">addChild</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'settings'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #b1b100;">foreach</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$settings</span> <span style="color: #b1b100;">as</span> <span style="color: #000088;">$key</span> <span style="color: #339933;">=&gt;</span> <span style="color: #000088;">$val</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000088;">$settingsNode</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">addAttribute</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$key</span><span style="color: #339933;">,</span> <span style="color: #000088;">$val</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&#125;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&#125;</span><br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span><a href="http://www.php.net/isset"><span style="color: #990000;">isset</span></a><span style="color: #009900;">&#40;</span><span style="color: #000088;">$linkOptions</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000088;">$options</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$email</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">addChild</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'link-options'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #b1b100;">foreach</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$linkOptions</span> <span style="color: #b1b100;">as</span> <span style="color: #000088;">$key</span> <span style="color: #339933;">=&gt;</span> <span style="color: #000088;">$val</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000088;">$options</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">addAttribute</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$key</span><span style="color: #339933;">,</span> <span style="color: #000088;">$val</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&#125;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&#125;</span><br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000088;">$i</span> <span style="color: #339933;">=</span> <span style="color: #cc66cc;">0</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #b1b100;">foreach</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$contacts</span> <span style="color: #b1b100;">as</span> <span style="color: #000088;">$contact</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000088;">$contactNode</span><span style="color: #009900;">&#91;</span><span style="color: #000088;">$i</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$email</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">addChild</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'contact'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #b1b100;">foreach</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$contact</span> <span style="color: #b1b100;">as</span> <span style="color: #000088;">$key</span> <span style="color: #339933;">=&gt;</span> <span style="color: #000088;">$val</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000088;">$contactNode</span><span style="color: #009900;">&#91;</span><span style="color: #000088;">$i</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">addAttribute</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$key</span><span style="color: #339933;">,</span> <span style="color: #000088;">$val</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&#125;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000088;">$i</span><span style="color: #339933;">++;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&#125;</span><br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #b1b100;">return</span> <span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">transmit</span><span style="color: #009900;">&#40;</span><span style="color: #009900; font-weight: bold;">__FUNCTION__</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; <span style="color: #009900;">&#125;</span><br />
<br />
&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">function</span> insertContact<span style="color: #009900;">&#40;</span><span style="color: #000088;">$dbID</span><span style="color: #339933;">,</span> <span style="color: #000088;">$fields</span> <span style="color: #339933;">=</span> <a href="http://www.php.net/array"><span style="color: #990000;">array</span></a><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000088;">$contact</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">incomingData</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">addChild</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'contact'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000088;">$contact</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">addAttribute</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'databaseID'</span><span style="color: #339933;">,</span> <span style="color: #000088;">$dbID</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000088;">$i</span> <span style="color: #339933;">=</span> <span style="color: #cc66cc;">0</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #b1b100;">foreach</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$fields</span> <span style="color: #b1b100;">as</span> <span style="color: #000088;">$key</span> <span style="color: #339933;">=&gt;</span> <span style="color: #000088;">$val</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000088;">$field</span><span style="color: #009900;">&#91;</span><span style="color: #000088;">$i</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$contact</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">addChild</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'field'</span><span style="color: #339933;">,</span> <span style="color: #000088;">$val</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000088;">$field</span><span style="color: #009900;">&#91;</span><span style="color: #000088;">$i</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">addAttribute</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'id'</span><span style="color: #339933;">,</span> <span style="color: #000088;">$key</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000088;">$i</span><span style="color: #339933;">++;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&#125;</span><br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #b1b100;">return</span> <span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">transmit</span><span style="color: #009900;">&#40;</span><span style="color: #009900; font-weight: bold;">__FUNCTION__</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; <span style="color: #009900;">&#125;</span><br />
<br />
&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">function</span> getEmailMessageStatus<span style="color: #009900;">&#40;</span><span style="color: #000088;">$messageID</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000088;">$emailMessage</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">incomingData</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">addChild</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'email-message'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000088;">$emailMessage</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">addAttribute</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'messageID'</span><span style="color: #339933;">,</span> <span style="color: #000088;">$messageID</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
<br />
&nbsp; &nbsp; <span style="color: #b1b100;">return</span> <span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">transmit</span><span style="color: #009900;">&#40;</span><span style="color: #009900; font-weight: bold;">__FUNCTION__</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; <span style="color: #009900;">&#125;</span><br />
<br />
&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">function</span> getContactData<span style="color: #009900;">&#40;</span><span style="color: #000088;">$dbID</span><span style="color: #339933;">,</span> <span style="color: #000088;">$iMarketingSyncID</span> <span style="color: #339933;">=</span> <span style="color: #009900; font-weight: bold;">NULL</span><span style="color: #339933;">,</span> <span style="color: #000088;">$syncID</span> <span style="color: #339933;">=</span> <span style="color: #009900; font-weight: bold;">NULL</span><span style="color: #339933;">,</span> <span style="color: #000088;">$email</span> <span style="color: #339933;">=</span> <span style="color: #009900; font-weight: bold;">NULL</span><span style="color: #339933;">,</span> <span style="color: #000088;">$webSyncID</span> <span style="color: #339933;">=</span> <span style="color: #009900; font-weight: bold;">NULL</span> <span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000088;">$contact</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">incomingData</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">addChild</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'contact'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000088;">$contact</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">addAttribute</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'databaseID'</span><span style="color: #339933;">,</span> <span style="color: #000088;">$dbID</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span><a href="http://www.php.net/isset"><span style="color: #990000;">isset</span></a><span style="color: #009900;">&#40;</span><span style="color: #000088;">$iMarketingSyncID</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000088;">$contact</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">addAttribute</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'iMarketingSyncID'</span><span style="color: #339933;">,</span> <span style="color: #000088;">$iMarketingSyncID</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span><a href="http://www.php.net/isset"><span style="color: #990000;">isset</span></a><span style="color: #009900;">&#40;</span><span style="color: #000088;">$syncID</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000088;">$contact</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">addAttribute</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'syncID'</span><span style="color: #339933;">,</span> <span style="color: #000088;">$syncID</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span><a href="http://www.php.net/isset"><span style="color: #990000;">isset</span></a><span style="color: #009900;">&#40;</span><span style="color: #000088;">$email</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000088;">$contact</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">addAttribute</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'email'</span><span style="color: #339933;">,</span> <span style="color: #000088;">$email</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span><a href="http://www.php.net/isset"><span style="color: #990000;">isset</span></a><span style="color: #009900;">&#40;</span><span style="color: #000088;">$webSyncID</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000088;">$contact</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">addAttribute</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'webSyncID'</span><span style="color: #339933;">,</span> <span style="color: #000088;">$webSyncID</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #b1b100;">return</span> <span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">transmit</span><span style="color: #009900;">&#40;</span><span style="color: #009900; font-weight: bold;">__FUNCTION__</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; <span style="color: #009900;">&#125;</span><br />
<span style="color: #009900;">&#125;</span></div></td></tr></tbody></table></div>
<img src="http://feeds.feedburner.com/~r/joshuamcginnis/~4/ETsKGexezcA" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://joshuamcginnis.com/2010/08/31/vtrenz-engageb2b-soap-api-php-library/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://joshuamcginnis.com/2010/08/31/vtrenz-engageb2b-soap-api-php-library/</feedburner:origLink></item>
		<item>
		<title>How to fix the @font-face flicker issue in FireFox</title>
		<link>http://feedproxy.google.com/~r/joshuamcginnis/~3/QK7c3Peqhu4/</link>
		<comments>http://joshuamcginnis.com/2010/08/17/how-to-fix-the-font-face-flicker-issue-in-firefox/#comments</comments>
		<pubDate>Tue, 17 Aug 2010 18:37:27 +0000</pubDate>
		<dc:creator>Joshua McGinnis</dc:creator>
				<category><![CDATA[Google]]></category>
		<category><![CDATA[Javascript]]></category>
		<category><![CDATA[Web Development]]></category>

		<guid isPermaLink="false">http://joshuamcginnis.com/?p=2832</guid>
		<description><![CDATA[I&#8217;ve been using @font-face more and more over the past couple of months as a way to use custom fonts on websites I manage, but the issue I keep running into is that the contents of the page (including background sprites) will flicker a second after the content has loaded. It&#8217;s really ugly. The best [...]]]></description>
				<content:encoded><![CDATA[<p>I&#8217;ve been using @font-face more and more over the past couple of months as a way to use custom fonts on websites I manage, but the issue I keep running into is that the contents of the page (including background sprites) will flicker a second after the content has loaded. It&#8217;s really ugly. </p>
<p>The best solution that I have found for solving this issue is one published by Paul Irish (in <a href="http://paulirish.com/2009/fighting-the-font-face-fout/">Fighting the @font-face FOUT</a>).</p>
<p>Drop this snippet of javascript in your JS. It targets FireFox 3.5+ and takes care of automatically hiding all page contents until the fonts are loaded and ready to be rendered. </p>
<p>Instead of a flicker, the user will just see a blank page for that half second and then a fully rendered page with all custom fonts embedded. I&#8217;ve not tried <a href="http://code.google.com/webfonts">Google&#8217;s Web Font API or Directory</a>, but their homepage (which is supposedly using the web font api) flickers in Firefox  &#8211; so I&#8217;m not sure it works all that well. </p>
<p>Here&#8217;s the javascript I use to solve the flicker issue:</p>
<div class="codecolorer-container javascript twitlight" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br />3<br />4<br />5<br />6<br />7<br />8<br />9<br />10<br />11<br /></div></td><td><div class="javascript codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #009900;">&#40;</span><span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span><br />
&nbsp; <span style="color: #006600; font-style: italic;">// if firefox 3.5+, hide content till load (or 3 seconds) to prevent FOUT</span><br />
&nbsp; <span style="color: #003366; font-weight: bold;">var</span> d <span style="color: #339933;">=</span> document<span style="color: #339933;">,</span> e <span style="color: #339933;">=</span> d.<span style="color: #660066;">documentElement</span><span style="color: #339933;">,</span> s <span style="color: #339933;">=</span> d.<span style="color: #660066;">createElement</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'style'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; <span style="color: #000066; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span>e.<span style="color: #660066;">style</span>.<span style="color: #660066;">MozTransform</span> <span style="color: #339933;">===</span> <span style="color: #3366CC;">''</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span> <span style="color: #006600; font-style: italic;">// gecko 1.9.1 inference</span><br />
&nbsp; &nbsp; s.<span style="color: #660066;">textContent</span> <span style="color: #339933;">=</span> <span style="color: #3366CC;">'body{visibility:hidden}'</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; e.<span style="color: #660066;">firstChild</span>.<span style="color: #660066;">appendChild</span><span style="color: #009900;">&#40;</span>s<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; <span style="color: #003366; font-weight: bold;">function</span> f<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span> s.<span style="color: #660066;">parentNode</span> <span style="color: #339933;">&amp;&amp;</span> s.<span style="color: #660066;">parentNode</span>.<span style="color: #660066;">removeChild</span><span style="color: #009900;">&#40;</span>s<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #009900;">&#125;</span><br />
&nbsp; &nbsp; addEventListener<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'load'</span><span style="color: #339933;">,</span>f<span style="color: #339933;">,</span><span style="color: #003366; font-weight: bold;">false</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; setTimeout<span style="color: #009900;">&#40;</span>f<span style="color: #339933;">,</span><span style="color: #CC0000;">3000</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <br />
&nbsp; <span style="color: #009900;">&#125;</span><br />
<span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></div></td></tr></tbody></table></div>
<img src="http://feeds.feedburner.com/~r/joshuamcginnis/~4/QK7c3Peqhu4" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://joshuamcginnis.com/2010/08/17/how-to-fix-the-font-face-flicker-issue-in-firefox/feed/</wfw:commentRss>
		<slash:comments>8</slash:comments>
		<feedburner:origLink>http://joshuamcginnis.com/2010/08/17/how-to-fix-the-font-face-flicker-issue-in-firefox/</feedburner:origLink></item>
		<item>
		<title>Using Zend to Add ReCaptcha to Contact Form</title>
		<link>http://feedproxy.google.com/~r/joshuamcginnis/~3/Dz8pMkeYtC0/</link>
		<comments>http://joshuamcginnis.com/2010/08/09/using-zend-to-add-recaptcha-to-contact-form/#comments</comments>
		<pubDate>Mon, 09 Aug 2010 18:01:08 +0000</pubDate>
		<dc:creator>Joshua McGinnis</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[QuickBase]]></category>
		<category><![CDATA[Web Development]]></category>
		<category><![CDATA[Work]]></category>
		<category><![CDATA[Zend Framework]]></category>

		<guid isPermaLink="false">http://joshuamcginnis.com/?p=2813</guid>
		<description><![CDATA[Over the past few weeks, spammers have been inundating the QuickBase Contact Us form with automated spam. This has been quite a nuisance for the folks at QuickBase who read and respond to these contact form submissions. In response to the complaints of spam, it was suggested that we add a captcha to the for [...]]]></description>
				<content:encoded><![CDATA[<p>Over the past few weeks, spammers have been inundating the <a href="http://quickbase.intuit.com/contact-us">QuickBase Contact Us</a> form with automated spam. This has been quite a nuisance for the folks at QuickBase who read and respond to these contact form submissions.</p>
<p><img src="http://joshuamcginnis.com/wp-content/uploads/2010/08/captcha.gif" alt="recaptcha" title="recaptcha" width="478" height="144" class="aligncenter size-full wp-image-2820" /></p>
<p>In response to the complaints of spam, it was suggested that we add a captcha to the for &#8211; so today, I added the captcha using Zend_Captcha_ReCaptcha, a plugin that is included in the Zend Framework. Here&#8217;s how it&#8217;s done:</p>
<h3>Create a reCAPTCHA account &amp; Generate Keys</h3>
<p>Create an account here: <a href="http://www.google.com/recaptcha">http://www.google.com/recaptcha</a></p>
<p>Once there, generate some keys for your domain(s). I created keys for our production domain and my local testing url.</p>
<h3>Add the keys to the app config and registry</h3>
<p>In your application.ini file, you&#8217;ll want to add the keys for production and your staging environment.</p>
<div class="codecolorer-container css twitlight" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br />3<br />4<br />5<br />6<br />7<br /></div></td><td><div class="css codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">----------------------- ReCaptcha ------------------------<br />
recaptcha<span style="color: #6666ff;">.pubkey</span> <span style="color: #00AA00;">=</span> <span style="color: #ff0000;">&quot;YOUR-KEY-HERE&quot;</span><br />
recaptcha<span style="color: #6666ff;">.privkey</span> <span style="color: #00AA00;">=</span> <span style="color: #ff0000;">&quot;YOUR-KEY-HERE&quot;</span><br />
<br />
<span style="color: #00AA00;">&#91;</span>staging <span style="color: #00AA00;">:</span> production<span style="color: #00AA00;">&#93;</span><br />
recaptcha<span style="color: #6666ff;">.publickey</span> <span style="color: #00AA00;">=</span> <span style="color: #ff0000;">&quot;YOUR-KEY-HERE&quot;</span><br />
recaptcha<span style="color: #6666ff;">.privatekey</span> <span style="color: #00AA00;">=</span> <span style="color: #ff0000;">&quot;YOUR-KEY-HERE&quot;</span></div></td></tr></tbody></table></div>
<h4>Add Keys to the registry</h4>
<p>In your bootloader.php, typically in the _init method, add the keys to the registry.</p>
<div class="codecolorer-container php twitlight" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br />3<br />4<br /></div></td><td><div class="php codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #000000; font-weight: bold;">protected</span> <span style="color: #000000; font-weight: bold;">function</span> _initAutoload<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><br />
<span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; <span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">options</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">getOptions</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; Zend_Registry<span style="color: #339933;">::</span><span style="color: #004000;">set</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'config.recaptcha'</span><span style="color: #339933;">,</span> <span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">options</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'recaptcha'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></div></td></tr></tbody></table></div>
<h3>Add the Zend_Form_Recaptcha Form Element to your form</h3>
<p>In your form class, you need to setup a recaptcha service using Zend_Service_ReCaptcha. It is here that you pass in the registry values for your Recaptcha public and private keys. It is also here that you can specify timeout and the theme to use.</p>
<div class="codecolorer-container php twitlight" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br />3<br />4<br />5<br />6<br />7<br />8<br />9<br />10<br />11<br />12<br />13<br />14<br />15<br />16<br />17<br />18<br />19<br />20<br />21<br />22<br />23<br />24<br />25<br />26<br />27<br />28<br />29<br />30<br /></div></td><td><div class="php codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #000000; font-weight: bold;">&lt;?php</span><br />
<span style="color: #000000; font-weight: bold;">class</span> MyApplication_Forms_ContactUs <span style="color: #000000; font-weight: bold;">extends</span> Zend_Form<br />
<span style="color: #009900;">&#123;</span><br />
&nbsp; <span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">function</span> __construct<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><br />
&nbsp; <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #666666; font-style: italic;">//Other Form Stuff Here //</span><br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #666666; font-style: italic;">// Captcha</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000088;">$recaptchaKeys</span> <span style="color: #339933;">=</span> Zend_Registry<span style="color: #339933;">::</span><span style="color: #004000;">get</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'config.recaptcha'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000088;">$recaptcha</span> <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> Zend_Service_ReCaptcha<span style="color: #009900;">&#40;</span><span style="color: #000088;">$recaptchaKeys</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'publickey'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">,</span> <span style="color: #000088;">$recaptchaKeys</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'privatekey'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">,</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900; font-weight: bold;">NULL</span><span style="color: #339933;">,</span> <a href="http://www.php.net/array"><span style="color: #990000;">array</span></a><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'theme'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'clean'</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000088;">$captcha</span> <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> Zend_Form_Element_Captcha<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'captcha'</span><span style="color: #339933;">,</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <a href="http://www.php.net/array"><span style="color: #990000;">array</span></a><span style="color: #009900;">&#40;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">'label'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'Type the characters you see in the picture below.'</span><span style="color: #339933;">,</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">'captcha'</span> <span style="color: #339933;">=&gt;</span> &nbsp;<span style="color: #0000ff;">'ReCaptcha'</span><span style="color: #339933;">,</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">'captchaOptions'</span> &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #339933;">=&gt;</span> <a href="http://www.php.net/array"><span style="color: #990000;">array</span></a><span style="color: #009900;">&#40;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">'captcha'</span> &nbsp; <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'ReCaptcha'</span><span style="color: #339933;">,</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">'service'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #000088;">$recaptcha</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
<br />
&nbsp; &nbsp; <span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">addElements</span><span style="color: #009900;">&#40;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <a href="http://www.php.net/array"><span style="color: #990000;">array</span></a><span style="color: #009900;">&#40;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000088;">$captcha</span><span style="color: #339933;">,</span> <span style="color: #000088;">$submit</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #666666; font-style: italic;">//Other Form Stuff Here - Like a Submit Button, etc) //</span><br />
&nbsp; &nbsp;<span style="color: #009900;">&#125;</span><br />
<span style="color: #009900;">&#125;</span></div></td></tr></tbody></table></div>
<h3>Add the form to your controller &#038; view</h3>
<div class="codecolorer-container php twitlight" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br />3<br />4<br />5<br />6<br />7<br />8<br /></div></td><td><div class="php codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">view</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">form</span> <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> MyApplication_Forms_ContactUs<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
<br />
<span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">getRequest</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">isPost</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">&amp;&amp;</span> <span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">view</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">form</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">isValid</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span>_getAllParams<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><br />
<span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp;<span style="color: #666666; font-style: italic;">//Yay - The captcha and all other form rules were validated</span><br />
<span style="color: #009900;">&#125;</span> <br />
<span style="color: #b1b100;">else</span><br />
&nbsp; <a href="http://www.php.net/var_dump"><span style="color: #990000;">var_dump</span></a><span style="color: #009900;">&#40;</span><span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span>_getAllParams<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></div></td></tr></tbody></table></div>
<p><strong>Echo captcha in the view:</strong></p>
<div class="codecolorer-container php twitlight" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br /></div></td><td><div class="php codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">form</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">captcha</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$form</span></div></td></tr></tbody></table></div>
<p>That&#8217;s really about it. Because you&#8217;re creating the captcha as an extension of Zend_Form_Element, it will run through the form validator class that Zend provides. This means that errors returned from the captcha service will be handled and decorated just like any other errors with your form. </p>
<img src="http://feeds.feedburner.com/~r/joshuamcginnis/~4/Dz8pMkeYtC0" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://joshuamcginnis.com/2010/08/09/using-zend-to-add-recaptcha-to-contact-form/feed/</wfw:commentRss>
		<slash:comments>11</slash:comments>
		<feedburner:origLink>http://joshuamcginnis.com/2010/08/09/using-zend-to-add-recaptcha-to-contact-form/</feedburner:origLink></item>
		<item>
		<title>Olin College of Engineering Homepage Hacked</title>
		<link>http://feedproxy.google.com/~r/joshuamcginnis/~3/1fxIO7-zvGI/</link>
		<comments>http://joshuamcginnis.com/2010/08/03/olin-college-of-engineering-homepage-hacked/#comments</comments>
		<pubDate>Tue, 03 Aug 2010 03:45:32 +0000</pubDate>
		<dc:creator>Joshua McGinnis</dc:creator>
				<category><![CDATA[News]]></category>
		<category><![CDATA[School]]></category>

		<guid isPermaLink="false">http://joshuamcginnis.com/?p=2795</guid>
		<description><![CDATA[It seems that the homepage of Olin College of Engineering has been hacked. I use the term hacked loosely because it looks like the website is just a victim of some sort of third-party software exploit or it could be that they haven&#8217;t quite nailed down some of the permissions on their servers (they are [...]]]></description>
				<content:encoded><![CDATA[<p>It seems that the homepage of Olin College of Engineering has been <em>hacked</em>. I use the term hacked loosely because it looks like the website is just a victim of some sort of third-party software exploit or it could be that they haven&#8217;t quite nailed down some of the permissions on their servers (they are using IIS afterall).</p>
<p>After looking at the site with Firebug, it appears the site is trying to load malicious scripts from russian websites: aquaticwrap.ru and nemohuildin.ru (see screenshot below).</p>
<p>I&#8217;m not sure they know it yet because the issue is still live and in production, but I&#8217;m about to try and let them know via email &#038; twitter.</p>
<p>Screenshot of Chrome malware warning:<br />
<div id="attachment_2800" class="wp-caption aligncenter" style="width: 310px"><a href="http://joshuamcginnis.com/wp-content/uploads/2010/08/olin-hacked-warning.jpg"><img src="http://joshuamcginnis.com/wp-content/uploads/2010/08/olin-hacked-warning-300x226.jpg" alt="olin-hacked-warning" title="olin-hacked-warning" width="300" height="226" class="size-medium wp-image-2800" /></a><p class="wp-caption-text">Chrome Malware Warning</p></div></p>
<p>Here&#8217;s a screenshot of the firebug net tab:<br />
<div id="attachment_2796" class="wp-caption aligncenter" style="width: 310px"><a href="http://joshuamcginnis.com/wp-content/uploads/2010/08/olin-hacked.jpg"><img src="http://joshuamcginnis.com/wp-content/uploads/2010/08/olin-hacked-300x231.jpg" alt="Olin College Hacked" title="Olin College Hacked" width="300" height="231" class="size-medium wp-image-2796" /></a><p class="wp-caption-text">Olin College Hacked</p></div></p>
<img src="http://feeds.feedburner.com/~r/joshuamcginnis/~4/1fxIO7-zvGI" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://joshuamcginnis.com/2010/08/03/olin-college-of-engineering-homepage-hacked/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://joshuamcginnis.com/2010/08/03/olin-college-of-engineering-homepage-hacked/</feedburner:origLink></item>
		<item>
		<title>Best way to manage multiple rewards and discount keychain cards</title>
		<link>http://feedproxy.google.com/~r/joshuamcginnis/~3/1bkCp0WvCRQ/</link>
		<comments>http://joshuamcginnis.com/2010/08/02/best-way-to-manage-multiple-rewards-discount-keychain-card/#comments</comments>
		<pubDate>Mon, 02 Aug 2010 19:24:20 +0000</pubDate>
		<dc:creator>Joshua McGinnis</dc:creator>
				<category><![CDATA[Android]]></category>
		<category><![CDATA[Mobile Dev]]></category>
		<category><![CDATA[News]]></category>

		<guid isPermaLink="false">http://joshuamcginnis.com/?p=2782</guid>
		<description><![CDATA[I can&#8217;t tell you how annoyed I&#8217;ve been that I have to carry around *teen different customer rewards cards on my keychain. It&#8217;s ugly, bulky, and just a waste in many respects. Today, I saw an article on Mashable about a free application that completely takes care of managing these for me. The app, known [...]]]></description>
				<content:encoded><![CDATA[<p>I can&#8217;t tell you how annoyed I&#8217;ve been that I have to carry around *teen different customer rewards cards on my keychain. It&#8217;s ugly, bulky, and just a waste in many respects. Today, I saw an article on <a href="http://mashable.com/2010/08/02/key-ring-rewards-card/">Mashable</a> about a free application that completely takes care of managing these for me.</p>
<p>The app, known as <a href="http://keyringapp.com/">Key Ring</a>, will scan your loyalty card and then store it in their database so that anytime you go to the store and you need to use one of these cards,  you can just pull out your phone, open the app, and let them scan the barcode that automatically got generated when you entered all of your rewards cards.</p>
<h2>Video of How Key Ring App Works</h2>
<p><object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" width="425" height="344" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0"><param name="allowFullScreen" value="true" /><param name="allowscriptaccess" value="always" /><param name="src" value="http://www.youtube.com/v/ituahdQTitk&amp;hl=en_US&amp;fs=1" /><param name="allowfullscreen" value="true" /><embed type="application/x-shockwave-flash" width="425" height="344" src="http://www.youtube.com/v/ituahdQTitk&amp;hl=en_US&amp;fs=1" allowscriptaccess="always" allowfullscreen="true"></embed></object></p>
<h2>How to get Key Ring App</h2>
<p>Android users can scan the barcode below using a 2D barcode scanner app to install Key Ring.<br />
<a href="http://joshuamcginnis.com/wp-content/uploads/2010/08/2d_barcode.png"><img src="http://joshuamcginnis.com/wp-content/uploads/2010/08/2d_barcode-300x300.png" alt="key ring app" title="key ring app" width="300" height="300" class="aligncenter size-medium wp-image-2785" /></a></p>
<p>iPhone users &#8211; <a href="itms://itunes.apple.com/us/app/key-ring-reward-cards/id372547556?mt=8">click here to launch iTunes and install the app</a>.</p>
<img src="http://feeds.feedburner.com/~r/joshuamcginnis/~4/1bkCp0WvCRQ" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://joshuamcginnis.com/2010/08/02/best-way-to-manage-multiple-rewards-discount-keychain-card/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://joshuamcginnis.com/2010/08/02/best-way-to-manage-multiple-rewards-discount-keychain-card/</feedburner:origLink></item>
		<item>
		<title>Create a Basic A/B Test Tool with Zend Framework</title>
		<link>http://feedproxy.google.com/~r/joshuamcginnis/~3/fJUk2obPYtA/</link>
		<comments>http://joshuamcginnis.com/2010/07/30/create-a-basic-ab-test-tool-with-zend-framework/#comments</comments>
		<pubDate>Fri, 30 Jul 2010 14:22:53 +0000</pubDate>
		<dc:creator>Joshua McGinnis</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[Web Development]]></category>
		<category><![CDATA[Zend Framework]]></category>

		<guid isPermaLink="false">http://joshuamcginnis.com/?p=2773</guid>
		<description><![CDATA[Below is a A/B testing Zend Framework View Helper that will allow you to easily create a custom A/B test in the event you either don&#8217;t want to pay for a tool, don&#8217;t want to share your data with Google or some other need that other tools can&#8217;t fulfill. Using the A/B Test View Helper [...]]]></description>
				<content:encoded><![CDATA[<p>Below is a A/B testing Zend Framework View Helper that will allow you to easily create a custom A/B test in the event you either don&#8217;t want to pay for a tool, don&#8217;t want to share your data with Google or some other need that other tools can&#8217;t fulfill.</p>
<h3>Using the A/B Test View Helper</h3>
<p>This tool uses cookies to designates which version of a test they should see. To setup a test, call the helper at the top of your control layout with the path to the variant you wish to test passed in as an argument.</p>
<p><strong>View helper call on your control:</strong></p>
<div class="codecolorer-container php twitlight" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br /></div></td><td><div class="php codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">ABTest</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'/path/to/variant-2'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></div></td></tr></tbody></table></div>
<p>As with any test, drive traffic to your control (where you placed the call to the helper). The helper will then randomly place the visitor in either the control or the variant you passed it and set a cookie so that they always get redirected to the right variant in the future.</p>
<p>Don&#8217;t forget to put a call to the helper on all of the variant layouts or views, otherwise the user won&#8217;t be redirected to the control if the user went to the variant directly and have a control cookie.</p>
<p><strong>View helper call on your variant:</strong></p>
<div class="codecolorer-container php twitlight" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br /></div></td><td><div class="php codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">ABTest</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></div></td></tr></tbody></table></div>
<p>This is a quick and dirty solution. If you wanted to build a more robust tool, you might want to consider adding the following features:</p>
<ul>
<li>Consider adding a registerVars method that lets you pass in multiple variants for you test</li>
<li>Support the ability to only put a percentage of traffic into the test (the one below puts 100% of traffic into the test)</li>
<li>Add support for test start and expire date</li>
</ul>
<p><strong>Tracking</strong><br />
A major piece of A/B testing is tracking the visitors to each test, conversions and statistical significance between each test. This helper does not include anything related to tracking. We use our own custom QuickBase-driven tracking mechanism that doesn&#8217;t require integration into the helper, but depending on your needs, you may want to modify the helper to integrate with whatever tracking mechanism you&#8217;re using.</p>
<p>Here&#8217;s the class for the helper:</p>
<div class="codecolorer-container php twitlight" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br />3<br />4<br />5<br />6<br />7<br />8<br />9<br />10<br />11<br />12<br />13<br />14<br />15<br />16<br />17<br />18<br />19<br />20<br />21<br />22<br />23<br />24<br />25<br />26<br />27<br />28<br />29<br />30<br />31<br />32<br />33<br />34<br />35<br />36<br />37<br />38<br />39<br />40<br />41<br />42<br />43<br />44<br />45<br />46<br />47<br />48<br />49<br />50<br />51<br />52<br />53<br />54<br />55<br />56<br />57<br />58<br />59<br />60<br />61<br />62<br />63<br />64<br />65<br />66<br />67<br />68<br />69<br />70<br />71<br />72<br />73<br /></div></td><td><div class="php codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #009933; font-style: italic;">/**<br />
&nbsp;* This is a tool for creating A/B Tests<br />
&nbsp;*<br />
&nbsp;* @author: Joshua McGinnis &lt;joshua_mcginnis@intuit.com&gt;<br />
&nbsp;*/</span><br />
<span style="color: #000000; font-weight: bold;">class</span> App_View_Helper_ABTest <span style="color: #000000; font-weight: bold;">extends</span> Zend_View_Helper_Abstract <span style="color: #009900;">&#123;</span><br />
<br />
&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">protected</span> <span style="color: #000088;">$currentUrl</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">''</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">protected</span> <span style="color: #000088;">$protocol</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">''</span><span style="color: #339933;">;</span><br />
<br />
&nbsp; &nbsp; <span style="color: #009933; font-style: italic;">/**<br />
&nbsp; &nbsp; &nbsp;* Main view helper.<br />
&nbsp; &nbsp; &nbsp;*<br />
&nbsp; &nbsp; &nbsp;* Call this helper at the top of a layout and pass in the variants urls<br />
&nbsp; &nbsp; &nbsp;* or leave empty for variant pages that are part of the test.<br />
&nbsp; &nbsp; &nbsp;* Send all traffic to the control and this script will randomly<br />
&nbsp; &nbsp; &nbsp;* place the visitor in one version of the page or the other.<br />
&nbsp; &nbsp; &nbsp;*<br />
&nbsp; &nbsp; &nbsp;* @param string $variantUrl<br />
&nbsp; &nbsp; &nbsp;*/</span><br />
&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">function</span> ABTest<span style="color: #009900;">&#40;</span><span style="color: #000088;">$variantUrl</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;&quot;</span><span style="color: #009900;">&#41;</span><br />
&nbsp; &nbsp; <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">setCurrentUrl</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009933; font-style: italic;">/**<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;* &nbsp;Check to see if the user is a new visitor, if so, give them a test<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;* &nbsp;cookie and redirect them if put into something other than the<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;* &nbsp;control.<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;*<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;* The following needs to go at the top of each variant to ensure<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;* visitors always end up on the right variant:<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;*<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;*/</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">newTestVisitor</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">&amp;&amp;</span> <a href="http://www.php.net/isset"><span style="color: #990000;">isset</span></a><span style="color: #009900;">&#40;</span><span style="color: #000088;">$variantUrl</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&#123;</span> <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #b1b100;">echo</span> <span style="color: #0000ff;">'set cookies'</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000088;">$url</span> <span style="color: #339933;">=</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">isValidUrl</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$variantUrl</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> ? <span style="color: #000088;">$variantUrl</span> <span style="color: #339933;">:</span> <span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">protocol</span> <span style="color: #339933;">.</span> <span style="color: #000088;">$_SERVER</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'SERVER_NAME'</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">.</span> <span style="color: #000088;">$variantUrl</span><span style="color: #339933;">;</span><br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000088;">$rand</span> <span style="color: #339933;">=</span> <a href="http://www.php.net/rand"><span style="color: #990000;">rand</span></a><span style="color: #009900;">&#40;</span><span style="color: #cc66cc;">0</span><span style="color: #339933;">,</span> <span style="color: #cc66cc;">1</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #b1b100;">echo</span> <span style="color: #000088;">$rand</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$rand</span> <span style="color: #339933;">==</span> <span style="color: #cc66cc;">0</span><span style="color: #009900;">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <a href="http://www.php.net/setcookie"><span style="color: #990000;">setcookie</span></a><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'abTest'</span><span style="color: #339933;">,</span> <span style="color: #000088;">$url</span><span style="color: #339933;">,</span> <a href="http://www.php.net/time"><span style="color: #990000;">time</span></a><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">+</span><span style="color: #cc66cc;">60</span><span style="color: #339933;">*</span><span style="color: #cc66cc;">60</span><span style="color: #339933;">*</span><span style="color: #cc66cc;">24</span><span style="color: #339933;">*</span><span style="color: #cc66cc;">90</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <a href="http://www.php.net/header"><span style="color: #990000;">header</span></a><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;Location: &quot;</span> <span style="color: #339933;">.</span> <span style="color: #000088;">$url</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&#125;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #b1b100;">else</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <a href="http://www.php.net/setcookie"><span style="color: #990000;">setcookie</span></a><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'abTest'</span><span style="color: #339933;">,</span> <span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">currentUrl</span><span style="color: #339933;">,</span> <a href="http://www.php.net/time"><span style="color: #990000;">time</span></a><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">+</span><span style="color: #cc66cc;">60</span><span style="color: #339933;">*</span><span style="color: #cc66cc;">60</span><span style="color: #339933;">*</span><span style="color: #cc66cc;">24</span><span style="color: #339933;">*</span><span style="color: #cc66cc;">90</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&#125;</span><br />
&nbsp; &nbsp; <span style="color: #009900;">&#125;</span><br />
<br />
&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">private</span> <span style="color: #000000; font-weight: bold;">function</span> setCurrentUrl<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><br />
&nbsp; &nbsp; <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">protocol</span> <span style="color: #339933;">=</span> <span style="color: #009900;">&#40;</span><a href="http://www.php.net/isset"><span style="color: #990000;">isset</span></a><span style="color: #009900;">&#40;</span><span style="color: #000088;">$_SERVER</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'HTTPS'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> ? <span style="color: #0000ff;">'https://'</span> <span style="color: #339933;">:</span> <span style="color: #0000ff;">'http://'</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">currentUrl</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">protocol</span> <span style="color: #339933;">.</span> <span style="color: #000088;">$_SERVER</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'SERVER_NAME'</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">.</span> <span style="color: #000088;">$_SERVER</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'REQUEST_URI'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; <span style="color: #009900;">&#125;</span><br />
<br />
&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">function</span> newTestVisitor<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><br />
&nbsp; &nbsp; <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span><a href="http://www.php.net/isset"><span style="color: #990000;">isset</span></a><span style="color: #009900;">&#40;</span><span style="color: #000088;">$_COOKIE</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'abTest'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$_COOKIE</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'abTest'</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;">currentUrl</span><span style="color: #009900;">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <a href="http://www.php.net/header"><span style="color: #990000;">Header</span></a><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;Location: &quot;</span><span style="color: #339933;">.</span> <span style="color: #000088;">$_COOKIE</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'abTest'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&#125;</span> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #b1b100;">else</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #b1b100;">return</span> <span style="color: #009900; font-weight: bold;">true</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; <span style="color: #009900;">&#125;</span><br />
<br />
&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">private</span> <span style="color: #000000; font-weight: bold;">function</span> isValidURL<span style="color: #009900;">&#40;</span><span style="color: #000088;">$url</span><span style="color: #009900;">&#41;</span><br />
&nbsp; &nbsp; <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #b1b100;">return</span> <a href="http://www.php.net/preg_match"><span style="color: #990000;">preg_match</span></a><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'|^http(s)?://[a-z0-9-]+(.[a-z0-9-]+)*(:[0-9]+)?(/.*)?$|i'</span><span style="color: #339933;">,</span> <span style="color: #000088;">$url</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; <span style="color: #009900;">&#125;</span><br />
<span style="color: #009900;">&#125;</span></div></td></tr></tbody></table></div>
<img src="http://feeds.feedburner.com/~r/joshuamcginnis/~4/fJUk2obPYtA" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://joshuamcginnis.com/2010/07/30/create-a-basic-ab-test-tool-with-zend-framework/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://joshuamcginnis.com/2010/07/30/create-a-basic-ab-test-tool-with-zend-framework/</feedburner:origLink></item>
		<item>
		<title>McGinnis Genealogy Group on Facebook</title>
		<link>http://feedproxy.google.com/~r/joshuamcginnis/~3/oRO9Gw44jsY/</link>
		<comments>http://joshuamcginnis.com/2010/07/28/mcginnis-genealogy-group-on-facebook/#comments</comments>
		<pubDate>Wed, 28 Jul 2010 04:54:39 +0000</pubDate>
		<dc:creator>Joshua McGinnis</dc:creator>
				<category><![CDATA[Misc]]></category>

		<guid isPermaLink="false">http://joshuamcginnis.com/?p=2756</guid>
		<description><![CDATA[Last month, I created a Facebook group dedicated to McGinnis Genealogy. If you manage to find this post by searching for some &#8216;McGinnis&#8217; related keyword, please feel free to join the group and contribute to other McGinnis relatives who are looking for McGinnis genealogy info. P4GJAGVPJFEF]]></description>
				<content:encoded><![CDATA[<p>Last month, I created a Facebook group dedicated to <a href="http://www.facebook.com/group.php?gid=123319924373850&amp;v=wall&amp;ref=ts">McGinnis Genealogy</a>. If you manage to find this post by searching for some &#8216;McGinnis&#8217; related keyword, please feel free to join the group and contribute to other McGinnis relatives who are looking for McGinnis genealogy info.</p>
<p><iframe src="http://www.facebook.com/plugins/likebox.php?id=123319924373850&amp;width=525&amp;connections=10&amp;stream=false&amp;header=true&amp;height=287" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:525px; height:287px; " allowTransparency="true"></iframe></p>
<a href="http://www.facebook.com/group.php?gid=123319924373850&amp;v=wall&amp;ref=tso" ><input name="submit" type="submit" id="submit" value="Visit Group" /></a>
<p>P4GJAGVPJFEF</p>
<img src="http://feeds.feedburner.com/~r/joshuamcginnis/~4/oRO9Gw44jsY" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://joshuamcginnis.com/2010/07/28/mcginnis-genealogy-group-on-facebook/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://joshuamcginnis.com/2010/07/28/mcginnis-genealogy-group-on-facebook/</feedburner:origLink></item>
		<item>
		<title>Create an Annotated Timeline with the Google Visualization API and QuickBase API</title>
		<link>http://feedproxy.google.com/~r/joshuamcginnis/~3/sq3ap2ut0u8/</link>
		<comments>http://joshuamcginnis.com/2010/07/27/create-an-annotated-timeline-with-the-google-visualization-api-and-quickbase-api/#comments</comments>
		<pubDate>Tue, 27 Jul 2010 14:58:31 +0000</pubDate>
		<dc:creator>Joshua McGinnis</dc:creator>
				<category><![CDATA[API]]></category>
		<category><![CDATA[Google]]></category>
		<category><![CDATA[Javascript]]></category>
		<category><![CDATA[QuickBase]]></category>

		<guid isPermaLink="false">http://joshuamcginnis.com/?p=2616</guid>
		<description><![CDATA[The Google Visualization API has a lot of really useful charts and graphs that, when combined with a web-based database like QuickBase, can really be powerful. Here&#8217;s a complete example of how to use the PHP SDK for QuickBase to get data from a QuickBase and use it side-by-side with the Google Visualization API to [...]]]></description>
				<content:encoded><![CDATA[<p>The <a href="http://code.google.com/apis/visualization/documentation/gallery/annotatedtimeline.html">Google Visualization API</a> has a lot of really useful charts and graphs that, when combined with a <a href="http://quickbase.intuit.com">web-based database</a> like QuickBase, can really be powerful. </p>
<p><a href="http://joshuamcginnis.com/wp-content/uploads/2010/07/annotated_timeline.gif"><img src="http://joshuamcginnis.com/wp-content/uploads/2010/07/annotated_timeline.gif" alt="Google Annotated Timeline" title="Google Annotated Timeline" width="533" height="250" class="aligncenter size-full wp-image-2619" /></a></p>
<p>Here&#8217;s a complete example of how to use the <a href="https://code.intuit.com/sf/projects/qb_php_sdk">PHP SDK for QuickBase</a> to get data from a QuickBase and use it side-by-side with the Google Visualization API to generate annotated time line. The example below is one I used to compare the total number of trials we get on our website with the number of inbound support cases we get.</p>
<p>You&#8217;re going to see some date manipulation going on here. QuickBase ouputs the &#8216;Date Created&#8217; timestamp in milliseconds. I needed to turn this into a format that was easy for the Javascript date() function would be able to parse. I also wanted to normalize the dates so that I could group the total number of support cases by day.</p>
<div class="codecolorer-container php twitlight" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br />3<br />4<br />5<br />6<br />7<br />8<br />9<br />10<br />11<br />12<br />13<br />14<br />15<br />16<br />17<br />18<br />19<br />20<br />21<br />22<br />23<br />24<br />25<br />26<br />27<br />28<br />29<br />30<br />31<br />32<br />33<br />34<br />35<br />36<br />37<br />38<br />39<br />40<br />41<br />42<br />43<br />44<br />45<br />46<br />47<br />48<br />49<br />50<br />51<br />52<br />53<br />54<br />55<br />56<br />57<br />58<br />59<br />60<br />61<br />62<br />63<br />64<br />65<br />66<br /></div></td><td><div class="php codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #000000; font-weight: bold;">&lt;?php</span><br />
&nbsp; &nbsp; <span style="color: #b1b100;">include</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'qb.php'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; <span style="color: #000088;">$quickbase</span> <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> QuickBase<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">''</span><span style="color: #339933;">,</span><span style="color: #0000ff;">''</span><span style="color: #339933;">,</span><span style="color: #009900; font-weight: bold;">true</span><span style="color: #339933;">,</span><span style="color: #0000ff;">'chljaara'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">//replace chljaara with your table dbid</span><br />
&nbsp; &nbsp; <span style="color: #000088;">$result</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$quickbase</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">do_query</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">''</span><span style="color: #339933;">,</span><span style="color: #0000ff;">'123'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">//replace 123 with your query id</span><br />
<br />
&nbsp; &nbsp; <span style="color: #000088;">$trials</span> <span style="color: #339933;">=</span> <a href="http://www.php.net/array"><span style="color: #990000;">array</span></a><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; <br />
&nbsp; &nbsp; <span style="color: #666666; font-style: italic;">// build a 2d array for the Google chart</span><br />
&nbsp; &nbsp; <span style="color: #b1b100;">foreach</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$result</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">table</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">records</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">record</span> <span style="color: #b1b100;">as</span> <span style="color: #000088;">$record</span><span style="color: #009900;">&#41;</span><br />
&nbsp; &nbsp; <span style="color: #009900;">&#123;</span><br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000088;">$timestamp</span> <span style="color: #339933;">=</span> <a href="http://www.php.net/round"><span style="color: #990000;">round</span></a><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#40;</span>double<span style="color: #009900;">&#41;</span><span style="color: #000088;">$record</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">f</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">/</span> <span style="color: #cc66cc;">1000</span><span style="color: #339933;">,</span> <span style="color: #cc66cc;">0</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000088;">$date_string</span> <span style="color: #339933;">=</span> <a href="http://www.php.net/date"><span style="color: #990000;">date</span></a><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;F j, Y&quot;</span><span style="color: #339933;">,</span> <span style="color: #000088;">$timestamp</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000088;">$case_type</span> <span style="color: #339933;">=</span> <span style="color: #009900;">&#40;</span>string<span style="color: #009900;">&#41;</span> <span style="color: #000088;">$record</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">f</span><span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">1</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span><br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span><a href="http://www.php.net/array_key_exists"><span style="color: #990000;">array_key_exists</span></a><span style="color: #009900;">&#40;</span><span style="color: #000088;">$date_string</span><span style="color: #339933;">,</span> <span style="color: #000088;">$trials</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span><a href="http://www.php.net/array_key_exists"><span style="color: #990000;">array_key_exists</span></a><span style="color: #009900;">&#40;</span><span style="color: #000088;">$case_type</span><span style="color: #339933;">,</span> <span style="color: #000088;">$trials</span><span style="color: #009900;">&#91;</span><span style="color: #000088;">$date_string</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000088;">$trials</span><span style="color: #009900;">&#91;</span><span style="color: #000088;">$date_string</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#91;</span><span style="color: #000088;">$case_type</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">+=</span> <span style="color: #cc66cc;">1</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&#125;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #b1b100;">else</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000088;">$trials</span><span style="color: #009900;">&#91;</span><span style="color: #000088;">$date_string</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#91;</span><span style="color: #000088;">$case_type</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> <span style="color: #cc66cc;">1</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&#125;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #b1b100;">else</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000088;">$trials</span><span style="color: #009900;">&#91;</span><span style="color: #000088;">$date_string</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">=</span> <a href="http://www.php.net/array"><span style="color: #990000;">array</span></a><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; <span style="color: #009900;">&#125;</span><br />
<span style="color: #000000; font-weight: bold;">?&gt;</span><br />
&lt;!DOCTYPE HTML&gt;<br />
&lt;html&gt;<br />
&nbsp; &lt;head&gt;<br />
&nbsp; &nbsp; &lt;script type='text/javascript' src='http://www.google.com/jsapi'&gt;&lt;/script&gt;<br />
&nbsp; &nbsp; &lt;script type='text/javascript'&gt;<br />
&nbsp; &nbsp; &nbsp; google.load('visualization', '1', {'packages':['annotatedtimeline']});<br />
&nbsp; &nbsp; &nbsp; google.setOnLoadCallback(drawChart);<br />
&nbsp; &nbsp; &nbsp; function drawChart() {<br />
&nbsp; &nbsp; &nbsp; &nbsp; var data = new google.visualization.DataTable();<br />
&nbsp; &nbsp; &nbsp; &nbsp; data.addColumn('date', 'Date');<br />
&nbsp; &nbsp; &nbsp; &nbsp; data.addColumn('number', 'Trials');<br />
&nbsp; &nbsp; &nbsp; &nbsp; data.addColumn('number', 'Support Cases');<br />
&nbsp; &nbsp; &nbsp; &nbsp; data.addRows<br />
&nbsp; &nbsp; &nbsp; &nbsp; ([<br />
<span style="color: #000000; font-weight: bold;">&lt;?php</span><br />
&nbsp; &nbsp; <span style="color: #b1b100;">foreach</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$trials</span> <span style="color: #b1b100;">as</span> <span style="color: #000088;">$key</span> <span style="color: #339933;">=&gt;</span> <span style="color: #000088;">$val</span><span style="color: #009900;">&#41;</span><br />
&nbsp; &nbsp; <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000088;">$trials</span> <span style="color: #339933;">=</span> <a href="http://www.php.net/isset"><span style="color: #990000;">isset</span></a><span style="color: #009900;">&#40;</span><span style="color: #000088;">$val</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'Trial'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span> ? <span style="color: #000088;">$val</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'Trial'</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">:</span> <span style="color: #cc66cc;">0</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000088;">$support_cases</span> <span style="color: #339933;">=</span> <a href="http://www.php.net/isset"><span style="color: #990000;">isset</span></a><span style="color: #009900;">&#40;</span><span style="color: #000088;">$val</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'Support Case'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span> ? <span style="color: #000088;">$val</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'Support'</span> <span style="color: #b1b100;">Case</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">:</span> <span style="color: #cc66cc;">0</span><span style="color: #339933;">;</span><br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #b1b100;">echo</span> <span style="color: #0000ff;">'[new Date(&quot;'</span><span style="color: #339933;">.</span> <span style="color: #000088;">$key</span> <span style="color: #339933;">.</span><span style="color: #0000ff;">'&quot;), '</span> <span style="color: #339933;">.</span> <span style="color: #000088;">$trials</span> <span style="color: #339933;">.</span> <span style="color: #0000ff;">', '</span> <span style="color: #339933;">.</span> <span style="color: #000088;">$support_cases</span> <span style="color: #339933;">.</span> <span style="color: #0000ff;">'],'</span> <span style="color: #339933;">.</span> <span style="color: #0000ff;">&quot;<span style="color: #000099; font-weight: bold;">\r</span>&quot;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; <span style="color: #009900;">&#125;</span><br />
<span style="color: #000000; font-weight: bold;">?&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; ]);<br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; var chart = new google.visualization.AnnotatedTimeLine(document.getElementById('chart_div'));<br />
&nbsp; &nbsp; &nbsp; &nbsp; chart.draw(data, {displayAnnotations: true, fill: 10});<br />
&nbsp; &nbsp; &nbsp; }<br />
&nbsp; &nbsp; &lt;/script&gt;<br />
&nbsp; &lt;/head&gt;<br />
<br />
&nbsp; &lt;body&gt;<br />
<br />
&nbsp; &nbsp; &lt;div id='chart_div' style='width: 90%; height: 70%;'&gt;&lt;/div&gt;<br />
<br />
&nbsp; &lt;/body&gt;<br />
&lt;/html&gt;</div></td></tr></tbody></table></div>
<img src="http://feeds.feedburner.com/~r/joshuamcginnis/~4/sq3ap2ut0u8" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://joshuamcginnis.com/2010/07/27/create-an-annotated-timeline-with-the-google-visualization-api-and-quickbase-api/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		<feedburner:origLink>http://joshuamcginnis.com/2010/07/27/create-an-annotated-timeline-with-the-google-visualization-api-and-quickbase-api/</feedburner:origLink></item>
		<item>
		<title>Embedding QRCode Barcodes in Intuit QuickBase</title>
		<link>http://feedproxy.google.com/~r/joshuamcginnis/~3/qyZ4SMoAdnw/</link>
		<comments>http://joshuamcginnis.com/2010/07/27/embedding-qrcode-barcodes-in-intuit-quickbase/#comments</comments>
		<pubDate>Tue, 27 Jul 2010 14:29:31 +0000</pubDate>
		<dc:creator>Joshua McGinnis</dc:creator>
				<category><![CDATA[API]]></category>
		<category><![CDATA[QuickBase]]></category>
		<category><![CDATA[Tutorials]]></category>

		<guid isPermaLink="false">http://joshuamcginnis.com/?p=2603</guid>
		<description><![CDATA[Title: Embedding QRCode Barcodes in Intuit QuickBase This post will describe how you can use the Google Charts API to embed to dynamically create QRCodes for contacts in a QuickBase online database application. QR Codes are a 2D barcode that can store a bit more data than standard barcodes, such as a complete person’s contact [...]]]></description>
				<content:encoded><![CDATA[<p>Title: Embedding QRCode Barcodes in Intuit QuickBase</p>
<p>This post will describe how you can use the <a href="http://code.google.com/apis/chart/">Google Charts API</a> to embed to dynamically create QRCodes for contacts in a QuickBase <a href="http://quickbase.intuit.com/">online database</a> application.</p>
<p><a href="http://joshuamcginnis.com/wp-content/uploads/2010/07/qrcode.gif"><img class="alignleft size-medium wp-image-2608" title="QR Code in QuickBase" src="http://joshuamcginnis.com/wp-content/uploads/2010/07/qrcode-300x172.gif" alt="QR Code in QuickBase" width="300" height="172" /></a>QR Codes are a 2D barcode that can store a bit more data than standard barcodes, such as a complete person’s contact information with their Name, Company, Email &amp; Phone Number.</p>
<h2><strong>Embedding the QRCode in Your Application</strong></h2>
<p>Before you begin, you will need to navigate to the table where your contacts are located and add a new “Formula &#8211; Text” field where you want the QRCode to be visible on your ‘Contacts’ form.</p>
<h3><strong>Adding the new field to your contacts table</strong></h3>
<p>One way of accomplishing this is to view or edit a contact record and then right click beneath one of the existing fields and then click on a ‘Add a field after this one …’.</p>
<p>This will bring you to the Add a Field to a Form screen. Scroll all the way down and clicked on &lt;Create a New Field&gt;.</p>
<p>Set the Field Label to ‘QRCode’ (or whatever you want to label it). Set the field type to ‘Formulat – Text’<a href="http://joshuamcginnis.com/wp-content/uploads/2010/07/add_field.gif"><img class="alignright size-medium wp-image-2605" title="Add Field in QuickBase" src="http://joshuamcginnis.com/wp-content/uploads/2010/07/add_field-300x171.gif" alt="Add Field in QuickBase" width="300" height="171" /></a></p>
<h3><strong>Generating the QRCode formula code</strong></h3>
<p>Once you have created the field, you can right-click on the field in the view contact record form and then click on ‘Edit the field properties for this field’.</p>
<p>This will bring you to a screen where you can edit the ‘Formula’ for this field.</p>
<h4><strong>Understanding how the formula field works</strong></h4>
<p><a href="http://joshuamcginnis.com/wp-content/uploads/2010/07/field_properties.gif"><img class="alignleft size-medium wp-image-2606" title="Field Properties in QuickBase" src="http://joshuamcginnis.com/wp-content/uploads/2010/07/field_properties-300x294.gif" alt="Field Properties in QuickBase" width="300" height="294" /></a>The formula field is a textbox that lets you insert html intermingled with variables that represent fields in your application.</p>
<p>When a formula field is rendered, the server is parsing the contents of the formula field and dynamically generating the output before you see what is on the screen.</p>
<p>This is why if you put in a formula that uses a field called [First Name] , you see “Joshua” on the report and not [First Name]. The server has dynamically replaced the first name variable with the first name of the person corresponding to the record you are viewing.</p>
<p>This will come in handy when understanding how the QRCode is being built.</p>
<h2><strong>The QRCode Formula</strong></h2>
<p>You are allowed to put HTML in formula fields which means that you can make a report that will display an image using the img tag.</p>
<p>The first step is to create an empty image tag and put that in your formula field. It should look the following:</p>
<div class="codecolorer-container html4strict twitlight" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br /></div></td><td><div class="html4strict codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">&quot;<span style="color: #009900;">&lt;<a href="http://december.com/html/4/element/img.html"><span style="color: #000000; font-weight: bold;">img</span></a> <span style="color: #000066;">src</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;\&quot;</span> <span style="color: #000066;">alt</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;\&amp;quot;\&amp;quot;/&quot;</span> <span style="color: #66cc66;">/</span>&gt;</span>&quot;</div></td></tr></tbody></table></div>
<p>Notice that strings (and any HTML is considered a string) must be surrounded with quotes. Anywhere that you will need quotes to be rendered, to surround the src and alt attributes for example, you will need to escape the quotes with a \.</p>
<p>When you want to append a field with a string, you must close the string with a quote and concatenate the field with a plus sign. <a href="https://www.quickbase.com/help/default.html#using_formulas_in_QuickBase.html">Click here for help using formulas in QuickBase</a>.</p>
<p>And finally, here’s the complete formula field value:</p>
<div class="codecolorer-container html4strict twitlight" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br /></div></td><td><div class="html4strict codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">&quot;<span style="color: #009900;">&lt;<a href="http://december.com/html/4/element/img.html"><span style="color: #000000; font-weight: bold;">img</span></a> <span style="color: #000066;">src</span><span style="color: #66cc66;">=</span>\<span style="color: #ff0000;">&quot;http://chart.apis.google.com/chart?cht=qr&amp;chs=120x120&amp;chl=MECARD%3AN%3A&quot;</span>&amp;<span style="color: #66cc66;">&#91;</span>First <span style="color: #000066;">Name</span><span style="color: #66cc66;">&#93;</span>&amp;<span style="color: #ff0000;">&quot;+&quot;</span>&amp;<span style="color: #66cc66;">&#91;</span>Last <span style="color: #000066;">Name</span><span style="color: #66cc66;">&#93;</span>&amp;<span style="color: #ff0000;">&quot;%3BTEL%3A&quot;</span>&amp;<span style="color: #66cc66;">&#91;</span>Phone<span style="color: #66cc66;">&#93;</span>&amp;<span style="color: #ff0000;">&quot;%3BEMAIL%3A&quot;</span>&amp;<span style="color: #66cc66;">&#91;</span>E-mail Address<span style="color: #66cc66;">&#93;</span>&amp;<span style="color: #ff0000;">&quot;%3BURL%3Ahttp://quickbase.intuit.com/%3B\&quot;</span> <span style="color: #000066;">alt</span><span style="color: #66cc66;">=</span>\<span style="color: #ff0000;">&quot;\&quot;</span><span style="color: #66cc66;">/</span>&gt;</span>&quot;</div></td></tr></tbody></table></div>
<p>If your name, email, address, and url fields are different – you should replace them with whatever the name of your fields are.</p>
<p>If you examine the code, you’ll see that all that is happening is that you are creating an image tag that dynamically passes in information about the contact record to a url that spites out the QRCode.</p>
<p><a href="http://joshuamcginnis.com/wp-content/uploads/2010/07/formula_field.gif"><img class="aligncenter size-full wp-image-2607" title="Formula Field in QuickBase" src="http://joshuamcginnis.com/wp-content/uploads/2010/07/formula_field.gif" alt="Formula Field in QuickBase" width="705" height="94" /></a></p>
<p>If you find a good use for these QR Codes in QuickBase, let me know. I’m sure many folks here at QuickBase would be interested to see how you are putting this feature to use.</p>
<img src="http://feeds.feedburner.com/~r/joshuamcginnis/~4/qyZ4SMoAdnw" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://joshuamcginnis.com/2010/07/27/embedding-qrcode-barcodes-in-intuit-quickbase/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		<feedburner:origLink>http://joshuamcginnis.com/2010/07/27/embedding-qrcode-barcodes-in-intuit-quickbase/</feedburner:origLink></item>
		<item>
		<title>Website For Mushroom Pictures, Identification and Mycology</title>
		<link>http://feedproxy.google.com/~r/joshuamcginnis/~3/i-J7luuMH04/</link>
		<comments>http://joshuamcginnis.com/2010/07/22/website-for-mushroom-pictures-identification-and-mycology/#comments</comments>
		<pubDate>Thu, 22 Jul 2010 00:27:51 +0000</pubDate>
		<dc:creator>Joshua McGinnis</dc:creator>
				<category><![CDATA[Mycology]]></category>

		<guid isPermaLink="false">http://www.joshuamcginnis.com/?p=2452</guid>
		<description><![CDATA[Over the past few months, I’ve taken up the hobby of mushroom hunting and identification. This has caused quite the few people to scratch their heads, not excluding my neighbor who recently inquired about the “indoor greenhouse” I had setup in my basement to look like a lab of some sort. Once I explained to [...]]]></description>
				<content:encoded><![CDATA[<p>Over the past few months, I’ve taken up the hobby of mushroom hunting and identification. This has caused quite the few people to scratch their heads, not excluding my neighbor who recently inquired about the “indoor greenhouse” I had setup in my basement to look like a lab of some sort. Once I explained to him that my little operation was for growing shiitake mushrooms, he was actually quite intrigued.</p>
<p><a href="http://joshuamcginnis.com/wp-content/uploads/2010/07/IL3jcl.jpg"><img class="alignleft size-medium wp-image-2582" title="Mushroom" src="http://joshuamcginnis.com/wp-content/uploads/2010/07/IL3jcl-300x225.jpg" alt="Mushroom" width="300" height="225" /></a>So why mushrooms and why now? Well, I’ve always been curious about how mushrooms grew and if it were possible to grow your own. I knew that it wasn’t going to be easy; otherwise more people would have done it. How many times have you gone over to someone’s house and noticed a mushroom growing in the window?</p>
<p>But alas, I did some googling and ended up finding two major resources that made me realize growing mushrooms was possible: <a href="http://www.mushroomvideos.com/">http://www.mushroomvideos.com/</a> and <a href="http://www.shroomery.org">http://www.shroomery.org</a>.</p>
<p>Mushroomvideos.com outlined something called the BRF/PF Tek (which stands for the Brown Rice Flower Technique) method of growing mushrooms. Using easily obtainable materials such as jars, ground brown rice flour and spores purchased from the internet, it seemed it was indeed possible to grow mushrooms at home.</p>
<p>So naturally, I ordered the necessary supplies and two books by Paul Stamets, the originator of many techniques for finding and growing various mushrooms – especially those that can be sold in markets.</p>
<p>In the meantime, while I work on trying to successfully grow my first mushroom (I’ve got beech and shiitakes incubating), I’ve been going on periodic mushroom hunts in the <a href="http://maps.google.com/maps?f=q&amp;source=s_q&amp;hl=en&amp;geocode=&amp;q=Storer+Convervation+waltham,+ma&amp;sll=37.0625,-95.677068&amp;sspn=49.490703,107.138672&amp;gl=us&amp;ie=UTF8&amp;hq=Storer+Convervation&amp;hnear=Waltham,+Middlesex,+Massachusetts&amp;ll=42.391326,-71.230459&amp;spn=0.043866,0.104628&amp;z=14&amp;iwloc=A">Storer Convervation land</a>, right next to the Robert Treat Paine Estate where I recently got married.</p>
<p><img class="alignright size-medium wp-image-2585" title="Slime Mold Fungus" src="http://joshuamcginnis.com/wp-content/uploads/2010/07/PQdEV-300x225.jpg" alt="Slime Mold Fungus" width="300" height="225" /></p>
<p>And after taking lots of pictures of my finds, I decided I would create a tumblelog for other amateur mycologists that post my pictures and pictures of the mushrooms from the community along with the best guess classification of the mushroom.</p>
<p>I don’t have a lot of time to devote to the site, much less any website outside of work, but tumblelogs are pretty easy to maintain and I figured this <em>could</em> help others identify their own mushrooms by comparing my photos with the mushroom they found.</p>
<p>You can find my site dedicated to mushroom identification here: <a href="http://www.shrooman.com/">http://www.shrooman.com/</a></p>
<img src="http://feeds.feedburner.com/~r/joshuamcginnis/~4/i-J7luuMH04" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://joshuamcginnis.com/2010/07/22/website-for-mushroom-pictures-identification-and-mycology/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://joshuamcginnis.com/2010/07/22/website-for-mushroom-pictures-identification-and-mycology/</feedburner:origLink></item>
		<item>
		<title>WebEX API PHP SDK</title>
		<link>http://feedproxy.google.com/~r/joshuamcginnis/~3/JvU55BuJrQg/</link>
		<comments>http://joshuamcginnis.com/2010/07/12/webex-api-php-sdk/#comments</comments>
		<pubDate>Mon, 12 Jul 2010 23:26:58 +0000</pubDate>
		<dc:creator>Joshua McGinnis</dc:creator>
				<category><![CDATA[API]]></category>
		<category><![CDATA[Open Source]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Portfolio]]></category>
		<category><![CDATA[Web Development]]></category>
		<category><![CDATA[XML]]></category>

		<guid isPermaLink="false">http://www.joshuamcginnis.com/?p=2455</guid>
		<description><![CDATA[Are you a PHP developer looking to do WebEx API Integration for things like: Getting WebEx meeting information Retrieving a list of WebEx Event attendees Creating new Meeting and Event attendees Well, good news &#8211; there is now a WebEx PHP SDK (really &#8211; just a class with a set of wrapper methods) that makes [...]]]></description>
				<content:encoded><![CDATA[<p><a href="http://www.joshuamcginnis.com/wp-content/uploads/2010/07/webex-api.png"><img class="aligncenter size-full wp-image-2524" title="WebEx PHP SDK" src="http://www.joshuamcginnis.com/wp-content/uploads/2010/07/webex-api.png" alt="WebEx PHP SDK" width="558" height="311" /></a></p>
<p>Are you a PHP developer looking to do WebEx API Integration for things like:</p>
<ul>
<li>Getting WebEx meeting information</li>
<li>Retrieving a list of WebEx Event attendees</li>
<li>Creating new Meeting and Event attendees</li>
</ul>
<p>Well, good news &#8211; there is now a WebEx PHP SDK (really &#8211; just a class with a set of wrapper methods) that makes interacting with the WebEx API Easy.</p>
<p class="center"><a href="http://joshuamcginnis.com/webex/" target="_blank"><input name="submit" type="submit" id="submit" value="Download SDK" /></a></p>
<h2>WebEx API Methods</h2>
<p>Below is a list of methods that the current WebEx PHP SDK supports:</p>
<ul>
<li>user_LstsummaryUser()</li>
<li>meeting_GetjoinurlMeeting()</li>
<li>event_LstsummaryProgram()</li>
<li>event_LstsummaryEvent()</li>
<li>attendee_CreateMeetingAttendee()</li>
<li>attendee_LstMeetingAttendee()</li>
<li>attendee_RegisterMeetingAttendee()</li>
</ul>
<h3>Additonal WebEx API Resources:</h3>
<ul>
<li><a href="http://developer.webex.com/web/meetingservices/xmlapi">WebEx XML API Documentation</a></li>
<li><a href="http://developer.webex.com/web/meetingservices/urlapi">WebEx URL API Documentation</a></li>
<li><a href="http://developer.webex.com/web/meetingservices/codesamples">WebEx API Code Samples</a></li>
</ul>
<img src="http://feeds.feedburner.com/~r/joshuamcginnis/~4/JvU55BuJrQg" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://joshuamcginnis.com/2010/07/12/webex-api-php-sdk/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		<feedburner:origLink>http://joshuamcginnis.com/2010/07/12/webex-api-php-sdk/</feedburner:origLink></item>
		<item>
		<title>QuickBase Team Leadership Blog</title>
		<link>http://feedproxy.google.com/~r/joshuamcginnis/~3/GOOkxHYnarI/</link>
		<comments>http://joshuamcginnis.com/2010/07/12/quickbase-team-leadership-blog/#comments</comments>
		<pubDate>Mon, 12 Jul 2010 22:07:07 +0000</pubDate>
		<dc:creator>Joshua McGinnis</dc:creator>
				<category><![CDATA[Portfolio]]></category>
		<category><![CDATA[QuickBase]]></category>
		<category><![CDATA[WordPress]]></category>

		<guid isPermaLink="false">http://www.joshuamcginnis.com/?p=2491</guid>
		<description><![CDATA[In March of 2010, Intuit QuickBase launched it&#8217;s Team Leadership &#38; Productivity Blog. The blog is now focused on helping team leaders learn how to be better leader and drive productivity within their group. Before the launch; however, a lot of work went into the planning of the website. This included: Who is the target [...]]]></description>
				<content:encoded><![CDATA[<p><a href="http://www.joshuamcginnis.com/wp-content/uploads/2010/07/quickbase_blog.jpg"><img class="alignleft size-medium wp-image-2498" title="QuickBase Blog" src="http://www.joshuamcginnis.com/wp-content/uploads/2010/07/quickbase_blog-300x184.jpg" alt="QuickBase Blog" width="300" height="184" /></a> In March of 2010, <a href="http://quickbase.intuit.com">Intuit QuickBase</a> launched it&#8217;s <a href="http://quickbase.intuit.com/blog">Team Leadership &amp; Productivity Blog</a>. The blog is now focused on helping team leaders learn how to be better leader and drive productivity within their group.</p>
<p>Before the launch; however, a lot of work went into the planning of the website. This included:</p>
<ul>
<li>Who is the target audience for the blog</li>
<li>What are our business objectives</li>
<li>Where would the new blog live?</li>
<li>How will we use our social networks to promote the blog?</li>
</ul>
<h2>From Idea to Website</h2>
<p>After these crucial business and marketing questions were answers, I stepped in to help turn the idea of a new blog into reality. With the business and marketing requirements in hand, I was left with the following questions on the technical side:</p>
<ul>
<li>Where in the website information architecture will this blog live?</li>
<li>How will the blog maintain a unique identity, yet still feel like it belongs?</li>
<li>What platform we will use to serve up the content?</li>
<li>Who will design the new blog?</li>
</ul>
<p>Once these questions were resolve, I was able to design and build the new blog in two short weeks by sourcing an external vendor for design and development. Once the design was ready, we sliced and diced the PSD into XHTML/CSS and integrated the code into a WordPress theme &#8211; complete with dynamic sidebar functionality and custom implementations of the social widgets.</p>
<img src="http://feeds.feedburner.com/~r/joshuamcginnis/~4/GOOkxHYnarI" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://joshuamcginnis.com/2010/07/12/quickbase-team-leadership-blog/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://joshuamcginnis.com/2010/07/12/quickbase-team-leadership-blog/</feedburner:origLink></item>
		<item>
		<title>QuickBase &amp; WebEx Webinar Registration System</title>
		<link>http://feedproxy.google.com/~r/joshuamcginnis/~3/womULrJ0VDA/</link>
		<comments>http://joshuamcginnis.com/2010/07/12/quickbase-webex-webinar-registration-system/#comments</comments>
		<pubDate>Mon, 12 Jul 2010 16:16:13 +0000</pubDate>
		<dc:creator>Joshua McGinnis</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://www.joshuamcginnis.com/?p=2457</guid>
		<description />
				<content:encoded><![CDATA[<img src="http://feeds.feedburner.com/~r/joshuamcginnis/~4/womULrJ0VDA" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://joshuamcginnis.com/2010/07/12/quickbase-webex-webinar-registration-system/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://joshuamcginnis.com/2010/07/12/quickbase-webex-webinar-registration-system/</feedburner:origLink></item>
		<item>
		<title>Intuit QuickBase Website</title>
		<link>http://feedproxy.google.com/~r/joshuamcginnis/~3/TgFgS3c9MPM/</link>
		<comments>http://joshuamcginnis.com/2010/07/10/intuit-quickbase-website/#comments</comments>
		<pubDate>Sat, 10 Jul 2010 08:41:21 +0000</pubDate>
		<dc:creator>Joshua McGinnis</dc:creator>
				<category><![CDATA[API]]></category>
		<category><![CDATA[CSS]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Portfolio]]></category>
		<category><![CDATA[QuickBase]]></category>
		<category><![CDATA[Web Development]]></category>
		<category><![CDATA[WordPress]]></category>
		<category><![CDATA[XHTML]]></category>
		<category><![CDATA[XML]]></category>
		<category><![CDATA[Zend Framework]]></category>

		<guid isPermaLink="false">http://blog.joshuamcginnis.com/?p=850</guid>
		<description><![CDATA[Since December of 2007, I have had the privilege of being the webmaster of the Intuit QuickBase web marketing website. What is QuickBase? Simply put, QuickBase is an online database that business users can use for building and running web-based applications. Uses for the types of applications QuickBase customers might create are for project management, [...]]]></description>
				<content:encoded><![CDATA[<p>Since December of 2007, I have had the privilege of being the webmaster of the <a href="http://quickbase.intuit.com">Intuit QuickBase</a> web marketing website.</p>
<h2><strong>What is QuickBase?</strong></h2>
<p>Simply put, QuickBase is an online database that business users can use for building and running web-based applications.  <a href="http://joshuamcginnis.com/wp-content/uploads/2010/07/hero.gif"><img src="http://joshuamcginnis.com/wp-content/uploads/2010/07/hero-300x101.gif" alt="Intuit QuickBase Hero" title="Intuit QuickBase Hero" width="300" height="101" class="alignleft size-medium wp-image-2573" /></a>Uses for the types of applications QuickBase customers might create are for project management, sales management, and order tracking. </p>
<p>QuickBase is used by over 50 of the Fortune 100 and has hundreds of thousands of users. Because it is owned and operated by Intuit (makers of TurboTax, Quicken and QuickBooks),  it extremely stable and secure.</p>
<h2><strong>My Job at QuickBase as the Webmaster</strong></h2>
<ul>
<li>Drive the overall execution of marketing’s website strategies and drive business results</li>
<li>Work to define customer success and drive tangible business results to achieve group goals</li>
<li>Support the QuickBase team by acting as a designer/developer, ultimately helping them execute their campaigns, tasks, and events</li>
<li>Act as liaison for channeling marketing technical and business requirements to the QuickBase PD team</li>
<li>Establish self as a thought leader in QuickBase website integration among QuickBase customers</li>
</ul>
<p><a href="http://joshuamcginnis.com/wp-content/uploads/2010/07/resources.gif"><img src="http://joshuamcginnis.com/wp-content/uploads/2010/07/resources-300x217.gif" alt="QuickBase Resources" title="QuickBase Resources" width="300" height="217" class="alignright size-medium wp-image-2574" /></a></p>
<p><a href="http://joshuamcginnis.com/wp-content/uploads/2010/07/customers.gif"><img src="http://joshuamcginnis.com/wp-content/uploads/2010/07/customers-300x105.gif" alt="QuickBase Customers" title="QuickBase Customers" width="300" height="105" class="alignright size-medium wp-image-2572" /></a></p>
<h2><strong>Technologies Used on the QuickBase Marketing Website</strong></h2>
<ul>
<li>XHTML<strong> </strong></li>
<li>CSS<strong> </strong></li>
<li>XML<strong> </strong></li>
<li>PHP<strong></strong></li>
<li>Apache<strong></strong></li>
<li>Redhat Enterprise Linux</li>
<li>Zend Framework<strong></strong></li>
<li>MySQL<strong></strong></li>
<li>WordPress<strong></strong></li>
<li>Drupal<strong></strong></li>
<li>WebEx API<strong></strong></li>
<li>Engage B2B WSAPI<strong></strong></li>
<li>QuickBase <strong></strong></li>
<li>Google Search Appliance<strong></strong></li>
<li>And much more …</li>
</ul>
<p style="margin: 5px 0 10px 0;"><a href="http://quickbase.intuit.com/" ”_blank”><input name="submit" type="submit" id="submit" value="Launch QuickBase" /></a></p>
<h5><strong>Want to learn more?</strong></h5>
<p>If you&#8217;re interested in learning more about the QuickBase website or you have any questions, please feel free to <a href="http://quickbase.intuit.com/contact/">contact me</a>.</p>
<img src="http://feeds.feedburner.com/~r/joshuamcginnis/~4/TgFgS3c9MPM" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://joshuamcginnis.com/2010/07/10/intuit-quickbase-website/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://joshuamcginnis.com/2010/07/10/intuit-quickbase-website/</feedburner:origLink></item>
		<item>
		<title>Easy Cross-Browser @font-face Solution</title>
		<link>http://feedproxy.google.com/~r/joshuamcginnis/~3/ToJb3Pp9iRM/</link>
		<comments>http://joshuamcginnis.com/2010/07/09/easy-cross-browser-font-face-solution/#comments</comments>
		<pubDate>Fri, 09 Jul 2010 14:08:43 +0000</pubDate>
		<dc:creator>Joshua McGinnis</dc:creator>
				<category><![CDATA[CSS]]></category>
		<category><![CDATA[Web Development]]></category>

		<guid isPermaLink="false">http://mcginn.is/?p=1901</guid>
		<description><![CDATA[So you want to use a custom font on your website and you want it to be search-engine friendly, support multiple browsers (including IE6), and you want to use a pure CSS solution because you’re tired of the work involved with sIFR and cufón. Well, @font-face to the rescue. Convert Your Fonts: Different browsers require [...]]]></description>
				<content:encoded><![CDATA[<p>So you want to use a custom font on your website and you want it to be search-engine friendly, support multiple browsers (including IE6), and you want to use a pure CSS solution because you’re tired of the work involved with sIFR and cufón. Well, @font-face to the rescue.</p>
<h2><strong>Convert Your Fonts:</strong></h2>
<p>Different browsers require different types of fonts. For example, Internet Explorer requires .EOT and other browsers will require .SVG, .TTF, or .OTF font formats.</p>
<p>Chances are, you probably have the .TTF or .OTF version already installed on your machine. Not a problem, there is an awesome website that will:</p>
<ul>
<li>Convert your fonts to all of the required formats</li>
<li>Allow you to make your font file web-only so that people can’t <em>steal</em> your font and install in on their machine</li>
<li>Strip out any un-used characters to reduce the file size of the font</li>
<li>Automatically generate the fonts and the CSS for you to use the fonts</li>
</ul>
<p>Here’s the website that can do it all:</p>
<p><a href="http://www.fontsquirrel.com/fontface/generator">http://www.fontsquirrel.com/fontface/generator</a></p>
<h2><strong>How to use @font-face:</strong></h2>
<p>@font-face lets you associate a font-family name of your choosing with imported fonts. You can also specify multiple versions of the same font file which you will need to do in order to support the various browsers.</p>
<div class="codecolorer-container css twitlight" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br />3<br />4<br />5<br />6<br />7<br />8<br />9<br />10<br /></div></td><td><div class="css codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #a1a100;">@font-face {</span><br />
&nbsp; &nbsp;<span style="color: #000000; font-weight: bold;">font-family</span><span style="color: #00AA00;">:</span> <span style="color: #ff0000;">'FSAlbert'</span><span style="color: #00AA00;">;</span><br />
&nbsp; &nbsp;src<span style="color: #00AA00;">:</span> <span style="color: #993333;">url</span><span style="color: #00AA00;">&#40;</span><span style="color: #ff0000;">'fonts/fs_albert-webfont.eot'</span><span style="color: #00AA00;">&#41;</span><span style="color: #00AA00;">;</span><br />
&nbsp; &nbsp;src<span style="color: #00AA00;">:</span> local<span style="color: #00AA00;">&#40;</span><span style="color: #ff0000;">'*'</span><span style="color: #00AA00;">&#41;</span><span style="color: #00AA00;">,</span> <span style="color: #993333;">url</span><span style="color: #00AA00;">&#40;</span><span style="color: #ff0000;">'fonts/fs_albert-webfont.ttf'</span><span style="color: #00AA00;">&#41;</span> format<span style="color: #00AA00;">&#40;</span><span style="color: #ff0000;">'truetype'</span><span style="color: #00AA00;">&#41;</span><span style="color: #00AA00;">,</span><br />
&nbsp; &nbsp; &nbsp; <span style="color: #993333;">url</span><span style="color: #00AA00;">&#40;</span><span style="color: #ff0000;">'fonts/fs_albert-webfont.svg#webfontHPkZa0j3'</span><span style="color: #00AA00;">&#41;</span> format<span style="color: #00AA00;">&#40;</span><span style="color: #ff0000;">'svg'</span><span style="color: #00AA00;">&#41;</span><span style="color: #00AA00;">;</span><br />
<span style="color: #00AA00;">&#125;</span><br />
<br />
h1 <span style="color: #00AA00;">&#123;</span><br />
&nbsp; &nbsp;<span style="color: #000000; font-weight: bold;">font-family</span><span style="color: #00AA00;">:</span> <span style="color: #ff0000;">'FSAlbert'</span><span style="color: #00AA00;">;</span><br />
<span style="color: #00AA00;">&#125;</span></div></td></tr></tbody></table></div>
<p>Notice that I’ve put in an asterisk in the local param. Assuming the user does not have a font installed called *, this will force the browser to use the remote font files for the designated font name.</p>
<img src="http://feeds.feedburner.com/~r/joshuamcginnis/~4/ToJb3Pp9iRM" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://joshuamcginnis.com/2010/07/09/easy-cross-browser-font-face-solution/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://joshuamcginnis.com/2010/07/09/easy-cross-browser-font-face-solution/</feedburner:origLink></item>
		<item>
		<title>Inroduction to Writing PHP Command-Line (CLI) Scripts</title>
		<link>http://feedproxy.google.com/~r/joshuamcginnis/~3/A39M_30CUHA/</link>
		<comments>http://joshuamcginnis.com/2010/07/09/inroduction-to-writing-php-command-line-cli-scripts/#comments</comments>
		<pubDate>Fri, 09 Jul 2010 13:35:55 +0000</pubDate>
		<dc:creator>Joshua McGinnis</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[Web Development]]></category>

		<guid isPermaLink="false">http://mcginn.is/?p=1890</guid>
		<description><![CDATA[In this tutorial, I will show you how to get started with writing command-line interface (CLI) scripts using PHP. Here are a few reasons why you might want to write a CLI application in PHP: You want to write a tool for admin-ing your server, but you’re more comfortable using PHP You don’t need to [...]]]></description>
				<content:encoded><![CDATA[<p>In this tutorial, I will show you how to get started with writing command-line interface (CLI) scripts using PHP. Here are a few reasons why you might want to write a CLI application in PHP:</p>
<ul>
<li>You want to write a tool for admin-ing your server, but you’re more comfortable using PHP</li>
<li>You don’t need to output any content to a public-facing web page</li>
</ul>
<h3>The Basics</h3>
<p>First, I’ll assume you’ve already got PHP setup on your web server and that you either know the path to the php executable or you’ve already added to your system’s PATH (you can test this by passing php –v to the CLI). If not, see <a href="http://www.google.com/search?q=installing+php&amp;ie=utf-8&amp;oe=utf-8&amp;aq=t&amp;client=firefox-a&amp;rlz=1R1GGGL_en___US353">this link</a>.</p>
<p>When executing a command-line script, there are essentially three pieces to the command that is entered into the prompt.</p>
<p><em>Example:</em></p>
<div class="codecolorer-container bash twitlight" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br /></div></td><td><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #000000; font-weight: bold;">&gt;</span> <span style="color: #000000; font-weight: bold;">/</span>path<span style="color: #000000; font-weight: bold;">/</span>to<span style="color: #000000; font-weight: bold;">/</span>php script.php arguments</div></td></tr></tbody></table></div>
<p><strong>/path/to/php:</strong> the path to your PHP executable.<br />
<strong>script.php:</strong> the name of the PHP script you are executing<br />
<strong>arguments:</strong> any commands, options, flags, or arguments you’ll be passing to the script</p>
<p>If you aren’t passing anything arguments to the script in the command-line, then what you see above is basically all you need to know to execute a script at the command-line. You’ve told the CLI what the interpreter will be for the command (/path/to/php) and the name of script to execute. Once you hit enter, the result should print directly to the screen.</p>
<p>Most users, however, will want to do more than just execute a standalone script with no external information passed to the script. For this, you’ll need to know how to read arguments passed to the script.</p>
<h2><strong>Reading Arguments in PHP from a CLI</strong></h2>
<p>PHP provides two important predefined variables that will make CLI scripting in PHP possible: $argv and $argc.</p>
<h3>$argc</h3>
<p>$argc [<a href="http://www.php.net/manual/en/reserved.variables.argc.php">$argc on php.net</a>] is the easiest to get. It is simply the number of arguments passed to the script and it can be useful when determining whether or not a user entered a parameter.</p>
<p><em>*Note: The filename of the script is always passed as an argument to the script so the $argc count will always have a minimum value of 1.</em></p>
<p><strong><em>Example 1</em></strong></p>
<div class="codecolorer-container php twitlight" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br />3<br /></div></td><td><div class="php codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #000000; font-weight: bold;">&lt;?php</span><br />
&nbsp; &nbsp;<a href="http://www.php.net/var_dump"><span style="color: #990000;">var_dump</span></a><span style="color: #009900;">&#40;</span><span style="color: #000088;">$argc</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
<span style="color: #000000; font-weight: bold;">?&gt;</span></div></td></tr></tbody></table></div>
<p><strong><em>Example 2:</em></strong></p>
<div class="codecolorer-container php twitlight" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br />3<br />4<br />5<br />6<br /></div></td><td><div class="php codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #000000; font-weight: bold;">&lt;?php</span><br />
<span style="color: #666666; font-style: italic;">//Check to see if there were params passed to the script</span><br />
<span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span> <span style="color: #000088;">$argc</span> <span style="color: #339933;">&gt;</span> <span style="color: #cc66cc;">1</span> <span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; <span style="color: #666666; font-style: italic;">//do stuff here</span><br />
<span style="color: #009900;">&#125;</span><br />
<span style="color: #000000; font-weight: bold;">?&gt;</span></div></td></tr></tbody></table></div>
<h3>$argv</h3>
<p>$argv [<a href="http://www.php.net/manual/en/reserved.variables.argv.php">$argv on php.net</a>] is the work horse of PHP CLI scripting and this is where you’ll be spending a lot of your time when writing interactive scripts. $argv is an array of arguments passed to the script.</p>
<p><em><strong>Let’s look at some examples:</strong></em></p>
<div class="codecolorer-container bash twitlight" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br /></div></td><td><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #000000; font-weight: bold;">&gt;</span>  <span style="color: #000000; font-weight: bold;">/</span>path<span style="color: #000000; font-weight: bold;">/</span>to<span style="color: #000000; font-weight: bold;">/</span>php script.php arg1 arg2</div></td></tr></tbody></table></div>
<p><strong><em>Output:</em></strong></p>
<div class="codecolorer-container php twitlight" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br />3<br />4<br />5<br />6<br />7<br />8<br /></div></td><td><div class="php codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><a href="http://www.php.net/array"><span style="color: #990000;">array</span></a><span style="color: #009900;">&#40;</span><span style="color: #cc66cc;">2</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; <span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">0</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">=&gt;</span><br />
&nbsp; &nbsp; string<span style="color: #009900;">&#40;</span><span style="color: #cc66cc;">10</span><span style="color: #009900;">&#41;</span> <span style="color: #0000ff;">&quot;script.php&quot;</span><br />
&nbsp; <span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">1</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">=&gt;</span><br />
&nbsp; &nbsp;string<span style="color: #009900;">&#40;</span><span style="color: #cc66cc;">4</span><span style="color: #009900;">&#41;</span> <span style="color: #0000ff;">&quot;arg1&quot;</span><br />
&nbsp; <span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">2</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">=&gt;</span><br />
&nbsp; &nbsp;string<span style="color: #009900;">&#40;</span><span style="color: #cc66cc;">4</span><span style="color: #009900;">&#41;</span> <span style="color: #0000ff;">&quot;arg2&quot;</span><br />
<span style="color: #009900;">&#125;</span></div></td></tr></tbody></table></div>
<p>Notice that the first argument is always the name of the script.php that was executed.</p>
<h3><strong>Setting PHP ini variables in a CLI script</strong></h3>
<p><strong><em>Example:</em></strong></p>
<div class="codecolorer-container php twitlight" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br />3<br />4<br />5<br />6<br /></div></td><td><div class="php codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">#!/usr/bin/php –d memory_limit=512M<br />
<br />
<span style="color: #000000; font-weight: bold;">&lt;?php</span><br />
&nbsp; <span style="color: #b1b100;">print</span> <span style="color: #0000ff;">&quot;memory_limit=&quot;</span><span style="color: #339933;">.</span><a href="http://www.php.net/ini_get"><span style="color: #990000;">ini_get</span></a><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;memory_limit&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">.</span><span style="color: #0000ff;">&quot;<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span><span style="color: #339933;">;</span><br />
&nbsp; <a href="http://www.php.net/var_dump"><span style="color: #990000;">var_dump</span></a><span style="color: #009900;">&#40;</span><span style="color: #000088;">$argv</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
<span style="color: #000000; font-weight: bold;">?&gt;</span></div></td></tr></tbody></table></div>
<p>There’s a lot thrown into this one, but let’s start at the beginning. In the linux/unix world, whenever the first two characters are “#!” (pound shebang), the system recognizes these as interpreter directives that alerts the system that this file is indeed a script and it should be interpreted by the path to executable after the directives (in our case: /usr/bin/php). Read more about the <em><a href="http://en.wikipedia.org/wiki/Shebang_%28Unix%29">shebang</a></em>.</p>
<p>On the same line, we’re passing the –d flag (which tells php we’re about set an INI config) and then of course, we’re setting the memory_limit to 512 Mb.</p>
<p>When the script is executed, it will read this line first and then pass the rest of the file to the interpreter.</p>
<p><strong><em>Output:</em></strong></p>
<div class="codecolorer-container php twitlight" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br />3<br />4<br />5<br /></div></td><td><div class="php codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">memory_limit<span style="color: #339933;">=</span>512M<br />
<a href="http://www.php.net/array"><span style="color: #990000;">array</span></a><span style="color: #009900;">&#40;</span><span style="color: #cc66cc;">1</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; <span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">0</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">=&gt;</span><br />
&nbsp; string<span style="color: #009900;">&#40;</span><span style="color: #cc66cc;">12</span><span style="color: #009900;">&#41;</span> <span style="color: #0000ff;">&quot;./script.php&quot;</span><br />
<span style="color: #009900;">&#125;</span></div></td></tr></tbody></table></div>
<h2><strong>How to accept user input in a PHP CLI script:</strong></h2>
<p>Here’s an example of how to write an interactive script that allows the user executing the script to enter in input during script execution.</p>
<p><strong><em>Example:</em></strong></p>
<div class="codecolorer-container php twitlight" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br />3<br />4<br />5<br />6<br />7<br />8<br />9<br />10<br />11<br />12<br />13<br />14<br /></div></td><td><div class="php codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #000000; font-weight: bold;">&lt;?php</span><br />
&nbsp; <span style="color: #b1b100;">echo</span> <span style="color: #0000ff;">&quot;Are you sure you want to do this?  Type 'yes' to continue: &quot;</span><span style="color: #339933;">;</span><br />
<br />
&nbsp; <span style="color: #000088;">$handle</span> <span style="color: #339933;">=</span> <a href="http://www.php.net/fopen"><span style="color: #990000;">fopen</span></a> <span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;php://stdin&quot;</span><span style="color: #339933;">,</span><span style="color: #0000ff;">&quot;r&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; <span style="color: #000088;">$line</span> <span style="color: #339933;">=</span> <a href="http://www.php.net/fgets"><span style="color: #990000;">fgets</span></a><span style="color: #009900;">&#40;</span><span style="color: #000088;">$handle</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
<br />
&nbsp; <span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span><a href="http://www.php.net/trim"><span style="color: #990000;">trim</span></a><span style="color: #009900;">&#40;</span><span style="color: #000088;">$line</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">!=</span> <span style="color: #0000ff;">'yes'</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp;<span style="color: #b1b100;">echo</span> <span style="color: #0000ff;">&quot;ABORTING!<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp;<a href="http://www.php.net/exit"><span style="color: #990000;">exit</span></a><span style="color: #339933;">;</span><br />
&nbsp; <span style="color: #009900;">&#125;</span><br />
<br />
&nbsp; <span style="color: #b1b100;">echo</span> <span style="color: #0000ff;">&quot;<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span><span style="color: #339933;">;</span><br />
&nbsp; <span style="color: #b1b100;">echo</span> <span style="color: #0000ff;">&quot;Thank you, continuing...<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span><span style="color: #339933;">;</span><br />
<span style="color: #000000; font-weight: bold;">?&gt;</span></div></td></tr></tbody></table></div>
<p>To read the contents of input, you’ll need to use the php://stdin input stream.</p>
<p>&#8211;</p>
<p>In conclusion, if you’re beyond this beginner tutorial, I’d start by reading <a href="http://docs.php.net/manual/en/features.commandline.php">php.net’s command-line features page</a>. There are a lot more examples of how to do more involved things like looping through $argv and parsing the arguments to make the script perform as desired.</p>
<img src="http://feeds.feedburner.com/~r/joshuamcginnis/~4/A39M_30CUHA" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://joshuamcginnis.com/2010/07/09/inroduction-to-writing-php-command-line-cli-scripts/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		<feedburner:origLink>http://joshuamcginnis.com/2010/07/09/inroduction-to-writing-php-command-line-cli-scripts/</feedburner:origLink></item>
		<item>
		<title>Intuit’s FreeCycle@Work on the QuickBase Platform</title>
		<link>http://feedproxy.google.com/~r/joshuamcginnis/~3/iIyAcitE_Lw/</link>
		<comments>http://joshuamcginnis.com/2010/07/07/intuits-freecyclework-on-the-quickbase-platform/#comments</comments>
		<pubDate>Wed, 07 Jul 2010 15:40:02 +0000</pubDate>
		<dc:creator>Joshua McGinnis</dc:creator>
				<category><![CDATA[Portfolio]]></category>
		<category><![CDATA[QuickBase]]></category>
		<category><![CDATA[Web Development]]></category>

		<guid isPermaLink="false">http://mcginn.is/?p=1865</guid>
		<description><![CDATA[On April 21, Intuit announced a new free corporate sustainability tool called FreeCycle@Work. FreeCycle@Work is targetted towards business who want to offer its employees the features of the wildly popular communtiy-based Freecycle.org, but with the advantages of having a centralized online database for just their company. Working closely with Sr. QuickBase Marketing Manager Gregory Collins [...]]]></description>
				<content:encoded><![CDATA[<p>On April 21, Intuit announced a new free corporate sustainability tool called <a href="http://quickbase.intuit.com/freecycle">FreeCycle@Work</a>. FreeCycle@Work is targetted towards business who want to offer its employees the features of the wildly popular communtiy-based <a href="http://www.freecycle.org">Freecycle.org</a>, but with the advantages of having a centralized <a href="http://quickbase.intuit.com">online database</a> for just their company.</p>
<p>Working closely with Sr. QuickBase Marketing Manager Gregory Collins and the QuickBase Product Development team, I stepped into to help make the idea a reality but driving the development of this wonderful idea into an actual working product.</p>
<p>Over the course of about three weeks, this small team scoped, designed, and built the FreeCycle@Work marketing website, user registration and customized QuickBase applications using only available API&#8217;s.</p>
<p>In two short months, FreeCycle@Work now has over 500 registered businesses and thousands of users.</p>
<p class="center"><a href="http://quickbase.intuit.com/freecycle" target="_blank"><input name="submit" type="submit" id="submit" value="Visit FreeCycle@Work" /></a></p>
<p><strong>Additional resources:</strong></p>
<ul>
<li><a href="http://quickbase.intuit.com/freecycle/faqs">Official FreeCycle@Work FAQ&#8217;s</a></li>
<li><a href="http://about.intuit.com/about_intuit/press_room/press_release/articles/2010/QuickBaseAndFreecycleExtendFreeReuseProgram.html">FreeCycle@Work Press-release</a></li>
</ul>
<img src="http://feeds.feedburner.com/~r/joshuamcginnis/~4/iIyAcitE_Lw" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://joshuamcginnis.com/2010/07/07/intuits-freecyclework-on-the-quickbase-platform/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://joshuamcginnis.com/2010/07/07/intuits-freecyclework-on-the-quickbase-platform/</feedburner:origLink></item>
		<item>
		<title>PHP SDK for QuickBase API</title>
		<link>http://feedproxy.google.com/~r/joshuamcginnis/~3/o4KI6vRCGhg/</link>
		<comments>http://joshuamcginnis.com/2010/07/07/php-sdk-quickbase-api/#comments</comments>
		<pubDate>Wed, 07 Jul 2010 15:14:35 +0000</pubDate>
		<dc:creator>Joshua McGinnis</dc:creator>
				<category><![CDATA[Open Source]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Portfolio]]></category>
		<category><![CDATA[QuickBase]]></category>
		<category><![CDATA[Web Development]]></category>

		<guid isPermaLink="false">http://mcginn.is/?p=1839</guid>
		<description><![CDATA[During my time at Intuit, I have been a strong advocate of using and giving back to the open source community and one of the projects I’ve had the privilege of working on is the QuickBase PHP SDK project at code.intuit.com. This SDK is in heavy use on the QuickBase web-marketing website. We use it [...]]]></description>
				<content:encoded><![CDATA[<p><a href="http://mcginn.is/wp-content/uploads/2010/07/php_sdk.png"><img class="aligncenter size-full wp-image-1856" title="QuickBase PHP SDK" src="http://mcginn.is/wp-content/uploads/2010/07/php_sdk.png" alt="QuickBase PHP SDK" width="609" height="324" /></a></p>
<p>During my time at Intuit, I have been a strong advocate of using and giving back to the open source community and one of the projects I’ve had the privilege of working on is the <strong>QuickBase PHP SDK</strong> project at <a href="https://code.intuit.com/sf/projects/qb_php_sdk">code.intuit.com</a>.</p>
<p>This SDK is in heavy use on the <a href="http://quickbase.intuit.com">QuickBase web-marketing website</a>. We use it primarily to integrate many of the back-end systems we’ve created for tracking and customer management with the front-end where our website visitors interact with us.</p>
<h3>Examples of why you might need the QuickBase PHP SDK:</h3>
<ul>
<li>You’re doing PHP development and QuickBase API integration</li>
<li>You need to complete your QuickBase project FAST due to the demands of your team</li>
<li>The QuickBase Javascript SDK is great, but can only be used on the quickbase.com domain due to XSS (cross-site scripting) security limitations</li>
</ul>
<h3>Examples of how you might use the QuickBase PHP SDK:</h3>
<ul>
<li>You want to create web forms that populate data dynamically into various QuickBase</li>
<li>You need the read data from a QuickBase and do “stuff” with it (caching, display it, move it around, manipulate it, etc)</li>
<li>You need to update information in a QuickBase in nightly batches through the use of custom cron scripts</li>
</ul>
<p>Do any of the examples above sound familiar?</p>
<blockquote><p>For the app-y things we like to build, QuickBase and its robust API work  great.</p></blockquote>
<p>We use QuickBase as our database work horse for a lot of what we do. I won’t pretend it is a direct replacement for MySQL or any other enterprise transaction database – but it’s a great solution for a group like us who have a totally custom web application that doesn’t necessarily want/need the overhead of a self-managed SQL-based database. For the app-y things we like to build, QuickBase and its robust API work great.</p>
<p>On the QuickBase website, we have over five QuickBase’s acting as mini-CMS’s, populating areas of our site such as our Customers section and Recent News.</p>
<h2>How to download the QuickBase SDK</h2>
<p>In the past, I made the SDK available immediately available through my blog – however, that is changing because I <em>need</em> people to contribute to the project.</p>
<p>The only way I’m going to make this SDK better is by getting feedback and having folks help knock out the bugs.</p>
<p>The first thing you should do is because a project member:</p>
<p class="center"><a href="http://code.intuit.com/sf/projects/qb_php_sdk" target="_blank"><input name="submit" type="submit" id="submit" value="Join the Project" /></a></p>
<p><strong>Or you can just check out the sdk with Subversion like so:</strong></p>
<div class="codecolorer-container html4strict twitlight" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br /></div></td><td><div class="html4strict codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">svn checkout https://code.intuit.com/svn/repos/quickbase-php-sdk</div></td></tr></tbody></table></div>
<h3>Helpful Resources</h3>
<ul>
<li><a href="http://member.developer.intuit.com/MyIDN/technical_resources/quickbase/framework/httpapiref/HTML_API_Programmers_Guide.htm">QuickBase HTTP API Documentation</a></li>
<li><a href="http://www.quickbase.com/help/default.html">QuickBase Help</a></li>
<li><a href="http://community.intuit.com/category/quickbase">QuickBase Community Forum</a></li>
<li><a href="http://quickbase.intuit.com/developer/">QuickBase Innovation Network</a></li>
</ul>
<img src="http://feeds.feedburner.com/~r/joshuamcginnis/~4/o4KI6vRCGhg" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://joshuamcginnis.com/2010/07/07/php-sdk-quickbase-api/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		<feedburner:origLink>http://joshuamcginnis.com/2010/07/07/php-sdk-quickbase-api/</feedburner:origLink></item>
		<item>
		<title>the best mp3 player you've never heard of – creative zen stone plus</title>
		<link>http://feedproxy.google.com/~r/joshuamcginnis/~3/NIlWPtP4h38/</link>
		<comments>http://joshuamcginnis.com/2009/08/20/the-best-mp3-player-youve-never-heard-of-creative-zen-stone-plus/#comments</comments>
		<pubDate>Thu, 20 Aug 2009 12:17:35 +0000</pubDate>
		<dc:creator>Joshua McGinnis</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://blog.joshuamcginnis.com/?p=1285</guid>
		<description><![CDATA[a few months ago, the mp3 player i regularly took with me during exercise decided to fail. shortly thereafter, i ended up at a toys &#8216;r us (presumably to buy something for felicity) and i decided to peruse through their feeble electronics dept. what i found was this little black looking &#8220;thing&#8221; that cost a [...]]]></description>
				<content:encoded><![CDATA[<p>a few months ago, the mp3 player i regularly took with me during exercise decided to fail. shortly thereafter, i ended up at a toys &#8216;r us (presumably to buy something for felicity) and i decided to peruse through their feeble electronics dept.</p>
<p>what i found was this little black looking &#8220;thing&#8221; that cost a mere $12.99. it promised an mp3 player and radio. well. let me tell you &#8211; this is possibly the best little mp3 player i&#8217;ve ever used.</p>
<p>it has a radio, mp3 player, voice recorder, stopwatch, usb interface, rechargeable battery which lasts several hours, and a very simple on screen display. not only that, it&#8217;s waterproof &#8211; which is good because i&#8217;ve washed it by accident twice and it&#8217;s still chugging away.</p>
<p>now it doesn&#8217;t hold a ton of mp3s, but i mainly listen to the radio so that&#8217;s not a big deal for me.</p>
<p>i don&#8217;t think they make these puppies anymore, but <a href="http://www.google.com/products?q=zen%20stone%20plus&#038;hl=en&#038;ie=UTF-8&#038;rlz=1B3GGGL_enUS255US255&#038;tab=nf">i did quick search and found some businesses selling them</a>.</p>
<p><a href="http://mcginn.is/wp-content/uploads/2009/08/creative-zen-stone-plus-oled.jpg"><img src="http://mcginn.is/wp-content/uploads/2009/08/creative-zen-stone-plus-oled.jpg" alt="creative-zen-stone-plus-oled" title="creative-zen-stone-plus-oled" width="450" height="371" class="aligncenter size-full wp-image-1286" /></a></p>
<img src="http://feeds.feedburner.com/~r/joshuamcginnis/~4/NIlWPtP4h38" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://joshuamcginnis.com/2009/08/20/the-best-mp3-player-youve-never-heard-of-creative-zen-stone-plus/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://joshuamcginnis.com/2009/08/20/the-best-mp3-player-youve-never-heard-of-creative-zen-stone-plus/</feedburner:origLink></item>
		<item>
		<title>My Thoughts on Healthcare Reform</title>
		<link>http://feedproxy.google.com/~r/joshuamcginnis/~3/IR5c1j0ozA0/</link>
		<comments>http://joshuamcginnis.com/2009/08/11/my-thoughts-on-healthcare-reform/#comments</comments>
		<pubDate>Wed, 12 Aug 2009 01:33:59 +0000</pubDate>
		<dc:creator>Joshua McGinnis</dc:creator>
				<category><![CDATA[Politics]]></category>

		<guid isPermaLink="false">http://blog.joshuamcginnis.com/?p=1282</guid>
		<description><![CDATA[Here’s basically what i think about healthcare reform in a nutshell. It should be fairly straightforward and hopefully fair. First: I’m extremely satisfied with my healthcare situation today. I (and my daughter) have great coverage at an affordable price. True, my company pays a lot of my insurance, but i assume they do so because [...]]]></description>
				<content:encoded><![CDATA[<p>Here’s basically what i think about healthcare reform in a nutshell. It should be fairly straightforward and hopefully fair.</p>
<p>First: I’m extremely satisfied with my healthcare situation today. I (and my daughter) have great coverage at an affordable price. True, my company pays a lot of my insurance, but i assume they do so because it is worth it to them. If they couldn&#8217;t afford it, they put more of the burden on the employees or lay off more people &#8230; but they aren&#8217;t so here we are.</p>
<p>In principle, I’m not for government controlling anything related to my personal life. I believe government&#8217;s role is to protect its people and from a financial standpoint, tax people so that it can provide &#8220;<a href="http://en.wikipedia.org/wiki/Public_good">public goods</a>&#8220;. Anytime government or any big governing body tries to run something (any big corporate employee knows this) &#8211; it becomes difficult to effect change and manage the company. This is why you see smaller startups often referred to as being more &#8220;agile&#8221;.</p>
<p>I do believe healthcare is something that should be universally available to everyone. For instance, if someone just got their arm chopped off, they should be able to walk into an emergency room to get care.</p>
<p>I also think that people need to look at a healthcare a lot like the way they look at their light bill (or cable &#8211; depending on how far south you live). It’s a fact of life. You cannot expect to use the ER as your doctor. You must purchase some sort of healthcare.</p>
<p>I do not think that i should subsidize poor people&#8217;s healthcare. Why? It’s not because i do not care about poor people. I care very much for them. Whether you believe in the bible or not, i adhere to this scripture:</p>
<p>Leviticus 19:9-10 &#8211; &#8220;When you reap the harvest of your land, you are not to reap to the very edge of your field or gather the gleanings of your harvest. You must not strip your vineyard bare or gather its fallen grapes. Leave them for the poor and the foreign resident; I am the Lord your God.&#8221;</p>
<p>Basically, i think we should &#8220;leave the edges of our crops for the poor&#8221;. But the way i look at it, i already pay over 30% of my income towards taxes. That’s beyond the edges of my crop. At some point, i think we the people have to hold our government accountable for that 30% and how they manage that money. I have lots of thoughts and opinions on how the government manages our current tax dollars, but for the sake of time and for simplicity, I’ll just say what i think: there is enough money going into the system. Find a way to encourage universal coverage without eliminating private insurance, increasing taxes, and de-valuing the dollar by spending what we don&#8217;t have.</p>
<p>Lastly, i think there is a way to express your opinions on government. 90+% of the time, yelling pointlessly at a town meeting (no matter which side you are on) is NOT the way to do it. However, if the controlling/decision-making party is not providing a way for the public to express and/or they are not acknowledging public concern, then sometimes the only counter is a more vocal power-driven response.</p>
<p>Oh &#8211; and a 1000+ page healthcare bill seems wild complicated. This is not an issue to be rushed &#8211; so stop rushing it! What sucks is that these bills are written by lawyers so even if you read it all and think you understand it; it could be interpreted by a judge to be something else. That fact alone should be enough reason to give the public plenty of time to be onboard.</p>
<p>there&#8217;s a ton of stuff I’m leaving out like conservatives blaming a lot of waste on illegal immigrants clouding up the system, but i think I’ve covered what&#8217;s most important to me.</p>
<p>As i told one of our interns today at work, what are important to me are the facts. If you have thoughts or added information that could help me form an opinion, please share it.</p>
<img src="http://feeds.feedburner.com/~r/joshuamcginnis/~4/IR5c1j0ozA0" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://joshuamcginnis.com/2009/08/11/my-thoughts-on-healthcare-reform/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://joshuamcginnis.com/2009/08/11/my-thoughts-on-healthcare-reform/</feedburner:origLink></item>
		<item>
		<title>tagged.com is a crazy spammer</title>
		<link>http://feedproxy.google.com/~r/joshuamcginnis/~3/SM6ELtzcB0Y/</link>
		<comments>http://joshuamcginnis.com/2009/07/30/tagged-com-is-a-crazy-spammer/#comments</comments>
		<pubDate>Fri, 31 Jul 2009 01:17:26 +0000</pubDate>
		<dc:creator>Joshua McGinnis</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://blog.joshuamcginnis.com/?p=1277</guid>
		<description><![CDATA[look at that title. how&#8217;s that for seo? anyways, i&#8217;ve been getting tons of spam from site called tagged.com that i DID NOT sign up for. today, i decided to click on usubscribe (knowing good and well that doing so almost always opts you in for even more spam), and the monstrosity of what i [...]]]></description>
				<content:encoded><![CDATA[<p>look at that title. how&#8217;s that for seo?</p>
<p>anyways, i&#8217;ve been getting tons of spam from site called tagged.com that i DID NOT sign up for. today, i decided to click on usubscribe (knowing good and well that doing so almost always opts you in for even more spam), and the monstrosity of what i encountered is below.</p>
<p>that&#8217;s right, there&#8217;s an email pref. for basically every possible action that occurs in nature, including: &#8220;email me when someone uses the bathroom&#8221;, &#8220;email me when something falls on the floor&#8221;, and my personal favorite: &#8220;email me every time someone gives me LUV&#8221;. *sigh</p>
<p><a href="http://mcginn.is/wp-content/uploads/2009/07/tagged.jpg"><img src="http://mcginn.is/wp-content/uploads/2009/07/tagged.jpg" alt="tagged" title="tagged" width="652" height="663" class="aligncenter size-full wp-image-1278" /></a></p>
<img src="http://feeds.feedburner.com/~r/joshuamcginnis/~4/SM6ELtzcB0Y" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://joshuamcginnis.com/2009/07/30/tagged-com-is-a-crazy-spammer/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://joshuamcginnis.com/2009/07/30/tagged-com-is-a-crazy-spammer/</feedburner:origLink></item>
		<item>
		<title>QuickBase Questions, FAQ’s, and API Support</title>
		<link>http://feedproxy.google.com/~r/joshuamcginnis/~3/9JOfs1ZIn3U/</link>
		<comments>http://joshuamcginnis.com/2009/07/09/quickbase-questions-faqs-and-api-support/#comments</comments>
		<pubDate>Thu, 09 Jul 2009 13:38:59 +0000</pubDate>
		<dc:creator>Joshua McGinnis</dc:creator>
				<category><![CDATA[QuickBase]]></category>

		<guid isPermaLink="false">http://blog.joshuamcginnis.com/?p=1271</guid>
		<description><![CDATA[If you have a question about QuickBase, the use of the api in particular, please ask in the comments of this post. I will update this blog post to include your question and my answer so that others who come across my site can see it. Many of you have been emailing me GREAT questions [...]]]></description>
				<content:encoded><![CDATA[<p>If you have a question about QuickBase, the use of the api in particular, please ask in the comments of this post. I will update this blog post to include your question and my answer so that others who come across my site can see it. Many of you have been emailing me GREAT questions that I would love to share with the rest of the QuickBase community.</p>
<p>Any questions about QuickBase are open game, but my speciality is with the QuickBase API. If I don&#8217;t know the answer, I&#8217;ll find it and/or get you in touch with someone who can.</p>
<p>This is not an official alternative to contacting our support at <a href="http://quickbase.intuit.com/support/">http://quickbase.intuit.com/support/</a>. You should still contact our support team if you have any urgent or business-critical inquiries.</p>
<h2>1. How can I create a web form to let a user edit and add records in QuickBase?</h2>
<p>I have a custom form, created with the QuickBase custom form wizard, which anyone can use to add a new record to my table in my QuickBase application.</p>
<p>Ideally, though, I would like users to be able to edit existing records with the form. Unfortunately, I have only found commands that point the form to edit existing records. Is there anyway this form can edit the form if some of the fields match? E.g. The name field in the existing record is ‘Joey’. When the user enters ‘Joey’ into the form, it would automatically point the edited record to edit the entire record that includes ‘Joey’ in the name field.</p>
<h4><strong>Answer</strong></h4>
<p><strong></strong>In order to do this, you would need to invoke either javascript or process the form via a backend script (like PHP) to handle the logic of whether or not to do an add_record or an edit_record.</p>
<p>I’d recommend you host the form yourself on your company’s website (if you aren’t already) and use the api for processing the form. Doing this gives you more flexibility in what you can do with the data that is submitted and what records are affected.</p>
<img src="http://feeds.feedburner.com/~r/joshuamcginnis/~4/9JOfs1ZIn3U" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://joshuamcginnis.com/2009/07/09/quickbase-questions-faqs-and-api-support/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		<feedburner:origLink>http://joshuamcginnis.com/2009/07/09/quickbase-questions-faqs-and-api-support/</feedburner:origLink></item>
		<item>
		<title>link: is, in many ways, useless for competitive analysis</title>
		<link>http://feedproxy.google.com/~r/joshuamcginnis/~3/XrrWIRGaYs4/</link>
		<comments>http://joshuamcginnis.com/2009/07/06/link-is-in-many-ways-useless-for-competitive-analysis/#comments</comments>
		<pubDate>Tue, 07 Jul 2009 00:36:03 +0000</pubDate>
		<dc:creator>Joshua McGinnis</dc:creator>
				<category><![CDATA[SEO]]></category>

		<guid isPermaLink="false">http://blog.joshuamcginnis.com/?p=1267</guid>
		<description><![CDATA[so i was doing some seo today and i noticed that in google webmaster tools, the &#8220;backlink&#8221; report was reporting thousands more links than what google was reporting in a link: search. so, i went and i posted a question in the webmaster tools forum here. ultimately, the answer i was given was that yes [...]]]></description>
				<content:encoded><![CDATA[<p>so i was doing some seo today and i noticed that in <a href="https://www.google.com/webmasters/tools/">google webmaster tools</a>, the &#8220;backlink&#8221; report was reporting thousands more links than what google was reporting in a <a href="http://www.google.com/search?hl=en&amp;rlz=1B3GGGL_enUS269US269&amp;q=link%3Ajoshuamcginnis.com&amp;aq=f&amp;oq=&amp;aqi=">link: search</a>.</p>
<p>so, i went and i posted a question in the webmaster tools forum <a href="http://www.google.com/support/forum/p/Webmasters/thread?tid=6f8a6166955bfb61&amp;hl=en">here</a>. ultimately, the answer i was given was that yes &#8211; there are two different reports and neither are accurate.</p>
<p>it turns out that link: is a &#8220;random sampling&#8221; of the number of backlinks you have while webmaster tools shows all backlinks, including links with rel=&#8221;nofollow&#8221;. my response was that i think this is pure silliness on google&#8217;s part. it makes it very difficult for people to gauge how well their organic efforts are paying off.</p>
<p>my exact response:</p>
<blockquote><p>&#8220;Well, this is just silly. There are two reports, neither are accurate. Without being able to at least extract out which links are valid (meet PageRank and do not have rel=&#8221;nofollow&#8221;), there&#8217;s no real way to gauge how many backlinks we have and/or how our competitors are performing and/or how well our organic seo efforts are paying off. Seems odd to me that the response from Google (in the FAQ) would be: &#8220;This is normal and you don&#8217;t need to worry about it.&#8221;</p></blockquote>
<p><a href="http://www.mattcutts.com/blog/">matt cutts</a> gives his explanation of what is going on here:</p>
<p><object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" width="480" height="295" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0"><param name="allowFullScreen" value="true" /><param name="allowscriptaccess" value="always" /><param name="src" value="http://www.youtube.com/v/TjQ2QVQpaK0&amp;hl=en&amp;fs=1&amp;" /><param name="allowfullscreen" value="true" /><embed type="application/x-shockwave-flash" width="480" height="295" src="http://www.youtube.com/v/TjQ2QVQpaK0&amp;hl=en&amp;fs=1&amp;" allowscriptaccess="always" allowfullscreen="true"></embed></object></p>
<p>so there you have it. link: is not the best tool for determining how many and/or what quality backlinks you or your competitors have.</p>
<img src="http://feeds.feedburner.com/~r/joshuamcginnis/~4/XrrWIRGaYs4" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://joshuamcginnis.com/2009/07/06/link-is-in-many-ways-useless-for-competitive-analysis/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://joshuamcginnis.com/2009/07/06/link-is-in-many-ways-useless-for-competitive-analysis/</feedburner:origLink></item>
		<item>
		<title>john ziegler tears contessa brewer a new one</title>
		<link>http://feedproxy.google.com/~r/joshuamcginnis/~3/xWE_xSpbeFo/</link>
		<comments>http://joshuamcginnis.com/2009/06/11/john-ziegler-tears-contessa-brewer-a-new-one/#comments</comments>
		<pubDate>Thu, 11 Jun 2009 20:01:49 +0000</pubDate>
		<dc:creator>Joshua McGinnis</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://blog.joshuamcginnis.com/?p=1261</guid>
		<description><![CDATA[having just seen john ziegler&#8217;s new documentary (thanks to michael graham of 96.9 wtkk for the free tickets), i think i have some perspective on how and why his recent msnbc interview with contessa brewer (see below) went down. this guy, in my view, is doing an extraordinary job at trying to bring back some [...]]]></description>
				<content:encoded><![CDATA[<p>having just seen john ziegler&#8217;s <a href="http://howobamagotelected.com">new documentary</a> (thanks to michael graham of 96.9 wtkk for the free tickets), i think i have some perspective on how and why his recent msnbc interview with contessa brewer (see below) went down.</p>
<p>this guy, in my view, is doing an extraordinary job at trying to bring back some of the balance to the media.</p>
<p>if you like watching two interviewers have at it with each other (i sure do), check this one out:</p>
<div><iframe height="339" width="425" src="http://www.msnbc.msn.com/id/22425001/vp/31206590#31206590" frameborder="0" scrolling="no"></iframe>
<p style="font-size:11px; font-family:Arial, Helvetica, sans-serif; color: #999; margin-top: 5px; background: transparent; text-align: center; width: 425px;">Visit msnbc.com for <a style="text-decoration:none !important; border-bottom: 1px dotted #999 !important; font-weight:normal !important; height: 13px; color:#5799DB !important;" href="http://www.msnbc.msn.com">Breaking News</a>, <a href="http://www.msnbc.msn.com/id/3032507" style="text-decoration:none !important; border-bottom: 1px dotted #999 !important; font-weight:normal !important; height: 13px; color:#5799DB !important;">World News</a>, and <a href="http://www.msnbc.msn.com/id/3032072" style="text-decoration:none !important; border-bottom: 1px dotted #999 !important; font-weight:normal !important; height: 13px; color:#5799DB !important;">News about the Economy</a></p>
</div>
<img src="http://feeds.feedburner.com/~r/joshuamcginnis/~4/xWE_xSpbeFo" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://joshuamcginnis.com/2009/06/11/john-ziegler-tears-contessa-brewer-a-new-one/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://joshuamcginnis.com/2009/06/11/john-ziegler-tears-contessa-brewer-a-new-one/</feedburner:origLink></item>
		<item>
		<title>mass voters are clueless and oh yea, i told you so</title>
		<link>http://feedproxy.google.com/~r/joshuamcginnis/~3/BsO_wPJs7Ew/</link>
		<comments>http://joshuamcginnis.com/2009/05/20/mass-voters-are-clueless-and-oh-yea-i-told-you-so/#comments</comments>
		<pubDate>Wed, 20 May 2009 13:32:31 +0000</pubDate>
		<dc:creator>Joshua McGinnis</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://blog.joshuamcginnis.com/?p=1252</guid>
		<description><![CDATA[mass voters overwhelmingly decided to NOT eliminate our state sales tax last november for fear of &#8220;retaliatory tax increases.&#8221; well guess what mass voters? as i predicted, a tax increase has happened anyways. last night, the mass senate voted to increase the state sales tax from 5% to 6.25%. did i mention that we&#8217;re in [...]]]></description>
				<content:encoded><![CDATA[<p>mass voters overwhelmingly decided to NOT eliminate our state sales tax last november for fear of &#8220;retaliatory tax increases.&#8221; well guess what mass voters? as i predicted, a tax increase has happened anyways. last night, the mass senate voted to increase the state sales tax from 5% to 6.25%. did i mention that we&#8217;re in a recession with record-high unemployment?</p>
<p>oh, it doesn&#8217;t stop there. the state also decided to lift the sales tax exemption on alcohol. so when you go to buy your 6-pack, you won&#8217;t only be paying for ridiculously high sin-taxes the state already has in place, you&#8217;ll be paying a TAX on top of a TAX. yup &#8211; mass. is taxing a tax.</p>
<p>when asked about the tax, senator candaras said &#8220;&#8230; this sales tax will fund a lot of very important programs, at least in part for some of the most vulnerable citizens.&#8221;</p>
<p>vulnerable citizens, eh? what exactly is a &#8220;vulnerable citizen.&#8221; it CANT be the <a href="http://wbztv.com/local/welfare.donated.cars.2.1009559.html">welfare recipients getting free cars with AAA and free insurance, can it?</a> it CANT be the ones getting <a href="http://sayanythingblog.com/entry/safelink_wireless_a_government_welfare_program_for_cell_phones/">free cell phones</a>, can it?</p>
<p>i guess it can.</p>
<img src="http://feeds.feedburner.com/~r/joshuamcginnis/~4/BsO_wPJs7Ew" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://joshuamcginnis.com/2009/05/20/mass-voters-are-clueless-and-oh-yea-i-told-you-so/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://joshuamcginnis.com/2009/05/20/mass-voters-are-clueless-and-oh-yea-i-told-you-so/</feedburner:origLink></item>
		<item>
		<title>another deceptive offer from valero gas credit card company</title>
		<link>http://feedproxy.google.com/~r/joshuamcginnis/~3/x76OBDxeEjw/</link>
		<comments>http://joshuamcginnis.com/2009/05/01/another-deceptive-offer-from-valero-gas-credit-card-company/#comments</comments>
		<pubDate>Fri, 01 May 2009 23:49:50 +0000</pubDate>
		<dc:creator>Joshua McGinnis</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://blog.joshuamcginnis.com/?p=1241</guid>
		<description><![CDATA[surprise: i got another credit card offer in the mail today. this time, it was from valero, a gas company that i have a gas card through. so what&#8217;s the gimmick this time? they sent me what looks like a flyer with big letters telling me to IMMEDIATELY RESPOND or else! but wait, what&#8217;s that [...]]]></description>
				<content:encoded><![CDATA[<p>surprise: i got another credit card offer in the mail today. this time, it was from <a href="http://www.valero.com/default.aspx">valero</a>, a gas company that i have a gas card through.</p>
<p>so what&#8217;s the gimmick this time? they sent me what looks like a flyer with big letters telling me to IMMEDIATELY RESPOND or else! but wait, what&#8217;s that in fine print below my signature? ah: &#8220;If your address is correct and you do not wish to become a Protected Cardholder, then no response is necessary.&#8221;</p>
<p><a href="http://mcginn.is/wp-content/uploads/2009/05/valero_offer.gif" rel="attachment wp-att-1242"><img src="http://mcginn.is/wp-content/uploads/2009/05/valero_offer.gif" alt="valero_offer" title="valero_offer" width="545" height="643" class="aligncenter size-full wp-image-1242" /></a></p>
<p>but wait! I WANT to be a &#8220;Protected Cardholder&#8221; don&#8217;t I? If I don&#8217;t sign this, does that mean somehow I&#8217;m not protected.</p>
<p>oh &#8211; here it is. Let me just flip the offer and read where it clearly states what I&#8217;m signing myself up for.</p>
<p><a href="http://mcginn.is/wp-content/uploads/2009/05/valero_offer_fine_print.gif" rel="attachment wp-att-1243"><img src="http://mcginn.is/wp-content/uploads/2009/05/valero_offer_fine_print.gif" alt="valero_offer_fine_print" title="valero_offer_fine_print" width="521" height="324" class="aligncenter size-full wp-image-1243" /></a></p>
<p>Ohhh &#8211; there&#8217;s where the fee is. In those easy to see tiny little paragraphs.</p>
<p>Silly credit card company. You allllmost had me.</p>
<img src="http://feeds.feedburner.com/~r/joshuamcginnis/~4/x76OBDxeEjw" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://joshuamcginnis.com/2009/05/01/another-deceptive-offer-from-valero-gas-credit-card-company/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		<feedburner:origLink>http://joshuamcginnis.com/2009/05/01/another-deceptive-offer-from-valero-gas-credit-card-company/</feedburner:origLink></item>
		<item>
		<title>QuickBase PHP API Examples</title>
		<link>http://feedproxy.google.com/~r/joshuamcginnis/~3/pvAigPBT7kI/</link>
		<comments>http://joshuamcginnis.com/2009/04/23/quickbase-php-api-examples/#comments</comments>
		<pubDate>Thu, 23 Apr 2009 11:36:11 +0000</pubDate>
		<dc:creator>Joshua McGinnis</dc:creator>
				<category><![CDATA[API]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[QuickBase]]></category>
		<category><![CDATA[Web Development]]></category>
		<category><![CDATA[XML]]></category>

		<guid isPermaLink="false">http://blog.joshuamcginnis.com/?p=1228</guid>
		<description><![CDATA[i&#8217;ve had a few requests for examples of how to use the quickbase php api wrapper. so here goes: setup the quickbase object with login info include the library and setup the object by passing in username, password, true/false (xml/http), and dbID of the db/table you&#8217;ll be transacting with. 12include_once&#40;'../includes/qb.php'&#41;; $quickbase = new QuickBase&#40;'username','password', true, [...]]]></description>
				<content:encoded><![CDATA[<p>i&#8217;ve had a few requests for examples of how to use the <a href="http://blog.joshuamcginnis.com/2008/09/php-wrapper-for-quickbase/">quickbase php api wrapper</a>. so here goes:</p>
<h4>setup the quickbase object with login info</h4>
<p>include the library and setup the object by passing in username, password, true/false (xml/http), and dbID of the db/table you&#8217;ll be transacting with.</p>
<div class="codecolorer-container php twitlight" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br /></div></td><td><div class="php codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #b1b100;">include_once</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'../includes/qb.php'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
<span style="color: #000088;">$quickbase</span> <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> QuickBase<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'username'</span><span style="color: #339933;">,</span><span style="color: #0000ff;">'password'</span><span style="color: #339933;">,</span> <span style="color: #009900; font-weight: bold;">true</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'dbID'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></div></td></tr></tbody></table></div>
<h4>do a quickbase query</h4>
<p>here, we setup a query to return field 3 where (field id 15 is equal to somevalue).</p>
<div class="codecolorer-container php twitlight" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br />3<br />4<br />5<br />6<br />7<br />8<br /></div></td><td><div class="php codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #000088;">$queries</span> <span style="color: #339933;">=</span> <a href="http://www.php.net/array"><span style="color: #990000;">array</span></a><span style="color: #009900;">&#40;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <a href="http://www.php.net/array"><span style="color: #990000;">array</span></a><span style="color: #009900;">&#40;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">'fid'</span> &nbsp; <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'15'</span><span style="color: #339933;">,</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">'ev'</span>&nbsp; &nbsp; <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'ex'</span><span style="color: #339933;">,</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">'cri'</span> &nbsp; <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'somevalue'</span><span style="color: #009900;">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
<br />
<span style="color: #000088;">$results</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$quickbase</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">do_query</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$queries</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">''</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">''</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'3'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></div></td></tr></tbody></table></div>
<h4>adding a record to a quickbase</h4>
<p>this one is super easy. create an associative array with field id&#8217;s and values and then use the add_record method.</p>
<div class="codecolorer-container php twitlight" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br />3<br />4<br />5<br />6<br />7<br />8<br />9<br />10<br />11<br />12<br /></div></td><td><div class="php codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #000088;">$fields</span> <span style="color: #339933;">=</span> <a href="http://www.php.net/array"><span style="color: #990000;">array</span></a><span style="color: #009900;">&#40;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <a href="http://www.php.net/array"><span style="color: #990000;">array</span></a><span style="color: #009900;">&#40;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">'fid'</span> &nbsp; <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'1'</span><span style="color: #339933;">,</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">'value'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'some value'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <a href="http://www.php.net/array"><span style="color: #990000;">array</span></a><span style="color: #009900;">&#40;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">'fid'</span> &nbsp; <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'2'</span><span style="color: #339933;">,</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">'value'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'some value'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <a href="http://www.php.net/array"><span style="color: #990000;">array</span></a><span style="color: #009900;">&#40;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">'fid'</span> &nbsp; <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'3'</span><span style="color: #339933;">,</span><br />
<span style="color: #0000ff;">'value'</span><span style="color: #339933;">=&gt;</span><span style="color: #0000ff;">'some value'</span><span style="color: #009900;">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
<span style="color: #000088;">$quickbase</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">add_record</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$fields</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></div></td></tr></tbody></table></div>
<h4>edit a quickbase record</h4>
<p>almost identical to add_record, setup the array and use the edit_record method.</p>
<div class="codecolorer-container php twitlight" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br />3<br />4<br />5<br />6<br />7<br />8<br />9<br />10<br />11<br />12<br /></div></td><td><div class="php codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #000088;">$fields</span> <span style="color: #339933;">=</span> <a href="http://www.php.net/array"><span style="color: #990000;">array</span></a><span style="color: #009900;">&#40;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <a href="http://www.php.net/array"><span style="color: #990000;">array</span></a><span style="color: #009900;">&#40;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">'fid'</span> &nbsp; <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'1'</span><span style="color: #339933;">,</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">'value'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'some value'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <a href="http://www.php.net/array"><span style="color: #990000;">array</span></a><span style="color: #009900;">&#40;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">'fid'</span> &nbsp; <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'2'</span><span style="color: #339933;">,</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">'value'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'some value'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <a href="http://www.php.net/array"><span style="color: #990000;">array</span></a><span style="color: #009900;">&#40;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">'fid'</span> &nbsp; <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'3'</span><span style="color: #339933;">,</span><br />
<span style="color: #0000ff;">'value'</span><span style="color: #339933;">=&gt;</span><span style="color: #0000ff;">'some value'</span><span style="color: #009900;">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
<span style="color: #000088;">$quickbase</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">edit_record</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$fields</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></div></td></tr></tbody></table></div>
<h4>do a quickbase query</h4>
<p>here, we setup a query to return field 3 where (field id 15 is equal to somevalue).</p>
<div class="codecolorer-container php twitlight" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br />3<br />4<br />5<br />6<br />7<br />8<br /></div></td><td><div class="php codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #000088;">$queries</span> <span style="color: #339933;">=</span> <a href="http://www.php.net/array"><span style="color: #990000;">array</span></a><span style="color: #009900;">&#40;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <a href="http://www.php.net/array"><span style="color: #990000;">array</span></a><span style="color: #009900;">&#40;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">'fid'</span> &nbsp; <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'15'</span><span style="color: #339933;">,</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">'ev'</span>&nbsp; &nbsp; <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'ex'</span><span style="color: #339933;">,</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0000ff;">'cri'</span> &nbsp; <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'somevalue'</span><span style="color: #009900;">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
<br />
<span style="color: #000088;">$results</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$quickbase</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">do_query</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$queries</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">''</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">''</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'5'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></div></td></tr></tbody></table></div>
<img src="http://feeds.feedburner.com/~r/joshuamcginnis/~4/pvAigPBT7kI" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://joshuamcginnis.com/2009/04/23/quickbase-php-api-examples/feed/</wfw:commentRss>
		<slash:comments>51</slash:comments>
		<feedburner:origLink>http://joshuamcginnis.com/2009/04/23/quickbase-php-api-examples/</feedburner:origLink></item>
	</channel>
</rss><!-- Dynamic page generated in 4.615 seconds. --><!-- Cached page generated by WP-Super-Cache on 2013-05-07 00:26:46 -->
