<?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: 1 &amp; 1 &#8211; Read the FAQ</title>
	<atom:link href="http://alexrabe.de/2008/08/07/1-1-read-the-faq/feed/" rel="self" type="application/rss+xml" />
	<link>http://alexrabe.de/2008/08/07/1-1-read-the-faq/</link>
	<description>ALEX RABE &#124; learning by doing...</description>
	<lastBuildDate>Wed, 08 Feb 2012 16:33:11 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
<xhtml:meta xmlns:xhtml="http://www.w3.org/1999/xhtml" name="robots" content="noindex" />
	<item>
		<title>By: Randy</title>
		<link>http://alexrabe.de/2008/08/07/1-1-read-the-faq/#comment-17703</link>
		<dc:creator>Randy</dc:creator>
		<pubDate>Wed, 08 Oct 2008 23:58:21 +0000</pubDate>
		<guid isPermaLink="false">http://alexrabe.de/2008/08/07/1-1-read-the-faq/#comment-17703</guid>
		<description>Manolo,

I think you have a great fix for a very frustrating problem.

But..

I wasn&#039;t sure which version of the plugin you are using, I upgraded to 0.99.1 trying to fix this. I would be glad to roll back though.

And Alexes CSS is messing up the code. and copy and paste to dreamweaver isn&#039;t working.

Maybe you can contact me ---- spam at grammalei.com ---and we can exchange email addresses ??


