<?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>Blog: Raised Eyebrow Web Studio, Inc. &#187; Nonprofit Tech</title>
	<atom:link href="http://blog.raisedeyebrow.com/category/nonprofit-tech/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.raisedeyebrow.com</link>
	<description>What's turning heads at Raised Eyebrow</description>
	<lastBuildDate>Thu, 15 Jul 2010 15:19:02 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Calling all social change geeks: It&#8217;s NetSquared Camp Vancouver</title>
		<link>http://blog.raisedeyebrow.com/2010/07/calling-all-social-change-geeks-its-netsquared-camp-vancouver/#utm_source=rss&amp;utm_medium=rss&amp;utm_campaign=calling-all-social-change-geeks-its-netsquared-camp-vancouver</link>
		<comments>http://blog.raisedeyebrow.com/2010/07/calling-all-social-change-geeks-its-netsquared-camp-vancouver/#comments</comments>
		<pubDate>Thu, 15 Jul 2010 15:19:02 +0000</pubDate>
		<dc:creator>Lauren Bacon</dc:creator>
				<category><![CDATA[Nonprofit Tech]]></category>
		<category><![CDATA[Raised Eyebrow]]></category>
		<category><![CDATA[Workshops & Events]]></category>

		<guid isPermaLink="false">http://blog.raisedeyebrow.com/?p=984</guid>
		<description><![CDATA[A month from now, on Saturday, August 14, I&#8217;ll be attending Vancouver&#8217;s first NetSquared Camp, a day-long event for people who work at the intersection of social change and technology. The goal of the event is to build skills and capacity through peer learning, and invites the participation of &#8220;nonprofits, activists and social entrepreneurs [along] [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://blog.raisedeyebrow.com/wp-content/uploads/2010/07/netsquaredcamp.gif"><img class="alignleft size-medium wp-image-987" title="NetSquared Camp logo" src="http://blog.raisedeyebrow.com/wp-content/uploads/2010/07/netsquaredcamp-300x79.gif" alt="" width="300" height="79" /></a>A month from now, on Saturday, August 14, I&#8217;ll be attending <a href="http://www.netsquared.org/blog/elijah/register-netsquared-camp-vancouver">Vancouver&#8217;s first NetSquared Camp</a>, a day-long event for people who work at the intersection of social change and technology. The goal of the event is to build skills and capacity through peer learning, and invites the participation of &#8220;nonprofits, activists and social entrepreneurs [along] with  their friends and allies in the world of technology and communications.&#8221;</p>
<p>NetSquared Camp is an <a href="http://en.wikipedia.org/wiki/Unconference">unconference</a>, and for those who aren&#8217;t familiar with that term, it&#8217;s an event where the agenda is entirely driven by the participants. So if you show up and speak up, there&#8217;s a very good chance that you&#8217;ll learn something that&#8217;s relevant to you. (You may also end up teaching others, since the participants also lead &amp; facilitate the sessions.)</p>
<p>The <a href="http://www.netsquared.org/blog/elijah/register-netsquared-camp-vancouver">list of suggested session topics</a> is both wide-ranging and highly practical, and the organizers have set up <a href="http://netsquaredcampvancouver.wikispaces.com/Session+proposals">a wiki where you can propose your own session ideas</a>.</p>
<p>Perhaps best of all, the ticket price is by donation, with the suggested donation a very affordable $20. By the look of <a href="http://netsquaredvancouver.eventbrite.com/">the RSVP list</a>, interest is high, and as with all unconferences, the event&#8217;s success will depend entirely on who shows up &#8212; so please <a href="http://netsquaredvancouver.eventbrite.com/">mark the date in your calendar</a> and spread the word.</p>
<p>Here at Raised Eyebrow we&#8217;re very passionate about sharing what we know and building capacity within the nonprofit sector, so we&#8217;re very pleased to be a sponsor of NetSquared Camp Vancouver 2010. I&#8217;m looking forward to seeing how the agenda evolves.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.raisedeyebrow.com/2010/07/calling-all-social-change-geeks-its-netsquared-camp-vancouver/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Provincial Government Funding for New Technology Training Could Help Offset the Cost of a New Website?</title>
		<link>http://blog.raisedeyebrow.com/2010/06/provincial-government-funding-for-new-technology-training-could-help-offset-the-cost-of-a-new-website/#utm_source=rss&amp;utm_medium=rss&amp;utm_campaign=provincial-government-funding-for-new-technology-training-could-help-offset-the-cost-of-a-new-website</link>
		<comments>http://blog.raisedeyebrow.com/2010/06/provincial-government-funding-for-new-technology-training-could-help-offset-the-cost-of-a-new-website/#comments</comments>
		<pubDate>Mon, 21 Jun 2010 16:30:07 +0000</pubDate>
		<dc:creator>Emira Mears</dc:creator>
				<category><![CDATA[Nonprofit Tech]]></category>
		<category><![CDATA[Raised Eyebrow]]></category>

		<guid isPermaLink="false">http://blog.raisedeyebrow.com/?p=946</guid>
		<description><![CDATA[Depending on the size of your organization and whether or not you have previously applied for this program, there is a BC Government initiative which your organization may be able to use to offset some of the cost of your website (re)design and development project.
Information about the program and the one page application form are [...]]]></description>
			<content:encoded><![CDATA[<p><!-- 		@page { margin: 2cm } 		P { margin-bottom: 0.21cm } 		A:link { so-language: zxx } -->Depending on the size of your organization and whether or not you have previously applied for this program, there is a BC Government initiative which your organization may be able to use to offset some of the cost of your website (re)design and development project.</p>
<p>Information about the program and the one page application form are available on the Ministry website: <a href="http://www.aved.gov.bc.ca/workplace_training_program/welcome.htm">http://www.aved.gov.bc.ca/workplace_training_program/welcome.htm</a></p>
<p>In brief the eligibility requirements are:</p>
<ul>
<li>Business or organization 	(non-profit organizations are eligible) with less than 50 employees 	(this number would not include volunteers).</li>
<li>Been operating for more than a 	year.</li>
<li>Apply the funding to training 	which will “help improve productivity” and/or “support the 	introduction of new equipment, technology or work process”. Your 	new CMS should be eligible as a new technology which will also help 	improve productivity.</li>
<li>You must have not already applied 	for the grant.</li>
</ul>
<p>The grant offers:</p>
<ul>
<li>Up to $1,500 per employee for 	training costs</li>
<li>An organizational maximum of 	$5,000</li>
</ul>
<p>Please note that training for Owners is not eligible for the grant, however, we have been unable to ascertain whether or not Executive Directors are excluded (there is no language that says so, and the Ministry has been slow to respond).</p>
<p>The program is in place until January 31, 2011.</p>
<p>Please note, this is a one time grant so if you feel there is other training  to which you could better apply this grant, then we would advise you to not apply for the grant for your website training.</p>
<p>Of course Raised Eyebrow can not guarantee that your funding will be approved, but the training we provide to our clients as a part of a website redesign or a new development project does fit into the criteria of the program. We are in no way affiliated with this program, we simply want to make our clients aware of it as we are conscious of the limited resources that many of our clients operate under.</p>
<p><strong>More information:</strong></p>
<ul>
<li><a href="http://www.aved.gov.bc.ca/workplace_training_program/docs/application.pdf">Download 	the One Page Application Form</a> (PDF)</li>
<li><a href="http://www.aved.gov.bc.ca/workplace_training_program/docs/qa.pdf">Questions 	and Answers on the Ministry website</a> (PDF)</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://blog.raisedeyebrow.com/2010/06/provincial-government-funding-for-new-technology-training-could-help-offset-the-cost-of-a-new-website/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Hey, Web Geeks With Hearts of Gold: We&#8217;re Hiring.</title>
		<link>http://blog.raisedeyebrow.com/2010/05/hey-web-geeks-with-hearts-of-gold-were-hiring/#utm_source=rss&amp;utm_medium=rss&amp;utm_campaign=hey-web-geeks-with-hearts-of-gold-were-hiring</link>
		<comments>http://blog.raisedeyebrow.com/2010/05/hey-web-geeks-with-hearts-of-gold-were-hiring/#comments</comments>
		<pubDate>Fri, 28 May 2010 16:31:08 +0000</pubDate>
		<dc:creator>Lauren Bacon</dc:creator>
				<category><![CDATA[Drupal]]></category>
		<category><![CDATA[Geekery]]></category>
		<category><![CDATA[Nonprofit Tech]]></category>
		<category><![CDATA[Raised Eyebrow]]></category>

		<guid isPermaLink="false">http://blog.raisedeyebrow.com/?p=915</guid>
		<description><![CDATA[We&#8217;re excited to announce a new opportunity at Raised Eyebrow. Our little-web-studio-that-could is growing again, and we&#8217;ve got an opening for a Front-End Developer/Themer to help us build awesome websites for fabulous, mission-driven clients.
This is a position for someone with solid technical skills &#8212; someone who can rock HTML and CSS, who prides themselves on [...]]]></description>
			<content:encoded><![CDATA[<p>We&#8217;re excited to announce a new opportunity at Raised Eyebrow. Our little-web-studio-that-could is growing again, and we&#8217;ve got an opening for a <a href="http://raisedeyebrow.com/jobs/">Front-End Developer/Themer</a> to help us build awesome websites for fabulous, mission-driven clients.</p>
<p>This is a position for someone with solid technical skills &#8212; someone who can rock HTML and CSS, who prides themselves on attention to detail and clean, elegant code. You&#8217;ll be turning design comps into themes for Drupal and WordPress sites, so experience with one (or both) of those CMS&#8217;s is preferred, but if you&#8217;re confident in your coding skills and are new to Drupal &amp; WordPress, don&#8217;t let that stop you.</p>
<p>Because we&#8217;re a small shop, everyone here tends to wear a few hats, so we&#8217;re looking for someone with smarts, adaptability and a serious appetite for learning. We pride ourselves on the quality of our work, our efficiency, and our passion for our clients &#8212; and we&#8217;re looking for someone whose shares those values.</p>
<p>In our beautiful, heritage Gastown office, you&#8217;ll find a friendly team of experts, a ridiculously well-stocked tea cabinet, and abundant opportunities to work on projects that allow you to flex your technical muscles and bring your heart and ideals to work.</p>
<p>Sound like a fit for you (or someone you know)? <a href="http://raisedeyebrow.com/jobs/">The job description, with details on how to apply, is right here.</a></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.raisedeyebrow.com/2010/05/hey-web-geeks-with-hearts-of-gold-were-hiring/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Inexpensive Image Editing Tools: Format your photos on a budget</title>
		<link>http://blog.raisedeyebrow.com/2010/05/inexpensive-image-editing-tools-format-your-photos-on-a-budget/#utm_source=rss&amp;utm_medium=rss&amp;utm_campaign=inexpensive-image-editing-tools-format-your-photos-on-a-budget</link>
		<comments>http://blog.raisedeyebrow.com/2010/05/inexpensive-image-editing-tools-format-your-photos-on-a-budget/#comments</comments>
		<pubDate>Tue, 18 May 2010 15:54:11 +0000</pubDate>
		<dc:creator>Lauren Bacon</dc:creator>
				<category><![CDATA[Design]]></category>
		<category><![CDATA[Gadgets]]></category>
		<category><![CDATA[Geekery]]></category>
		<category><![CDATA[Nonprofit Tech]]></category>
		<category><![CDATA[Productivity]]></category>

		<guid isPermaLink="false">http://blog.raisedeyebrow.com/?p=902</guid>
		<description><![CDATA[We&#8217;re often asked for recommendations on image editing software that doesn&#8217;t cost an arm and a leg. Photoshop is fantastic, but the price tag is steep, and in fact, its strengths can also be weaknesses in that it&#8217;s actually such a powerful program that it can overwhelm the novice or intermediate user.
So, where do you [...]]]></description>
			<content:encoded><![CDATA[<p>We&#8217;re often asked for recommendations on image editing software that doesn&#8217;t cost an arm and a leg. <a href="http://www.adobe.com/products/photoshop/compare/">Photoshop</a> is fantastic, but the price tag is steep, and in fact, its strengths can also be weaknesses in that it&#8217;s actually such a powerful program that it can overwhelm the novice or intermediate user.</p>
<p>So, where do you turn if your needs are relatively straightforward and your budget is limited? I would recommend one of the following tools:</p>
<h2><a href="http://www.picnik.com/">Picnik</a></h2>
<p>Picnik is a powerful online application that allows you to upload &amp; edit images on the fly. There is a free version but the options are rather limited; however, it might do the trick for what your client needs. The premium version starts at $2.08/month. Picnik even integrates with <a href="http://www.flickr.com/">Flickr</a>, <a href="http://picasa.google.com">Picasa</a> &amp; <a href="http://www.facebook.com">Facebook</a>, so if your client uses those tools that might come in handy. I find it a little slow, compared to Photoshop (mostly because of the time required to upload &amp; download files), but it&#8217;s a very good tool for people with no/little budget.</p>
<h2><a href="http://www.adobe.com/products/photoshopelwin/">Photoshop Elements</a></h2>
<p>This is a stripped-down version of Photoshop that&#8217;s perfect for what most of our clients need, which is basic photo &amp; image editing tools for web use. It&#8217;s under $100 and provides a good chunk of the core Photoshop functionality &#8212; in some ways I would recommend it over Photoshop for basic-level users, because with fewer options it&#8217;s less confusing.</p>
<h2><a href="https://www.photoshop.com/">Photoshop.com</a></h2>
<p>Adobe&#8217;s answer to Picnik is an online editing toolset that you can use for free; the only limitation is file storage. The free accounts comes with 2 GB of storage space for your files, and beyond that you pay an annual subscription fee that varies (anywhere from $20-$500 USD) based on the amount of storage you need.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.raisedeyebrow.com/2010/05/inexpensive-image-editing-tools-format-your-photos-on-a-budget/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Datadotgc.ca &#8211; A Drupal case study</title>
		<link>http://blog.raisedeyebrow.com/2010/04/datadotgc-ca-a-drupal-case-study/#utm_source=rss&amp;utm_medium=rss&amp;utm_campaign=datadotgc-ca-a-drupal-case-study</link>
		<comments>http://blog.raisedeyebrow.com/2010/04/datadotgc-ca-a-drupal-case-study/#comments</comments>
		<pubDate>Thu, 29 Apr 2010 17:56:20 +0000</pubDate>
		<dc:creator>Colin Calnan</dc:creator>
				<category><![CDATA[Code and Coding]]></category>
		<category><![CDATA[Content Management Systems]]></category>
		<category><![CDATA[Drupal]]></category>
		<category><![CDATA[Geekery]]></category>
		<category><![CDATA[Nonprofit Tech]]></category>
		<category><![CDATA[CKAN]]></category>
		<category><![CDATA[Open data]]></category>

		<guid isPermaLink="false">http://blog.raisedeyebrow.com/?p=863</guid>
		<description><![CDATA[We recently launched http://www.datadotgc.ca, an open data collection portal for Canada, built to help poke the Canadian government in the right direction, towards something like similar sites in the UK (data.gov.uk) and the US (data.gov). Read David Eaves&#8217; explanation of its purpose. For the benefit of the programming and Drupal community, I&#8217;m going to run [...]]]></description>
			<content:encoded><![CDATA[<p>We recently launched <a href="http://www.datadotgc.ca">http://www.datadotgc.ca</a>, an open data collection portal for Canada, built to help poke the Canadian government in the right direction, towards something like similar sites in the UK (<a href="http://data.gov.uk">data.gov.uk</a>) and the US (<a href="http://data.gov">data.gov</a>). <a href="http://eaves.ca/2010/04/15/datadotgc-ca-launched-the-opportunity-and-challenge/">Read David Eaves&#8217; explanation of its purpose</a>. For the benefit of the programming and Drupal community, I&#8217;m going to run through, with the aid of code samples, the development of the Drupal module to communicate with the CKAN API (which is where the data is stored). I&#8217;ll also walk through Theming, integration with Google Charts, Tag Clouds and most importantly, caching.</p>
<h3>What is CKAN?</h3>
<blockquote><p>CKAN is a registry or catalogue system for datasets or other &#8220;knowledge&#8221; resources. CKAN aims to make it easy to find, share and reuse open content and data, especially in ways that are machine automatable.</p></blockquote>
<p>CKAN is a nice big database that is built to accept user input of the type of data we&#8217;re trying to collect for datadotgc.ca. It has a slick front and back end that allows administrative access to the collected data.<br />
You can find out more on <a href="http://www.okfn.org/ckan/">their website</a>. </p>
<h3>CKAN&#8217;s API</h3>
<p>In order to utilize the power of CKAN I needed to link it up to Drupal. CKAN has a <a href="http://knowledgeforge.net/ckan/doc/ckan/api.html">powerful and flexible API</a> that I used extensively in the module.</p>
<h3>The Foundation</h3>
<p>Early on in the project I got in touch with the wonderful team at CKAN and they then put me in touch with Sean Burlington from the <a href="http://data.gov.uk">data.gov.uk</a> development team. They had also built their site in Drupal and Seán had lots of information on how they tweaked their CKAN site to work with Drupal. He worked hard to open source some of the work that they had done, and <a href="http://www.practicalweb.co.uk/blog/10/02/24/drupal-module-ckan-integration">released it</a> just in time for us to get started. Seáns module provided the basic API connectivity we needed to get started and was the foundation for our module.</p>
<h3>The Build</h3>
<p>How do you integrate Drupal with the CKAN API? Let&#8217;s start with the basics:</p>
<p>CKAN stores the <a href="http://www.datadotgc.ca/dataset/geogratisnat_hydrography_v100">individual datasets that you see on Datadotgc.ca</a> as &#8216;<em>Packages</em>&#8216;. It became clear that these &#8216;Packages&#8217; could be directly mapped to the standard node architecture in Drupal. To achieve this I created a content type in the module that stored all the data I needed.</p>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p863code11'); return false;">View Code</a> PHP</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p86311"><td class="code" id="p863code11"><pre class="php" style="font-family:monospace;"><span style="color: #009933; font-style: italic;">/**
 * Define module-provided node types.
 */</span>
<span style="color: #000000; font-weight: bold;">function</span> ckan_node_info<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
  <span style="color: #b1b100;">return</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;">'ckan'</span> <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>
    <span style="color: #0000ff;">'name'</span>           <span style="color: #339933;">=&gt;</span> t<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'CKAN Package'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span>
    <span style="color: #0000ff;">'module'</span>         <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'ckan'</span><span style="color: #339933;">,</span>
    <span style="color: #0000ff;">'description'</span>    <span style="color: #339933;">=&gt;</span> t<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'A package of Open Data.'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span>
    <span style="color: #0000ff;">'has_title'</span>      <span style="color: #339933;">=&gt;</span> <span style="color: #009900; font-weight: bold;">TRUE</span><span style="color: #339933;">,</span>
    <span style="color: #0000ff;">'title_label'</span>    <span style="color: #339933;">=&gt;</span> t<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'Title'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span>
    <span style="color: #0000ff;">'has_body'</span>       <span style="color: #339933;">=&gt;</span> <span style="color: #009900; font-weight: bold;">TRUE</span><span style="color: #339933;">,</span>
    <span style="color: #0000ff;">'body_label'</span>     <span style="color: #339933;">=&gt;</span> t<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'Package Description'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span>
    <span style="color: #0000ff;">'min_word_count'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #cc66cc;">0</span><span style="color: #339933;">,</span>
    <span style="color: #0000ff;">'locked'</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: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">function</span> ckan_create_node<span style="color: #009900;">&#40;</span><span style="color: #000088;">$ckan_data</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
  <span style="color: #000088;">$node</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;">'title'</span>   <span style="color: #339933;">=&gt;</span> <span style="color: #000088;">$ckan_data</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">title</span><span style="color: #339933;">,</span>
    <span style="color: #0000ff;">'uid'</span>     <span style="color: #339933;">=&gt;</span> <span style="color: #cc66cc;">1</span><span style="color: #339933;">,</span>
    <span style="color: #0000ff;">'body'</span>    <span style="color: #339933;">=&gt;</span> <span style="color: #000088;">$ckan_data</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">name</span><span style="color: #339933;">,</span>
    <span style="color: #0000ff;">'promote'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #cc66cc;">1</span><span style="color: #339933;">,</span>
    <span style="color: #0000ff;">'path'</span>    <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'dataset/'</span> <span style="color: #339933;">.</span> <span style="color: #000088;">$ckan_data</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">name</span><span style="color: #339933;">,</span>
    <span style="color: #0000ff;">'type'</span>    <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'ckan'</span><span style="color: #339933;">,</span>
    <span style="color: #0000ff;">'comment'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #cc66cc;">2</span><span style="color: #339933;">,</span>
  <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span></pre></td></tr></table></div>

<p>As you can see from the code, the only data elements to be set when a node is created are <em>Title</em>, <em>Body</em> and <em>Path</em>. The body of the node is set to be the name of the CKAN package, which is in fact a simple string: <em>geogratisnat_hydrography_v100</em>.</p>
<p>The more complex CKAN data was not mapped to any CCK fields as you might think, but instead it is pulled from CKAN when the node is loaded. This simplifies the Drupal side of things by ensuring that we don&#8217;t have to keep track of any changes to the structure or contents of the dataset that may happen on the CKAN side.</p>
<p>Here is an example of some package data:</p>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p863code12'); return false;">View Code</a> INI</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p86312"><td class="code" id="p863code12"><pre class="ini" style="font-family:monospace;"><span style="color: #000066; font-weight:bold;"><span style="">&#91;</span>maintainer<span style="">&#93;</span></span> <span style="color: #000066; font-weight:bold;">=</span><span style="color: #660066;">&gt; Government of Canada, Natural Resources Canada, Centre for Topographic Information <span style="">&#40;</span>Sherbrooke<span style="">&#41;</span></span>
<span style="color: #000066; font-weight:bold;"><span style="">&#91;</span>name<span style="">&#93;</span></span> <span style="color: #000066; font-weight:bold;">=</span><span style="color: #660066;">&gt; 1996_population_census_data_canada</span>
<span style="color: #000066; font-weight:bold;"><span style="">&#91;</span>author<span style="">&#93;</span></span> <span style="color: #000066; font-weight:bold;">=</span><span style="color: #660066;">&gt; Government of Canada, Natural Resources Canada, Canada Centre for Remote Sensing, GeoAccess Division, The Atlas of Canada</span>
<span style="color: #000066; font-weight:bold;"><span style="">&#91;</span>url<span style="">&#93;</span></span> <span style="color: #000066; font-weight:bold;">=</span><span style="color: #660066;">&gt; ftp://ftp.geogratis.gc.ca/atlas/Population_Ecumene_Census/1996/</span>
<span style="color: #000066; font-weight:bold;"><span style="">&#91;</span>notes<span style="">&#93;</span></span> <span style="color: #000066; font-weight:bold;">=</span><span style="color: #660066;">&gt; The parts of Canada making up the 1996 Settled Area, <span style="">&#40;</span>or Population Ecumene<span style="">&#41;</span>, represents a selection of the 5984 Census Subdivisions <span style="">&#40;</span>CSD<span style="">&#41;</span> as defined by Statistics Canada for the 1996 Census. The selection process essentially removes those CSDs with very large areas and/or very low populations. Some of British Columbia's CSD boundaries have been further modified to better conform to the distinctive settlement patterns in the Cordilleran regions. The 1996 Settled Area is an attempt to balance the needs of national scale choropleth mapping with the spatial reality that the majority of Canada's land area contains very few people. The Settled Area represents more than 98% of the Canadian population captured in the 1996 Census of Canada.</span>
<span style="color: #000066; font-weight:bold;"><span style="">&#91;</span>title<span style="">&#93;</span></span> <span style="color: #000066; font-weight:bold;">=</span><span style="color: #660066;">&gt; 1996 Population <span style="">&#40;</span>Ecumene<span style="">&#41;</span> Census Data, Canada</span>
<span style="color: #000066; font-weight:bold;"><span style="">&#91;</span>download_url<span style="">&#93;</span></span> <span style="color: #000066; font-weight:bold;">=</span><span style="color: #660066;">&gt; ftp://ftp.geogratis.gc.ca/atlas/Population_Ecumene_Census/1996/1996.zip</span></pre></td></tr></table></div>

<p>When a node is loaded, the package data is pulled from CKAN and then cached for later use.</p>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p863code13'); return false;">View Code</a> PHP</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p86313"><td class="code" id="p863code13"><pre class="php" style="font-family:monospace;"><span style="color: #009933; font-style: italic;">/**
 * Load node-type-specific information
 */</span>
<span style="color: #000000; font-weight: bold;">function</span> ckan_load<span style="color: #009900;">&#40;</span><span style="color: #000088;">$node</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
  <span style="color: #000088;">$ckan</span> <span style="color: #339933;">=</span> ckan_ckan<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
  <span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$cache</span> <span style="color: #339933;">=</span> cache_get<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'ckan:'</span><span style="color: #339933;">.</span> <span style="color: #000088;">$node</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">body</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'cache_ckan'</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">&amp;&amp;</span> <span style="color: #339933;">!</span><a href="http://www.php.net/empty"><span style="color: #990000;">empty</span></a><span style="color: #009900;">&#40;</span><span style="color: #000088;">$cache</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">data</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
    <span style="color: #666666; font-style: italic;">// Get the cached data</span>
    <span style="color: #000088;">$node</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">ckan</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$cache</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">data</span><span style="color: #339933;">;</span>
  <span style="color: #009900;">&#125;</span> <span style="color: #b1b100;">else</span> <span style="color: #009900;">&#123;</span>
    try <span style="color: #009900;">&#123;</span>
      <span style="color: #666666; font-style: italic;">// Call the API to get the package data</span>
      <span style="color: #000088;">$node</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">ckan</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$ckan</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">getPackage</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$node</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">body</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span> catch <span style="color: #009900;">&#40;</span>Exception <span style="color: #000088;">$e</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
      drupal_set_message<span style="color: #009900;">&#40;</span><span style="color: #000088;">$e</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">getMessage</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'error'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span>
    <span style="color: #666666; font-style: italic;">// Cache this package data for later use</span>
    cache_set<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'ckan:'</span><span style="color: #339933;">.</span> <span style="color: #000088;">$node</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">body</span><span style="color: #339933;">,</span> <span style="color: #000088;">$node</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">ckan</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'cache_ckan'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>	
    watchdog<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'ckan'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'Called CKAN API for '</span><span style="color: #339933;">.</span><span style="color: #000088;">$node</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">body</span><span style="color: #339933;">.</span><span style="color: #0000ff;">' package - ckan_load()'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
  <span style="color: #009900;">&#125;</span>
  <span style="color: #b1b100;">return</span> <span style="color: #000088;">$node</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span></pre></td></tr></table></div>

<p>Once the CKAN data has been added to the node object it&#8217;s relatively easy to output this data in a node template. I created a template file in my theme called node_ckan.tpl.php and here&#8217;s an example of how I displayed some of the CKAN package data in there:</p>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p863code14'); return false;">View Code</a> PHP</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p86314"><td class="code" id="p863code14"><pre class="php" style="font-family:monospace;"><span style="color: #339933;">&lt;</span> ?php <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$title</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">:</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>
 <span style="color: #339933;">&lt;</span>h1 id<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;page-title&quot;</span> <span style="color: #000000; font-weight: bold;">class</span><span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;title tk-museo-slab&quot;</span><span style="color: #339933;">&gt;&lt;</span> ?php <span style="color: #b1b100;">print</span> <span style="color: #000088;">$title</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span><span style="color: #339933;">&lt;/</span>h1<span style="color: #339933;">&gt;</span>
<span style="color: #339933;">&lt;</span> ?php <span style="color: #b1b100;">endif</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>
&nbsp;
<span style="color: #339933;">&lt;</span> ?php <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$ckan</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">name</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">:</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>
  <span style="color: #339933;">&lt;</span>div <span style="color: #000000; font-weight: bold;">class</span><span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;package-name&quot;</span><span style="color: #339933;">&gt;</span><span style="color: #009900;">&#40;</span><span style="color: #339933;">&lt;</span> ?php <span style="color: #b1b100;">print</span> <span style="color: #000088;">$ckan</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">name</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">&lt;/</span>div<span style="color: #339933;">&gt;</span>
<span style="color: #339933;">&lt;</span> ?php <span style="color: #b1b100;">endif</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>
&nbsp;
<span style="color: #339933;">&lt;</span> ?php <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$ckan</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">url</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">:</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>
 <span style="color: #339933;">&lt;</span>div <span style="color: #000000; font-weight: bold;">class</span><span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;package-link&quot;</span><span style="color: #339933;">&gt;&lt;</span> ?php <span style="color: #b1b100;">print</span> l<span style="color: #009900;">&#40;</span><span style="color: #000088;">$ckan</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">url</span><span style="color: #339933;">,</span> <span style="color: #000088;">$ckan</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">url</span><span style="color: #339933;">,</span> <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;">'attributes'</span> <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><span style="color: #0000ff;">'class'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'link'</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span><span style="color: #339933;">&lt;/</span>div<span style="color: #339933;">&gt;</span>
<span style="color: #339933;">&lt;</span> ?php <span style="color: #b1b100;">endif</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span></pre></td></tr></table></div>

<p>You can see from all of the above examples I&#8217;m using a class object called &#8220;<em>ckan</em>&#8221; to store our data. This came from Sean&#8217;s module and is a simple class that provides the connectivity to the CKAN API. Here&#8217;s a brief synopsis of how it works:</p>
<ol>
<li>First I need a way to connect to the API. That&#8217;s relatively straightforward using the <a href="http://php.net/manual/en/book.curl.php">curl libraries in php</a>.

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p863code15'); return false;">View Code</a> PHP</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p86315"><td class="code" id="p863code15"><pre class="php" style="font-family:monospace;"><span style="color: #000088;">$ch</span> <span style="color: #339933;">=</span> <a href="http://www.php.net/curl_init"><span style="color: #990000;">curl_init</span></a><span style="color: #009900;">&#40;</span><span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">url</span> <span style="color: #339933;">.</span> <span style="color: #000088;">$url</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<a href="http://www.php.net/curl_setopt"><span style="color: #990000;">curl_setopt</span></a><span style="color: #009900;">&#40;</span><span style="color: #000088;">$ch</span><span style="color: #339933;">,</span> CURLOPT_RETURNTRANSFER<span style="color: #339933;">,</span> <span style="color: #cc66cc;">1</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<a href="http://www.php.net/curl_setopt"><span style="color: #990000;">curl_setopt</span></a><span style="color: #009900;">&#40;</span><span style="color: #000088;">$ch</span><span style="color: #339933;">,</span> CURLOPT_HEADER<span style="color: #339933;">,</span> <span style="color: #cc66cc;">0</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<a href="http://www.php.net/curl_setopt"><span style="color: #990000;">curl_setopt</span></a><span style="color: #009900;">&#40;</span><span style="color: #000088;">$ch</span><span style="color: #339933;">,</span> CURLOPT_TIMEOUT<span style="color: #339933;">,</span> <span style="color: #cc66cc;">30</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$result</span> <span style="color: #339933;">=</span> <a href="http://www.php.net/curl_exec"><span style="color: #990000;">curl_exec</span></a><span style="color: #009900;">&#40;</span><span style="color: #000088;">$ch</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$info</span> <span style="color: #339933;">=</span> <a href="http://www.php.net/curl_getinfo"><span style="color: #990000;">curl_getinfo</span></a><span style="color: #009900;">&#40;</span><span style="color: #000088;">$ch</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<a href="http://www.php.net/curl_close"><span style="color: #990000;">curl_close</span></a><span style="color: #009900;">&#40;</span><span style="color: #000088;">$ch</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></td></tr></table></div>

</li>
<li>Now create some functions that allow various parts of the API to be called. Below is an example of two class functions which call the API.

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p863code16'); return false;">View Code</a> PHP</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p86316"><td class="code" id="p863code16"><pre class="php" style="font-family:monospace;"><span style="color: #666666; font-style: italic;">// Get an individual package</span>
<span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">function</span> getPackage<span style="color: #009900;">&#40;</span><span style="color: #000088;">$package</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
  <span style="color: #000088;">$package</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">transfer</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'api/rest/package/'</span> <span style="color: #339933;">.</span> <a href="http://www.php.net/urlencode"><span style="color: #990000;">urlencode</span></a><span style="color: #009900;">&#40;</span><span style="color: #000088;">$package</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
  <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #339933;">!</span><span style="color: #000088;">$package</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">name</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
    <span style="color: #b1b100;">throw</span> <span style="color: #000000; font-weight: bold;">new</span> CkanException<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;Package Load Error&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
  <span style="color: #009900;">&#125;</span>
  <span style="color: #b1b100;">return</span> <span style="color: #000088;">$package</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #666666; font-style: italic;">// Get a list of all packages</span>
<span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">function</span> getPackageList<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
  <span style="color: #000088;">$list</span> <span style="color: #339933;">=</span>  <span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">transfer</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'api/rest/package/'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
  <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #339933;">!</span><a href="http://www.php.net/is_array"><span style="color: #990000;">is_array</span></a><span style="color: #009900;">&#40;</span><span style="color: #000088;">$list</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
    <span style="color: #b1b100;">throw</span> <span style="color: #000000; font-weight: bold;">new</span> CkanException<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;Package List Error&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
  <span style="color: #009900;">&#125;</span>
  <span style="color: #b1b100;">return</span> <span style="color: #000088;">$list</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span></pre></td></tr></table></div>

</li>
</ol>
<p>All of these API calls return a JSON object which is then decoded into an object using the PHP function:</p>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p863code17'); return false;">View Code</a> PHP</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p86317"><td class="code" id="p863code17"><pre class="php" style="font-family:monospace;"><a href="http://www.php.net/json_decode"><span style="color: #990000;">json_decode</span></a><span style="color: #009900;">&#40;</span><span style="color: #000088;">$results</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></td></tr></table></div>

<h3>Theming</h3>
<p>Once that data has been successfully retrieved and decoded from JSON into something that&#8217;s easier to handle, it needs to be themed. For this I created two theming functions; one for creating an individual list item, the other to create a formatted list of these individual items. I call the theme function whenever I get results from the API, and pass it the results, along with the title I want to appear on the listings page.</p>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p863code18'); return false;">View Code</a> PHP</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p86318"><td class="code" id="p863code18"><pre class="php" style="font-family:monospace;"><span style="color: #666666; font-style: italic;">// Theme the results retrieved from API call</span>
theme<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'ckan_results'</span><span style="color: #339933;">,</span> <span style="color: #000088;">$results</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'All Packages'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #009933; font-style: italic;">/**
 * Theme search results
 */</span>
<span style="color: #000000; font-weight: bold;">function</span> theme_ckan_results<span style="color: #009900;">&#40;</span><span style="color: #000088;">$results</span><span style="color: #339933;">,</span> <span style="color: #000088;">$title</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">''</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
  <span style="color: #666666; font-style: italic;">// Two global variables needed by the pager.</span>
  <span style="color: #666666; font-style: italic;">// Taken from pager_query() in pager.inc</span>
  <span style="color: #000000; font-weight: bold;">global</span> <span style="color: #000088;">$pager_page_array</span><span style="color: #339933;">,</span> <span style="color: #000088;">$pager_total</span><span style="color: #339933;">;</span>
&nbsp;
  <span style="color: #000088;">$output</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">''</span><span style="color: #339933;">;</span>
&nbsp;
  <span style="color: #666666; font-style: italic;">// Grab the 'page' query parameter.</span>
  <span style="color: #666666; font-style: italic;">// Taken from pager_query() in pager.inc</span>
  <span style="color: #000088;">$page</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;">$_GET</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'page'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span> ? <span style="color: #000088;">$_GET</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'page'</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">:</span> <span style="color: #0000ff;">''</span><span style="color: #339933;">;</span>
&nbsp;
  <span style="color: #666666; font-style: italic;">// Convert comma-separated $page to an array, used by other functions.</span>
  <span style="color: #666666; font-style: italic;">// Taken from pager_query() in pager.inc</span>
  <span style="color: #000088;">$pager_page_array</span> <span style="color: #339933;">=</span> <a href="http://www.php.net/explode"><span style="color: #990000;">explode</span></a><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">','</span><span style="color: #339933;">,</span> <span style="color: #000088;">$page</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
  <span style="color: #666666; font-style: italic;">// Generate the data for page the requested and add it to the output.</span>
  <span style="color: #000088;">$items_per_page</span> <span style="color: #339933;">=</span> variable_get<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'ckan_items_per_page'</span><span style="color: #339933;">,</span> <span style="color: #cc66cc;">4</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
  <span style="color: #666666; font-style: italic;">// If there are less results than the specified number of items per page, reset the number of items per page</span>
  <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;">count</span> <span style="color: #339933;">&lt;</span> <span style="color: #000088;">$items_per_page</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span> <span style="color: #000088;">$items_per_page</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$results</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">count</span><span style="color: #339933;">;</span> <span style="color: #009900;">&#125;</span>
&nbsp;
  <span style="color: #666666; font-style: italic;">// Initialize pager</span>
  <span style="color: #000088;">$start</span> <span style="color: #339933;">=</span> <span style="color: #cc66cc;">0</span><span style="color: #339933;">;</span>
  <span style="color: #666666; font-style: italic;">// If it's not the first page</span>
  <span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$page</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
    <span style="color: #666666; font-style: italic;">// Set the data to start displaying on the correct page</span>
    <span style="color: #000088;">$start</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$page</span> <span style="color: #339933;">*</span> <span style="color: #000088;">$items_per_page</span><span style="color: #339933;">;</span>
  <span style="color: #009900;">&#125;</span>
&nbsp;
   <span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$title</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
     <span style="color: #000088;">$output</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">'&lt;h1 id=&quot;page-title&quot;&gt;'</span><span style="color: #339933;">.</span><span style="color: #000088;">$title</span><span style="color: #339933;">.</span><span style="color: #0000ff;">'&lt;/h1&gt;'</span><span style="color: #339933;">;</span>
   <span style="color: #009900;">&#125;</span>
&nbsp;
  <span style="color: #000088;">$output</span> <span style="color: #339933;">.=</span> <span style="color: #0000ff;">'&lt;h3 class=&quot;resultscount&quot;&gt;Your search returned '</span><span style="color: #339933;">.</span><span style="color: #000088;">$results</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">count</span> <span style="color: #339933;">.</span><span style="color: #0000ff;">' records&lt;/h3&gt;'</span><span style="color: #339933;">;</span>
&nbsp;
  <span style="color: #666666; font-style: italic;">// Theme the individual results</span>
  <span style="color: #b1b100;">for</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$i</span> <span style="color: #339933;">=</span> <span style="color: #cc66cc;">0</span><span style="color: #339933;">;</span> <span style="color: #000088;">$i</span> <span style="color: #339933;">&lt;</span> <span style="color: #000088;">$items_per_page</span><span style="color: #339933;">;</span> <span style="color: #000088;">$i</span><span style="color: #339933;">++</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
      <span style="color: #000088;">$output</span> <span style="color: #339933;">.=</span>  theme<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'ckan_item'</span><span style="color: #339933;">,</span> <span style="color: #000088;">$results</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">results</span><span style="color: #009900;">&#91;</span><span style="color: #000088;">$i</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
  <span style="color: #009900;">&#125;</span>
&nbsp;
  <span style="color: #666666; font-style: italic;">// Put some magic in the two global variables</span>
  <span style="color: #666666; font-style: italic;">// Based on code in pager_query() in pager.inc</span>
  <span style="color: #000088;">$total_results</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$results</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">count</span><span style="color: #339933;">;</span>
  <span style="color: #000088;">$pager_total</span><span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">0</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> <a href="http://www.php.net/ceil"><span style="color: #990000;">ceil</span></a><span style="color: #009900;">&#40;</span><span style="color: #000088;">$total_results</span> <span style="color: #339933;">/</span> <span style="color: #000088;">$items_per_page</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">//ckan_number_of_pages();</span>
  <span style="color: #000088;">$pager_page_array</span><span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">0</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span>
    <a href="http://www.php.net/max"><span style="color: #990000;">max</span></a><span style="color: #009900;">&#40;</span><span style="color: #cc66cc;">0</span><span style="color: #339933;">,</span> <a href="http://www.php.net/min"><span style="color: #990000;">min</span></a><span style="color: #009900;">&#40;</span>
      <span style="color: #009900;">&#40;</span>int<span style="color: #009900;">&#41;</span><span style="color: #000088;">$pager_page_array</span><span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">0</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">,</span>
      <span style="color: #009900;">&#40;</span><span style="color: #009900;">&#40;</span>int<span style="color: #009900;">&#41;</span><span style="color: #000088;">$pager_total</span><span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">0</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">-</span> <span style="color: #cc66cc;">1</span><span style="color: #009900;">&#41;</span>
    <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
  <span style="color: #666666; font-style: italic;">// Add the pager to the output.</span>
  <span style="color: #000088;">$output</span> <span style="color: #339933;">.=</span> theme<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'pager'</span><span style="color: #339933;">,</span> <span style="color: #009900; font-weight: bold;">NULL</span><span style="color: #339933;">,</span> <span style="color: #000088;">$items_per_page</span><span style="color: #339933;">,</span> <span style="color: #cc66cc;">0</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
  <span style="color: #b1b100;">return</span> <span style="color: #000088;">$output</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #009933; font-style: italic;">/**
 * Theme individual search items
 */</span>
<span style="color: #000000; font-weight: bold;">function</span> theme_ckan_item<span style="color: #009900;">&#40;</span><span style="color: #000088;">$item</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
  <span style="color: #666666; font-style: italic;">// Link the title to the dataset</span>
  <span style="color: #000088;">$output</span> <span style="color: #339933;">.=</span> <span style="color: #0000ff;">'&lt;h2&gt;'</span> <span style="color: #339933;">.</span> l<span style="color: #009900;">&#40;</span><span style="color: #000088;">$item</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">title</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'dataset/'</span> <span style="color: #339933;">.</span> <a href="http://www.php.net/urlencode"><span style="color: #990000;">urlencode</span></a><span style="color: #009900;">&#40;</span>check_plain<span style="color: #009900;">&#40;</span><span style="color: #000088;">$item</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">name</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">.</span> <span style="color: #0000ff;">'&lt;/h2&gt;'</span><span style="color: #339933;">;</span>
  <span style="color: #666666; font-style: italic;">// Truncate the notes field</span>
  <span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$item</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">notes</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
    <span style="color: #000088;">$output</span> <span style="color: #339933;">.=</span> <span style="color: #0000ff;">'&lt;p&gt;'</span> <span style="color: #339933;">.</span> truncate_utf8<span style="color: #009900;">&#40;</span><span style="color: #000088;">$item</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">notes</span><span style="color: #339933;">,</span> <span style="color: #cc66cc;">250</span><span style="color: #339933;">,</span> <span style="color: #000088;">$wordsafe</span> <span style="color: #339933;">=</span> <span style="color: #009900; font-weight: bold;">FALSE</span><span style="color: #339933;">,</span> <span style="color: #000088;">$dots</span> <span style="color: #339933;">=</span> <span style="color: #009900; font-weight: bold;">TRUE</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">.</span> <span style="color: #0000ff;">'&lt;/p&gt;'</span><span style="color: #339933;">;</span>
  <span style="color: #009900;">&#125;</span>
  <span style="color: #666666; font-style: italic;">// Output any tags	</span>
  <span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span><a href="http://www.php.net/count"><span style="color: #990000;">count</span></a><span style="color: #009900;">&#40;</span><span style="color: #000088;">$item</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">tags</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">&gt;</span> <span style="color: #cc66cc;">0</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
    <span style="color: #b1b100;">foreach</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$item</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">tags</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>
      <span style="color: #000088;">$items</span><span style="color: #009900;">&#91;</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> l<span style="color: #009900;">&#40;</span><span style="color: #000088;">$value</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'data/tag/'</span><span style="color: #339933;">.</span><span style="color: #000088;">$value</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span>
  <span style="color: #000088;">$seperated</span> <span style="color: #339933;">=</span> <a href="http://www.php.net/implode"><span style="color: #990000;">implode</span></a><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">', '</span><span style="color: #339933;">,</span> <span style="color: #000088;">$items</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
  <span style="color: #000088;">$output</span> <span style="color: #339933;">.=</span> <span style="color: #0000ff;">'&lt;p&gt;&lt;strong&gt;Tags:&lt;/strong&gt; '</span> <span style="color: #339933;">.</span><span style="color: #000088;">$seperated</span><span style="color: #339933;">.</span> <span style="color: #0000ff;">'&lt;/p&gt;'</span><span style="color: #339933;">;</span>
  <span style="color: #009900;">&#125;</span>	
<span style="color: #b1b100;">return</span> <span style="color: #000088;">$output</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span></pre></td></tr></table></div>

<p>One thing you need to consider when displaying a list of results is having a pager built in so that you can break the list into bite-sized chunks. This took quite a while to figure out how to do. The problem was that the API call resulted in a lot of data and that resulted in a significant delay loading the page, due to the amount of time to complete the round trip to the API, along with the time taken to render all of that in a pager. CKAN however is very clever. When you call the API and ask for a list of packages, it returns the packages, but it also returns, as a variable, the count of the records your query generated. As well as that you can use the parameters &#8216;<em>offset</em>&#8216; and &#8216;<em>limit</em>&#8216; just like in SQL. What&#8217;s even more clever here is that it still returns the variable that holds the count of the records the query generated, but it also only returns the number of packages determined by the &#8216;<em>offset</em>&#8216; and &#8216;<em>limit</em>&#8216; parameters. </p>
<p>So if an API call to list all packages for a certain tag would normally return 200 records, and you specify a limit of 10 and an offset of 10, the data returned will contain a count of the number of records normally generated by that call, 200, but will <strong>only return 10 packages</strong> in the data, as specified by the offset and limit. This came in extremely useful for the pager as I just passed an offset and limit each time a page was loaded and then cached the returned data.</p>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p863code19'); return false;">View Code</a> PHP</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p86319"><td class="code" id="p863code19"><pre class="php" style="font-family:monospace;"><span style="color: #000088;">$ckan</span> <span style="color: #339933;">=</span> ckan_ckan<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$start</span> <span style="color: #339933;">=</span> <span style="color: #cc66cc;">0</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$items_per_page</span> <span style="color: #339933;">=</span> variable_get<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'ckan_items_per_page'</span><span style="color: #339933;">,</span> <span style="color: #cc66cc;">4</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$page</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
  <span style="color: #666666; font-style: italic;">// If we're in a page, we need to set where to start the list</span>
  <span style="color: #000088;">$start</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$page</span> <span style="color: #339933;">*</span> <span style="color: #000088;">$items_per_page</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #666666; font-style: italic;">// Set the offset</span>
<span style="color: #000088;">$offset</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$start</span><span style="color: #339933;">;</span>
<span style="color: #666666; font-style: italic;">// Limit to the number of items per page </span>
<span style="color: #000088;">$limit</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$items_per_page</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #666666; font-style: italic;">// Get the list of tags with their count</span>
try <span style="color: #009900;">&#123;</span>
  <span style="color: #000088;">$results</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$ckan</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">advancedSearch</span><span style="color: #009900;">&#40;</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;">'department'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #000088;">$ministry</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'all_fields'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'1'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'offset'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #000088;">$offset</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'limit'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #000088;">$limit</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span> catch <span style="color: #009900;">&#40;</span>Exception <span style="color: #000088;">$e</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
  drupal_goto<span style="color: #009900;">&#40;</span>variable_get<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'ckan_no_results_page'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'sorry'</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span></pre></td></tr></table></div>

<h3>Homepage Chart</h3>
<p>There was a requirement for a graph on the homepage the displayed the number of packages attributed to each Government Ministry. The quickest way to do this was using <a href="http://code.google.com/apis/charttools/">Google Chart Tools</a>. It was relatively straightforward to get the data we needed. I did however have to do some funky sorting to get the data in the correct order. I also <a href="http://psychopyko.com/tutorial/how-to-use-google-charts/">found a wonderful tutorial</a> that really helped to clear up some of the label/legend issues I was having.</p>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p863code20'); return false;">View Code</a> PHP</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p86320"><td class="code" id="p863code20"><pre class="php" style="font-family:monospace;"><span style="color: #009933; font-style: italic;">/**
 * Function to build a Google Chart
 *
 * @return	  string	HTML code with img tag
 *
 **/</span>
<span style="color: #000000; font-weight: bold;">function</span> ckan_chart<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
  <span style="color: #666666; font-style: italic;">// If there is a cached version of the chart</span>
  <span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$cache</span> <span style="color: #339933;">=</span> cache_get<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'ckan:chart'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'cache_ckan'</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">&amp;&amp;</span> <span style="color: #339933;">!</span><a href="http://www.php.net/empty"><span style="color: #990000;">empty</span></a><span style="color: #009900;">&#40;</span><span style="color: #000088;">$cache</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">data</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
    <span style="color: #000088;">$image</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$cache</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">data</span><span style="color: #339933;">;</span>
  <span style="color: #009900;">&#125;</span> <span style="color: #b1b100;">else</span> <span style="color: #009900;">&#123;</span>
    watchdog<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'ckan'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'Called Google API to build chart'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #666666; font-style: italic;">// Get the list of ministries</span>
    <span style="color: #000088;">$ministries</span> <span style="color: #339933;">=</span> <a href="http://www.php.net/explode"><span style="color: #990000;">explode</span></a><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;<span style="color: #000099; font-weight: bold;">\r</span><span style="color: #000099; font-weight: bold;">\n</span>&quot;</span><span style="color: #339933;">,</span> filter_xss<span style="color: #009900;">&#40;</span>variable_get<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'ckan_ministry_list'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">''</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #666666; font-style: italic;">// Set up our data array</span>
    <span style="color: #000088;">$data</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: #b1b100;">foreach</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$ministries</span> <span style="color: #b1b100;">as</span> <span style="color: #000088;">$ministry</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
      <span style="color: #000088;">$ckan</span> <span style="color: #339933;">=</span> ckan_ckan<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
      <span style="color: #666666; font-style: italic;">// Get the list of tags with their count</span>
      try <span style="color: #009900;">&#123;</span>
        <span style="color: #000088;">$results</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$ckan</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">advancedSearch</span><span style="color: #009900;">&#40;</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;">'department'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #000088;">$ministry</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'all_fields'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'0'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'offset'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'0'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'limit'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'1'</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        <span style="color: #000088;">$count</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$results</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">count</span><span style="color: #339933;">;</span>
      <span style="color: #009900;">&#125;</span> catch <span style="color: #009900;">&#40;</span>Exception <span style="color: #000088;">$e</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
        <span style="color: #000088;">$count</span> <span style="color: #339933;">=</span> <span style="color: #cc66cc;">0</span><span style="color: #339933;">;</span>
      <span style="color: #009900;">&#125;</span>
      <span style="color: #666666; font-style: italic;">// Cache the count to use on the Ministry list page '/ministry'</span>
      cache_set<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'ckan:ministry_'</span><span style="color: #339933;">.</span> <span style="color: #000088;">$ministry</span> <span style="color: #339933;">.</span><span style="color: #0000ff;">'_count'</span><span style="color: #339933;">,</span> <span style="color: #000088;">$count</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'cache_ckan'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
      <span style="color: #000088;">$chart</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">data</span><span style="color: #009900;">&#91;</span><span style="color: #000088;">$ministry</span><span style="color: #339933;">.</span> <span style="color: #0000ff;">' ('</span><span style="color: #339933;">.</span> <span style="color: #000088;">$count</span> <span style="color: #339933;">.</span> <span style="color: #0000ff;">')'</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$count</span><span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span>
    <span style="color: #666666; font-style: italic;">// Sort the array in reverse order - most packages first and maintain index association</span>
    <a href="http://www.php.net/arsort"><span style="color: #990000;">arsort</span></a><span style="color: #009900;">&#40;</span><span style="color: #000088;">$chart</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">data</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #666666; font-style: italic;">// Return all the keys of the data array - the names of the ministries</span>
    <span style="color: #000088;">$chart</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">legend</span> <span style="color: #339933;">=</span> <a href="http://www.php.net/array_keys"><span style="color: #990000;">array_keys</span></a><span style="color: #009900;">&#40;</span><span style="color: #000088;">$chart</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">data</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #666666; font-style: italic;">// Get the range of the chart - highest + a quarter</span>
    <span style="color: #000088;">$range</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><a href="http://www.php.net/current"><span style="color: #990000;">current</span></a><span style="color: #009900;">&#40;</span><span style="color: #000088;">$chart</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">data</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">*</span> <span style="color:#800080;">1.25</span><span style="color: #339933;">,</span> <span style="color: #339933;">-</span><span style="color: #cc66cc;">1</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #666666; font-style: italic;">// Grid spacing  100/MaxRange*IntervalAmount</span>
    <span style="color: #000088;">$grid</span> <span style="color: #339933;">=</span> <span style="color: #cc66cc;">100</span><span style="color: #339933;">/</span><span style="color: #000088;">$range</span> <span style="color: #339933;">*</span> <span style="color: #cc66cc;">50</span><span style="color: #339933;">;</span>
    <span style="color: #666666; font-style: italic;">// Chart size, must be less than 30k pixels</span>
    <span style="color: #000088;">$chart</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">size</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;">'590'</span><span style="color: #339933;">,</span>
      <span style="color: #0000ff;">'380'</span>
    <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
    <span style="color: #666666; font-style: italic;">// Create query</span>
    <span style="color: #000088;">$chart</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">query</span> <span style="color: #339933;">=</span>
      <span style="color: #0000ff;">'cht=bhg&amp;'</span><span style="color: #339933;">.</span>	<span style="color: #666666; font-style: italic;">// Type</span>
      <span style="color: #0000ff;">'chd=t:'</span><span style="color: #339933;">.</span><a href="http://www.php.net/implode"><span style="color: #990000;">implode</span></a><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">','</span><span style="color: #339933;">,</span> <span style="color: #000088;">$chart</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">data</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">.</span><span style="color: #0000ff;">'&amp;'</span><span style="color: #339933;">.</span>	<span style="color: #666666; font-style: italic;">// Data</span>
      <span style="color: #0000ff;">'chs='</span><span style="color: #339933;">.</span><span style="color: #000088;">$chart</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">size</span><span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">0</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">.</span><span style="color: #0000ff;">'x'</span><span style="color: #339933;">.</span> <span style="color: #000088;">$chart</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">size</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: #0000ff;">'&amp;'</span><span style="color: #339933;">.</span>	<span style="color: #666666; font-style: italic;">// Size</span>
      <span style="color: #0000ff;">'chco=cc0000&amp;'</span><span style="color: #339933;">.</span>	<span style="color: #666666; font-style: italic;">// Color ( Remove # from string )</span>
      <span style="color: #0000ff;">'chxt=x,y&amp;'</span><span style="color: #339933;">.</span>	<span style="color: #666666; font-style: italic;">// X,Y axis labels</span>
      <span style="color: #0000ff;">'chxr=0,0,'</span><span style="color: #339933;">.</span><span style="color: #000088;">$range</span><span style="color: #339933;">.</span><span style="color: #0000ff;">'&amp;'</span><span style="color: #339933;">.</span> <span style="color: #666666; font-style: italic;">// Range</span>
      <span style="color: #0000ff;">'chxs=1,000000,13|0,000000,13&amp;'</span><span style="color: #339933;">.</span> 	<span style="color: #666666; font-style: italic;">// Axis colors and font size</span>
      <span style="color: #0000ff;">'chg='</span><span style="color: #339933;">.</span><span style="color: #000088;">$grid</span><span style="color: #339933;">.</span><span style="color: #0000ff;">',0,5,5&amp;'</span><span style="color: #339933;">.</span> <span style="color: #666666; font-style: italic;">// Grid verticalgridlines, horizontalgridlines, linesize, gapsize</span>
      <span style="color: #0000ff;">'chds=0,'</span><span style="color: #339933;">.</span><span style="color: #000088;">$range</span><span style="color: #339933;">.</span><span style="color: #0000ff;">'&amp;'</span><span style="color: #339933;">.</span>	<span style="color: #666666; font-style: italic;">// Scale</span>
      <span style="color: #0000ff;">'chma=0,0,0,0&amp;'</span><span style="color: #339933;">.</span> <span style="color: #666666; font-style: italic;">//left_margin, right_margin, top_margin, bottom_margin| legend_width, legend_height</span>
      <span style="color: #0000ff;">'chbh=13,0,2&amp;'</span><span style="color: #339933;">.</span>	<span style="color: #666666; font-style: italic;">// bar_width_or_scale, space_between_bars, space_between_groups</span>
      <span style="color: #0000ff;">'chxl=1:|'</span><span style="color: #339933;">.</span><a href="http://www.php.net/implode"><span style="color: #990000;">implode</span></a><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'|'</span><span style="color: #339933;">,</span> <a href="http://www.php.net/array_reverse"><span style="color: #990000;">array_reverse</span></a><span style="color: #009900;">&#40;</span><span style="color: #000088;">$chart</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">legend</span><span style="color: #339933;">,</span> <span style="color: #009900; font-weight: bold;">TRUE</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">.</span><span style="color: #0000ff;">'&amp;'</span><span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">//|Jan|Feb|Mar|Apr|May'</span>
&nbsp;
    <span style="color: #000088;">$api_path</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">'http://chart.apis.google.com/chart?'</span><span style="color: #339933;">;</span>
    <span style="color: #000088;">$url</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$chart</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">query</span><span style="color: #339933;">;</span>
    <span style="color: #000088;">$image</span> <span style="color: #339933;">=</span> <a href="http://www.php.net/sprintf"><span style="color: #990000;">sprintf</span></a><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'&lt;img src=&quot;%s&quot; alt=&quot;%s&quot; style=&quot;width:%spx;height:%spx;&quot; /&gt;'</span><span style="color: #339933;">,</span> <span style="color: #000088;">$api_path</span><span style="color: #339933;">.</span><span style="color: #000088;">$url</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'Who\'s Sharing'</span><span style="color: #339933;">,</span> <span style="color: #000088;">$chart</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">size</span><span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">0</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">,</span> <span style="color: #000088;">$chart</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">size</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>
      cache_set<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'ckan:chart'</span><span style="color: #339933;">,</span> <span style="color: #000088;">$image</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'cache_ckan'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
  <span style="color: #009900;">&#125;</span>	
  <span style="color: #b1b100;">return</span> <span style="color: #000088;">$image</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span></pre></td></tr></table></div>

<p>So that&#8217;s a brief(not-so) overview of some of the fundamentals of how I integrated Drupal with CKAN and was able to create nodes and listings directly from API calls. </p>
<p><a href="/2010/06/datadotgc-ca-a-drupal-case-study-part-2/">In my next post I&#8217;ll cover some very important areas</a> of the module development such as:</p>
<ul>
<li>Caching</li>
<li>Tag cloud creation</li>
<li>Using the CKAN Search API for all lists</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://blog.raisedeyebrow.com/2010/04/datadotgc-ca-a-drupal-case-study/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Socially Conscious Geeks Unite!</title>
		<link>http://blog.raisedeyebrow.com/2010/03/socially-conscious-geeks-unite/#utm_source=rss&amp;utm_medium=rss&amp;utm_campaign=socially-conscious-geeks-unite</link>
		<comments>http://blog.raisedeyebrow.com/2010/03/socially-conscious-geeks-unite/#comments</comments>
		<pubDate>Sun, 14 Mar 2010 16:52:01 +0000</pubDate>
		<dc:creator>Lauren Bacon</dc:creator>
				<category><![CDATA[Design]]></category>
		<category><![CDATA[Geekery]]></category>
		<category><![CDATA[Nonprofit Tech]]></category>
		<category><![CDATA[Workshops & Events]]></category>

		<guid isPermaLink="false">http://blog.raisedeyebrow.com/?p=835</guid>
		<description><![CDATA[I&#8217;m writing this from Austin, TX, where I&#8217;m participating in one of the geek world&#8217;s biggest and best-loved festivals, South by Southwest Interactive (SXSWi for short). Yesterday afternoon, I had the great pleasure of co-facilitating a session with Leif Utne, VP of Community at Zanby, that was a group discussion on how design &#38; tech [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://blog.raisedeyebrow.com/wp-content/uploads/2010/03/thesociallyconsciousgeek.jpg"><img class="alignleft size-full wp-image-837" title="thesociallyconsciousgeek" src="http://blog.raisedeyebrow.com/wp-content/uploads/2010/03/thesociallyconsciousgeek.jpg" alt="" width="320" height="320" /></a>I&#8217;m writing this from Austin, TX, where I&#8217;m participating in one of the geek world&#8217;s biggest and best-loved festivals, <a href="http://www.sxsw.com/interactive">South by Southwest Interactive</a> (SXSWi for short). Yesterday afternoon, I had the great pleasure of co-facilitating a session with <a href="http://leifutne.wordpress.com/">Leif Utne</a>, VP of Community at <a href="http://zanby.com/">Zanby</a>, that was a group discussion on how design &amp; tech geeks can make the world a better place while making a living.</p>
<p>When we were planning the session, Leif suggested we use a format I wasn&#8217;t familiar with &#8212; the <a href="http://www.kstoolkit.org/Samoan+Circle">Samoan Circle</a>, a modified fishbowl process that encourages listening and made room for many of the attendees to come forward and speak. The chairs in the room were arranged in the round, and we pulled four chairs into the middle of the room, facing each other, so that everyone could see and hear the folks who were talking.</p>
<p>The theme of the session was &#8220;<a href="http://my.sxsw.com/events/event/794">Socially Conscious Geek: making money while doing good</a>,&#8221; and we provided some framing questions, but we knew that whoever showed up would have their own questions and goals for the discussion, so we tried to move quickly beyond our introductions and dive into the conversation proper.</p>
<p>I&#8217;m so glad we did, because as soon as we opened it up to the room, the conversation went in very interesting directions. Some of the themes that emerged were:</p>
<ul>
<li>Recruiting challenges for nonprofits: Someone asked how nonprofits can attract staff when the salaries are generally lower than they are in the corporate sector. Some great responses to this question emerged, including:
<ul>
<li>Explore what gets geeks interested, and offer up incentives that matter to them</li>
<li>Sell the lifestyle &amp; &#8220;sleep better at night&#8221; benefits</li>
<li>Offer other benefits that provide competitive advantage with corporate positions, e.g. keep work hours reasonable, paid volunteer time, etc.</li>
<li>Someone mentioned that in the US, if you work for nonprofit organizations for 10 years after college, your <a href="http://www.ncnonprofits.org/advocacy/loanforgiveness.asp">outstanding student loans are forgiven</a>. Given the size of the average student loan these days, that could provide a tangible financial benefit in the tens, or even hundreds of thousands of dollars.</li>
<li>Recognize that nonprofits can offer more opportunities for leadership &amp; effecting change within the organization, because nonprofits often have leaner &amp; more democratic structures. (I want to point out that this is definitely not always the case, though I do think it&#8217;s a valid point. However, I&#8217;ve seen some highly inefficient nonprofit organizations in my time.)</li>
</ul>
</li>
<li>There was some great discussion of how our definitions of sustainability must include financial sustainability; this is true for both for-profit and not-for-profit organizations. We need to both make money and do good; neither can be sacrificed. Some models put forward for this included:
<ul>
<li>Businesses can build charitable giving into their modus operandi, i.e. give x% of pre-tax profits to a particular cause or organization.</li>
<li>Design &amp; tech agencies can offer discounts to nonprofit clients &amp; stay profitable by engaging high-profit corporate clients.</li>
<li>Social enterprise models, e.g. nonprofits creating products &amp; services people are willing to pay for.</li>
<li>Seed funding from progressive coalitions</li>
</ul>
</li>
<li>We also heard a number of people ask how we can collaborate better across movements and sectors &#8211; there is a real hunger for cross-pollination of ideas and learning from one another&#8217;s successes and failures.</li>
<li>One women shared her story of working at a large, multinational corporation, feeling somewhat discouraged by said corporation&#8217;s lack of a formal social responsibility mandate, and responding by starting interest groups within her company. This has had the effect of both raising the profile of various causes, but also concrete changes in the business such as influencing purchasing decisions.</li>
<li>Someone said they would love to see a crowdsourcing app that could leverage companies&#8217; internal technical skills &amp; resources and connect &amp; share them with nonprofits who need them.</li>
</ul>
<p>Those were my notes, but there&#8217;s plenty more available on Twitter &#8212; attendees tweeted their session notes using the hashtag <a href="http://search.twitter.com/search?q=%23scgeek">#scgeek</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.raisedeyebrow.com/2010/03/socially-conscious-geeks-unite/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Socially Conscious Geek: Makin’ Money While Doin’ Good</title>
		<link>http://blog.raisedeyebrow.com/2010/01/socially-conscious-geek-makin%e2%80%99-money-while-doin%e2%80%99-good/#utm_source=rss&amp;utm_medium=rss&amp;utm_campaign=socially-conscious-geek-makin%25e2%2580%2599-money-while-doin%25e2%2580%2599-good</link>
		<comments>http://blog.raisedeyebrow.com/2010/01/socially-conscious-geek-makin%e2%80%99-money-while-doin%e2%80%99-good/#comments</comments>
		<pubDate>Thu, 14 Jan 2010 15:42:25 +0000</pubDate>
		<dc:creator>Lauren Bacon</dc:creator>
				<category><![CDATA[Design]]></category>
		<category><![CDATA[Geekery]]></category>
		<category><![CDATA[Nonprofit Tech]]></category>
		<category><![CDATA[Raised Eyebrow]]></category>
		<category><![CDATA[The Social Web]]></category>
		<category><![CDATA[Workshops & Events]]></category>

		<guid isPermaLink="false">http://blog.raisedeyebrow.com/?p=804</guid>
		<description><![CDATA[Two years ago, Emira &#38; I went to South by Southwest (AKA SXSW) for the first time, and presented a panel called “Boss Lady” that featured tips for online business owners from several of the savviest women entrepreneurs we know: Vickie Howell, Jenny Hart &#38; Alex Beauchamp, all of whom appear in the pages of [...]]]></description>
			<content:encoded><![CDATA[<p><img class="alignleft size-full wp-image-816" title="sxswi2010" src="http://blog.raisedeyebrow.com/wp-content/uploads/2010/01/sxswi2010.gif" alt="sxswi2010" width="181" height="272" />Two years ago, Emira &amp; I went to <a href="http://sxsw.com">South by Southwest</a> (AKA SXSW) for the first time, and presented a panel called “<a href="http://2007.sxsw.com/interactive/programming/panels/?action=show&amp;id=IAP060126">Boss Lady</a>” that featured tips for online business owners from several of the savviest women entrepreneurs we know: <a href="http://www.vickiehowell.com">Vickie Howell</a>, <a href="http://www.jennyhart.net/">Jenny Hart</a> &amp; <a href="http://girlatplay.com/">Alex Beauchamp</a>, all of whom appear in the pages of our book, <em><a href="http://laurenandemira.com">The Boss of You</a>. </em>We had such a good time that we knew we wanted to go back as soon as humanly possible, though last year we were too busy getting our book out the door to attend the conference.</p>
<p>But this year we’re back, this time with a panel that we hope will prove helpful to geeks of both the design and techie varieties – both camps are in full force at <a href="http://sxsw.com/interactive/">SXSW’s Interactive conference</a>, which is a pure, 24/7, all-out geekfest – who are looking to bring their values into their paid work, whether it’s by learning to work with clients in the nonprofit sector, creating apps that help mission-driven organizations work more effectively, or infusing some environmental or social-justice savvy into their workplaces. The panel’s called “<a href="http://panelpicker.sxsw.com/ideas/view/3573">Socially Conscious Geek: Makin’ Money While Doin’ Good</a>”, and it takes place Saturday, March 13<sup>th</sup>.</p>
<p>The topic was inspired by a topic our friend Noah Scalin (of <a href="http://skulladay.blogspot.com/">Skull-A-Day</a> and <a href="http://www.alrdesign.com/">Another Limited Rebellion</a> fame) spoke about at the 2009 <a href="http://www.howconference.com">HOW Conference</a>. His focus was more on graphic design, since that’s his area of expertise, but when I asked him about riffing on his ideas for an interactive design audience, he shared his materials with me with typical generosity. (This is a guy who lives and breathes a DIY, share-and-share-alike mentality that a lot of designers could learn from. But that’s a topic for another day.)</p>
<p>This time I’ll be attending the conference solo, while Emira spends some time with her new baby; my co-facilitator for the session is <a href="http://leifutne.wordpress.com/">Leif Utne</a>, a friend and colleague who works for <a href="http://zanby.com/">Zanby</a>, a software company that specializes in supporting online social communities for change. Leif’s background includes a stint as the publisher of Worldchanging.org, and lots of experience building online communities; he&#8217;s also a journalist, activist and social entrepreneur.  Zanby is used to support <a href="http://www.theuptake.org">The UpTake</a>, a web video community that among other things was heavily involved in documenting the RNC and DNC prior to the 2008 election, and was also engaged in citizen vote monitoring during the election. He brings both amazing facilitation skills as well as a solid understanding of how businesses and nonprofits can work together in mutually beneficial ways.</p>
<p>We’ll be conducting our session in a highly interactive, inclusive format called a Core Conversation: Leif and I will be kick-starting the discussion and planting some seeds, but the idea is that whoever shows up will have a chance to step forward and contribute questions and ideas – so I’m really excited to see how it develops.</p>
<p>We’re hoping to address questions like:</p>
<ul>
<li> What is a socially conscious geek?</li>
<li> How can I specialize in socially conscious work and earn a living wage?</li>
<li> What are some of the unique opportunities and challenges of specializing in socially conscious work?</li>
<li> What is the difference between non-profit and no-profit clients?</li>
<li> How do I make the transition from corporate work to working with non-profit and/or mission-driven clients?</li>
<li> What is the “triple bottom line” approach to business?</li>
<li> What are some examples of alternative business models that are emerging among socially conscious geeks?</li>
<li> How is socially conscious work different than “green” work?</li>
<li> What are some examples of clients I might be able to work with as a socially conscious geek?</li>
<li> How should I market myself to values-driven clients? Is it different from marketing to corporate clients?</li>
</ul>
<p>Ultimately, though, the decisions about what we cover will rest with whoever shows up. So please help us spread the word – and if you’ll be at SXSW, we’d love to see you there!</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.raisedeyebrow.com/2010/01/socially-conscious-geek-makin%e2%80%99-money-while-doin%e2%80%99-good/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>A Better Word for &#8220;Nonprofit&#8221;</title>
		<link>http://blog.raisedeyebrow.com/2010/01/a-better-word-for-nonprofit/#utm_source=rss&amp;utm_medium=rss&amp;utm_campaign=a-better-word-for-nonprofit</link>
		<comments>http://blog.raisedeyebrow.com/2010/01/a-better-word-for-nonprofit/#comments</comments>
		<pubDate>Mon, 11 Jan 2010 15:40:46 +0000</pubDate>
		<dc:creator>Lauren Bacon</dc:creator>
				<category><![CDATA[Nonprofit Tech]]></category>
		<category><![CDATA[Online Strategy]]></category>

		<guid isPermaLink="false">http://blog.raisedeyebrow.com/?p=810</guid>
		<description><![CDATA[Is there a better term for &#8220;nonprofit&#8221;? A recent article by Dan Pallotta at Harvard Business blogs begins, &#8220;Anyone who has thought about it for more than a nanosecond agrees that &#8216;nonprofit&#8217; is about the worst possible summary we could give of ourselves and our work.&#8221; He goes on to argue that the nonprofit sector [...]]]></description>
			<content:encoded><![CDATA[<p>Is there a better term for &#8220;nonprofit&#8221;? <a title="Let's Call it the Humanity Sector" href="http://blogs.hbr.org/pallotta/2009/12/the-humanity-sector.html">A recent article by Dan Pallotta</a> at Harvard Business blogs begins, &#8220;Anyone who has thought about it for more than a nanosecond agrees that &#8216;nonprofit&#8217; is about the worst possible summary we could give of ourselves and our work.&#8221; He goes on to argue that the nonprofit sector could stand to define itself in terms of what it <em>is, </em>rather than what it is <em>not.</em> (It&#8217;s a great post, and well worth reading, as are the unusually thoughtful comments that accompany it.) Pallotta&#8217;s suggestion is we move to using the term &#8220;Humanity Sector.&#8221;</p>
<p>This isn&#8217;t the first time I&#8217;ve come across the idea of renaming the nonprofit sector. <a title="Stop being a not-for-profit" href="http://www.forimpact.org/2008/10/stop_being_a_not-for-profit.php">Tom Suddes makes a compelling case</a> in favour of using &#8220;for impact&#8221; instead &#8212; though personally, I&#8217;m not sure that distinguishes this sector from the business &amp; government sectors in any useful way. Surely we all want to make an impact? (That being said, if you ever get to hear him talk about fundraising, do yourself a favour and go &#8212; he has some amazing insights and a great deal of charm.)</p>
<p>I&#8217;m also not convinced of the &#8220;humanity&#8221; moniker, because the nonprofit sector includes a lot of organizations that really don&#8217;t focus on humanity &#8212; there are astronomy educators and environmental justice warriors and all kinds of other groups for whom &#8220;humanity&#8221; isn&#8217;t the emphasis. I&#8217;ve heard &#8220;third sector&#8221; (which feels awkward &amp; low-priority), &#8220;non-governmental&#8221; (okay, but uninspiring), &#8220;community profit&#8221; (can&#8217;t the community profit from corporate &amp; governmental work as well?), and &#8220;public benefit&#8221; (see &#8220;community profit&#8221;) &#8212; but none of those work for me either.</p>
<p>Although I love the idea of moving away from &#8220;nonprofit,&#8221; I&#8217;d really like us to find an option that is both broadly inclusive of the wide variety of organizations within the sector, and clearly distinct from the focus of for-profit and governmental actors. Because the key differences that mark nonprofits are legal in nature, perhaps &#8220;nonprofit&#8221; is the simplest option.</p>
<p>But there is one other suggestion I quite like, with a couple of reservations: &#8220;<a href="http://philanthropy.com/news/conference/8680/goodbye-nonprofit-sector-hello-delta-sector">the delta sector</a>,&#8221; as proposed by Robert K. Ross in <a href="http://philanthropy.com/">The Chronicle of Philanthropy</a>. Yes, it sounds a bit like a Star Trek reference. But here&#8217;s his pitch:</p>
<blockquote><p>Robert K. Ross, president of the California Endowment, a health foundation in Los Angeles, says he’s got just the word: “delta,” the Greek letter that signifies change. So, no more talk about the “nonprofit sector,” he said at the closing session of the National Conference on Volunteering and Service.</p>
<p>It’s now the “delta sector.”</p>
<p>“We need to be more intentionally about change and transformation,” he said. “Business as usual is leaving too many families broken and too many families and folks with hopelessness and despair.”</p></blockquote>
<p>I&#8217;m not a hundred percent sold on &#8220;delta sector&#8221; &#8212; I&#8217;m not sure it works for arts organizations (or many conservative groups that actively resist change), and I&#8217;m also not convinced that change is a worthwhile motive in and of itself &#8212; but I like the sentiment behind it, and indeed behind all these ideas. It warms my former-English-major heart that so many good people are putting so much brain power towards thinking about the importance of language, and I&#8217;d love to see the nonprofit / for impact / humanity / delta sector wrestle with this some more and see if we can&#8217;t come up with a better name.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.raisedeyebrow.com/2010/01/a-better-word-for-nonprofit/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Using Drupal to deliver video</title>
		<link>http://blog.raisedeyebrow.com/2009/12/using-drupal-to-deliver-video/#utm_source=rss&amp;utm_medium=rss&amp;utm_campaign=using-drupal-to-deliver-video</link>
		<comments>http://blog.raisedeyebrow.com/2009/12/using-drupal-to-deliver-video/#comments</comments>
		<pubDate>Tue, 22 Dec 2009 17:11:51 +0000</pubDate>
		<dc:creator>Colin Calnan</dc:creator>
				<category><![CDATA[Code and Coding]]></category>
		<category><![CDATA[Content Management Systems]]></category>
		<category><![CDATA[Drupal]]></category>
		<category><![CDATA[Geekery]]></category>
		<category><![CDATA[Nonprofit Tech]]></category>
		<category><![CDATA[Our Clients]]></category>
		<category><![CDATA[Video]]></category>

		<guid isPermaLink="false">http://blog.raisedeyebrow.com/?p=103</guid>
		<description><![CDATA[There are many ways to skin the cat when it comes to putting video on a Drupal site. I&#8217;ve tried and tested quite a few methods since my first introduction to Drupal 2 years ago. I&#8217;ve used Embedded Media Field as well as Video Filter but finally settled on the combination of FileField with JWPlayer [...]]]></description>
			<content:encoded><![CDATA[<p>There are many ways to skin the cat when it comes to putting video on a Drupal site. I&#8217;ve tried and tested quite a few methods since my first introduction to Drupal 2 years ago. I&#8217;ve used <a href="http://drupal.org/project/emfield">Embedded Media Field </a>as well as <a href="http://drupal.org/project/video_filter">Video Filter</a> but finally settled on the combination of <a href="http://drupal.org/project/filefield">FileField</a> with <a href="http://www.longtailvideo.com/players/jw-flv-player/">JWPlayer</a> or <a href="http://flowplayer.org/">Flowplayer</a> and in some cases the <a href="http://drupal.org/project/media_mover">Media Mover Module</a> for moving files to <a href="http://aws.amazon.com/s3/">Amazon S3</a> storage. I&#8217;m going to use our recent launch of the <a href="http://www.policyalternatives.ca">CCPA website</a> as a case study for how we currently handle video delivery. So let&#8217;s dissect this a little.</p>
<h3>Uploading files</h3>
<p>The video files need to be uploaded before we display them. This is best achieved using the wonderful <a href="http://drupal.org/project/filefield">Filefield</a> Module. This is quite a simple yet powerful module developed/maintained by <a href="http://www.lullabot.com/">Lullabot</a>, <a href="http://quicksketch.org/">Nate Haug</a> (<a href="http://drupal.org/user/35821">quicksketch</a>), whom I&#8217;ve had the pleasure of being trained by at one of their excellent Drupal Theming workshops. Once you install and enable the module you then add a new CCK field, of type &#8220;filefield&#8221;. In our case we have a content type called &#8220;Multimedia&#8221;. We add the field to this content type. You then need to configure the following:</p>
<h4>1. Permitted upload file extensions</h4>
<p style="padding-left: 30px;">In most cases this is relatively straightforward, it&#8217;s just one file type. If you&#8217;re using JWPlayer or Flowplayer it will be FLV. Both these players are built to play Flash Video files (FLV). If you have Quicktime MOV&#8217;s or AVI&#8217;s that you want to upload then you&#8217;ll need to consider different options for playing video. For the purpose of this case study we&#8217;re just uploading FLV files.</p>
<p style="padding-left: 30px;">
<h4>2. File size restrictions</h4>
<p style="padding-left: 30px;">It&#8217;s very important that you set these, otherwise you may end up with users trying to upload 200MB videos, not a very good idea. I set this low as a learning feature for clients. Any reasonably long FLV file that is over 40MB is probably not optimized as well as it should be.</p>
<p style="padding-left: 30px;">
<h4>3. Path Settings</h4>
<p style="padding-left: 30px;">I like to keep all files that admin/editor users upload in a folder called <strong>uploads</strong> so that it&#8217;s easy to manage them later if they need to be exported etc.</p>
<p style="padding-left: 30px;">
<div id="attachment_729" class="wp-caption aligncenter" style="width: 398px"><a href="http://blog.raisedeyebrow.com/wp-content/uploads/2009/12/ccpa-video-admin.gif"><img class="size-full wp-image-729" title="File Field" src="http://blog.raisedeyebrow.com/wp-content/uploads/2009/12/ccpa-video-admin.gif" alt="File Field" width="388" height="576" /></a><p class="wp-caption-text">Multimedia File Field Settings</p></div>
<p style="padding-left: 30px; text-align: center;">
<h3>Create a placeholder image</h3>
<p>Most video players require some sort of poster/placeholder image to display before the video plays. In this case I created another FileField for the placeholder image. We&#8217;ll use that later on in conjunction with the <a href="http://ftp.drupal.org/files/projects/imagecache-6.x-2.0-beta9.tar.gz">ImageCache module</a> to achieve our desired results.</p>
<h3>Moving Files to Amazon S3</h3>
<p>We&#8217;ve been using Amazon S3 for storing video files on quite a number of sites recently. One reason is that we were looking for a location off the webserver that could deliver the video, without impacting the performance of the server, so that in the event of a traffic spike the webserver wouldn&#8217;t fall over. We could also have used Amazon EC2 or another CDN service for this, however as most of our clients have a very regional (BC) audience. Most CDN&#8217;s have nodes in various locations across the US and Europe and this would have served no real improvement as the nearest cached version will always be in the same place for everyone.</p>
<p>So if they&#8217;re uploading the files directly to the Drupal site, how to the files get delivered from Amazon S3. That&#8217;s where the <a href="http://drupal.org/project/media_mover">Media Mover module</a> comes in. This module has many purposes, but for our needs it simply harvests all the files uploaded via the &#8220;Multimedia&#8221; content type and moves those files to Amazon S3 so that we can deliver them from there.</p>
<p>Download, install and enable the Media Mover module. You&#8217;ll also need an S3 account and will need to set that up via the module setting page. You then need to add a Configuration via https://www.yoursite.ca/admin/build/media_mover/add.</p>
<p>Media Mover has 4 actions which it performs on your files:</p>
<ul>
<li>Harvest &#8211; Define/collect the files you want to perform actions on</li>
<li>Process &#8211; Perform certain actions on the files</li>
<li>Storage &#8211; Where to store files once the actions have been carried out</li>
<li>Complete &#8211; Final actions to perform on the files</li>
</ul>
<p>So in this case we just want to <strong>harvest</strong> all Multimedia files and <strong>store</strong> them on Amazon S3.</p>
<p>So for clarification here Media Mover does <strong>NOT MOVE</strong> the files to Amazon S3, it simply <strong>COPIES</strong> them over to S3 and the original files remain on your server.</p>
<div id="attachment_730" class="wp-caption aligncenter" style="width: 399px"><a href="http://blog.raisedeyebrow.com/wp-content/uploads/2009/12/ccpa-media-mover-settings.gif"><img class="size-full wp-image-730" title="Media Mover Settings" src="http://blog.raisedeyebrow.com/wp-content/uploads/2009/12/ccpa-media-mover-settings.gif" alt="Media Mover Settings" width="389" height="572" /></a><p class="wp-caption-text">Media Mover Settings</p></div>
<p style="text-align: center;">
<h3>Delivering the moved Video files</h3>
<p>So this is where the Drupal theming trickery comes in. Flowplayer and JWPlayer are both Flash based FLV video players than can be called using Javascript and that&#8217;s exactly what I do on this site. In plain english this is what happens:</p>
<ol>
<li>Output the placeholder image to screen as a link.</li>
<li>Use Javascript so that when the user clicks on the image the video plays.</li>
<li>Deliver the video from the file on Amazon S3 rather than the file on the webserver (Drupal site).</li>
</ol>
<p>We need to modify three files to achive the above:</p>
<ul>
<li>template.php</li>
<li>multimedia.js (a newly created JS file)</li>
<li>node-multimedia.tpl.php (a custom template file for all multimedia types)</li>
</ul>
<h4>template.php file</h4>
<p>Setting up all the variables we&#8217;re going to need to use as well as making the javascript available</p>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p103code27'); return false;">View Code</a> PHP</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p10327"><td class="code" id="p103code27"><pre class="php" style="font-family:monospace;"><span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$variables</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'field_file'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">0</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'view'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span> <span style="color: #666666; font-style: italic;">//If there is a file and there is something to display...</span>
  <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$variables</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'field_aspect_ratio'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">0</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'value'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span> <span style="color: #666666; font-style: italic;">//Aspect ratio handling</span>
    <span style="color: #000088;">$variables</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'aspect_ratio'</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$variables</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'field_aspect_ratio'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">0</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'value'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
  <span style="color: #009900;">&#125;</span> <span style="color: #b1b100;">else</span> <span style="color: #009900;">&#123;</span>
  <span style="color: #000088;">$variables</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'aspect_ratio'</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">'normal'</span><span style="color: #339933;">;</span>
  <span style="color: #009900;">&#125;</span>
  <span style="color: #000088;">$variables</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'multimedia_type'</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">'video'</span><span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">//Set the type of multimedia - we also have audio and interactive...</span>
  custom_theme_get_media_mover_files<span style="color: #009900;">&#40;</span><span style="color: #000088;">$variables</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'field_file'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">0</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">,</span> <span style="color: #000088;">$variables</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'media_mover'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">3</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">//Set the filepath to the media moved filepath...</span>
  drupal_add_js<span style="color: #009900;">&#40;</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;">'videoplayerpath'</span> <span style="color: #339933;">=&gt;</span> path_to_theme<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">.</span><span style="color: #0000ff;">'/scripts/plugins/flowplayer/flowplayer-3.1.1.swf'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'setting'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">//Set a JS variable to retrieve later...</span>
  drupal_add_js<span style="color: #009900;">&#40;</span>path_to_theme<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">.</span><span style="color: #0000ff;">'/scripts/plugins/flowplayer/example/flowplayer-3.1.1.min.js'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'theme'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">//Call the player...</span>
  drupal_add_js<span style="color: #009900;">&#40;</span>path_to_theme<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">.</span><span style="color: #0000ff;">'/scripts/multimedia.js'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'theme'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><span style="color: #666666; font-style: italic;">//Call the custom JQuery to handle creating the player...</span>
<span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #009933; font-style: italic;">/**
 * A function that takes a file object and a media_mover element array and set the file path to
 * its media moved path on Amazon S3 or wherever it moved to.
 *
 * It uses the unique file_id identifier to match file with media_mover file.
 *
 * $file = $variables['file_image'][0];
 * $media_mover = $variables['media_mover'][{id of media mover configuration}];
 *
 * @param 		&amp;$file A Drupal file array (by reference)
 * @param 		$media_mover A media_mover file/element array
 */</span>
<span style="color: #000000; font-weight: bold;">function</span> custom_theme_get_media_mover_files<span style="color: #009900;">&#40;</span><span style="color: #339933;">&amp;</span><span style="color: #000088;">$file</span><span style="color: #339933;">,</span> <span style="color: #000088;">$media_mover</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
  <span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span>module_exists<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'media_mover_api'</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">&amp;&amp;</span> <span style="color: #000088;">$media_mover</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span> <span style="color: #666666; font-style: italic;">// If media mover is installed...</span>
    <span style="color: #b1b100;">foreach</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$media_mover</span> <span style="color: #b1b100;">as</span> <span style="color: #000088;">$media</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span> <span style="color: #666666; font-style: italic;">// Loop through each media_moved file...</span>
      <span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$media</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'fid'</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">==</span> <span style="color: #000088;">$file</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'fid'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span> <span style="color: #666666; font-style: italic;">// If they match (file id is a unique identifier...</span>
        <span style="color: #000088;">$file</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'filepath'</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$media</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'complete_file'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">// Replace the attached file path with the media moved file path...</span>
      <span style="color: #009900;">&#125;</span>
    <span style="color: #009900;">&#125;</span>
  <span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#125;</span> <span style="color: #666666; font-style: italic;">// custom_theme_get_media_mover_files()</span></pre></td></tr></table></div>

<p>Let me explain one thing in regards to line 9. I&#8217;ve created a custom function and I&#8217;m passing</p>
<pre>$variables['media_mover'][3]</pre>
<p>to my custom function. When you create a Media Mover configuration and map it to a CCK field, it creates an array in $variables to keep track of the Media Mover object. The array is called <strong>&#8216;media_mover&#8217;</strong> and the number <strong>3</strong> in this case is the ID of the Media Mover configuration.</p>
<h4>node-multimedia.tpl.php</h4>
<p>Set up the template. Create a wrapper div with the placeholder image as the background image (this is run through imagecache) and display the play button as a link with the path set to the path of the Amazon S3 file. This link will also have an id attribute of<strong> &#8216;multimedia&#8217;</strong>. This is necessary as it allows us to attach the player, via Javascript, to this link.</p>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p103code28'); return false;">View Code</a> PHP</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p10328"><td class="code" id="p103code28"><pre class="php" style="font-family:monospace;"><span style="color: #339933;">&lt;</span>div id<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;containing-block&quot;</span><span style="color: #339933;">&gt;</span>
<span style="color: #339933;">&lt;</span>div id<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;video-wrapper&quot;</span> <span style="color: #000000; font-weight: bold;">class</span><span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;&lt;?php print <span style="color: #006699; font-weight: bold;">$aspect_ratio</span>;?&gt;&quot;</span><span style="color: #339933;">&gt;</span>
<span style="color: #339933;">&lt;</span>div<span style="color: #339933;">&gt;</span>
     <span style="color: #339933;">&amp;</span>lt<span style="color: #339933;">;</span> ?php <span style="color: #b1b100;">print</span> l<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'&lt;img src=&quot;/'</span><span style="color: #339933;">.</span>path_to_theme<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">.</span><span style="color: #0000ff;">'/images/ccpa-button-play-large.png&quot; alt=&quot;Play this video&quot; /&gt;'</span><span style="color: #339933;">,</span> <span style="color: #000088;">$field_file</span><span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">0</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'filepath'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">,</span> <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;">'html'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #009900; font-weight: bold;">TRUE</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'attributes'</span> <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><span style="color: #0000ff;">'id'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'multimedia'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'class'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #000088;">$multimedia_type</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span><span style="color: #339933;">&lt;/</span>div<span style="color: #339933;">&gt;</span>
<span style="color: #339933;">&lt;/</span>div<span style="color: #339933;">&gt;</span>
<span style="color: #339933;">&lt;/</span>div<span style="color: #339933;">&gt;</span></pre></td></tr></table></div>

<h4>multimedia.js file</h4>
<p>Hook the Flowplayer to the link, with id  of &#8216;multimedia&#8217;, that we created in the template.</p>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p103code29'); return false;">View Code</a> JAVASCRIPT</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p10329"><td class="code" id="p103code29"><pre class="javascript" style="font-family:monospace;">Drupal.<span style="color: #660066;">behaviors</span>.<span style="color: #660066;">showMultimedia</span> <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span>context<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
  <span style="color: #003366; font-weight: bold;">var</span> interactive_path <span style="color: #339933;">=</span> $<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'#multimedia'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">attr</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'href'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #009966; font-style: italic;">/*Get the path to the video*/</span>
  <span style="color: #003366; font-weight: bold;">var</span> interactive_image <span style="color: #339933;">=</span> $<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'#multimedia'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">css</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'background-image'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>	<span style="color: #009966; font-style: italic;">/*Get the path to the placeholder image*/</span>
  interactive_image <span style="color: #339933;">=</span> interactive_image.<span style="color: #660066;">slice</span><span style="color: #009900;">&#40;</span><span style="color: #CC0000;">4</span><span style="color: #339933;">,</span>interactive_image.<span style="color: #660066;">length</span><span style="color: #339933;">-</span><span style="color: #CC0000;">1</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><span style="color: #006600; font-style: italic;">/*Tidying up the interactive image path*/</span>
&nbsp;
  <span style="color: #000066; font-weight: bold;">if</span><span style="color: #009900;">&#40;</span>$<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'#multimedia'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">hasClass</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'video'</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><span style="color: #006600; font-style: italic;">/*If the link has a class of video*/</span>
  $<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'#multimedia'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">flowplayer</span><span style="color: #009900;">&#40;</span> <span style="color: #009966; font-style: italic;">/*Initialize the flowplayer and configure the controls*/</span>
    Drupal.<span style="color: #660066;">settings</span>.<span style="color: #660066;">basePath</span> <span style="color: #339933;">+</span> Drupal.<span style="color: #660066;">settings</span>.<span style="color: #660066;">videoplayerpath</span><span style="color: #339933;">,</span> <span style="color: #009966; font-style: italic;">/*Path to the player, gotten from temaplate.php*/</span>
    <span style="color: #009900;">&#123;</span>
      plugins<span style="color: #339933;">:</span> <span style="color: #009900;">&#123;</span>
	controls<span style="color: #339933;">:</span> <span style="color: #009900;">&#123;</span>
	  <span style="color: #000066;">stop</span><span style="color: #339933;">:</span> <span style="color: #003366; font-weight: bold;">true</span><span style="color: #339933;">,</span>
	  backgroundColor<span style="color: #339933;">:</span> <span style="color: #3366CC;">'#efefef'</span><span style="color: #339933;">,</span>
	  backgroundGradient<span style="color: #339933;">:</span> <span style="color: #3366CC;">'none'</span><span style="color: #339933;">,</span>
	  borderRadius<span style="color: #339933;">:</span> <span style="color: #3366CC;">'0px'</span><span style="color: #339933;">,</span>
	  bufferColor<span style="color: #339933;">:</span> <span style="color: #3366CC;">'#d2d6ab'</span><span style="color: #339933;">,</span>
	  bufferGradient<span style="color: #339933;">:</span> <span style="color: #3366CC;">'none'</span><span style="color: #339933;">,</span>
	  buttonColor<span style="color: #339933;">:</span> <span style="color: #3366CC;">'#777777'</span><span style="color: #339933;">,</span>
	  buttonOverColor<span style="color: #339933;">:</span> <span style="color: #3366CC;">'#99a134'</span><span style="color: #339933;">,</span>
	  durationColor<span style="color: #339933;">:</span> <span style="color: #3366CC;">'#cccccc'</span><span style="color: #339933;">,</span>
	  height<span style="color: #339933;">:</span> <span style="color: #CC0000;">25</span><span style="color: #339933;">,</span>
	  opacity<span style="color: #339933;">:</span> <span style="color: #CC0000;">1.0</span><span style="color: #339933;">,</span>
	  progressColor<span style="color: #339933;">:</span> <span style="color: #3366CC;">'#99a134'</span><span style="color: #339933;">,</span>
	  sliderColor<span style="color: #339933;">:</span> <span style="color: #3366CC;">'#9999999'</span><span style="color: #339933;">,</span>
	  sliderGradient<span style="color: #339933;">:</span> <span style="color: #3366CC;">'none'</span><span style="color: #339933;">,</span>
	  timeBgColor<span style="color: #339933;">:</span> <span style="color: #3366CC;">'#777777'</span><span style="color: #339933;">,</span>
	  timeColor<span style="color: #339933;">:</span> <span style="color: #3366CC;">'#ffffff'</span><span style="color: #339933;">,</span>
	  tooltipColor<span style="color: #339933;">:</span> <span style="color: #3366CC;">'#000000'</span><span style="color: #339933;">,</span>
	  tooltipTextColor<span style="color: #339933;">:</span> <span style="color: #3366CC;">'#ffffff'</span><span style="color: #339933;">,</span>
	  volumeSliderColor<span style="color: #339933;">:</span> <span style="color: #3366CC;">'#777777'</span><span style="color: #339933;">,</span>
	  volumeSliderGradient<span style="color: #339933;">:</span> <span style="color: #3366CC;">'none'</span>
	<span style="color: #009900;">&#125;</span>
      <span style="color: #009900;">&#125;</span>
    <span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
  <span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#125;</span><span style="color: #339933;">;</span></pre></td></tr></table></div>

<p>I hope that was easy to follow. Now there&#8217;s one more thing to cover and that&#8217;s <strong>Aspect Ratio.</strong></p>
<h3>Aspect Ratio</h3>
<p>The issue of aspect ratio is very important when figuring out how to display video. Not so recently YouTube switched all video display to the 16:9 ratio thus setting the stage for the proliferation of the widescreen aspect ratio across the web. So how do you allow the user to upload a video and choose it&#8217;s aspect ratio. I&#8217;m sure there are other ways to do this via Metadata etc, but for our needs on this site I used a CCK field. This is a simple CCK field set with three options:</p>
<ol>
<li>None (defaults to 4:3)</li>
<li>Normal (4:3)</li>
<li>Widescreen (16:9)</li>
</ol>
<div id="attachment_753" class="wp-caption aligncenter" style="width: 396px"><a href="http://blog.raisedeyebrow.com/wp-content/uploads/2009/12/ccpa-aspect-ratio.gif"><img class="size-full wp-image-753" title="ccpa-aspect-ratio" src="http://blog.raisedeyebrow.com/wp-content/uploads/2009/12/ccpa-aspect-ratio.gif" alt="ccpa-aspect-ratio" width="386" height="487" /></a><p class="wp-caption-text">Aspect Ratio Field Settings</p></div>
<p style="text-align: center;">
<p>We then check the value of this field in <strong>template.php</strong> above:</p>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p103code30'); return false;">View Code</a> PHP</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p10330"><td class="code" id="p103code30"><pre class="php" style="font-family:monospace;"><span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$variables</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'field_aspect_ratio'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">0</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'value'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span> <span style="color: #666666; font-style: italic;">//Aspect ratio handling</span>
    <span style="color: #000088;">$variables</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'aspect_ratio'</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$variables</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'field_aspect_ratio'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">0</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'value'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
  <span style="color: #009900;">&#125;</span> <span style="color: #b1b100;">else</span> <span style="color: #009900;">&#123;</span>
  <span style="color: #000088;">$variables</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'aspect_ratio'</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">'normal'</span><span style="color: #339933;">;</span>
  <span style="color: #009900;">&#125;</span></pre></td></tr></table></div>

<p>and set a variable called &#8216;aspect_ratio&#8221; which we apply as a class to the div wrapping the video in the <strong>node-multimedia.tpl.php</strong>:</p>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p103code31'); return false;">View Code</a> PHP</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p10331"><td class="code" id="p103code31"><pre class="php" style="font-family:monospace;"><span style="color: #339933;">&lt;</span>div id<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;containing-block&quot;</span><span style="color: #339933;">&gt;</span>
<span style="color: #339933;">&lt;</span>div id<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;video-wrapper&quot;</span> <span style="color: #000000; font-weight: bold;">class</span><span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;&lt;?php print <span style="color: #006699; font-weight: bold;">$aspect_ratio</span>;?&gt;&quot;</span><span style="color: #339933;">&gt;</span>
<span style="color: #339933;">&lt;</span>div<span style="color: #339933;">&gt;</span>
     <span style="color: #339933;">&lt;</span> ?php <span style="color: #b1b100;">print</span> l<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'&lt;img src=&quot;/'</span><span style="color: #339933;">.</span>path_to_theme<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">.</span><span style="color: #0000ff;">'/images/ccpa-button-play-large.png&quot; alt=&quot;Play this video&quot; /&gt;'</span><span style="color: #339933;">,</span> <span style="color: #000088;">$field_file</span><span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">0</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'filepath'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">,</span> <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;">'html'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #009900; font-weight: bold;">TRUE</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'attributes'</span> <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><span style="color: #0000ff;">'id'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'multimedia'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'class'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #000088;">$multimedia_type</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span><span style="color: #339933;">&lt;/</span>div<span style="color: #339933;">&gt;</span>
<span style="color: #339933;">&lt;/</span>div<span style="color: #339933;">&gt;</span>
<span style="color: #339933;">&lt;/</span>div<span style="color: #339933;">&gt;</span></pre></td></tr></table></div>

<p>We have also created <strong>image cache presets</strong> for the placeholder images to account for both aspect ratios. These are named &#8216;multimedia_normal&#8217; and &#8216;multimedia_widescreen&#8217; and these have the appropriate dimensions associated with them:</p>
<div id="attachment_760" class="wp-caption aligncenter" style="width: 441px"><a href="http://blog.raisedeyebrow.com/wp-content/uploads/2009/12/ccpa-imagecache-presets.gif"><img class="size-full wp-image-760" title="ccpa-imagecache-presets" src="http://blog.raisedeyebrow.com/wp-content/uploads/2009/12/ccpa-imagecache-presets.gif" alt="ccpa-imagecache-presets" width="431" height="79" /></a><p class="wp-caption-text">Image Cache Presets</p></div>
<p style="text-align: center;">So using the <a href="http://www.alistapart.com/articles/creating-intrinsic-ratios-for-video/">amazing article on A List Apart for creating intrinsic ratios for video</a> we use CSS to resize the player based on the aspect ratio chosen by the user.</p>
<h4>style.css file</h4>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p103code32'); return false;">View Code</a> CSS</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p10332"><td class="code" id="p103code32"><pre class="css" style="font-family:monospace;"><span style="color: #808080; font-style: italic;">/* -- Multimedia -- */</span>
<span style="color: #cc00cc;">#containing-</span><span style="color: #993333;">block</span> <span style="color: #00AA00;">&#123;</span>
  <span style="color: #000000; font-weight: bold;">width</span><span style="color: #00AA00;">:</span> <span style="color: #933;">100%</span><span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span>
&nbsp;
<span style="color: #cc00cc;">#video-wrapper</span> <span style="color: #00AA00;">&#123;</span>
  <span style="color: #000000; font-weight: bold;">position</span><span style="color: #00AA00;">:</span> <span style="color: #993333;">relative</span><span style="color: #00AA00;">;</span>
  <span style="color: #000000; font-weight: bold;">padding-top</span><span style="color: #00AA00;">:</span> <span style="color: #933;">25px</span><span style="color: #00AA00;">;</span>
  <span style="color: #000000; font-weight: bold;">height</span><span style="color: #00AA00;">:</span> <span style="color: #cc66cc;">0</span><span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span>
&nbsp;
  <span style="color: #cc00cc;">#video-wrapper</span> div<span style="color: #00AA00;">,</span>
  <span style="color: #cc00cc;">#video-wrapper</span> <span style="color: #993333;">embed</span><span style="color: #00AA00;">,</span>
  <span style="color: #cc00cc;">#video-wrapper</span> object <span style="color: #00AA00;">&#123;</span>
    <span style="color: #000000; font-weight: bold;">position</span><span style="color: #00AA00;">:</span> <span style="color: #993333;">absolute</span><span style="color: #00AA00;">;</span>
    <span style="color: #000000; font-weight: bold;">top</span><span style="color: #00AA00;">:</span> <span style="color: #cc66cc;">0</span><span style="color: #00AA00;">;</span>
    <span style="color: #000000; font-weight: bold;">left</span><span style="color: #00AA00;">:</span> <span style="color: #cc66cc;">0</span><span style="color: #00AA00;">;</span>
    <span style="color: #000000; font-weight: bold;">width</span><span style="color: #00AA00;">:</span> <span style="color: #933;">100%</span><span style="color: #00AA00;">;</span>
    <span style="color: #000000; font-weight: bold;">height</span><span style="color: #00AA00;">:</span> <span style="color: #933;">100%</span><span style="color: #00AA00;">;</span>
  <span style="color: #00AA00;">&#125;</span>
&nbsp;
  <span style="color: #cc00cc;">#video-wrapper</span>.<span style="color: #993333;">normal</span> <span style="color: #00AA00;">&#123;</span>
    <span style="color: #000000; font-weight: bold;">padding-bottom</span><span style="color: #00AA00;">:</span> <span style="color: #933;">75%</span><span style="color: #00AA00;">;</span>
  <span style="color: #00AA00;">&#125;</span>
&nbsp;
  <span style="color: #cc00cc;">#video-wrapper</span><span style="color: #6666ff;">.widescreen</span> <span style="color: #00AA00;">&#123;</span>
    <span style="color: #000000; font-weight: bold;">padding-bottom</span><span style="color: #00AA00;">:</span> <span style="color: #933;">56.25%</span><span style="color: #00AA00;">;</span>
  <span style="color: #00AA00;">&#125;</span>
&nbsp;
  <span style="color: #00AA00;">*</span> html <span style="color: #cc00cc;">#video-wrapper</span> <span style="color: #00AA00;">&#123;</span>
    <span style="color: #000000; font-weight: bold;">margin-bottom</span><span style="color: #00AA00;">:</span> <span style="color: #933;">45px</span><span style="color: #00AA00;">;</span>
    margin-bot\tom<span style="color: #00AA00;">:</span> <span style="color: #cc66cc;">0</span><span style="color: #00AA00;">;</span>
  <span style="color: #00AA00;">&#125;</span>
&nbsp;
<span style="color: #cc00cc;">#video-wrapper</span> <span style="color: #cc00cc;">#multimedia</span><span style="color: #6666ff;">.audio</span> <span style="color: #00AA00;">&#123;</span>
  <span style="color: #000000; font-weight: bold;">display</span><span style="color: #00AA00;">:</span><span style="color: #993333;">block</span><span style="color: #00AA00;">;</span>
  <span style="color: #000000; font-weight: bold;">height</span><span style="color: #00AA00;">:</span><span style="color: #933;">100%</span><span style="color: #00AA00;">;</span>
  <span style="color: #000000; font-weight: bold;">margin</span><span style="color: #00AA00;">:</span><span style="color: #933;">1em</span> <span style="color: #cc66cc;">0</span> <span style="color: #cc66cc;">0</span> <span style="color: #cc66cc;">0</span><span style="color: #00AA00;">;</span>
  <span style="color: #000000; font-weight: bold;">text-align</span><span style="color: #00AA00;">:</span> <span style="color: #993333;">center</span><span style="color: #00AA00;">;</span>
  <span style="color: #000000; font-weight: bold;">width</span><span style="color: #00AA00;">:</span><span style="color: #933;">100%</span><span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span>
&nbsp;
<span style="color: #cc00cc;">#video-wrapper</span> <span style="color: #cc00cc;">#multimedia</span> <span style="color: #00AA00;">&#123;</span>
  <span style="color: #000000; font-weight: bold;">display</span><span style="color: #00AA00;">:</span><span style="color: #993333;">block</span><span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span>
&nbsp;
  <span style="color: #cc00cc;">#video-wrapper</span>.<span style="color: #993333;">normal</span> <span style="color: #cc00cc;">#multimedia</span> img <span style="color: #00AA00;">&#123;</span>
    <span style="color: #808080; font-style: italic;">/*margin:118.5px 0 0;*/</span>
    <span style="color: #000000; font-weight: bold;">margin</span><span style="color: #00AA00;">:</span><span style="color: #933;">32%</span> <span style="color: #933;">42%</span><span style="color: #00AA00;">;</span>
  <span style="color: #00AA00;">&#125;</span>
&nbsp;
  <span style="color: #cc00cc;">#video-wrapper</span><span style="color: #6666ff;">.widescreen</span> <span style="color: #cc00cc;">#multimedia</span> img <span style="color: #00AA00;">&#123;</span>
    <span style="color: #000000; font-weight: bold;">margin</span><span style="color: #00AA00;">:</span><span style="color: #933;">22%</span> <span style="color: #933;">41%</span><span style="color: #00AA00;">;</span>
  <span style="color: #00AA00;">&#125;</span></pre></td></tr></table></div>

<p>And the end result looks something like this <a href="http://www.policyalternatives.ca/multimedia/matthew-poverty-and-looking-after-each-other-tough-times">http://www.policyalternatives.ca/multimedia/matthew-poverty-and-looking-after-each-other-tough-times</a>. They haven&#8217;t added any widescreen content yet, just testing content.</p>
<h4>So what are the advantages of doing things this way?</h4>
<ol>
<li>You can easily use any player to play your flash files (all you need to do  is change the path to your player and a few configuration params in multimedia.js)</li>
<li>All your video content is hosted on and delivered from Amazon S3. But there is also a copy on your local server in the event of something going wrong on Amazon S3</li>
<li>You don&#8217;t have to worry about your video looking skewed due to aspect ratio problems</li>
<li>You can add many other apsect ratios pretty quickly</li>
<li>The video file is still downloadable when javascript is not present or disabled</li>
</ol>
<p>I&#8217;d love to get feedback on how other do this, please leave a comment or send me an email and let me know how you deliver Video content on your site.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.raisedeyebrow.com/2009/12/using-drupal-to-deliver-video/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Launched: PolicyAlternatives.ca</title>
		<link>http://blog.raisedeyebrow.com/2009/12/ccpa-launch/#utm_source=rss&amp;utm_medium=rss&amp;utm_campaign=ccpa-launch</link>
		<comments>http://blog.raisedeyebrow.com/2009/12/ccpa-launch/#comments</comments>
		<pubDate>Mon, 14 Dec 2009 16:58:03 +0000</pubDate>
		<dc:creator>Lauren Bacon</dc:creator>
				<category><![CDATA[Design]]></category>
		<category><![CDATA[Drupal]]></category>
		<category><![CDATA[Nonprofit Tech]]></category>
		<category><![CDATA[Online Strategy]]></category>
		<category><![CDATA[Our Clients]]></category>
		<category><![CDATA[Raised Eyebrow]]></category>
		<category><![CDATA[CCPA]]></category>
		<category><![CDATA[data migration]]></category>
		<category><![CDATA[document library]]></category>
		<category><![CDATA[publications]]></category>

		<guid isPermaLink="false">http://blog.raisedeyebrow.com/?p=708</guid>
		<description><![CDATA[We are very proud to unveil a project we&#8217;ve been working on for several months now: a redesign of policyalternatives.ca, the online home of the Canadian Centre for Policy Alternatives. Canada&#8217;s leading progressive research institute, the CCPA is a prolific publisher of reports and studies, books, articles, commentary and fact sheets on issues ranging from [...]]]></description>
			<content:encoded><![CDATA[<p><img class="alignright size-medium wp-image-721" title="Redesigned CCPA home page" src="http://blog.raisedeyebrow.com/wp-content/uploads/2009/12/ccpa-home-300x184.jpg" alt="Redesigned CCPA home page" width="300" height="184" />We are very proud to unveil a project we&#8217;ve been working on for several months now: a redesign of <a href="http://www.policyalternatives.ca">policyalternatives.ca</a>, the online home of the Canadian Centre for Policy Alternatives. Canada&#8217;s leading progressive research institute, the CCPA is a prolific publisher of <a href="http://www.policyalternatives.ca/publications/reports">reports and studies</a>, <a href="http://www.policyalternatives.ca/publications/bookstore">books</a>, <a href="http://www.policyalternatives.ca/publications/monitor">articles</a>, <a href="http://www.policyalternatives.ca/publications/commentary">commentary and fact sheets</a> on issues ranging from income equality to environmental policy, privatization of public services, and beyond.</p>
<p>They are highly respected, but like many organizations working towards policy change, they don&#8217;t always reach as broad an audience as they might hope; not many people have the time and inclination to read an in-depth research report, so in recent years they have been creating more bite-sized, easy-to-digest content in both written and <a title="CCPA Multimedia Studio" href="http://www.policyalternatives.ca/multimedia">multimedia</a> formats. As the range of content has grown, though, so has the need to cross-reference related materials &#8212; so the CCPA&#8217;s website needed to both invite visitors to browse through an extensive library in an intuitive and approachable way, but also allow people seeking more in-depth content to locate related materials quickly and easily. (One of our developers describes the complex interrelationships between the CCPA&#8217;s publications as &#8220;like Facebook for documents.&#8221;)</p>
<p>Their five year-old website, although rich in content and highly trafficked, didn&#8217;t offer visitors any way to easily share the CCPA&#8217;s content with their social networks, whether through Facebook or Twitter, or even through their own publications, blogs or presentations. Exchange of ideas is the CCPA&#8217;s raison d&#8217;etre, so it stands to reason that above and beyond extending the website&#8217;s &#8220;share this&#8221; features, the organization would benefit from encouraging online visitors to <a title="CCPA terms of (re)use" href="http://www.policyalternatives.ca/terms">use and share its content</a> &#8212; and they do, using a <a href="http://creativecommons.org/">Creative Commons</a> license.</p>
<p>This project was a complex one on several fronts, as we wrestled with improving navigation through the site (both via menus and site links as well as with improved <a href="http://www.policyalternatives.ca/search">search tools</a>); updating the site&#8217;s look and feel; and migrating the extensive site content (along with the aforementioned relationships between content items) from a commercial CMS platform into Drupal.</p>
<p>Oh, and we also set up a shopping cart (for books, memberships, donations and journal subscriptions).</p>
<p>There&#8217;s a real sense of accomplishment here at Raised Eyebrow when we look at the final result, but of course on the web, there&#8217;s no such thing as a final edit. Our best hope, in fact, is that we&#8217;ve helped to create a solid platform upon which the CCPA can continue to build and extend over the coming years. So while right now we are celebrating the grand opening, the real fun in some ways is still to come. I&#8217;m sure we&#8217;ll see the CCPA continue to play a leadership role when it comes to presenting research online in accessible and innovative ways.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.raisedeyebrow.com/2009/12/ccpa-launch/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>
