<?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 with WordPress MU</title>
	<atom:link href="http://www.htmlcenter.com/blog/using-timthumb-with-wordpress-mu/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.htmlcenter.com/blog/using-timthumb-with-wordpress-mu/</link>
	<description>Web Development Help and Tutorials</description>
	<lastBuildDate>Sun, 05 Feb 2012 17:25:31 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=</generator>
	<item>
		<title>By: Andrew Carter</title>
		<link>http://www.htmlcenter.com/blog/using-timthumb-with-wordpress-mu/#comment-14903</link>
		<dc:creator>Andrew Carter</dc:creator>
		<pubDate>Fri, 17 Sep 2010 14:56:30 +0000</pubDate>
		<guid isPermaLink="false">http://www.htmlcenter.com/?p=1274#comment-14903</guid>
		<description>Ha, wish I would have found this yesterday! I had a very similar issue when trying to display media uploaded from one MU site on a different MU site. I came up with a slightly different solution ( http://andrewroycarter.com/wordpress-2/using-timthumb-on-wordpress-multi-user/ ) but I like yours a lot! Also, timthumb rules ^_^</description>
		<content:encoded><![CDATA[<p>Ha, wish I would have found this yesterday! I had a very similar issue when trying to display media uploaded from one MU site on a different MU site. I came up with a slightly different solution ( <a href="http://andrewroycarter.com/wordpress-2/using-timthumb-on-wordpress-multi-user/" rel="nofollow">http://andrewroycarter.com/wordpress-2/using-timthumb-on-wordpress-multi-user/</a> ) but I like yours a lot! Also, timthumb rules ^_^</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Grant</title>
		<link>http://www.htmlcenter.com/blog/using-timthumb-with-wordpress-mu/#comment-13609</link>
		<dc:creator>Grant</dc:creator>
		<pubDate>Fri, 16 Jul 2010 02:09:32 +0000</pubDate>
		<guid isPermaLink="false">http://www.htmlcenter.com/?p=1274#comment-13609</guid>
		<description>Hey,

I am having a similar kind of problem.  I am trying to display this though on the homepage of my WPMU install using timthumb.php, which I have installed my homepage theme directory.  I am putting all the code in the functions.php file, which I think may be causing the problem.  Here is my code, any help would be great:

function get_recent_blogposts_featured_nfl($blog_id,$show){
	wp_reset_query();
	switch_to_blog($blog_id);
	global $post;?&gt;
	have_posts()) : $my_query-&gt;the_post();
	    $do_not_duplicate = $post-&gt;ID;  ?&gt;
        &lt;img src=&quot;/tools/timthumb.php?src=ID, &quot;thumb&quot;, $single = true); ?&gt;&amp;h=150&amp;w=350&amp;zc=1&quot;  /&gt;&lt;a href=&quot;&quot; rel=&quot;bookmark&quot;&gt;&lt;/a&gt;
        
	
	&lt;?php restore_current_blog();
}

Thanks,
Grant</description>
		<content:encoded><![CDATA[<p>Hey,</p>
<p>I am having a similar kind of problem.  I am trying to display this though on the homepage of my WPMU install using timthumb.php, which I have installed my homepage theme directory.  I am putting all the code in the functions.php file, which I think may be causing the problem.  Here is my code, any help would be great:</p>
<p>function get_recent_blogposts_featured_nfl($blog_id,$show){<br />
	wp_reset_query();<br />
	switch_to_blog($blog_id);<br />
	global $post;?&gt;<br />
	have_posts()) : $my_query-&gt;the_post();<br />
	    $do_not_duplicate = $post-&gt;ID;  ?&gt;<br />
        &lt;img src=&quot;/tools/timthumb.php?src=ID, &#8220;thumb&#8221;, $single = true); ?&gt;&amp;h=150&amp;w=350&amp;zc=1&#8243;  /&gt;&lt;a href=&quot;&#8221; rel=&#8221;bookmark&#8221;&gt;</p>
<p>	&lt;?php restore_current_blog();<br />
}</p>
<p>Thanks,<br />
Grant</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Eddi Hughes</title>
		<link>http://www.htmlcenter.com/blog/using-timthumb-with-wordpress-mu/#comment-10544</link>
		<dc:creator>Eddi Hughes</dc:creator>
		<pubDate>Fri, 11 Dec 2009 22:55:51 +0000</pubDate>
		<guid isPermaLink="false">http://www.htmlcenter.com/?p=1274#comment-10544</guid>
		<description>I briefly spoke with Andrea_R, she mentioned Get The Image plugin:
http://justintadlock.com/archives/2008/05/27/get-the-image-wordpress-plugin

I am reading through the documentation right now, figuring out how this may work. Idea&#039;s off the top of your head?</description>
		<content:encoded><![CDATA[<p>I briefly spoke with Andrea_R, she mentioned Get The Image plugin:<br />
<a href="http://justintadlock.com/archives/2008/05/27/get-the-image-wordpress-plugin" rel="nofollow">http://justintadlock.com/archives/2008/05/27/get-the-image-wordpress-plugin</a></p>
<p>I am reading through the documentation right now, figuring out how this may work. Idea&#8217;s off the top of your head?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Curtiss</title>
		<link>http://www.htmlcenter.com/blog/using-timthumb-with-wordpress-mu/#comment-10543</link>
		<dc:creator>Curtiss</dc:creator>
		<pubDate>Fri, 11 Dec 2009 22:09:27 +0000</pubDate>
		<guid isPermaLink="false">http://www.htmlcenter.com/?p=1274#comment-10543</guid>
		<description>Eddi - I&#039;m not sure about rewriting that function, but I do know that I&#039;ve seen a plugin or function that supposedly automatically detects images within posts. It could probably be used to eliminate the custom field and just use whatever the first image is that&#039;s included in the post. I&#039;ll see if I can find it, test it and write a post about it (making sure that it works with WPMU, of course).</description>
		<content:encoded><![CDATA[<p>Eddi &#8211; I&#8217;m not sure about rewriting that function, but I do know that I&#8217;ve seen a plugin or function that supposedly automatically detects images within posts. It could probably be used to eliminate the custom field and just use whatever the first image is that&#8217;s included in the post. I&#8217;ll see if I can find it, test it and write a post about it (making sure that it works with WPMU, of course).</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Eddi Hughes</title>
		<link>http://www.htmlcenter.com/blog/using-timthumb-with-wordpress-mu/#comment-10541</link>
		<dc:creator>Eddi Hughes</dc:creator>
		<pubDate>Fri, 11 Dec 2009 20:17:57 +0000</pubDate>
		<guid isPermaLink="false">http://www.htmlcenter.com/?p=1274#comment-10541</guid>
		<description>Figured it out, needed to set proper permissions to tools/

I was wondering if we could rewrite this function so we can eliminate the custom field

function sp_get_image($num = 0) {
	global $post;
	$children = get_children(array(
		&#039;post_parent&#039; =&gt; $post-&gt;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;,
		&#039;order&#039; =&gt; &#039;ASC&#039;
	));

	$count = 0;
    foreach ((array)$children as $key =&gt; $value) {
        $images[$count] = $value;
        $count++;
    }
	if(isset($images[$num]))
		return wp_make_link_relative(wp_get_attachment_url($images[$num]-&gt;ID));
	else
		return false;
}</description>
		<content:encoded><![CDATA[<p>Figured it out, needed to set proper permissions to tools/</p>
<p>I was wondering if we could rewrite this function so we can eliminate the custom field</p>
<p>function sp_get_image($num = 0) {<br />
	global $post;<br />
	$children = get_children(array(<br />
		&#8216;post_parent&#8217; =&gt; $post-&gt;ID,<br />
		&#8216;post_type&#8217; =&gt; &#8216;attachment&#8217;,<br />
		&#8216;post_mime_type&#8217; =&gt; &#8216;image&#8217;,<br />
		&#8216;orderby&#8217; =&gt; &#8216;menu_order&#8217;,<br />
		&#8216;order&#8217; =&gt; &#8216;ASC&#8217;<br />
	));</p>
<p>	$count = 0;<br />
    foreach ((array)$children as $key =&gt; $value) {<br />
        $images[$count] = $value;<br />
        $count++;<br />
    }<br />
	if(isset($images[$num]))<br />
		return wp_make_link_relative(wp_get_attachment_url($images[$num]-&gt;ID));<br />
	else<br />
		return false;<br />
}</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Eddi Hughes</title>
		<link>http://www.htmlcenter.com/blog/using-timthumb-with-wordpress-mu/#comment-10539</link>
		<dc:creator>Eddi Hughes</dc:creator>
		<pubDate>Fri, 11 Dec 2009 19:21:12 +0000</pubDate>
		<guid isPermaLink="false">http://www.htmlcenter.com/?p=1274#comment-10539</guid>
		<description>First one echo&#039;s /
Second echo&#039;s http://domain.com/files
Third: wp-content/blogs.dir/1/files
Last one returns the post_meta!

BUT, I think I figured out what is stopping us. If I visit the URL that it outputs, it gives me the following error:

=========================================

Warning: mkdir(./cache) [function.mkdir]: Permission denied in /home/socal/public_html/wp-content/themes/agent_10/tools/timthumb.php on line 454

Warning: chmod() [function.chmod]: No such file or directory in /home/socal/public_html/wp-content/themes/agent_10/tools/timthumb.php on line 455

Warning: touch() [function.touch]: Unable to create file ./cache/26a900be320d8619eb23d610e2b6dfba.png because No such file or directory in /home/socal/public_html/wp-content/themes/agent_10/tools/timthumb.php on line 241

Warning: Cannot modify header information - headers already sent by (output started at /home/socal/public_html/wp-content/themes/agent_10/tools/timthumb.php:454) in /home/socal/public_html/wp-content/themes/agent_10/tools/timthumb.php on line 251

=========================================

Visit the following URL to view the error. At this point I am not sure why it&#039;s returning permission denied.

http://searchonsocal.com/wp-content/themes/agent_10/tools/timthumb.php?src=/wp-content/blogs.dir/1/files/2009/09/wordpress_normal.jpg&amp;h=150&amp;w=200&amp;zc=1</description>
		<content:encoded><![CDATA[<p>First one echo&#8217;s /<br />
Second echo&#8217;s <a href="http://domain.com/files" rel="nofollow">http://domain.com/files</a><br />
Third: wp-content/blogs.dir/1/files<br />
Last one returns the post_meta!</p>
<p>BUT, I think I figured out what is stopping us. If I visit the URL that it outputs, it gives me the following error:</p>
<p>=========================================</p>
<p>Warning: mkdir(./cache) [function.mkdir]: Permission denied in /home/socal/public_html/wp-content/themes/agent_10/tools/timthumb.php on line 454</p>
<p>Warning: chmod() [function.chmod]: No such file or directory in /home/socal/public_html/wp-content/themes/agent_10/tools/timthumb.php on line 455</p>
<p>Warning: touch() [function.touch]: Unable to create file ./cache/26a900be320d8619eb23d610e2b6dfba.png because No such file or directory in /home/socal/public_html/wp-content/themes/agent_10/tools/timthumb.php on line 241</p>
<p>Warning: Cannot modify header information &#8211; headers already sent by (output started at /home/socal/public_html/wp-content/themes/agent_10/tools/timthumb.php:454) in /home/socal/public_html/wp-content/themes/agent_10/tools/timthumb.php on line 251</p>
<p>=========================================</p>
<p>Visit the following URL to view the error. At this point I am not sure why it&#8217;s returning permission denied.</p>
<p><a href="http://searchonsocal.com/wp-content/themes/agent_10/tools/timthumb.php?src=/wp-content/blogs.dir/1/files/2009/09/wordpress_normal.jpg&#038;h=150&#038;w=200&#038;zc=1" rel="nofollow">http://searchonsocal.com/wp-content/themes/agent_10/tools/timthumb.php?src=/wp-content/blogs.dir/1/files/2009/09/wordpress_normal.jpg&#038;h=150&#038;w=200&#038;zc=1</a></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Curtiss</title>
		<link>http://www.htmlcenter.com/blog/using-timthumb-with-wordpress-mu/#comment-10529</link>
		<dc:creator>Curtiss</dc:creator>
		<pubDate>Fri, 11 Dec 2009 03:01:54 +0000</pubDate>
		<guid isPermaLink="false">http://www.htmlcenter.com/?p=1274#comment-10529</guid>
		<description>Strange. Try testing the output of your script periodically by printing the output and then killing the script.

For instance, try using the following code inside the loop in your template:
&lt;code&gt;&lt;?php $curSite = get_current_site(1); echo $curSite-&gt;path; die(); ?&gt;&lt;/code&gt;
If that prints something, then try:
&lt;code&gt;&lt;?php echo get_blog_option($blog_id,&#039;fileupload_url&#039;); die(); ?&gt;&lt;/code&gt;
If that prints something, try:
&lt;code&gt;&lt;?php echo get_blog_option($blog_id,&#039;upload_path&#039;); ?&gt;&lt;/code&gt;
Finally, if all of those have printed some output, try:
&lt;code&gt;&lt;?php echo get_post_meta($post-&gt;ID, &quot;post-img&quot;, true); ?&gt;&lt;/code&gt;

That will help you diagnose which functions are failing or not returning anything.</description>
		<content:encoded><![CDATA[<p>Strange. Try testing the output of your script periodically by printing the output and then killing the script.</p>
<p>For instance, try using the following code inside the loop in your template:<br />
<code>&lt;?php $curSite = get_current_site(1); echo $curSite-&gt;path; die(); ?&gt;</code><br />
If that prints something, then try:<br />
<code>&lt;?php echo get_blog_option($blog_id,'fileupload_url'); die(); ?&gt;</code><br />
If that prints something, try:<br />
<code>&lt;?php echo get_blog_option($blog_id,'upload_path'); ?&gt;</code><br />
Finally, if all of those have printed some output, try:<br />
<code>&lt;?php echo get_post_meta($post-&gt;ID, "post-img", true); ?&gt;</code></p>
<p>That will help you diagnose which functions are failing or not returning anything.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Eddi Hughes</title>
		<link>http://www.htmlcenter.com/blog/using-timthumb-with-wordpress-mu/#comment-10527</link>
		<dc:creator>Eddi Hughes</dc:creator>
		<pubDate>Fri, 11 Dec 2009 01:17:07 +0000</pubDate>
		<guid isPermaLink="false">http://www.htmlcenter.com/?p=1274#comment-10527</guid>
		<description>That worked fixed it, but now the upload path doesn&#039;t appear. 

For example,

http://domain.com/wp-content/themes/theme/tools/timthumb.php?src=/&amp;h=150&amp;w=200&amp;zc=1

Any thoughts?</description>
		<content:encoded><![CDATA[<p>That worked fixed it, but now the upload path doesn&#8217;t appear. </p>
<p>For example,</p>
<p><a href="http://domain.com/wp-content/themes/theme/tools/timthumb.php?src=/&#038;h=150&#038;w=200&#038;zc=1" rel="nofollow">http://domain.com/wp-content/themes/theme/tools/timthumb.php?src=/&#038;h=150&#038;w=200&#038;zc=1</a></p>
<p>Any thoughts?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Curtiss</title>
		<link>http://www.htmlcenter.com/blog/using-timthumb-with-wordpress-mu/#comment-10522</link>
		<dc:creator>Curtiss</dc:creator>
		<pubDate>Thu, 10 Dec 2009 11:54:04 +0000</pubDate>
		<guid isPermaLink="false">http://www.htmlcenter.com/?p=1274#comment-10522</guid>
		<description>I&#039;m assuming that the call to TimThumb is on line 20 of your home.php theme file?

Do you happen to know which version of PHP you&#039;re running on your server? It just occurred to me that the way I have this written, it will only work in PHP5.

You could try replacing &lt;code&gt;echo get_current_site(1)-&gt;path;&lt;/code&gt; with &lt;code&gt;$curSite = get_current_site(); echo $curSite-&gt;path;&lt;/code&gt; and see if that makes a difference.

If that still fails, try breaking up the PHP into separate lines (start a new line after each semi-colon in the PHP code or after each opening &lt;code&gt;&lt;?php&lt;/code&gt; tag.</description>
		<content:encoded><![CDATA[<p>I&#8217;m assuming that the call to TimThumb is on line 20 of your home.php theme file?</p>
<p>Do you happen to know which version of PHP you&#8217;re running on your server? It just occurred to me that the way I have this written, it will only work in PHP5.</p>
<p>You could try replacing <code>echo get_current_site(1)-&gt;path;</code> with <code>$curSite = get_current_site(); echo $curSite-&gt;path;</code> and see if that makes a difference.</p>
<p>If that still fails, try breaking up the PHP into separate lines (start a new line after each semi-colon in the PHP code or after each opening <code>&lt;?php</code> tag.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Eddi Hughes</title>
		<link>http://www.htmlcenter.com/blog/using-timthumb-with-wordpress-mu/#comment-10517</link>
		<dc:creator>Eddi Hughes</dc:creator>
		<pubDate>Thu, 10 Dec 2009 04:59:04 +0000</pubDate>
		<guid isPermaLink="false">http://www.htmlcenter.com/?p=1274#comment-10517</guid>
		<description>Error I received is

Parse error: syntax error, unexpected T_OBJECT_OPERATOR, expecting &#039;,&#039; or &#039;;&#039; in /home/socal/public_html/wp-content/themes/agent_10/home.php on line 20</description>
		<content:encoded><![CDATA[<p>Error I received is</p>
<p>Parse error: syntax error, unexpected T_OBJECT_OPERATOR, expecting &#8216;,&#8217; or &#8216;;&#8217; in /home/socal/public_html/wp-content/themes/agent_10/home.php on line 20</p>
]]></content:encoded>
	</item>
</channel>
</rss>