If not I will try and go through the code and figure out all the mistakes in the copy process.</description>
		<content:encoded><![CDATA[<p>Manolo,</p>
<p>I think you have a great fix for a very frustrating problem.</p>
<p>But..</p>
<p>I wasn&#8217;t sure which version of the plugin you are using, I upgraded to 0.99.1 trying to fix this. I would be glad to roll back though.</p>
<p>And Alexes CSS is messing up the code. and copy and paste to dreamweaver isn&#8217;t working.</p>
<p>Maybe you can contact me &#8212;- spam at grammalei.com &#8212;and we can exchange email addresses ??</p>
<p>If not I will try and go through the code and figure out all the mistakes in the copy process.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Manolo</title>
		<link>http://alexrabe.de/2008/08/07/1-1-read-the-faq/#comment-17358</link>
		<dc:creator>Manolo</dc:creator>
		<pubDate>Sat, 06 Sep 2008 18:41:58 +0000</pubDate>
		<guid isPermaLink="false">http://alexrabe.de/2008/08/07/1-1-read-the-faq/#comment-17358</guid>
		<description>I have tried with the solution described in the forum to run PHP5 instead of 4… and it seemed that the situation improved… but still the memory limit is there and the script gets blocked before creating all the thumbs.
Since I wanted to use nextgen and I am not willing to move from 1and1, I have tried to find a “solution” – yeah, it is not a very nice solution, but it works.
I have introduced a pretty dummy function so 1and1 users can still use nextgen
1-	The modifications in nextgen (Sorry Alex, I did not want to mesh with your code)
a.	In the functions.php file (nextgen-gallery/admin/wp25/) you need to add this function:


function import_gallery1and1($galleryfolder) {
		// ** $galleryfolder contains relative path
		
		//TODO: Check permission of existing thumb folder &amp; images
		
		global $wpdb;
		
		$created_msg = &quot;&quot;;
		
		// remove trailing slash at the end, if somebody use it
		if (substr($galleryfolder, -1) == &#039;/&#039;) $galleryfolder = substr($galleryfolder, 0, -1);
		$gallerypath = WINABSPATH.$galleryfolder;
		
		if (!is_dir($gallerypath)) {
			nggallery::show_error(__(&#039;Directory&#039;, &#039;nggallery&#039;).&#039; &lt;strong&gt;&#039;.$gallerypath.&#039;&lt;/strong&gt; &#039;.__(&#039;doesn&#096;t exist!&#039;, &#039;nggallery&#039;));
			return ;
		}
		
		// read list of images
		$new_imageslist = nggAdmin::scandir($gallerypath);
		if (empty($new_imageslist)) {
			nggallery::show_message(__(&#039;Directory&#039;, &#039;nggallery&#039;).&#039; &lt;strong&gt;&#039;.$gallerypath.&#039;&lt;/strong&gt; &#039;.__(&#039;contains no pictures&#039;, &#039;nggallery&#039;));
			return;
		}
		
		// check &amp; create thumbnail folder
		if ( !nggallery::get_thumbnail_folder($gallerypath) )
			return;
		
		// take folder name as gallery name		
		$galleryname = basename($galleryfolder);
		
		// check for existing galleryfolder
		$gallery_id = $wpdb-&gt;get_var(&quot;SELECT gid FROM $wpdb-&gt;nggallery WHERE path = &#039;$galleryfolder&#039; &quot;);

		if (!$gallery_id) {
			$result = $wpdb-&gt;query(&quot;INSERT INTO $wpdb-&gt;nggallery (name, path) VALUES (&#039;$galleryname&#039;, &#039;$galleryfolder&#039;) &quot;);
			if (!$result) {
				nggallery::show_error(__(&#039;Database error. Could not add gallery!&#039;,&#039;nggallery&#039;));
				return;
			}
			$created_msg =__(&#039;Gallery&#039;,&#039;nggallery&#039;).&#039; &lt;strong&gt;&#039;.$galleryname.&#039;&lt;/strong&gt; &#039;.__(&#039;successfully created!&#039;,&#039;nggallery&#039;).&#039;&#039;;
			$gallery_id = $wpdb-&gt;insert_id;  // get index_id
		}
		
		// Look for existing image list
		$old_imageslist = $wpdb-&gt;get_col(&quot;SELECT filename FROM $wpdb-&gt;nggpictures WHERE galleryid = &#039;$gallery_id&#039; &quot;);
		// if no images are there, create empty array
		if ($old_imageslist == NULL) $old_imageslist = array();
		// check difference
		$new_images = array_diff($new_imageslist, $old_imageslist);
		// now create thumbnails
		
		//nggAdmin::generateThumbnail($gallerypath,$new_images);
		//Instead of creating the thumbs, we are just going to check if all images have a thumnb in the thumbs directory. Only images with thumb will be included
		$new_thumbslist = nggAdmin::scandir($gallerypath.&quot;/thumbs&quot;);
		$new_images = array_intersect($new_images, $new_thumbslist);
		//and after compration we need to &quot;create the thumbs files&quot;
		foreach($new_images as $thumb) { 
 		//echo &quot;$thumb/n/r&quot;;
		rename ( $gallerypath.&quot;/thumbs/&quot;.$thumb, $gallerypath.&quot;/thumbs/thumbs_&quot;.$thumb);
		} 

		// add images to database		
		$count_pic = nggAdmin::add_Images($gallery_id, $gallerypath, $new_images);
				
		nggallery::show_message($created_msg.$count_pic.__(&#039; picture(s) successfully added&#039;,&#039;nggallery&#039;));
		return;

	}

It makes exactly the same as importgallery but without lunching the creation of thumbs. Instead it checks if there is a thumb already created for each picture you want to import.
b.	In the manage.php file (nextgen-gallery/admin/wp25/) you need to add this lines.
Right after the 	“if (isset ($_POST[&#039;scanfolder&#039;]))”, in a new if:

	if (isset ($_POST[&#039;scanfolder1and1&#039;]))  {
	// scan folder looking for th files and the thumbs...a void producing the thumbs
		check_admin_referer(&#039;ngg_updategallery&#039;);
	
		$gallerypath = $wpdb-&gt;get_var(&quot;SELECT path FROM $wpdb-&gt;nggallery WHERE gid = &#039;$act_gid&#039; &quot;);
		nggAdmin::import_gallery1and1($gallerypath);
	}

And a new button to launch the process. After the “Scan Folder for new images”: 

		&lt;input type=&quot;submit&quot; name=&quot;scanfolder&quot; value=&quot; &quot; /&gt;
            &lt;input type=&quot;submit&quot; name=&quot;scanfolder1and1&quot; value=&quot; &quot; /&gt;

2-	Now, basically, we have to upload both pictures and thumbs (in a thumbs folder). Both files must have the same name (pay attention to the extension).
3-	You have to create the gallery without uploading any image.
4-	Then in “manage” the gallery next to the “Scan Folder for new images” button you will see a “Scan Folder for new images and thumbs” that launches the process.
Note that this is just a patch… I am pretty sure there is a better way of coding this solution (I am not a web developer)…and sure it should be easy to make points 3 and 4 run one after the other by creating a new “Import pictures and thumbs from a folder” in the “new gallery” section.
I am sharing this dummy solution just in case Alex wants to include some patch for 1nd1 users….</description>
		<content:encoded><![CDATA[<p>I have tried with the solution described in the forum to run PHP5 instead of 4… and it seemed that the situation improved… but still the memory limit is there and the script gets blocked before creating all the thumbs.<br />
Since I wanted to use nextgen and I am not willing to move from 1and1, I have tried to find a “solution” – yeah, it is not a very nice solution, but it works.<br />
I have introduced a pretty dummy function so 1and1 users can still use nextgen<br />
1-	The modifications in nextgen (Sorry Alex, I did not want to mesh with your code)<br />
a.	In the functions.php file (nextgen-gallery/admin/wp25/) you need to add this function:</p>
<p>function import_gallery1and1($galleryfolder) {<br />
		// ** $galleryfolder contains relative path</p>
<p>		//TODO: Check permission of existing thumb folder &amp; images</p>
<p>		global $wpdb;</p>
<p>		$created_msg = &#8220;&#8221;;</p>
<p>		// remove trailing slash at the end, if somebody use it<br />
		if (substr($galleryfolder, -1) == &#8216;/&#8217;) $galleryfolder = substr($galleryfolder, 0, -1);<br />
		$gallerypath = WINABSPATH.$galleryfolder;</p>
<p>		if (!is_dir($gallerypath)) {<br />
			nggallery::show_error(__(&#8216;Directory&#8217;, &#8216;nggallery&#8217;).&#8217; <strong>&#8216;.$gallerypath.&#8217;</strong> &#8216;.__(&#8216;doesn&#96;t exist!&#8217;, &#8216;nggallery&#8217;));<br />
			return ;<br />
		}</p>
<p>		// read list of images<br />
		$new_imageslist = nggAdmin::scandir($gallerypath);<br />
		if (empty($new_imageslist)) {<br />
			nggallery::show_message(__(&#8216;Directory&#8217;, &#8216;nggallery&#8217;).&#8217; <strong>&#8216;.$gallerypath.&#8217;</strong> &#8216;.__(&#8216;contains no pictures&#8217;, &#8216;nggallery&#8217;));<br />
			return;<br />
		}</p>
<p>		// check &amp; create thumbnail folder<br />
		if ( !nggallery::get_thumbnail_folder($gallerypath) )<br />
			return;</p>
<p>		// take folder name as gallery name<br />
		$galleryname = basename($galleryfolder);</p>
<p>		// check for existing galleryfolder<br />
		$gallery_id = $wpdb-&gt;get_var(&#8220;SELECT gid FROM $wpdb-&gt;nggallery WHERE path = &#8216;$galleryfolder&#8217; &#8220;);</p>
<p>		if (!$gallery_id) {<br />
			$result = $wpdb-&gt;query(&#8220;INSERT INTO $wpdb-&gt;nggallery (name, path) VALUES (&#8216;$galleryname&#8217;, &#8216;$galleryfolder&#8217;) &#8220;);<br />
			if (!$result) {<br />
				nggallery::show_error(__(&#8216;Database error. Could not add gallery!&#8217;,'nggallery&#8217;));<br />
				return;<br />
			}<br />
			$created_msg =__(&#8216;Gallery&#8217;,'nggallery&#8217;).&#8217; <strong>&#8216;.$galleryname.&#8217;</strong> &#8216;.__(&#8216;successfully created!&#8217;,'nggallery&#8217;).&#8221;;<br />
			$gallery_id = $wpdb-&gt;insert_id;  // get index_id<br />
		}</p>
<p>		// Look for existing image list<br />
		$old_imageslist = $wpdb-&gt;get_col(&#8220;SELECT filename FROM $wpdb-&gt;nggpictures WHERE galleryid = &#8216;$gallery_id&#8217; &#8220;);<br />
		// if no images are there, create empty array<br />
		if ($old_imageslist == NULL) $old_imageslist = array();<br />
		// check difference<br />
		$new_images = array_diff($new_imageslist, $old_imageslist);<br />
		// now create thumbnails</p>
<p>		//nggAdmin::generateThumbnail($gallerypath,$new_images);<br />
		//Instead of creating the thumbs, we are just going to check if all images have a thumnb in the thumbs directory. Only images with thumb will be included<br />
		$new_thumbslist = nggAdmin::scandir($gallerypath.&#8221;/thumbs&#8221;);<br />
		$new_images = array_intersect($new_images, $new_thumbslist);<br />
		//and after compration we need to &#8220;create the thumbs files&#8221;<br />
		foreach($new_images as $thumb) {<br />
 		//echo &#8220;$thumb/n/r&#8221;;<br />
		rename ( $gallerypath.&#8221;/thumbs/&#8221;.$thumb, $gallerypath.&#8221;/thumbs/thumbs_&#8221;.$thumb);<br />
		} </p>
<p>		// add images to database<br />
		$count_pic = nggAdmin::add_Images($gallery_id, $gallerypath, $new_images);</p>
<p>		nggallery::show_message($created_msg.$count_pic.__(&#8216; picture(s) successfully added&#8217;,'nggallery&#8217;));<br />
		return;</p>
<p>	}</p>
<p>It makes exactly the same as importgallery but without lunching the creation of thumbs. Instead it checks if there is a thumb already created for each picture you want to import.<br />
b.	In the manage.php file (nextgen-gallery/admin/wp25/) you need to add this lines.<br />
Right after the 	“if (isset ($_POST['scanfolder']))”, in a new if:</p>
<p>	if (isset ($_POST['scanfolder1and1']))  {<br />
	// scan folder looking for th files and the thumbs&#8230;a void producing the thumbs<br />
		check_admin_referer(&#8216;ngg_updategallery&#8217;);</p>
<p>		$gallerypath = $wpdb-&gt;get_var(&#8220;SELECT path FROM $wpdb-&gt;nggallery WHERE gid = &#8216;$act_gid&#8217; &#8220;);<br />
		nggAdmin::import_gallery1and1($gallerypath);<br />
	}</p>
<p>And a new button to launch the process. After the “Scan Folder for new images”: </p>
<p>		&lt;input type=&#8221;submit&#8221; name=&#8221;scanfolder&#8221; value=&#8221; &#8221; /&gt;<br />
            &lt;input type=&#8221;submit&#8221; name=&#8221;scanfolder1and1&#8243; value=&#8221; &#8221; /&gt;</p>
<p>2-	Now, basically, we have to upload both pictures and thumbs (in a thumbs folder). Both files must have the same name (pay attention to the extension).<br />
3-	You have to create the gallery without uploading any image.<br />
4-	Then in “manage” the gallery next to the “Scan Folder for new images” button you will see a “Scan Folder for new images and thumbs” that launches the process.<br />
Note that this is just a patch… I am pretty sure there is a better way of coding this solution (I am not a web developer)…and sure it should be easy to make points 3 and 4 run one after the other by creating a new “Import pictures and thumbs from a folder” in the “new gallery” section.<br />
I am sharing this dummy solution just in case Alex wants to include some patch for 1nd1 users….</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Thumb-Errors bei NextGen Gallery mit 1&#38;1 &#124; blogoperium</title>
		<link>http://alexrabe.de/2008/08/07/1-1-read-the-faq/#comment-17314</link>
		<dc:creator>Thumb-Errors bei NextGen Gallery mit 1&#38;1 &#124; blogoperium</dc:creator>
		<pubDate>Wed, 03 Sep 2008 20:55:30 +0000</pubDate>
		<guid isPermaLink="false">http://alexrabe.de/2008/08/07/1-1-read-the-faq/#comment-17314</guid>
		<description>[...] zu installieren, und dem Fehler somit zurande zu kommen, kam ich schließlich auf die Lösung über Alex&#8217; Post, der mich anfänglich nciht wirklich weiter - aber auf die richtige Spur [...]</description>
		<content:encoded><![CDATA[<p>[...] zu installieren, und dem Fehler somit zurande zu kommen, kam ich schließlich auf die Lösung über Alex&#8217; Post, der mich anfänglich nciht wirklich weiter &#8211; aber auf die richtige Spur [...]</p>
]]></content:encoded>
	</item>
</channel>
</rss>

