<?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>bensangeorge.com &#187; drupal</title>
	<atom:link href="http://bensangeorge.com/tag/drupal/feed/" rel="self" type="application/rss+xml" />
	<link>http://bensangeorge.com</link>
	<description></description>
	<lastBuildDate>Sat, 27 Mar 2010 16:19:06 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>skinet.com</title>
		<link>http://bensangeorge.com/2009/09/skinet-com/</link>
		<comments>http://bensangeorge.com/2009/09/skinet-com/#comments</comments>
		<pubDate>Sat, 19 Sep 2009 20:45:44 +0000</pubDate>
		<dc:creator>bensan</dc:creator>
				<category><![CDATA[portfolio]]></category>
		<category><![CDATA[drupal]]></category>

		<guid isPermaLink="false">http://bensangeorge.com/?p=603</guid>
		<description><![CDATA[A network of sites for the mountain sport enthusiast. skinet.com offers high-quality content for everyone who is in love with snow. Both skimag.com and skiingmag.com were finished within two months and was built in Drupal.]]></description>
			<content:encoded><![CDATA[<div class="left"><a href="http://www.skinet.com"><img class="alignright size-medium wp-image-604" title="skiingmag.com" src="http://bensangeorge.com/wp-content/uploads/2009/09/Skiing-Ski-Gear-Ski-Resorts-Skiing-Magazine-326x183.jpg" alt="skiingmag.com" width="326" height="183" /></a></div>
<div class="right">
<p>A network of sites for the mountain sport enthusiast. skinet.com offers high-quality content for everyone who is in love with snow. Both skimag.com and skiingmag.com were finished within two months and was built in Drupal.</p>
</div>
<div class="clear"></div>
]]></content:encoded>
			<wfw:commentRss>http://bensangeorge.com/2009/09/skinet-com/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Drupal bits: Migrating remote files in Drupal</title>
		<link>http://bensangeorge.com/2009/06/drupal-bits-migrating-remote-files-in-drupal/</link>
		<comments>http://bensangeorge.com/2009/06/drupal-bits-migrating-remote-files-in-drupal/#comments</comments>
		<pubDate>Sat, 27 Jun 2009 22:45:14 +0000</pubDate>
		<dc:creator>bensan</dc:creator>
				<category><![CDATA[drupal]]></category>
		<category><![CDATA[my thoughts on the matter]]></category>
		<category><![CDATA[software]]></category>
		<category><![CDATA[web development]]></category>
		<category><![CDATA[drupal6]]></category>
		<category><![CDATA[filesystem]]></category>
		<category><![CDATA[importing files]]></category>

		<guid isPermaLink="false">http://bensangeorge.com/?p=530</guid>
		<description><![CDATA[Recently I had to import a set of remote image files from another server but was not absolutely clear on how to get this done the Drupal way. I found the really came up with a solution of my own with drupal_http_request() which accepts an incoming URL and then executes a HTTP client request. The [...]]]></description>
			<content:encoded><![CDATA[<p>Recently I had to import a set of remote image files from another server but was not absolutely clear on how to get this done the Drupal way. I found the really came up with a solution of my own with drupal_http_request() which accepts an incoming URL and then executes a HTTP client request. The function returns the data and the response code.</p>
<p>[code lang="php"]$binary_image = drupal_http_request($url);[/code]</p>
<p>After checking the response code to make sure it was successful, use the Drupal function file_save_data() to physically store the file into whatever directory you want to store the image file in.</p>
<p>[code lang="php"]<br />
if ($binary_image-&gt;code == 200) {<br />
$filepath = file_save_data($binary_image-&gt;data, $save_to, FILE_EXISTS_RENAME);<br />
if ($filepath !== 0) {<br />
// attach other relevant information as well<br />
$fileinfo['filepath'] = $filepath;<br />
$fileinfo['filesize'] = filesize($save_to);<br />
$fileinfo = array_merge($fileinfo, getimagesize($save_to));<br />
return $fileinfo;<br />
}<br />
[/code]</p>
<p>The physical file should be saved but just because you&#8217;ve saved the file in the directory does not mean that Drupal is aware of the file. In order for that to happen, you also need the mime type, the file size, and the filepath and manually insert into a node. Once you&#8217;ve got those, you can create a node and insert those values along with the rest into it.</p>
<p>[code lang="php"]</p>
<p>// create a node<br />
// add the file's information into the node<br />
$node['field_thumbnail'] = array(<br />
array(<br />
'list' =&gt; 1,<br />
'data' =&gt; array(<br />
'alt' =&gt; '',<br />
'title' =&gt; '',<br />
),<br />
'fid' =&gt; $fid,<br />
'uid' =&gt; $user-&gt;uid,<br />
'filename' =&gt; $resource['logo_file'],<br />
'filepath' =&gt; 'files/_thumbnails/'.$resource['logo_file'],<br />
'filemime' =&gt; $info['mime'],<br />
'filesize' =&gt; $info['filesize'],<br />
'status' =&gt; 1,<br />
'timestamp' =&gt; time(),<br />
'alt' =&gt; '',<br />
'title' =&gt; '',<br />
'upload' =&gt; '',<br />
),<br />
[/code]</p>
<p>This will make Drupal recognize your files. Everything should be gravy. Hope this works for you. <strong></strong></p>
<p><strong>By the way, for all of you already on Drupal 7(lucky you), file_save_data() saves the data <span style="text-decoration: underline;">and</span> automatically updates the database with the file information.</strong></p>
]]></content:encoded>
			<wfw:commentRss>http://bensangeorge.com/2009/06/drupal-bits-migrating-remote-files-in-drupal/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Drupal Bits: Views 2 Relationships</title>
		<link>http://bensangeorge.com/2009/06/drupal-bits-views-2-relationships/</link>
		<comments>http://bensangeorge.com/2009/06/drupal-bits-views-2-relationships/#comments</comments>
		<pubDate>Tue, 16 Jun 2009 17:56:18 +0000</pubDate>
		<dc:creator>bensan</dc:creator>
				<category><![CDATA[bensangeorge]]></category>
		<category><![CDATA[drupal]]></category>
		<category><![CDATA[learning drupal]]></category>

		<guid isPermaLink="false">http://bensangeorge.com/2009/06/drupal-bits-views-2-relationships/</guid>
		<description><![CDATA[In around 8 minutes, I understood the concept of Views 2 Relationships by watching this video. Relationships helps you connect relate (duh) nodes to other nodes. In short, it is probably most helpful to think about this as a SQL join. Check out this video from drewish.com for the screencast: http://drewish.com/node/127]]></description>
			<content:encoded><![CDATA[<p>In around 8 minutes, I understood the concept of Views 2 Relationships by watching this video. Relationships helps you connect relate (duh) nodes to other nodes. In short, it is probably most helpful to think about this as a SQL join.</p>
<p>Check out this video from drewish.com for the screencast:</p>
<p><a title="Views 2 Relationships" href="http://drewish.com/node/127" target="_blank">http://drewish.com/node/127</a></p>
]]></content:encoded>
			<wfw:commentRss>http://bensangeorge.com/2009/06/drupal-bits-views-2-relationships/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>The future of Drupal (as envisioned by Lullabot!)</title>
		<link>http://bensangeorge.com/2009/04/the-future-of-drupal-as-envisioned-by-lullabot/</link>
		<comments>http://bensangeorge.com/2009/04/the-future-of-drupal-as-envisioned-by-lullabot/#comments</comments>
		<pubDate>Tue, 14 Apr 2009 01:36:35 +0000</pubDate>
		<dc:creator>bensan</dc:creator>
				<category><![CDATA[software]]></category>
		<category><![CDATA[drupal]]></category>

		<guid isPermaLink="false">http://bensangeorge.com/?p=497</guid>
		<description><![CDATA[Fascinating glimpse into an alternate view of the enriched UI experienced spearheaded by Lullabot. This is a separate project than the &#8220;offical&#8221; Drupal 7UX project. I am excited at the prospect of Drupal having a very friendly user experience. Enjoy! project buzzr]]></description>
			<content:encoded><![CDATA[<p>Fascinating glimpse into an alternate view of the enriched UI experienced spearheaded by Lullabot. This is a separate project than the &#8220;offical&#8221; Drupal 7UX project. I am excited at the prospect of Drupal having a very friendly user experience. Enjoy!</p>
<p><a title="Lullabot Buzzr" href="http://www.lullabot.com/articles/buzzr-demo-video-making-drupal-usable" target="_blank">project buzzr</a></p>
]]></content:encoded>
			<wfw:commentRss>http://bensangeorge.com/2009/04/the-future-of-drupal-as-envisioned-by-lullabot/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
