<?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/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<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>
	<lastBuildDate>Tue, 09 Aug 2011 16:56:32 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
		<item>
		<title>WordPress update permission issues</title>
		<link>http://think-robot.com/2011/06/wordpress-update-permission-issues/</link>
		<comments>http://think-robot.com/2011/06/wordpress-update-permission-issues/#comments</comments>
		<pubDate>Sun, 05 Jun 2011 22:24:19 +0000</pubDate>
		<dc:creator>Joanna</dc:creator>
				<category><![CDATA[Articles]]></category>
		<category><![CDATA[fix]]></category>
		<category><![CDATA[ftp]]></category>
		<category><![CDATA[permissions]]></category>
		<category><![CDATA[tip]]></category>
		<category><![CDATA[Wordpress]]></category>

		<guid isPermaLink="false">http://think-robot.com/?p=297</guid>
		<description><![CDATA[WordPress can often be such a pain to deal with&#8230; Recently I was trying to get an installation updated as well as some of the plugins. What should have been a straightforward task, turned out to be several hours of messing around with permissions and trying to figure out why even 777 isn&#8217;t enough for [...]]]></description>
			<content:encoded><![CDATA[<p>WordPress can often be such a pain to deal with&#8230;</p>
<p>Recently I was trying to get an installation updated as well as some of the plugins. What should have been a straightforward task, turned out to be several hours of messing around with permissions and trying to figure out why even 777 isn&#8217;t enough for the updates to NOT fail and what user should own what.</p>
<p>Well it turns out that it&#8217;s only partly the fault of WordPress as it is an <strong>issue with the FTP server</strong>. Still some better messaging would be helpful&#8230;</p>
<p>There were mentions about a patch and fixes in potentially in the <strong>3.2 WP version</strong> related to the error I was getting:</p>
<pre><code>Could not copy file.: /public_html/wp-admin/css/theme-editor.dev.css</code></pre>
<p>However only after stumbling across <a href="http://www.aeromental.net/2011/01/11/automatic-update-public_htmlwp-admincsstheme-editor-dev-css/" class="external">this page</a> I found an easy and quick solution.</p>
<p>Turns out it was enough to just switch from Pure-FTPD to <strong>Pro-FTPD</strong>.</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/11/nested-sortable-using-jtree-clickable-links/" rel="bookmark">Nested sortable using jTree - clickable links</a></li><li><a href="http://think-robot.com/2010/12/installing-windows-7-guest-on-vmware-7-on-opensuse-113-host/" rel="bookmark">Installing Windows 7 Guest on VMWare 7 on OpenSuse 11.3 Host</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/2010/12/zend-application-resource-plugin-loading-issues/" rel="bookmark">Zend Application Resource Plugin Loading Issues</a></li></ul></div>]]></content:encoded>
			<wfw:commentRss>http://think-robot.com/2011/06/wordpress-update-permission-issues/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Top Level Cookies in Opera for Custom Domain Names</title>
		<link>http://think-robot.com/2011/04/top-level-cookies-in-opera-for-custom-domain-names/</link>
		<comments>http://think-robot.com/2011/04/top-level-cookies-in-opera-for-custom-domain-names/#comments</comments>
		<pubDate>Sat, 02 Apr 2011 23:36:14 +0000</pubDate>
		<dc:creator>Joanna</dc:creator>
				<category><![CDATA[Code]]></category>
		<category><![CDATA[cookies]]></category>
		<category><![CDATA[dns]]></category>
		<category><![CDATA[domain]]></category>
		<category><![CDATA[fix]]></category>
		<category><![CDATA[host]]></category>
		<category><![CDATA[Opera]]></category>
		<category><![CDATA[tip]]></category>
		<category><![CDATA[top level]]></category>

		<guid isPermaLink="false">http://think-robot.com/?p=288</guid>
		<description><![CDATA[For our local development at work we all use the same fake domain &#8211; helps with setting API keys and other things across the board and isn&#8217;t hard to setup whatever system any new developer might have. It also happens to be not a &#8220;.com&#8221;: www.local.bnt &#8211; which is nice for not confusing it with [...]]]></description>
			<content:encoded><![CDATA[<p>For our local development at work we all use the same fake domain &#8211; helps with setting API keys and other things across the board and isn&#8217;t hard to setup whatever system any new developer might have. It also happens to be not a &#8220;.com&#8221;: <strong>www.local.bnt</strong> &#8211; which is nice for not confusing it with real sites.</p>
<p>While developing cross-subdomain authentication we suddenly realised that it didn&#8217;t work on Opera. After a bit of research it turns out that it&#8217;s not the setting of the cookie path (&#8220;.local.bnt&#8221;) that is the problem, but <a target="_blank" href="http://my.opera.com/yngve/blog/show.dml/267415">the way Opera checks which part of the domain name is the top level domain</a>:</p>
<blockquote><p>&#8220;Here at Opera we went for the rule-of-thumb method: When Opera is checking a cookie whose target domain matches certain criteriea (e.g. it is not a .com domain), <strong>we do a DNS name lookup for the target domain, to see if there is an IP address for that domain</strong>. If there is an IP address for the domain (e.g. example.no) we assume that the domain is a normal company domain, not a co.uk like domain, and therefore safe. If there is no IP address we assume that the domain is co.uk-like and therefore unsafe, and only allows the cookie to be set for the server that sent the cookie.&#8221;</p></blockquote>
<p>So that&#8217;s the problem right there and with an easy fix once you know the above&#8230; However the whole article is worth a read as it does shed some light on the multiple problems related to top level domains and cookies.</p>
<p>If you want to keep your random local domain name make sure your <strong>hosts file</strong> contains not only your sub domains, but the main one as well even if it is not used directly.</p>
<pre><code>127.0.0.1    www.local.bnt
<strong>127.0.0.1    local.bnt</strong>
</code></pre>
<div id="crp_related"><h2>Related Articles:</h2><ul><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><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><li><a href="http://think-robot.com/2010/03/multiple-changes-and-a-delete-on-same-object-in-doctrine/" rel="bookmark">Multiple changes and a delete on same object in doctrine</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/2009/04/regex-for-autolinking-urls/" rel="bookmark">Regex for Autolinking URLs</a></li></ul></div>]]></content:encoded>
			<wfw:commentRss>http://think-robot.com/2011/04/top-level-cookies-in-opera-for-custom-domain-names/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Enable delayed messages in Zend_Queue</title>
		<link>http://think-robot.com/2011/01/enable-delayed-messages-in-zend_queue/</link>
		<comments>http://think-robot.com/2011/01/enable-delayed-messages-in-zend_queue/#comments</comments>
		<pubDate>Sun, 30 Jan 2011 11:57:52 +0000</pubDate>
		<dc:creator>Joanna</dc:creator>
				<category><![CDATA[Code]]></category>
		<category><![CDATA[classes]]></category>
		<category><![CDATA[examples]]></category>
		<category><![CDATA[fix]]></category>
		<category><![CDATA[library]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[queue]]></category>
		<category><![CDATA[Zend]]></category>
		<category><![CDATA[Zend Framework]]></category>
		<category><![CDATA[Zend_Queue]]></category>

		<guid isPermaLink="false">http://think-robot.com/?p=268</guid>
		<description><![CDATA[The default Zend_Queue DB implementation unfortunately does not allow you to pass a timeout value when saving a message on the queue. However not all is lost and you can easily extend the standard Zend classes to add that functionality. All you need is your own Db adapter and Queue class. For the adapter you [...]]]></description>
			<content:encoded><![CDATA[<p>The default Zend_Queue DB implementation unfortunately does not allow you to <strong>pass a timeout value</strong> when saving a message on the queue. However not all is lost and you can easily extend the standard Zend classes to add that functionality.</p>
<p>All you need is your own <strong>Db adapter</strong> and <strong>Queue class</strong>.</p>
<p>For the adapter you only need to overwrite <strong>the send()</strong> function. The highlighted code below is the only change to the original class (2 lines affected&#8230;). You could actually apply this without extending Zend_Queue, but this way will be easier if you ever need to update your Zend library.</p>
<pre><code>&lt;?php

class TS_Queue_Adapter_Db extends Zend_Queue_Adapter_Db {

    /**
     * Send a message to the queue
     *
     * @param  string     $message Message to send to the active queue
     * @param  Zend_Queue $queue
     * @param  Timestamp $timeout
     * @return Zend_Queue_Message
     * @throws Zend_Queue_Exception - database error
     */
    public function send($message, Zend_Queue $queue = null<strong>, $timeout = null</strong>){
        if ($this->_messageRow === null) {
            $this->_messageRow = $this->_messageTable->createRow();
        }

        if ($queue === null) {
            $queue = $this->_queue;
        }

        if (is_scalar($message)) {
            $message = (string) $message;
        }
        if (is_string($message)) {
            $message = trim($message);
        }

        if (!$this->isExists($queue->getName())) {
            require_once 'Zend/Queue/Exception.php';
            throw new Zend_Queue_Exception('Queue does not exist:' . $queue->getName());
        }

        $msg = clone $this->_messageRow;
        $msg->queue_id = $this->getQueueId($queue->getName());
        $msg->created = time();
        $msg->body = $message;
        $msg->md5 = md5($message);
<strong>        $msg->timeout = $timeout;</strong>

        try {
            $msg->save();
        } catch (Exception $e) {
            require_once 'Zend/Queue/Exception.php';
            throw new Zend_Queue_Exception($e->getMessage(), $e->getCode(), $e);
        }

        $options = array(
            'queue' => $queue,
            'data' => $msg->toArray(),
        );

        $classname = $queue->getMessageClass();
        if (!class_exists($classname)) {
            require_once 'Zend/Loader.php';
            Zend_Loader::loadClass($classname);
        }
        return new $classname($options);
    }
}</code></pre>
<p>Your Queue class only needs to extend the <strong>send()</strong> function again to allow you to pass the timeout through. obviously you can use this class to add other functionality too.</p>
<pre><code>&lt;?php

class TS_Queue extends Zend_Queue {

	/**
	 * Send a message to the queue
	 *
	 * @param  mixed $message message
	 * @return Zend_Queue_Message
	 * @throws Zend_Queue_Exception
	 */
	public function send($message, $timeout = null){
		return $this->getAdapter()->send($message, null, $timeout);
	}
}</code></pre>
<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/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/2009/05/doctrine-many-to-many-with-extra-fields/" rel="bookmark">Doctrine Many To Many With Extra Fields</a></li><li><a href="http://think-robot.com/2008/12/using-zend_mail-and-google-smtp-to-send-emails/" rel="bookmark">Using Zend_Mail and Google SMTP to send emails</a></li><li><a href="http://think-robot.com/2010/12/zend-application-resource-plugin-loading-issues/" rel="bookmark">Zend Application Resource Plugin Loading Issues</a></li></ul></div>]]></content:encoded>
			<wfw:commentRss>http://think-robot.com/2011/01/enable-delayed-messages-in-zend_queue/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Installing Windows 7 Guest on VMWare 7 on OpenSuse 11.3 Host</title>
		<link>http://think-robot.com/2010/12/installing-windows-7-guest-on-vmware-7-on-opensuse-113-host/</link>
		<comments>http://think-robot.com/2010/12/installing-windows-7-guest-on-vmware-7-on-opensuse-113-host/#comments</comments>
		<pubDate>Wed, 15 Dec 2010 23:49:39 +0000</pubDate>
		<dc:creator>Joanna</dc:creator>
				<category><![CDATA[Articles]]></category>
		<category><![CDATA[fix]]></category>
		<category><![CDATA[install]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[OpenSuse]]></category>
		<category><![CDATA[ThinkPad]]></category>
		<category><![CDATA[tip]]></category>
		<category><![CDATA[vmware]]></category>
		<category><![CDATA[window 7]]></category>

		<guid isPermaLink="false">http://think-robot.com/?p=248</guid>
		<description><![CDATA[Maybe this will help anyone else stuck on the installation. For a long while my Windows 7 install inside VMWare 7 would get stuck at &#8220;expanding files 0%&#8221;. I kept thinking it was my machine and setup that was causing issue, after all a x64 tablet pc is not your most common config. Just in [...]]]></description>
			<content:encoded><![CDATA[<p>Maybe this will help anyone else stuck on the installation.</p>
<p>For a long while my Windows 7 install inside VMWare 7 would get stuck at <strong>&#8220;expanding files 0%&#8221;</strong>. I kept thinking it was my machine and setup that was causing issue, after all a x64 tablet pc is not your most common config. Just in case anyone is curious I&#8217;ve got a Thinkpad x201t.</p>
<p>After trying both 32bit and 64bit Windows 7 version, upgrading my RAM from 4GB to 8GB and trying out changing the virtual disk location from ntfs to ext3 and back I was quickly running out of options.</p>
<p>Unfortunately VMWare support is extremely picky about your os versions and didn&#8217;t even try to suggest anything unless I downgraded to OpenSuse 11.2 &#8211; which was not an option due to certain driver compatibility.</p>
<p>Fortunately I decided to give it one more go and instead of using my external dvd drive for the Windows 7 installation I <strong>saved the DVD as iso</strong> and run the installation that way. And there you go, that was the solution!</p>
<p>My suspicion was the fact that my DVD drive is usb powered, however while looking for a solution I saw similar questions being asked for other linux hosts and no mention of external DVD drives, so it might be a more generic issue.</p>
<div id="crp_related"><h2>Related Articles:</h2><ul><li><a href="http://think-robot.com/2008/08/opensuse-11-on-lenovo-thinkpad-x61-tablet-pc/" rel="bookmark">openSUSE 11 on Lenovo Thinkpad X61 (tablet pc)</a></li><li><a href="http://think-robot.com/2011/06/wordpress-update-permission-issues/" rel="bookmark">WordPress update permission issues</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/2008/08/server-error-500-htaccess-require-valid-user/" rel="bookmark">Server Error 500 - htaccess require valid-user</a></li></ul></div>]]></content:encoded>
			<wfw:commentRss>http://think-robot.com/2010/12/installing-windows-7-guest-on-vmware-7-on-opensuse-113-host/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>PHP_AUTH_USER and PHP_AUTH_PW is null</title>
		<link>http://think-robot.com/2010/12/php_auth_user-and-php_auth_pw-is-null/</link>
		<comments>http://think-robot.com/2010/12/php_auth_user-and-php_auth_pw-is-null/#comments</comments>
		<pubDate>Thu, 09 Dec 2010 19:30:41 +0000</pubDate>
		<dc:creator>Joanna</dc:creator>
				<category><![CDATA[Code]]></category>
		<category><![CDATA[authentication]]></category>
		<category><![CDATA[fix]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[tip]]></category>

		<guid isPermaLink="false">http://think-robot.com/?p=249</guid>
		<description><![CDATA[Ok, so you&#8217;re trying to setup password protection on your website using HTTP authentication. Unfortunately despite the request for password working your authentication keeps failing. If you check the output of your script and the password and username variables are not populated as expected it will usually be for one of two reasons. Working code [...]]]></description>
			<content:encoded><![CDATA[<p>Ok, so you&#8217;re trying to setup password protection on your website using HTTP authentication. Unfortunately despite the request for password working your authentication keeps failing. If you check the output of your script and the password and username variables are not populated as expected it will usually be for one of two reasons.</p>
<h2>Working code example</h2>
<pre><code>
$username = "expectedUsername";
$password = "expectedPassword";

if (!isset($_SERVER['PHP_AUTH_USER']) || $_SERVER['PHP_AUTH_USER'] != $username || $_SERVER['PHP_AUTH_PW'] != $password) {
  header('WWW-Authenticate: Basic realm=""');
  header('HTTP/1.0 401 Unauthorized');
  echo '&gt;h2>Authorization failed.&gt;/h2>';
  exit;
} else if($_SERVER['PHP_AUTH_USER'] != $username &#038; $_SERVER['PHP_AUTH_PW'] != $password){
  echo '&gt;h2>Authorization failed.&gt;/h2>';
  exit;
}</code></pre>
<h2>Most common reason for failure</h2>
<p>Firstly if you are using an older book or website as reference you will see <strong>$PHP_AUTH_USER</strong> mentioned instead of <strong>$_SERVER['PHP_AUTH_USER']</strong>. If you are using the former then this could be the reason for not seeing your variables populated.</p>
<h2>The reason that can take you by surprise</h2>
<p>If your code is correct (compare against the example) and you are using the $_SERVER variable format and still getting <strong>NULL</strong> inside both $_SERVER['PHP_AUTH_USER'] and $_SERVER['PHP_AUTH_PW'] it&#8217;s time to check your server settings.</p>
<p>HTTP authentication does not work with the <strong>cgi version of PHP</strong>, so if your hosting allows you will need to switch to PHP as Apache module or look for an alternative solution.</p>
<div id="crp_related"><h2>Related Articles:</h2><ul><li><a href="http://think-robot.com/2008/12/using-zend_mail-and-google-smtp-to-send-emails/" rel="bookmark">Using Zend_Mail and Google SMTP to send emails</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/2009/12/phpunit-selenium-screenshot-path-problem/" rel="bookmark">PHPUnit & Selenium - screenshot path problem</a></li><li><a href="http://think-robot.com/2008/08/opensuse-11-on-lenovo-thinkpad-x61-tablet-pc/" rel="bookmark">openSUSE 11 on Lenovo Thinkpad X61 (tablet pc)</a></li><li><a href="http://think-robot.com/2008/10/how-to-convert-pdt-projects-into-phpeclipse-projects/" rel="bookmark">How to convert PDT projects into PHPEclipse projects</a></li></ul></div>]]></content:encoded>
			<wfw:commentRss>http://think-robot.com/2010/12/php_auth_user-and-php_auth_pw-is-null/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<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>// 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']){</pre>
<p>Edit the file: <strong>wp-content/plugins/nggallery/admin/wp25/addgallery.php (line: 263)</strong></p>
<pre>	&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;</pre>
<p>Edit the file: <strong>wp-content/plugins/nggallery/admin/wp25/functions.php (line: 77)</strong></p>
<pre>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>
}  </pre>
<div id="crp_related"><h2>Related Articles:</h2><ul><li><a href="http://think-robot.com/2011/06/wordpress-update-permission-issues/" rel="bookmark">WordPress update permission issues</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/11/nested-sortable-using-jtree-clickable-links/" rel="bookmark">Nested sortable using jTree - clickable links</a></li><li><a href="http://think-robot.com/2010/09/using-textmate-for-easier-css3/" rel="bookmark">Using TextMate for easier CSS3</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></ul></div>]]></content:encoded>
			<wfw:commentRss>http://think-robot.com/2008/11/wordpress-nextgen-gallery-tweak/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Nested sortable using jTree &#8211; 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>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");</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/2011/03/jquery-multiple-events-without-default-behaviour/" rel="bookmark">jQuery Multiple Events Without Default Behaviour</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/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/2011/06/wordpress-update-permission-issues/" rel="bookmark">WordPress update permission issues</a></li><li><a href="http://think-robot.com/2008/11/wordpress-nextgen-gallery-tweak/" rel="bookmark">WordPress NextGen gallery tweak</a></li></ul></div>]]></content:encoded>
			<wfw:commentRss>http://think-robot.com/2008/11/nested-sortable-using-jtree-clickable-links/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Server Error 500 &#8211; 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. [...]]]></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>AuthName "Restricted Area"
AuthType Basic
AuthUserFile /YOUR_PATH/www/.htpasswd
AuthGroupFile /dev/null
require valid-user</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/2011/06/wordpress-update-permission-issues/" rel="bookmark">WordPress update permission issues</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/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/2010/12/php_auth_user-and-php_auth_pw-is-null/" rel="bookmark">PHP_AUTH_USER and PHP_AUTH_PW is null</a></li></ul></div>]]></content:encoded>
			<wfw:commentRss>http://think-robot.com/2008/08/server-error-500-htaccess-require-valid-user/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>

