
<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	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/"
		>
<channel>
	<title>Comments on: Using TimThumb, WPMU &amp; catch_that_image</title>
	<atom:link href="http://wearefriendlydesign.com/2009/11/05/combining-timthumb-wpmu-and-catch_that_image/feed/" rel="self" type="application/rss+xml" />
	<link>http://wearefriendlydesign.com/2009/11/05/combining-timthumb-wpmu-and-catch_that_image/</link>
	<description></description>
	<lastBuildDate>Thu, 18 Feb 2010 20:21:24 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.4</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: cokke'</title>
		<link>http://wearefriendlydesign.com/2009/11/05/combining-timthumb-wpmu-and-catch_that_image/comment-page-1/#comment-40</link>
		<dc:creator>cokke'</dc:creator>
		<pubDate>Thu, 18 Feb 2010 20:21:24 +0000</pubDate>
		<guid isPermaLink="false">http://wearefriendlydesign.com/?p=134#comment-40</guid>
		<description>thanks for the useful article... i try to do it and it solve my problem when i try to use ephoto from elegant theme on my WPMU....

regards...

- Cokke&#039; -</description>
		<content:encoded><![CDATA[<p>thanks for the useful article&#8230; i try to do it and it solve my problem when i try to use ephoto from elegant theme on my WPMU&#8230;.</p>
<p>regards&#8230;</p>
<p>- Cokke&#8217; -</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: FriendlyDesign</title>
		<link>http://wearefriendlydesign.com/2009/11/05/combining-timthumb-wpmu-and-catch_that_image/comment-page-1/#comment-27</link>
		<dc:creator>FriendlyDesign</dc:creator>
		<pubDate>Tue, 05 Jan 2010 08:52:33 +0000</pubDate>
		<guid isPermaLink="false">http://wearefriendlydesign.com/?p=134#comment-27</guid>
		<description>eDDi, that&#039;s a neat little trick, good work! We&#039;ll update our original post in due course.</description>
		<content:encoded><![CDATA[<p>eDDi, that&#8217;s a neat little trick, good work! We&#8217;ll update our original post in due course.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: eDDi Hughes</title>
		<link>http://wearefriendlydesign.com/2009/11/05/combining-timthumb-wpmu-and-catch_that_image/comment-page-1/#comment-22</link>
		<dc:creator>eDDi Hughes</dc:creator>
		<pubDate>Wed, 23 Dec 2009 23:09:10 +0000</pubDate>
		<guid isPermaLink="false">http://wearefriendlydesign.com/?p=134#comment-22</guid>
		<description>Wait! I miss read it! So I tested it out by replacing the no thumbnail line:

$first_img = &quot;/images/default.jpg&quot;;

With the lines below. Now, if we add another if statement, if attachment &gt; 0 then boom! What do you think of that?! :D

---------------------------

$attachments = get_children(array(&#039;post_parent&#039; =&gt; get_the_ID(), &#039;post_type&#039; =&gt; &#039;attachment&#039;, &#039;post_mime_type&#039; =&gt; &#039;image&#039;, &#039;orderby&#039; =&gt; &#039;menu_order&#039;));

if ( ! is_array($attachments) ) continue;
	$count = count($attachments);
	$first_attachment = array_shift($attachments);
	
	                //We&#039;re on WPMU
                $theImageSrc = wp_get_attachment_url($first_attachment-&gt;ID);
                $imageParts = explode(&#039;/files/&#039;, $theImageSrc);
                    
                if (isset($imageParts[1]))
                {
                    $first_img = &#039;/blogs.dir/&#039; . $blog_id . &#039;/files/&#039; . $imageParts[1];
                }

---------------------------</description>
		<content:encoded><![CDATA[<p>Wait! I miss read it! So I tested it out by replacing the no thumbnail line:</p>
<p>$first_img = &#8220;/images/default.jpg&#8221;;</p>
<p>With the lines below. Now, if we add another if statement, if attachment &gt; 0 then boom! What do you think of that?! :D</p>
<p>&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;</p>
<p>$attachments = get_children(array(&#8217;post_parent&#8217; =&gt; get_the_ID(), &#8216;post_type&#8217; =&gt; &#8216;attachment&#8217;, &#8216;post_mime_type&#8217; =&gt; &#8216;image&#8217;, &#8216;orderby&#8217; =&gt; &#8216;menu_order&#8217;));</p>
<p>if ( ! is_array($attachments) ) continue;<br />
	$count = count($attachments);<br />
	$first_attachment = array_shift($attachments);</p>
<p>	                //We&#8217;re on WPMU<br />
                $theImageSrc = wp_get_attachment_url($first_attachment-&gt;ID);<br />
                $imageParts = explode(&#8217;/files/&#8217;, $theImageSrc);</p>
<p>                if (isset($imageParts[1]))<br />
                {<br />
                    $first_img = &#8216;/blogs.dir/&#8217; . $blog_id . &#8216;/files/&#8217; . $imageParts[1];<br />
                }</p>
<p>&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: eDDi Hughes</title>
		<link>http://wearefriendlydesign.com/2009/11/05/combining-timthumb-wpmu-and-catch_that_image/comment-page-1/#comment-21</link>
		<dc:creator>eDDi Hughes</dc:creator>
		<pubDate>Wed, 23 Dec 2009 22:32:54 +0000</pubDate>
		<guid isPermaLink="false">http://wearefriendlydesign.com/?p=134#comment-21</guid>
		<description>I had an idea to call out the first image, so I tested it replacing the default.gif part with:

---------------------------------

$attachments = get_children(array(&#039;post_parent&#039; =&gt; get_the_ID(), &#039;post_type&#039; =&gt; &#039;attachment&#039;, &#039;post_mime_type&#039; =&gt; &#039;image&#039;, &#039;orderby&#039; =&gt; &#039;menu_order&#039;));

if ( ! is_array($attachments) ) continue;
	$count = count($attachments);
	$first_attachment = array_shift($attachments);

echo wp_get_attachment_url($first_attachment-&gt;ID);

---------------------------------

How would we write it so that wp_get_attachment_url($first_attachment-&gt;ID); returns the $first_img = &#039;/blogs.dir/&#039; . $blog_id . &#039;/files/&#039; . $imageParts[1]; properly???</description>
		<content:encoded><![CDATA[<p>I had an idea to call out the first image, so I tested it replacing the default.gif part with:</p>
<p>&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;</p>
<p>$attachments = get_children(array(&#8217;post_parent&#8217; =&gt; get_the_ID(), &#8216;post_type&#8217; =&gt; &#8216;attachment&#8217;, &#8216;post_mime_type&#8217; =&gt; &#8216;image&#8217;, &#8216;orderby&#8217; =&gt; &#8216;menu_order&#8217;));</p>
<p>if ( ! is_array($attachments) ) continue;<br />
	$count = count($attachments);<br />
	$first_attachment = array_shift($attachments);</p>
<p>echo wp_get_attachment_url($first_attachment-&gt;ID);</p>
<p>&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;</p>
<p>How would we write it so that wp_get_attachment_url($first_attachment-&gt;ID); returns the $first_img = &#8216;/blogs.dir/&#8217; . $blog_id . &#8216;/files/&#8217; . $imageParts[1]; properly???</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: FriendlyDesign</title>
		<link>http://wearefriendlydesign.com/2009/11/05/combining-timthumb-wpmu-and-catch_that_image/comment-page-1/#comment-20</link>
		<dc:creator>FriendlyDesign</dc:creator>
		<pubDate>Tue, 22 Dec 2009 09:01:37 +0000</pubDate>
		<guid isPermaLink="false">http://wearefriendlydesign.com/?p=134#comment-20</guid>
		<description>Hi Eddi, glad this worked for you. You&#039;re right about this being potentially cumbersome if you start getting into scores or hundreds of blogs. However, TimThumb does actually cache the images (hence the folder) so this will save some server resources. We have it running on a setup which has about 120 blogs and generates about 10,000 unique visitors on a daily basis and (albeit with a fairly poky server) never had a hiccup. Let us know how you get on!  Now, about that beer.... :)</description>
		<content:encoded><![CDATA[<p>Hi Eddi, glad this worked for you. You&#8217;re right about this being potentially cumbersome if you start getting into scores or hundreds of blogs. However, TimThumb does actually cache the images (hence the folder) so this will save some server resources. We have it running on a setup which has about 120 blogs and generates about 10,000 unique visitors on a daily basis and (albeit with a fairly poky server) never had a hiccup. Let us know how you get on!  Now, about that beer&#8230;. :)</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: eDDi Hughes</title>
		<link>http://wearefriendlydesign.com/2009/11/05/combining-timthumb-wpmu-and-catch_that_image/comment-page-1/#comment-19</link>
		<dc:creator>eDDi Hughes</dc:creator>
		<pubDate>Tue, 22 Dec 2009 01:18:58 +0000</pubDate>
		<guid isPermaLink="false">http://wearefriendlydesign.com/?p=134#comment-19</guid>
		<description>Sir,

I feel that I owe you a pint of the best beer in your region. This worked flawless with one draw back, the files timthumb.php was generating weren&#039;t being written to the cache directory.

I chmod the directory to 777 and it worked. The downside: with WPMU this could be cumbersome if you have multiple themes / users...

Any suggestions?</description>
		<content:encoded><![CDATA[<p>Sir,</p>
<p>I feel that I owe you a pint of the best beer in your region. This worked flawless with one draw back, the files timthumb.php was generating weren&#8217;t being written to the cache directory.</p>
<p>I chmod the directory to 777 and it worked. The downside: with WPMU this could be cumbersome if you have multiple themes / users&#8230;</p>
<p>Any suggestions?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Chad Hill</title>
		<link>http://wearefriendlydesign.com/2009/11/05/combining-timthumb-wpmu-and-catch_that_image/comment-page-1/#comment-17</link>
		<dc:creator>Chad Hill</dc:creator>
		<pubDate>Fri, 04 Dec 2009 00:53:31 +0000</pubDate>
		<guid isPermaLink="false">http://wearefriendlydesign.com/?p=134#comment-17</guid>
		<description>Thanks...you saved my life</description>
		<content:encoded><![CDATA[<p>Thanks&#8230;you saved my life</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: FriendlyDesign</title>
		<link>http://wearefriendlydesign.com/2009/11/05/combining-timthumb-wpmu-and-catch_that_image/comment-page-1/#comment-12</link>
		<dc:creator>FriendlyDesign</dc:creator>
		<pubDate>Fri, 06 Nov 2009 13:52:00 +0000</pubDate>
		<guid isPermaLink="false">http://wearefriendlydesign.com/?p=134#comment-12</guid>
		<description>Our pleasure! Thanks for the comments and good luck over the weekend. Give us a shout if you need a helping hand.</description>
		<content:encoded><![CDATA[<p>Our pleasure! Thanks for the comments and good luck over the weekend. Give us a shout if you need a helping hand.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: James</title>
		<link>http://wearefriendlydesign.com/2009/11/05/combining-timthumb-wpmu-and-catch_that_image/comment-page-1/#comment-11</link>
		<dc:creator>James</dc:creator>
		<pubDate>Fri, 06 Nov 2009 13:47:11 +0000</pubDate>
		<guid isPermaLink="false">http://wearefriendlydesign.com/?p=134#comment-11</guid>
		<description>Brilliant explanation.  Thanks for taking the time to go step by step.  I&#039;m gonna take a crack at implementing this over the weekend.
Thanks again!
-james</description>
		<content:encoded><![CDATA[<p>Brilliant explanation.  Thanks for taking the time to go step by step.  I&#8217;m gonna take a crack at implementing this over the weekend.<br />
Thanks again!<br />
-james</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: mbcx9rvt</title>
		<link>http://wearefriendlydesign.com/2009/11/05/combining-timthumb-wpmu-and-catch_that_image/comment-page-1/#comment-7</link>
		<dc:creator>mbcx9rvt</dc:creator>
		<pubDate>Fri, 06 Nov 2009 08:49:55 +0000</pubDate>
		<guid isPermaLink="false">http://wearefriendlydesign.com/?p=134#comment-7</guid>
		<description>Hi James, don&#039;t worry about being new to this - this sort of stuff isn&#039;t as trivial as it first seems. You need to add that larger chunk of code into your functions.php file. You need to make sure you _replace_ the existing catch_that_image function with that. Then, in your theme files - so on index.php, home.php, single.php or wherever you want to have control over the size of the image, then you put the first line of code that we posted. Hopefully that makes sense. If not, send us an e-mail and we&#039;ll walk you through it.</description>
		<content:encoded><![CDATA[<p>Hi James, don&#8217;t worry about being new to this &#8211; this sort of stuff isn&#8217;t as trivial as it first seems. You need to add that larger chunk of code into your functions.php file. You need to make sure you _replace_ the existing catch_that_image function with that. Then, in your theme files &#8211; so on index.php, home.php, single.php or wherever you want to have control over the size of the image, then you put the first line of code that we posted. Hopefully that makes sense. If not, send us an e-mail and we&#8217;ll walk you through it.</p>
]]></content:encoded>
	</item>
</channel>
</rss>
