<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Webdogs 2.0 &#187; php</title>
	<atom:link href="http://www.webdogs.org/tag/php/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.webdogs.org</link>
	<description>Webdogs 2.0 ~ data, design and derring-do since, uh, whenever</description>
	<lastBuildDate>Mon, 26 Jul 2010 21:04:16 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.1</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>A quick and dirty OneBox using PHP</title>
		<link>http://www.webdogs.org/2009/06/05/a-quick-and-dirty-onebox-using-php/</link>
		<comments>http://www.webdogs.org/2009/06/05/a-quick-and-dirty-onebox-using-php/#comments</comments>
		<pubDate>Fri, 05 Jun 2009 21:59:45 +0000</pubDate>
		<dc:creator>Brian Lawlor</dc:creator>
				<category><![CDATA[gsa]]></category>
		<category><![CDATA[specs]]></category>
		<category><![CDATA[onebox]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[tfp]]></category>
		<category><![CDATA[xslt]]></category>

		<guid isPermaLink="false">http://www.webdogs.org/findability/?p=862</guid>
		<description><![CDATA[Arguably the most common, if not first, Google Search Appliance (GSA) OneBox module that organizations implement is a module that returns personnel information or listings of some kind. It is one of the most obviously useful OneBox results one can come up with. As we ramped up to implement our version of it, we were [...]]]></description>
			<content:encoded><![CDATA[<p>Arguably the most common, if not first, Google Search Appliance (GSA) <a href="http://www.google.com/support/gsa/bin/answer.py?hl=en&#038;answer=38229">OneBox module</a> that organizations implement is a module that returns personnel information or listings of some kind. It is one of the most obviously useful OneBox results one can come up with. As we ramped up to implement our version of it, we were surprised to discover that most publicly available examples or models for creation of OneBox modules rely on technologies (ASP and Java being among the most prevalent) that we do not use. We could not find an example of such a OneBox using simple PHP/MySQL.</p>
<p>Our goal was to build an easily replicable OneBox module that does work with PHP, which we do use. A lot. PHP is at the heart of the <a href="http://pikasoftware.com/">Pika CMS</a> as well as our public websites built on <a href="http://wordpress.org/">WordPress</a>.</p>
<p>Here&#8217;s an example of what our OneBox special query result looks like, with the first keyword &#8220;staff&#8221; being the trigger and the second keyword &#8220;ukiah&#8221;, the name of one of our local office locations. The query returns a OneBox result listing all the active staff in that office:</p>
<p><img src="http://www.webdogs.org/project_files/onebox_ukiah.png" alt="" /></p>
<p>Clicking on the link for each person&#8217;s name triggers a new display with a photo of the person and his or her vitals. This module also works using the same initial trigger with a staff person&#8217;s particular name.</p>
<p>Most simply put, this OneBox module works by querying the MySQL database &#8220;users&#8221; table in the Pika CMS, the application used by all our active employees, across all positions, to record their time and work activity. More specifically, the module breaks down into five basic steps:</p>
<ul class="content">
<li>the OneBox module sends a query to a targeted PHP file</li>
<li>the PHP code runs a query against the targeted MySQL database</li>
<li>the PHP code then outputs the returned data as XML</li>
<li>the GSA reads that XML output</li>
<li>the GSA then formats that output for display as a search result</li>
</ul>
<p>Within the GSA console, one creates a module by selecting <strong>OneBox Modules > Create Module Definition</strong>, selecting the <strong>Trigger</strong> (in our case, &#8220;staff&#8217;), and then identifying the <strong>Provider</strong>, which in this example is the PHP file we created and attached to the module as an <strong>External Provider</strong>, by inserting the URL to the PHP file.</p>
<p>You can download as a ZIP file the <a href="http://www.webdogs.org/project_files/onebox_php_example.zip">PHP code and related GSA stylesheet template</a> used in this example.</p>
<p>The PHP file is annotated, but has select information edited or removed (host, passwords, etc.), for obvious reasons. Looking at the PHP code, in sequence the PHP submits the query, connects to the database, joins data from a combination of data tables in our case management system, then takes the results from the MySQL query and outputs it as XML, i.e., the &#8220;OneBoxResults&#8221; in the code.</p>
<p>Once the GSA outputs the query results as XML, it can then publish the results to a <strong>OneBox Stylesheet Template</strong>, which one can edit by clicking on the <strong>Edit XSL</strong> link at the bottom of the console page for the particular module.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.webdogs.org/2009/06/05/a-quick-and-dirty-onebox-using-php/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Food stamp calculator as a pedagogical tool</title>
		<link>http://www.webdogs.org/2008/12/16/food-stamp-calculator-as-a-pedagogical-tool/</link>
		<comments>http://www.webdogs.org/2008/12/16/food-stamp-calculator-as-a-pedagogical-tool/#comments</comments>
		<pubDate>Tue, 16 Dec 2008 07:49:10 +0000</pubDate>
		<dc:creator>Brian Lawlor</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[calculators]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[php]]></category>

		<guid isPermaLink="false">http://www.webdogs.org/?p=408</guid>
		<description><![CDATA[
To cut to the chase, this post is about a prototype food stamp calculator for use by advocates, built with PHP and JavaScript. (It works fine in Firefox; the design and functions are buggy in IE.)
Here&#8217;s the back story:
One of the most successful content projects undertaken by Legal Services of Northern California has been its [...]]]></description>
			<content:encoded><![CDATA[<p><img style="float: right; margin: 4px 0 0 15px;" src="http://www.webdogs.org/dog_files/dynamic_calculations.png" alt="" /></p>
<p>To cut to the chase, this post is about a <a href="http://www.webdogs.org/calculator/calculator.php">prototype food stamp calculator</a> for use by advocates, built with PHP and JavaScript. (It works fine in Firefox; the design and functions are buggy in IE.)</p>
<p>Here&#8217;s the back story:</p>
<p>One of the most successful content projects undertaken by <a href="http://www.lsnc.net/">Legal Services of Northern California</a> has been its web-based <a href="http://www.foodstampguide.org/">California Food Stamp Guide</a> (FSG). As part of that project, we had discussions about building a California-specific food stamp calculator, and then further discussions about the purpose and function of such a thing. Should it be client or advocate oriented? In either case, should it be more of an &#8220;estimator,&#8221; i.e., a <a href="http://www.snap-step1.usda.gov/fns/">screening tool</a> to get a reasonable, in-the-zone estimate of monthly benefits? Or a tool to make more precise food stamp budget calculations, such that one could check and challenge the calculations in individual cases made by a local welfare office? Among the <a href="http://www.foodstampguide.org/?page_id=145">editorial team</a> that worked on the FSG, there was great interest in having a calculator, but no actual consensus emerged about how best to approach it.</p>
<p>One distinctive idea did emerge, however. Rosemary French at the <a href="http://www.benchmarkinstitute.org/">Benchmark Institute</a> promoted the idea of a calculator that would serve as a pedagogical tool. Her notion incorporated these key elements to make it an effective advocate teaching tool: The calculator should make accurate, complete calculations based on all the possible economic and circumstantial elements that make up an actual monthly benefits determination; it should reveal how changes in a relevant dollar amount or in the application of a client&#8217;s individual circumstances (e.g., medical expenses, daycare expenses, etc.) affect the outcome; and it should display the calculation as a whole, on a single page, rather than in steps that cannot be viewed in relation to each other.</p>
<p>Rosemary&#8217;s idea was the one that inspired us to try something different from the array of other food stamp calculators out there. For various reasons we never quite completed the project, but we do want to share with the larger advocacy community what we did accomplish: a prototype for a California-specific <a href="http://www.webdogs.org/calculator/calculator.php">advocate tool for calculating monthly benefits</a> that honors its pedagogical purposes. (Again, it works as intended in Firefox; not so much in IE.)</p>
<p>Hopefully, use by advocates should be self-explanatory. Start entering numbers and selecting options and the budget calculations shall be revealed dynamically, on the right. The calculations are all based on current food stamp program eligibility standards in California, but can only be made accurately for households in which everyone is eligible; the prototype does not make calculations for mixed households in which one or more members are ineligible. There are Ajaxy pop-up help pages that can be used to provide explanations and links to other resources; one can also save a calculation as a bookmark or print out the results; and other touches. </p>
<p>The PHP and Javascript coding, which includes use of <a href="http://jquery.com/">jQuery</a>,  was done by the esteemed <a href="http://twitter.com/sstrudeau">Scott Trudeau</a>. (Ed Lachgar, on the LSNC IT staff, built the PHP print functions. The layout and visual design were done here at the Webdogs 2.0 labs, so don&#8217;t blame Scott for what it looks like.) If anyone has questions or interest about the PHP and JavaScript coding, feel free to <a href="http://twitter.com/sstrudeau">contact Scott</a> for details, explanations, etc.</p>
<p>Although we have no immediate plans to do more with this project, we are posting all the prototype code for those who may be interested in adapting, modifying or just playing with it. It&#8217;s yours for the taking:</p>
<p><a href="http://www.webdogs.org/dog_files/fscalculator.zip">Download the source code</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.webdogs.org/2008/12/16/food-stamp-calculator-as-a-pedagogical-tool/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Using IE conditional comments with Pika 3.06</title>
		<link>http://www.webdogs.org/2008/01/11/using-ie-conditional-comments-with-pika-306/</link>
		<comments>http://www.webdogs.org/2008/01/11/using-ie-conditional-comments-with-pika-306/#comments</comments>
		<pubDate>Fri, 11 Jan 2008 20:02:05 +0000</pubDate>
		<dc:creator>Brian Lawlor</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[css]]></category>
		<category><![CDATA[ie]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[pika]]></category>

		<guid isPermaLink="false">http://www.webdogs.org/2008/01/11/using-ie-conditional-comments-with-pika-306/</guid>
		<description><![CDATA[This is a repost of an item I added this morning to the PikaDocs wiki. And it has to do with a very unexpected problem we encountered with the recent Pika 3.06 iteration, which implements code changes that unintentionally strip out IE conditional comments from the Pika default.html template. Needless to say, IE conditional comments [...]]]></description>
			<content:encoded><![CDATA[<p>This is a repost of an item I added this morning to the <a href="http://pikasoftware.com/docs/">PikaDocs</a> wiki. And it has to do with a very unexpected problem we encountered with the recent Pika 3.06 iteration, which implements code changes that unintentionally strip out <a href="http://msdn2.microsoft.com/en-us/library/ms537512(VS.85).aspx">IE conditional comments</a> from the Pika <code>default.html</code> template. Needless to say, IE conditional comments are a widely adopted, all-but-standardized way to apply IE-only CSS code to control the design or display of web pages. And <a href="http://lsnc.net/">LSNC</a> has long relied on custom IE-specific CSS code for its <a href="http://pikasoftware.com/docs/index.php/Project_Claire:_Redesigning_Pika">Pika redesign</a>. What were CSS hacks like us to do about this dilemma?</p>
<p>Well, sure enough, those PHP-code ninjas over at Pika Software (Matt, to be specific) had the answer:</p>
<p>Open the <code>pl.php</code> file located in the your Pika subdirectory at <code>/app/lib/pl.php</code>. Carefully comment out lines 2055 and 2056 by preceding them with double-forward slashes so that it looks like this:</p>
<pre>
// $str = str_replace("&lt;!--[", $tpl_prefix, $str);
// $str = str_replace(&quot;]--&gt;&quot;, $tpl_suffix, $str);
</pre>
<p>Save the changes and upload the <code>pl.php</code> file to replace it. Now your IE conditional comments code will play nice with Pika 3.06.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.webdogs.org/2008/01/11/using-ie-conditional-comments-with-pika-306/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>WAMP me up, Scotty!</title>
		<link>http://www.webdogs.org/2007/08/15/wamp-me-up-scotty/</link>
		<comments>http://www.webdogs.org/2007/08/15/wamp-me-up-scotty/#comments</comments>
		<pubDate>Wed, 15 Aug 2007 18:07:30 +0000</pubDate>
		<dc:creator>Brian Lawlor</dc:creator>
				<category><![CDATA[mysql]]></category>
		<category><![CDATA[open source]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[wamp]]></category>

		<guid isPermaLink="false">http://www.webdogs.org/2007/08/15/wamp-me-up-scotty/</guid>
		<description><![CDATA[I got the heads up about Uniform Server, an open-source WAMP-based web development test bed server from The World&#8217;s Easiest PHP/MySQL Testing Server, a brief but informative article by Rob Williams at Community MX. What caught my eye in the article was this paragraph pregnant with the promise of total ease of use:
You do NOT [...]]]></description>
			<content:encoded><![CDATA[<p>I got the heads up about <a href="http://www.uniformserver.com/">Uniform Server</a>, an open-source <a href="http://www.google.com/search?hl=en&#038;rls=GGGL,GGGL:2006-25,GGGL:en&#038;defl=en&#038;q=define:WAMP&#038;sa=X&#038;oi=glossary_definition&#038;ct=title">WAMP</a>-based web development test bed server from <a href="http://www.communitymx.com/abstract.cfm?cid=E5752">The World&#8217;s Easiest PHP/MySQL Testing Server</a>, a brief but informative article by Rob Williams at Community MX. What caught my eye in the article was this paragraph pregnant with the promise of total ease of use:</p>
<p class="quote">You do NOT have to install it, configure it, or in fact make any change at all to the downloaded files in order to have a fully functioning test server up and running! One of the goals of Uniform is to create a standalone server that does not alter or affect the local machine in any way at all. Once you&#8217;ve downloaded the package, all you need to do is extract them to a folder and double-click the &#8220;start server&#8221; batch file; a full-fledged Apache 2 server with the latest version of PHP, MySQL and Perl already installed and pre-configured will then start up. When you&#8217;re done with your testing, simply double-click the &#8220;stop server&#8221; batch file and the entire server shuts down, packs itself up and disappears from existence again leaving no remnants in memory or registry files!</p>
<p>There is not one word of exaggeration in that description. Download it, extract it, click the <code>server_start.bat</code> file in the  &#8220;Uniform Server&#8221; folder to crank it up &#8230; and from your local Windows desktop you have a fully functioning and customizable web server test bed with all the files automatically placed in the default locations you would expect in a typical Linux server. Click the <code>stop.bat</code> and it all unloads from memory. And this wonderfully self-contained web server test bed is fully portable to a flash drive, whatever. Take your test bed with you, people. Sweet, to the max.</p>
<p>Uniform Server is a total freebie you can <a href="http://sourceforge.net/project/showfiles.php?group_id=53691">download</a>   from SourceForge. It works.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.webdogs.org/2007/08/15/wamp-me-up-scotty/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
