<?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/"
	
	xmlns:media="http://search.yahoo.com/mrss/"
	>

<channel>
	<title>WebDev</title>
	<atom:link href="http://blog.whiteinternet.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.whiteinternet.com</link>
	<description>Iain White&#039;s thoughts and tips on Web Development</description>
	<lastBuildDate>Sat, 07 Apr 2012 01:41:06 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.2</generator>
<xhtml:meta xmlns:xhtml="http://www.w3.org/1999/xhtml" name="robots" content="noindex" />
		<item>
		<title>IE does not trap events on transparent elements!</title>
		<link>http://blog.whiteinternet.com/css/ie-transparent-events/</link>
		<comments>http://blog.whiteinternet.com/css/ie-transparent-events/#comments</comments>
		<pubDate>Sat, 07 Apr 2012 01:20:36 +0000</pubDate>
		<dc:creator>Iain White</dc:creator>
				<category><![CDATA[CSS]]></category>
		<category><![CDATA[bug]]></category>
		<category><![CDATA[IE]]></category>

		<guid isPermaLink="false">http://blog.whiteinternet.com/?p=620</guid>
		<description><![CDATA[I recently developed a web application that needed a transparent layer to cover some parts of the site, to prevent mouse over’s and click events triggering on the underlying elements. This worked as expected in all browsers except Internet Explorer. &#8230; <a href="http://blog.whiteinternet.com/css/ie-transparent-events/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p><img class="alignleft size-full wp-image-622" title="Internet_Explorer_7_Logo" src="http://blog.whiteinternet.com/wp-content/uploads/2012/04/Internet_Explorer_7_Logo.png" alt="Internet Explorer 7 Logo IE does not trap events on transparent elements!" width="256" height="256" /></p>
<p>I recently developed a web application that needed a transparent layer to cover some parts of the site, to prevent mouse over’s and click events triggering on the underlying elements.</p>
<p>This worked as expected in all browsers except Internet Explorer.</p>
<p>After a bit of research and testing it turns out that <strong>IE does not trap events if an element is transparent</strong>!?</p>
<p>The work around was to give the element a background colour and then set its opacity to 0.9, which makes it almost transparent and able to trap events.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.whiteinternet.com/css/ie-transparent-events/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:thumbnail url="http://blog.whiteinternet.com/wp-content/uploads/2012/04/Internet_Explorer_7_Logo-150x150.png" />
		<media:content url="http://blog.whiteinternet.com/wp-content/uploads/2012/04/Internet_Explorer_7_Logo.png" medium="image">
			<media:title type="html">Internet_Explorer_7_Logo</media:title>
			<media:thumbnail url="http://blog.whiteinternet.com/wp-content/uploads/2012/04/Internet_Explorer_7_Logo-150x150.png" />
		</media:content>
	</item>
		<item>
		<title>Manifesto for Agile Software Development</title>
		<link>http://blog.whiteinternet.com/general/agile-manifesto/</link>
		<comments>http://blog.whiteinternet.com/general/agile-manifesto/#comments</comments>
		<pubDate>Tue, 03 Apr 2012 10:34:16 +0000</pubDate>
		<dc:creator>Iain White</dc:creator>
				<category><![CDATA[General]]></category>

		<guid isPermaLink="false">http://blog.whiteinternet.com/?p=626</guid>
		<description><![CDATA[We are uncovering better ways of developing software by doing it and helping others do it. Through this work we have come to value: Individuals and interactions over processes and tools Working software over comprehensive documentation Customer collaboration over contract &#8230; <a href="http://blog.whiteinternet.com/general/agile-manifesto/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p style="text-align: center;">We are uncovering better ways of developing<br />
software by doing it and helping others do it.<br />
Through this work we have come to value:</p>
<p style="text-align: center;"><strong><span style="font-size: small;">Individuals and interactions </span></strong><span style="font-size: x-small;">over processes and tools<br />
</span><strong><span style="font-size: small;">Working software </span></strong><span style="font-size: x-small;">over comprehensive documentation<br />
</span><strong><span style="font-size: small;">Customer collaboration </span></strong><span style="font-size: x-small;">over contract negotiation<br />
</span><strong><span style="font-size: small;">Responding to change </span></strong><span style="font-size: x-small;">over following a plan<br />
</span></p>
<p style="text-align: center;">That is, while there is value in the items on<br />
the right, we value the items on the left more.</p>
<table cellpadding="15">
<tbody>
<tr align="center" valign="top">
<td>
Kent Beck</p>
<p>Mike Beedle</p>
<p>Arie van Bennekum</p>
<p>Alistair Cockburn</p>
<p>Ward Cunningham</p>
<p>Martin Fowler</p>
<p>James Grenning</p>
<p>Jim Highsmith</p>
<p>Andrew Hunt</p>
<p>Ron Jeffries</p>
<p>Jon Kern</p>
<p>Brian Marick</p>
<p>Robert C. Martin</p>
<p>Steve Mellor</p>
<p>Ken Schwaber</p>
<p>Jeff Sutherland</p>
<p>Dave Thomas</td>
</tr>
</tbody>
</table>
<p style="text-align: center;"><span style="color: gray; font-size: xx-small;"><br />
© 2001, the above authors<br />
this declaration may be freely copied in any form,<br />
but only in its entirety through this notice.<br />
</span></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.whiteinternet.com/general/agile-manifesto/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
	</item>
		<item>
		<title>Freenet</title>
		<link>http://blog.whiteinternet.com/general/freenet/</link>
		<comments>http://blog.whiteinternet.com/general/freenet/#comments</comments>
		<pubDate>Sat, 31 Mar 2012 13:55:45 +0000</pubDate>
		<dc:creator>Iain White</dc:creator>
				<category><![CDATA[General]]></category>

		<guid isPermaLink="false">http://blog.whiteinternet.com/?p=604</guid>
		<description><![CDATA[Providing the world with FREE wireless broadband. Freenet was created as a service to the end user and a low cost method for businesses to advertise both socially and one to one marketing strategies. The concept of Freenet includes advertising &#8230; <a href="http://blog.whiteinternet.com/general/freenet/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<h2 style="text-align: center;">Providing the world with FREE wireless broadband.</h2>
<p style="text-align: center;"><img class="size-full wp-image-608 aligncenter" title="Freenet" src="http://blog.whiteinternet.com/wp-content/uploads/2012/03/freenet-logo.png" alt="freenet logo Freenet" width="340" height="51" /></p>
<p><strong>Freenet</strong> was created as a service to the end user and a low cost method for businesses to advertise both socially and one to one marketing strategies.</p>
<p>The concept of Freenet includes advertising at the top of each page served inside a web browser as a way of funding broadband at no cost to the end clients but without being malicious or &#8220;hard to live with&#8221;.</p>
<p style="text-align: right;">Visit <a href="http://www.myfreenet.com.au">www.myfreenet.com.au</a> for more details.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.whiteinternet.com/general/freenet/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:thumbnail url="http://blog.whiteinternet.com/wp-content/uploads/2012/03/freenet-logo-150x51.png" />
		<media:content url="http://blog.whiteinternet.com/wp-content/uploads/2012/03/freenet-logo.png" medium="image">
			<media:title type="html">Freenet</media:title>
			<media:thumbnail url="http://blog.whiteinternet.com/wp-content/uploads/2012/03/freenet-logo-150x51.png" />
		</media:content>
	</item>
		<item>
		<title>PHP 5.4 Released</title>
		<link>http://blog.whiteinternet.com/general/php-5-4-released/</link>
		<comments>http://blog.whiteinternet.com/general/php-5-4-released/#comments</comments>
		<pubDate>Sat, 03 Mar 2012 09:32:57 +0000</pubDate>
		<dc:creator>Iain White</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[PHP]]></category>

		<guid isPermaLink="false">http://blog.whiteinternet.com/?p=614</guid>
		<description><![CDATA[PHP 5.4.0 Release Announcement PHP 5.4.0 is available. This release is a major leap forward in the 5.x series, and includes a large number of new features and bug fixes. The key features of PHP 5.4.0 include: New language syntax &#8230; <a href="http://blog.whiteinternet.com/general/php-5-4-released/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<h2>PHP 5.4.0 Release Announcement</h2>
<p>PHP <a href="http://php.net/downloads.php#v5.4.0">5.4.0</a> is available.<br />
This release is a major leap forward in the 5.x series,<br />
and includes a large number of new features and bug fixes.
</p>
<p>
<strong>The key features of PHP 5.4.0 include:</strong>
</p>
<ul>
<li>New language syntax including Traits an a shortened array syntax</li>
<li>Improved performance and reduced memory consumption</li>
<li>Support for multibyte languages now available in all builds of PHP at the flip of a run-time switch</li>
<li>Built-in webserver in CLI mode to simplify development workflows and testing</li>
<li>Cleaner code base thanks to the removal of multiple deprecated language features</li>
<li>Many more improvements and fixes</li>
</ul>
<p>
<b>Changes that affect compatibility:</b>
</p>
<ul>
<li><a href="http://www.php.net/manual/security.globals.php">Register globals</a>, <a href="http://www.php.net/manual/security.magicquotes.php">magic quotes</a> and <a href="http://www.php.net/manual/features.safe-mode.php">safe mode</a> were removed</li>
<li>The <a href="http://php.net/manual/control-structures.break.php">break</a>/<a href="http://php.net/manual/control-structures.continue.php">continue</a> $var syntax was removed</li>
<li>The ini option <a href="http://www.php.net/manual/ini.core.php#ini.allow-call-time-pass-reference">allow_call_time_pass_reference</a> was removed</li>
<li>The PHP <a href="http://www.php.net/manual/ini.core.php#ini.default-charset">default_charset</a> is now &#8220;UTF-8&#8243; within the distributed php.ini files, but still defaults to &#8220;&#8221;</li>
</ul>
<p>
PHP 5.4 will be the last series to support Windows XP and Windows 2003. We will not provide binary packages for these Windows versions after PHP 5.4.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.whiteinternet.com/general/php-5-4-released/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
	</item>
		<item>
		<title>Merry Christmas</title>
		<link>http://blog.whiteinternet.com/general/merry-christmas/</link>
		<comments>http://blog.whiteinternet.com/general/merry-christmas/#comments</comments>
		<pubDate>Sat, 24 Dec 2011 15:00:51 +0000</pubDate>
		<dc:creator>Iain White</dc:creator>
				<category><![CDATA[General]]></category>

		<guid isPermaLink="false">http://blog.whiteinternet.com/?p=471</guid>
		<description><![CDATA[NORAD Santa Tracker NORAD Tracks Santa is an annual Christmas-themed entertainment program, which has existed since 1955, produced under the auspices of the North American Aerospace Defense Command (NORAD). Every year on Christmas Eve, &#8220;NORAD Tracks Santa&#8221; purports to follow &#8230; <a href="http://blog.whiteinternet.com/general/merry-christmas/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p><strong>NORAD Santa Tracker</strong></p>
<p>NORAD Tracks Santa is an annual Christmas-themed entertainment program, which has existed since 1955, produced under the auspices of the North American Aerospace Defense Command (NORAD). Every year on Christmas Eve, &#8220;NORAD Tracks Santa&#8221; purports to follow Santa Claus as he leaves the North Pole and delivers presents to children around the world.</p>
<p style="text-align: right;"><a href="http://www.noradsanta.org/">http://www.noradsanta.org/</a><img class="aligncenter size-full wp-image-474" title="santa1" src="http://blog.whiteinternet.com/wp-content/uploads/2011/12/santa1.png" alt="santa1 Merry Christmas" width="300" height="168" /></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.whiteinternet.com/general/merry-christmas/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:thumbnail url="http://blog.whiteinternet.com/wp-content/uploads/2011/12/santa1-150x150.png" />
		<media:content url="http://blog.whiteinternet.com/wp-content/uploads/2011/12/santa1.png" medium="image">
			<media:title type="html">santa1</media:title>
			<media:thumbnail url="http://blog.whiteinternet.com/wp-content/uploads/2011/12/santa1-150x150.png" />
		</media:content>
	</item>
		<item>
		<title>THE NIGHT BEFORE CHRISTMAS</title>
		<link>http://blog.whiteinternet.com/general/the-night-before-christmas/</link>
		<comments>http://blog.whiteinternet.com/general/the-night-before-christmas/#comments</comments>
		<pubDate>Sat, 24 Dec 2011 04:41:25 +0000</pubDate>
		<dc:creator>Iain White</dc:creator>
				<category><![CDATA[General]]></category>

		<guid isPermaLink="false">http://blog.whiteinternet.com/?p=468</guid>
		<description><![CDATA[THE NIGHT BEFORE CHRISTMAS by Clement Clarke Mooreor Henry Livingston &#8216;Twas the night before Christmas, when all through the house Not a creature was stirring, not even a mouse; The stockings were hung by the chimney with care, In hopes &#8230; <a href="http://blog.whiteinternet.com/general/the-night-before-christmas/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<h2><strong><span style="color: #ff0000;">THE NIGHT BEFORE CHRISTMAS</span></strong></h2>
<p><em>by Clement Clarke Mooreor Henry Livingston</em></p>
<div>&#8216;Twas the night before Christmas, when all through the house</div>
<div>Not a creature was stirring, not even a mouse;</div>
<div>The stockings were hung by the chimney with care,</div>
<div>In hopes that St. Nicholas soon would be there;</div>
<div>The children were nestled all snug in their beds,</div>
<div>While visions of sugar-plums danced in their heads;</div>
<div>And mamma in her &#8216;kerchief, and I in my cap,</div>
<div>Had just settled down for a long winter&#8217;s nap,</div>
<div>When out on the lawn there arose such a clatter,</div>
<div>I sprang from the bed to see what was the matter.</div>
<div>Away to the window I flew like a flash,</div>
<div>Tore open the shutters and threw up the sash.</div>
<div>The moon on the breast of the new-fallen snow</div>
<div>Gave the lustre of mid-day to objects below,</div>
<div>When, what to my wondering eyes should appear,</div>
<div>But a miniature sleigh, and eight tiny reindeer,</div>
<div>With a little old driver, so lively and quick,</div>
<div>I knew in a moment it must be St. Nick.</div>
<div>More rapid than eagles his coursers they came,</div>
<div>And he whistled, and shouted, and called them by name;</div>
<div>&#8220;Now, Dasher! now, Dancer! now, Prancer and Vixen!</div>
<div>On, Comet! on Cupid! on, Donder and Blitzen!</div>
<div>To the top of the porch! to the top of the wall!</div>
<div>Now dash away! dash away! dash away all!&#8221;</div>
<div>As dry leaves that before the wild hurricane fly,</div>
<div>When they meet with an obstacle, mount to the sky,</div>
<div>So up to the house-top the coursers they flew,</div>
<div>With the sleigh full of toys, and St. Nicholas too.</div>
<div>And then, in a twinkling, I heard on the roof</div>
<div>The prancing and pawing of each little hoof.</div>
<div>As I drew in my head, and was turning around,</div>
<div>Down the chimney St. Nicholas came with a bound.</div>
<div>He was dressed all in fur, from his head to his foot,</div>
<div>And his clothes were all tarnished with ashes and soot;</div>
<div>A bundle of toys he had flung on his back,</div>
<div>And he looked like a peddler just opening his pack.</div>
<div>His eyes &#8212; how they twinkled! his dimples how merry!</div>
<div>His cheeks were like roses, his nose like a cherry!</div>
<div>His droll little mouth was drawn up like a bow,</div>
<div>And the beard of his chin was as white as the snow;</div>
<div>The stump of a pipe he held tight in his teeth,</div>
<div>And the smoke it encircled his head like a wreath;</div>
<div>He had a broad face and a little round belly,</div>
<div>That shook, when he laughed like a bowlful of jelly.</div>
<div>He was chubby and plump, a right jolly old elf,</div>
<div>And I laughed when I saw him, in spite of myself;</div>
<div>A wink of his eye and a twist of his head,</div>
<div>Soon gave me to know I had nothing to dread;</div>
<div>He spoke not a word, but went straight to his work,</div>
<div>And filled all the stockings; then turned with a jerk,</div>
<div>And laying his finger aside of his nose,</div>
<div>And giving a nod, up the chimney he rose;</div>
<div>He sprang to his sleigh, to his team gave a whistle,</div>
<div>And away they all flew like the down of a thistle.</div>
<div>But I heard him exclaim, ere he drove out of sight,</div>
<p><em><br />
<span style="color: #e3041b; font-size: large;">&#8220;Happy Christmas to all, and to all a good-night.&#8221;<br />
</span><br />
</em></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.whiteinternet.com/general/the-night-before-christmas/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
	</item>
		<item>
		<title>&#8216;select&#8217; Isn&#8217;t Broken</title>
		<link>http://blog.whiteinternet.com/general/select-isnt-broken/</link>
		<comments>http://blog.whiteinternet.com/general/select-isnt-broken/#comments</comments>
		<pubDate>Thu, 22 Dec 2011 08:00:40 +0000</pubDate>
		<dc:creator>Iain White</dc:creator>
				<category><![CDATA[General]]></category>

		<guid isPermaLink="false">http://blog.whiteinternet.com/?p=483</guid>
		<description><![CDATA[I recently worked alongside an intern developing Drupal CMS based websites and was given a fresh view of how junior developers can on occasions leap to conclusions. In the book The Pragmatic Programmer, one of the software development tips is: &#8230; <a href="http://blog.whiteinternet.com/general/select-isnt-broken/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>I recently worked alongside an intern developing <strong>Drupal CMS</strong> based websites and was given a fresh view of how junior developers can on occasions leap to conclusions.</p>
<p>In the book <strong>The Pragmatic Programmer</strong>, one of the software development tips is:</p>
<p><strong>&#8216;select&#8217; Isn&#8217;t Broken</strong><br />
<em>It is rare to find a bug in the OS or the compiler, or even a third-party product or library. The bug is most likely in the application.</em></p>
<p>The individual I worked with was a talented and quick to learn developer, but I was surprised how often during his first Drupal project he looked for issues outside his code.</p>
<p>Memorable comments where “<em>I can make it work, but I need to hack Drupal core</em>”, “<em>I need to change the encoding of the database</em>” and “<em>There is a patch for Drupal 7 that will fix this</em>”.</p>
<p>The intern was a good developer, he had skill and passion, and he just needed some more experience.  The Drupal CMS is used by thousands of web sites, the company we worked for had hundreds of Drupal sites running the same or similar configurations.  There was a good chance that Drupal was not broken.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.whiteinternet.com/general/select-isnt-broken/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
	</item>
		<item>
		<title>Fix Drupal 6 View Jump Menu</title>
		<link>http://blog.whiteinternet.com/php/fix-drupal-6-view-jump-menu/</link>
		<comments>http://blog.whiteinternet.com/php/fix-drupal-6-view-jump-menu/#comments</comments>
		<pubDate>Wed, 14 Dec 2011 04:40:36 +0000</pubDate>
		<dc:creator>Iain White</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[Snippet Library - PHP]]></category>
		<category><![CDATA[Drupal]]></category>

		<guid isPermaLink="false">http://blog.whiteinternet.com/?p=532</guid>
		<description><![CDATA[When you output a Jump Menu from a View in Drupal 6, it displays &#38;amp; instead of the ampersand. Therefore &#8216;Terms &#38; Conditions&#8217; appears as &#8216;Terms &#38;amp; Conditions&#8217; in the menu. The following bit of PHP code fixes this problem: &#8230; <a href="http://blog.whiteinternet.com/php/fix-drupal-6-view-jump-menu/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>When you output a <strong>Jump Menu</strong> from a <strong>View</strong> in <strong>Drupal 6</strong>, it displays <em>&amp;amp;</em> instead of the ampersand.</p>
<p>Therefore <em>&#8216;Terms &amp; Conditions&#8217;</em> appears as <em>&#8216;Terms &amp;amp; Conditions&#8217;</em> in the menu.</p>
<p>The following bit of <strong>PHP</strong> code fixes this problem:</p>
<pre name="code" class="php">
/* Fix jump menu options encoding */
function hook_form_alter(&#038;$form, &#038;$form_state, $form_id) {
  switch ($form_id) {
    case 'ctools_jump_menu':
      foreach ($form['jump']['#options'] as $key => $value) {
        $form['jump']['#options'][$key] = html_entity_decode($value, ENT_QUOTES);
      }
  }
}
</pre>
]]></content:encoded>
			<wfw:commentRss>http://blog.whiteinternet.com/php/fix-drupal-6-view-jump-menu/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
	</item>
		<item>
		<title>Drupal 6 View Group By</title>
		<link>http://blog.whiteinternet.com/php/drupal-6-view-group-by/</link>
		<comments>http://blog.whiteinternet.com/php/drupal-6-view-group-by/#comments</comments>
		<pubDate>Wed, 14 Dec 2011 04:12:13 +0000</pubDate>
		<dc:creator>Iain White</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[Snippet Library - PHP]]></category>
		<category><![CDATA[Drupal]]></category>

		<guid isPermaLink="false">http://blog.whiteinternet.com/?p=528</guid>
		<description><![CDATA[The PHP code snippet below shows how to add a GROUP BY clause to a Drupal 6 View. function hook_views_pre_execute(&#038;$view) { switch($view->name) { case 'Services2': $search = array('ORDER BY'); $replace = array('GROUP BY node_data_field_parent_service.field_parent_service_nid ORDER BY'); $view->build_info['query'] = str_replace($search, $replace, &#8230; <a href="http://blog.whiteinternet.com/php/drupal-6-view-group-by/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>The <strong>PHP code</strong> snippet below shows how to add a <strong>GROUP BY</strong><br />
clause to a <strong>Drupal 6</strong> <strong>View</strong>.</p>
<pre name="code" class="php">
function hook_views_pre_execute(&#038;$view) {
  switch($view->name) {
    case 'Services2':
      $search = array('ORDER BY');
      $replace = array('GROUP BY node_data_field_parent_service.field_parent_service_nid ORDER BY');
      $view->build_info['query'] = str_replace($search,
                                               $replace,
                                               $view->build_info['query']);
    break;
  }
}
</pre>
]]></content:encoded>
			<wfw:commentRss>http://blog.whiteinternet.com/php/drupal-6-view-group-by/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
	</item>
		<item>
		<title>Member only content using Drupal 7</title>
		<link>http://blog.whiteinternet.com/php/drupal-members-only/</link>
		<comments>http://blog.whiteinternet.com/php/drupal-members-only/#comments</comments>
		<pubDate>Tue, 13 Dec 2011 23:03:28 +0000</pubDate>
		<dc:creator>Iain White</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[Drupal]]></category>

		<guid isPermaLink="false">http://blog.whiteinternet.com/?p=523</guid>
		<description><![CDATA[I was recently asked to create a mechanism in Drupal 7, so that a client could add member only content to their Drupal 7 web site. The content was to be added periodically by the company in the form of &#8230; <a href="http://blog.whiteinternet.com/php/drupal-members-only/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>I was recently asked to create a mechanism in<strong> Drupal 7</strong>, so that a client could add member only content to their Drupal 7 web site.</p>
<p>The content was to be added periodically by the company in the form of training courses.<br />
I created a new <em>Content Type</em> of <em>Course</em> and a template file <em>node—course.tpl.php</em> as shown below.</p>
<pre name="code" class="php">
<?php
  GLOBAL $user;
  $roles = $user->roles;
  $show = FALSE;
  $isAdmin = in_array('administrator', $roles);
  $isEditor = in_array('Editor', $roles);
  $isMember = in_array('Member', $roles);
  if ($isMember || $isAdmin || $isEditor) {
    $show = TRUE;
  }
  ?>
<div id="node-<?php print $node->nid; ?>" class="<?php print $classes; ?> clearfix"<?php print $attributes; ?>>
  <?php if (!$show): ?>
    <?php drupal_set_message('<strong>Sorry, you are not authorised to access this page.</strong> If you have been given access details for this course, please enter them below.', 'warning'); ?>
    <?php print drupal_render(drupal_get_form('user_login')); ?>
  <?php else: ?>
<div class="content"<?php print $content_attributes; ?>>
      <?php print render($content['body']); ?>
    </div>

  <?php endif; ?>
</div>
</pre>
<p>Once a visitor to the site is logged in and if they belong to the Role <em>Member</em>, they see the content, if not they get a login form.</p>
<p>The results can be seen in the following image:</p>
<p><img class="aligncenter size-full wp-image-524" title="drupal-login" src="http://blog.whiteinternet.com/wp-content/uploads/2011/12/drupal-login.png" alt="drupal login Member only content using Drupal 7" width="654" height="286" /></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.whiteinternet.com/php/drupal-members-only/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:thumbnail url="http://blog.whiteinternet.com/wp-content/uploads/2011/12/drupal-login-150x150.png" />
		<media:content url="http://blog.whiteinternet.com/wp-content/uploads/2011/12/drupal-login.png" medium="image">
			<media:title type="html">drupal-login</media:title>
			<media:thumbnail url="http://blog.whiteinternet.com/wp-content/uploads/2011/12/drupal-login-150x150.png" />
		</media:content>
	</item>
	</channel>
</rss>

<!-- Served from: blog.whiteinternet.com @ 2012-05-21 08:37:39 by W3 Total Cache -->
