<?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/"
	>

<channel>
	<title>ThinkRobot &#187; fix</title>
	<atom:link href="http://think-robot.com/tag/fix/feed/" rel="self" type="application/rss+xml" />
	<link>http://think-robot.com</link>
	<description>Design &#38; Development Blog</description>
	<pubDate>Sat, 06 Mar 2010 20:58:13 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.7.1</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Wordpress NextGen gallery tweak</title>
		<link>http://think-robot.com/2008/11/wordpress-nextgen-gallery-tweak/</link>
		<comments>http://think-robot.com/2008/11/wordpress-nextgen-gallery-tweak/#comments</comments>
		<pubDate>Wed, 12 Nov 2008 20:39:03 +0000</pubDate>
		<dc:creator>Joanna</dc:creator>
		
		<category><![CDATA[Code]]></category>

		<category><![CDATA[fix]]></category>

		<category><![CDATA[gallery]]></category>

		<category><![CDATA[NextGen]]></category>

		<category><![CDATA[uploads]]></category>

		<category><![CDATA[Wordpress]]></category>

		<guid isPermaLink="false">http://www.think-robot.com/?p=18</guid>
		<description><![CDATA[Recently I found myself in that very anoying situation where a very good piece of software seemed to lack just this one function&#8230; again. I have been doing a gallery website and used the NextGen gallery plugin to display the photos. Unfortunatelly it was a case of a gallery per post with about 1 or [...]]]></description>
			<content:encoded><![CDATA[<p>Recently I found myself in that very anoying situation where a very good piece of software seemed to lack just this one function&#8230; again. I have been doing a gallery website and used the <a href="http://wordpress.org/extend/plugins/nextgen-gallery/" target="_blank">NextGen gallery plugin</a> to display the photos. Unfortunatelly it was a case of a gallery per post with about 1 or 2 photos per gallery.</p>
<p>The biggest issue with this setting was the process of creating galleries. By default in NextGen you create the gallery on one page, upload the images in another, and then create new post yet elsewhere. But there had to be a way to at least merge the gallery creation with photo upload, especially considering a new gallery form consisted of a single &#8220;gallery name&#8221; field.<span id="more-18"></span>Surprisingly enough after checking the code, both actions are actually processed in the same place. Thus by adding a new field on the photo upload form this time consuming problem could be solved:</p>
<p>Edit the file: <strong>wp-content/plugins/nggallery/admin/wp25/addgallery.php (line: 15)</strong></p>
<pre><code>// link for the flash file
$swf_upload_link = NGGALLERY_URLPATH . 'admin/wp25/upload.php';
$swf_upload_link = wp_nonce_url($swf_upload_link, 'ngg_swfupload');
//flash doesn't seem to like encoded ampersands, so convert them back here
$swf_upload_link = str_replace('&amp;', '&amp;', $swf_upload_link);

$defaultpath = $ngg_options['gallerypath'];

if ($_POST['addgallery']<strong> || !empty($_POST['newgalleryname'])</strong>){
  <strong>if(!empty($_POST['newgalleryname']))
    $_POST['galleryname'] = $_POST['newgalleryname'];</strong>
  check_admin_referer('ngg_addgallery');
  $newgallery = attribute_escape($_POST['galleryname']);
  if (!empty($newgallery))
    <strong>$_POST['galleryselect'] = </strong>nggAdmin::create_gallery($newgallery, $defaultpath);
}
if ($_POST['zipupload']){</code></pre>
<p>Edit the file: <strong>wp-content/plugins/nggallery/admin/wp25/addgallery.php (line: 263)</strong></p>
<pre><code>	&lt;tr valign="top"&gt;
		&lt;th scope="row"&gt;&lt;?php _e('in to', 'nggallery') ;?&gt;&lt;/th&gt;
		&lt;td&gt;&lt;select name="galleryselect" id="galleryselect"&gt;
		&lt;option value="0" &gt;&lt;?php _e('Choose gallery', 'nggallery') ?&gt;&lt;/option&gt;
		&lt;?php
			$gallerylist = $wpdb-&gt;get_results("SELECT * FROM $wpdb-&gt;nggallery ORDER BY gid ASC");
			if(is_array($gallerylist)) {
				foreach($gallerylist as $gallery) {
					echo '&lt;option value="'.$gallery-&gt;gid.'" &gt;'.$gallery-&gt;name.' | '.$gallery-&gt;title.'&lt;/option&gt;'."n";
				}
			}
		?&gt;
		&lt;/select&gt;<strong> &lt;label&gt;or &lt;input type="text" name="newgalleryname"  /&gt;&lt;/label&gt;</strong>
		&lt;br /&gt;&lt;?php echo _e('Note : The upload limit on your server is ','nggallery') . "&lt;strong&gt;" . ini_get('upload_max_filesize') . "Byte&lt;/strong&gt;n"; ?&gt;
		&lt;br /&gt;&lt;?php if ((IS_WPMU) &amp;&amp; wpmu_enable_function('wpmuQuotaCheck')) display_space_usage(); ?&gt;&lt;/td&gt;
	&lt;/tr&gt;</code></pre>
<p>Edit the file: <strong>wp-content/plugins/nggallery/admin/wp25/functions.php (line: 77)</strong></p>
<pre><code>if ($result) {
	nggallery::show_error(__('Gallery', 'nggallery').' &lt;strong&gt;'.$galleryname.'&lt;/strong&gt; '.__('already exists', 'nggallery'));
	return false;
} else {
	$result = $wpdb-&gt;query("INSERT INTO $wpdb-&gt;nggallery (name, path, title) VALUES ('$galleryname', '$nggpath', '$gallerytitle') ");
	if ($result) nggallery::show_message(__('Gallery', 'nggallery').' &lt;strong&gt;'.$wpdb-&gt;insert_id." : ".$galleryname.'&lt;/strong&gt; '.__('successfully created!','nggallery')."
".__('You can show this gallery with the tag','nggallery').'&lt;strong&gt; &lt;/strong&gt;');
	<strong>return $wpdb-&gt;insert_id;</strong>
}  </code></pre>
<div id="crp_related"><h2>Related Articles:</h2><ul><li><a href="http://think-robot.com/2008/11/nested-sortable-using-jtree-clickable-links/" rel="bookmark">Nested sortable using jTree - clickable links</a></li><li><a href="http://think-robot.com/2009/04/zend_db_select-multiple-table-joins-explained/" rel="bookmark">Zend_Db_Select multiple table joins explained</a></li><li><a href="http://think-robot.com/2008/08/server-error-500-htaccess-require-valid-user/" rel="bookmark">Server Error 500 - htaccess require valid-user</a></li><li><a href="http://think-robot.com/2008/10/display-meetings-from-entourage-using-geektool/" rel="bookmark">Display Meetings From Entourage Using GeekTool</a></li><li><a href="http://think-robot.com/2009/05/doctrine-many-to-many-with-extra-fields/" rel="bookmark">Doctrine Many To Many With Extra Fields</a></li></ul></div>]]></content:encoded>
			<wfw:commentRss>http://think-robot.com/2008/11/wordpress-nextgen-gallery-tweak/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Nested sortable using jTree - clickable links</title>
		<link>http://think-robot.com/2008/11/nested-sortable-using-jtree-clickable-links/</link>
		<comments>http://think-robot.com/2008/11/nested-sortable-using-jtree-clickable-links/#comments</comments>
		<pubDate>Fri, 07 Nov 2008 11:08:35 +0000</pubDate>
		<dc:creator>Joanna</dc:creator>
		
		<category><![CDATA[Code]]></category>

		<category><![CDATA[fix]]></category>

		<category><![CDATA[JavaScript]]></category>

		<category><![CDATA[jQuery]]></category>

		<category><![CDATA[jTree]]></category>

		<guid isPermaLink="false">http://www.think-robot.com/?p=17</guid>
		<description><![CDATA[jTree is a lightweight solution for nested, sortable lists based on jQuery. I&#8217;ve been trying to find a good solution for quite a while, however the only good competitor to jTree is now not compatible with the new jQuery (1.2.6). After getting fed up at work with including totally different sets of javascript files depending [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.gimiti.com/kltan/wordpress/?p=29" target="_blank">jTree is a lightweight solution for nested, sortable lists based on jQuery</a>. I&#8217;ve been trying to find a good solution for quite a while, however the only good competitor to jTree is now not compatible with the new jQuery (1.2.6). After getting fed up at work with including totally different sets of javascript files depending on whether the nested sortable was needed on a page or not I have decided it was time for some clean-up.</p>
<p>Minimal is a very good word to describe <a href="http://www.gimiti.com/kltan/wordpress/?p=29" target="_blank">jTree</a>, which most of the time is good, however sometimes you might just want a little bit more. One of the biggest issues for me was lack of clickable links inside the <strong>LI</strong>s. Fortunately after some tweaking I came up with a hacky but working solution:</p>
<pre><code>if ($("#jTreeHelper").is(":not(:animated)") &amp;&amp; e.button !=2) {
 	//	Allow for clickable links
	<strong>if(new String(e.target).match(/(f|ht)tp(s{0,1}):///ig)){
 		return false;</strong><strong>
	}</strong>
	$("body").css("cursor","move");</code></pre>
<p>Just add the highlighted lines in the jquery.jtree.js file. Basically it just checks if the target of the click is a link and if it is it ignores the dragging.</p>
<div id="crp_related"><h2>Related Articles:</h2><ul><li><a href="http://think-robot.com/2009/06/hitch-object-oriented-event-handlers-with-jquery/" rel="bookmark">Hitch. Object-oriented event handlers with jQuery</a></li><li><a href="http://think-robot.com/2009/04/regex-for-autolinking-urls/" rel="bookmark">Regex for Autolinking URLs</a></li><li><a href="http://think-robot.com/2008/11/wordpress-nextgen-gallery-tweak/" rel="bookmark">Wordpress NextGen gallery tweak</a></li><li><a href="http://think-robot.com/2009/02/firefox-ignores-tabs-but-not-spaces-in-a-pre-tag/" rel="bookmark">Firefox ignores tabs but not spaces in a pre tag</a></li><li><a href="http://think-robot.com/2009/02/how-to-use-the-strong-ownership-list/" rel="bookmark">How To Use the Strong Ownership List</a></li></ul></div>]]></content:encoded>
			<wfw:commentRss>http://think-robot.com/2008/11/nested-sortable-using-jtree-clickable-links/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Server Error 500 - htaccess require valid-user</title>
		<link>http://think-robot.com/2008/08/server-error-500-htaccess-require-valid-user/</link>
		<comments>http://think-robot.com/2008/08/server-error-500-htaccess-require-valid-user/#comments</comments>
		<pubDate>Thu, 28 Aug 2008 21:19:33 +0000</pubDate>
		<dc:creator>Joanna</dc:creator>
		
		<category><![CDATA[Code]]></category>

		<category><![CDATA[fix]]></category>

		<category><![CDATA[htaccess]]></category>

		<category><![CDATA[htpasswd]]></category>

		<category><![CDATA[symlinks]]></category>

		<guid isPermaLink="false">http://www.think-robot.com/?p=11</guid>
		<description><![CDATA[I just spent a good couple of minutes hitting my head against the wall, trying to figure out why a perfectly good .htaccess file suddenly stopped working.
AuthName "Restricted Area"
AuthType Basic
AuthUserFile /YOUR_PATH/www/.htpasswd
AuthGroupFile /dev/null
require valid-user
After commenting things out it seemed that it was the last line that was causing the problems. However do not be fooled. Careful [...]]]></description>
			<content:encoded><![CDATA[<p>I just spent a good couple of minutes hitting my head against the wall, trying to figure out why a perfectly good .htaccess file suddenly stopped working.</p>
<pre><code><code>AuthName "Restricted Area"
AuthType Basic
AuthUserFile /YOUR_PATH/www/.htpasswd
AuthGroupFile /dev/null
require valid-user</code></code></pre>
<p>After commenting things out it seemed that it was the last line that was causing the problems. However do not be fooled. Careful inspection and a bit of Google searching led me back to the AuthUserFile declaration.</p>
<p>But what could be wrong with it? The file exists on the server. The passwords are properly encrypted. The problem was the &#8220;www&#8221; folder. Or should I rather say symlink. Changing &#8220;www&#8221; to the original folder: &#8220;public_html&#8221; solved the issue.</p>
<p>Moral for today: .htaccess does not like symlink folders when it comes to .htpasswd&#8230;</p>
<div id="crp_related"><h2>Related Articles:</h2><ul><li><a href="http://think-robot.com/2008/11/wordpress-nextgen-gallery-tweak/" rel="bookmark">Wordpress NextGen gallery tweak</a></li><li><a href="http://think-robot.com/2008/12/strong-ownership-list-approach/" rel="bookmark">Strong ownership list approach</a></li><li><a href="http://think-robot.com/2009/12/phpunit-selenium-screenshot-path-problem/" rel="bookmark">PHPUnit & Selenium - screenshot path problem</a></li><li><a href="http://think-robot.com/2008/11/nested-sortable-using-jtree-clickable-links/" rel="bookmark">Nested sortable using jTree - clickable links</a></li><li><a href="http://think-robot.com/2009/02/how-to-use-the-strong-ownership-list/" rel="bookmark">How To Use the Strong Ownership List</a></li></ul></div>]]></content:encoded>
			<wfw:commentRss>http://think-robot.com/2008/08/server-error-500-htaccess-require-valid-user/feed/</wfw:commentRss>
		</item>
	</channel>
</rss>
