<?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"
	>
<channel>
	<title>Comments on: Photopress 0.8.5</title>
	<atom:link href="http://familypress.net/archives/photopress-085/feed/" rel="self" type="application/rss+xml" />
	<link>http://familypress.net/archives/photopress-085/</link>
	<description>tools for family weblogs</description>
	<pubDate>Sun, 07 Sep 2008 20:25:47 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.6.1</generator>
		<item>
		<title>By: Roge</title>
		<link>http://familypress.net/archives/photopress-085/#comment-197</link>
		<dc:creator>Roge</dc:creator>
		<pubDate>Tue, 10 Jan 2006 09:10:25 +0000</pubDate>
		<guid isPermaLink="false">http://familypress.net/archives/photopress-085/#comment-197</guid>
		<description>nekkarcity: already fixed But I'm really sure "File Uploader" on/off should be optional. Many users might be confused.</description>
		<content:encoded><![CDATA[<p>nekkarcity: already fixed But I&#8217;m really sure &#8220;File Uploader&#8221; on/off should be optional. Many users might be confused.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: nekkarcity</title>
		<link>http://familypress.net/archives/photopress-085/#comment-196</link>
		<dc:creator>nekkarcity</dc:creator>
		<pubDate>Mon, 09 Jan 2006 23:29:14 +0000</pubDate>
		<guid isPermaLink="false">http://familypress.net/archives/photopress-085/#comment-196</guid>
		<description>@Roge
WP 2 changed the button API a little bit. Based on Owen Winkler button snap class itâ€™s easy to fix that. 
 
@Jedi Rory
tinyMCE object reference not found from popup

On the popup.php

	if (get_user_option('rich_editing') == 'true') {
		include_once(ABSPATH . 'wp-includes/js/tinymce/tiny_mce_popup.js');
	}

The Problem: the if â€“ itâ€™s better to add an extra option (variable) for the upload click.</description>
		<content:encoded><![CDATA[<p>@Roge<br />
WP 2 changed the button API a little bit. Based on Owen Winkler button snap class itâ€™s easy to fix that. </p>
<p>@Jedi Rory<br />
tinyMCE object reference not found from popup</p>
<p>On the popup.php</p>
<p>	if (get_user_option(&#8217;rich_editing&#8217;) == &#8216;true&#8217;) {<br />
		include_once(ABSPATH . &#8216;wp-includes/js/tinymce/tiny_mce_popup.js&#8217;);<br />
	}</p>
<p>The Problem: the if â€“ itâ€™s better to add an extra option (variable) for the upload click.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Roge</title>
		<link>http://familypress.net/archives/photopress-085/#comment-195</link>
		<dc:creator>Roge</dc:creator>
		<pubDate>Mon, 09 Jan 2006 20:06:50 +0000</pubDate>
		<guid isPermaLink="false">http://familypress.net/archives/photopress-085/#comment-195</guid>
		<description>Just found. Photopress disables standart file upload panel in WP 2.0 Write. Why?</description>
		<content:encoded><![CDATA[<p>Just found. Photopress disables standart file upload panel in WP 2.0 Write. Why?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Roge</title>
		<link>http://familypress.net/archives/photopress-085/#comment-194</link>
		<dc:creator>Roge</dc:creator>
		<pubDate>Sun, 08 Jan 2006 23:20:22 +0000</pubDate>
		<guid isPermaLink="false">http://familypress.net/archives/photopress-085/#comment-194</guid>
		<description>Another useful addon for edit image page - link to EDIT posts which use the image. Addon for pp_album_management():

		echo '' . __('Posts with this image:','photopress') . '
			';
		while ( have_posts() ) : the_post();
		echo '&lt;a href="';
		the_permalink();
		echo '"&gt;';
		the_title();
		echo '&lt;/a&gt; &#124; ';
		edit_post_link();
		echo '';
		endwhile;
		echo '';</description>
		<content:encoded><![CDATA[<p>Another useful addon for edit image page - link to EDIT posts which use the image. Addon for pp_album_management():</p>
<p>		echo &#8221; . __(&#8217;Posts with this image:&#8217;,'photopress&#8217;) . &#8216;<br />
			&#8216;;<br />
		while ( have_posts() ) : the_post();<br />
		echo &#8216;<a href="';<br />
		the_permalink();<br />
		echo '">&#8216;;<br />
		the_title();<br />
		echo &#8216;</a> | &#8216;;<br />
		edit_post_link();<br />
		echo &#8221;;<br />
		endwhile;<br />
		echo &#8221;;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Roge</title>
		<link>http://familypress.net/archives/photopress-085/#comment-193</link>
		<dc:creator>Roge</dc:creator>
		<pubDate>Sun, 08 Jan 2006 20:09:03 +0000</pubDate>
		<guid isPermaLink="false">http://familypress.net/archives/photopress-085/#comment-193</guid>
		<description>My fixes: 

pp_mass_resize() function works not with ORIGINAL files but with resized. Actually it will be useful to start work FROM originals. My code is:

--- First I have fix the pp_folder_contents() and add a new parameter $include_originals=true  So the final function is:

function pp_folder_contents($include_originals=true) {
	global $pp_options;
	$allowedtypes = trim(strtolower($pp_options['allowedtypes']));
	$allowedtypes = preg_replace("/ /","&#124;",$allowedtypes);
	$fileglob = '@\.(' . $allowedtypes . ')$@i';
	$handle = opendir($pp_options['photospath']);
	$list_array = array();
	while (false !== ($folder_contents = readdir($handle))) {
		$image_name = substr($folder_contents, strlen($pp_options['thumbprefix']));
		$is_original = strpos($pp_options['origprefix'], $image_name);
		if (($include_originals &#124;&#124; !$is_original) &#38;&#38; (preg_match($fileglob, $folder_contents)) &#38;&#38; (strstr($folder_contents, $pp_options['thumbprefix'])) &#38;&#38; is_file($pp_options['photospath'] . '/' . $image_name)) { // make sure both thumb and regular image are there
			$list_array[] = $image_name;
		}
	}
	@closedir($pp_options['photospath']);
	if (count($list_array) &#62; 1) {
		sort($list_array);
	}
	if (count($list_array) &#62; 0) {
		return $list_array;
	} else {
		return FALSE;
	}
}


There are 2 new strings in fuction:

		$is_original = strpos($pp_options['origprefix'], $image_name);
		if (($include_originals &#124;&#124; !$is_original) &#38;&#38; (preg_match($fileglob, $folder_contents)) &#38;&#38; (strstr($folder_contents, $pp_options['thumbprefix'])) &#38;&#38; is_file($pp_options['photospath'] . '/' . $image_name)) { 


--- Second. pp_mass_resize()  Gets files from folder WITHOUT originals. THEN takes originals and copies them to resized ONLY if resized need to be REresized ( thumbs can be done from resized). And only then resizes the files. It also checks IF originals option is enabled in options. IF not enabled then works as usual. Final:

function pp_mass_resize() {
	global $pp_options;
	$images = pp_folder_contents(false);
	$thumbsdone = 0;
	$imagesdone = 0;
	foreach ((array)$images as $image) {
		$pathtoorig = $pp_options['photospath'] . '/' . $pp_options['origprefix'] . $image;
		$pathtoimage = $pp_options['photospath'] . '/' . $image;
		$pathtothumb = $pp_options['photospath'] . '/' . $pp_options['thumbprefix'] . $image;

		$imginfo = getimagesize($pathtoimage);
		$thumbinfo = getimagesize($pathtothumb);
		
		if ($imginfo &#38;&#38; $thumbinfo) {
			if (($imginfo[0] != $pp_options['maxsize']) &#124;&#124; ($imginfo[1] != $pp_options['maxsize'])) {
					if ($pp_options['originals'] == '1' &#38;&#38; !copy($pathtoorig, $pathtoimage)) { echo "failed to copy $pathtoorig TO $pathtoimage\n";}
			}

			if (($imginfo[0] != $pp_options['maxsize']) &#124;&#124; ($imginfo[1] != $pp_options['maxsize'])) {
				if (pp_resize($pathtoimage, $pp_options['maxsize'], 0, '', 0)) {
					$imagesdone++;
				}
			}
			if (($thumbinfo[0] != $pp_options['thumbsize']) &#124;&#124; ($thumbinfo[1] != $pp_options['thumbsize'])) {
				if (pp_resize($pathtoimage, $pp_options['thumbsize'], $pp_options['thumbsize'], $pp_options['thumbprefix'], 1)) {
					$thumbsdone++;
				}
			}
		}
	}
return array($imagesdone,$thumbsdone);
}</description>
		<content:encoded><![CDATA[<p>My fixes: </p>
<p>pp_mass_resize() function works not with ORIGINAL files but with resized. Actually it will be useful to start work FROM originals. My code is:</p>
<p>&#8212; First I have fix the pp_folder_contents() and add a new parameter $include_originals=true  So the final function is:</p>
<p>function pp_folder_contents($include_originals=true) {<br />
	global $pp_options;<br />
	$allowedtypes = trim(strtolower($pp_options['allowedtypes']));<br />
	$allowedtypes = preg_replace(&#8221;/ /&#8221;,&#8221;|&#8221;,$allowedtypes);<br />
	$fileglob = &#8216;@\.(&#8217; . $allowedtypes . &#8216;)$@i&#8217;;<br />
	$handle = opendir($pp_options['photospath']);<br />
	$list_array = array();<br />
	while (false !== ($folder_contents = readdir($handle))) {<br />
		$image_name = substr($folder_contents, strlen($pp_options['thumbprefix']));<br />
		$is_original = strpos($pp_options['origprefix'], $image_name);<br />
		if (($include_originals || !$is_original) &amp;&amp; (preg_match($fileglob, $folder_contents)) &amp;&amp; (strstr($folder_contents, $pp_options['thumbprefix'])) &amp;&amp; is_file($pp_options['photospath'] . &#8216;/&#8217; . $image_name)) { // make sure both thumb and regular image are there<br />
			$list_array[] = $image_name;<br />
		}<br />
	}<br />
	@closedir($pp_options['photospath']);<br />
	if (count($list_array) &gt; 1) {<br />
		sort($list_array);<br />
	}<br />
	if (count($list_array) &gt; 0) {<br />
		return $list_array;<br />
	} else {<br />
		return FALSE;<br />
	}<br />
}</p>
<p>There are 2 new strings in fuction:</p>
<p>		$is_original = strpos($pp_options['origprefix'], $image_name);<br />
		if (($include_originals || !$is_original) &amp;&amp; (preg_match($fileglob, $folder_contents)) &amp;&amp; (strstr($folder_contents, $pp_options['thumbprefix'])) &amp;&amp; is_file($pp_options['photospath'] . &#8216;/&#8217; . $image_name)) { </p>
<p>&#8212; Second. pp_mass_resize()  Gets files from folder WITHOUT originals. THEN takes originals and copies them to resized ONLY if resized need to be REresized ( thumbs can be done from resized). And only then resizes the files. It also checks IF originals option is enabled in options. IF not enabled then works as usual. Final:</p>
<p>function pp_mass_resize() {<br />
	global $pp_options;<br />
	$images = pp_folder_contents(false);<br />
	$thumbsdone = 0;<br />
	$imagesdone = 0;<br />
	foreach ((array)$images as $image) {<br />
		$pathtoorig = $pp_options['photospath'] . &#8216;/&#8217; . $pp_options['origprefix'] . $image;<br />
		$pathtoimage = $pp_options['photospath'] . &#8216;/&#8217; . $image;<br />
		$pathtothumb = $pp_options['photospath'] . &#8216;/&#8217; . $pp_options['thumbprefix'] . $image;</p>
<p>		$imginfo = getimagesize($pathtoimage);<br />
		$thumbinfo = getimagesize($pathtothumb);</p>
<p>		if ($imginfo &amp;&amp; $thumbinfo) {<br />
			if (($imginfo[0] != $pp_options['maxsize']) || ($imginfo[1] != $pp_options['maxsize'])) {<br />
					if ($pp_options['originals'] == &#8216;1&#8242; &amp;&amp; !copy($pathtoorig, $pathtoimage)) { echo &#8220;failed to copy $pathtoorig TO $pathtoimage\n&#8221;;}<br />
			}</p>
<p>			if (($imginfo[0] != $pp_options['maxsize']) || ($imginfo[1] != $pp_options['maxsize'])) {<br />
				if (pp_resize($pathtoimage, $pp_options['maxsize'], 0, &#8221;, 0)) {<br />
					$imagesdone++;<br />
				}<br />
			}<br />
			if (($thumbinfo[0] != $pp_options['thumbsize']) || ($thumbinfo[1] != $pp_options['thumbsize'])) {<br />
				if (pp_resize($pathtoimage, $pp_options['thumbsize'], $pp_options['thumbsize'], $pp_options['thumbprefix'], 1)) {<br />
					$thumbsdone++;<br />
				}<br />
			}<br />
		}<br />
	}<br />
return array($imagesdone,$thumbsdone);<br />
}</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Roge</title>
		<link>http://familypress.net/archives/photopress-085/#comment-192</link>
		<dc:creator>Roge</dc:creator>
		<pubDate>Sun, 08 Jan 2006 19:16:17 +0000</pubDate>
		<guid isPermaLink="false">http://familypress.net/archives/photopress-085/#comment-192</guid>
		<description>Req:

Update photo file. (Overwrite the old one and take all parameters of old one: name, description etc...)

IF the new file has different name THEN rename it in to the old file name.

I think update functionality should be on photo edit screen + during new file upload (if same name then optional OVERWRITE or RENAME)

BTW. switched to WP 2.0 Everything works fine!</description>
		<content:encoded><![CDATA[<p>Req:</p>
<p>Update photo file. (Overwrite the old one and take all parameters of old one: name, description etc&#8230;)</p>
<p>IF the new file has different name THEN rename it in to the old file name.</p>
<p>I think update functionality should be on photo edit screen + during new file upload (if same name then optional OVERWRITE or RENAME)</p>
<p>BTW. switched to WP 2.0 Everything works fine!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: SHRIKEE</title>
		<link>http://familypress.net/archives/photopress-085/#comment-189</link>
		<dc:creator>SHRIKEE</dc:creator>
		<pubDate>Sun, 08 Jan 2006 05:46:06 +0000</pubDate>
		<guid isPermaLink="false">http://familypress.net/archives/photopress-085/#comment-189</guid>
		<description>Hope everything works now for you Britta.

I noticed Isaac does quite a big deal of personal support :) A vert nice touch if you ask  me! Not many do that...</description>
		<content:encoded><![CDATA[<p>Hope everything works now for you Britta.</p>
<p>I noticed Isaac does quite a big deal of personal support <img src='http://familypress.net/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> A vert nice touch if you ask  me! Not many do that&#8230;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Britta</title>
		<link>http://familypress.net/archives/photopress-085/#comment-188</link>
		<dc:creator>Britta</dc:creator>
		<pubDate>Sat, 07 Jan 2006 21:38:13 +0000</pubDate>
		<guid isPermaLink="false">http://familypress.net/archives/photopress-085/#comment-188</guid>
		<description>Update: I have now identified the problem, and it's unfortunately the permalinks option.</description>
		<content:encoded><![CDATA[<p>Update: I have now identified the problem, and it&#8217;s unfortunately the permalinks option.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Britta</title>
		<link>http://familypress.net/archives/photopress-085/#comment-187</link>
		<dc:creator>Britta</dc:creator>
		<pubDate>Sat, 07 Jan 2006 20:36:24 +0000</pubDate>
		<guid isPermaLink="false">http://familypress.net/archives/photopress-085/#comment-187</guid>
		<description>Thanks, Shrikee - but I had already installed a fresh, latest copy of PP.
Isaac was so kind to email me, suggesting that I probably need to edit the two album files; which is what I'll look into.</description>
		<content:encoded><![CDATA[<p>Thanks, Shrikee - but I had already installed a fresh, latest copy of PP.<br />
Isaac was so kind to email me, suggesting that I probably need to edit the two album files; which is what I&#8217;ll look into.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Roge</title>
		<link>http://familypress.net/archives/photopress-085/#comment-186</link>
		<dc:creator>Roge</dc:creator>
		<pubDate>Sat, 07 Jan 2006 17:16:11 +0000</pubDate>
		<guid isPermaLink="false">http://familypress.net/archives/photopress-085/#comment-186</guid>
		<description>Have change thumbnails size to larger value AND made them "square" -&#62; Mass resize doesn't resize them. Says 0 images 0 thumbnails.</description>
		<content:encoded><![CDATA[<p>Have change thumbnails size to larger value AND made them &#8220;square&#8221; -&gt; Mass resize doesn&#8217;t resize them. Says 0 images 0 thumbnails.</p>
]]></content:encoded>
	</item>
</channel>
</rss>
