<?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>Ruben Sargsyan &#187; NextGEN</title>
	<atom:link href="http://rubensargsyan.com/tag/nextgen/feed/" rel="self" type="application/rss+xml" />
	<link>http://rubensargsyan.com</link>
	<description>Personal Website</description>
	<lastBuildDate>Thu, 01 Dec 2011 19:15:18 +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 Plugin NextGEN Gallery Sorting Bugfix</title>
		<link>http://rubensargsyan.com/wordpress-plugin-nextgen-gallery-sorting-bugfix/</link>
		<comments>http://rubensargsyan.com/wordpress-plugin-nextgen-gallery-sorting-bugfix/#comments</comments>
		<pubDate>Tue, 24 Nov 2009 17:55:54 +0000</pubDate>
		<dc:creator>Ruben Sargsyan</dc:creator>
				<category><![CDATA[Wordpress]]></category>
		<category><![CDATA[bugfix]]></category>
		<category><![CDATA[NextGEN]]></category>
		<category><![CDATA[plugin]]></category>

		<guid isPermaLink="false">http://rubensargsyan.com/?p=129</guid>
		<description><![CDATA[The changing the sort options of WordPress plugin &#8220;NextGEN Gallery&#8221; doesn&#8217;t affect on the images of the gallery sorted by tags. To fix the bug, do the following changes in nextgen-gallery\lib\ngg-db.php set // Check for the exclude setting &#160; $ngg_options = get_option&#40;'ngg_options'&#41;; $gal_sort = $ngg_options&#91;'galSort'&#93;; $gal_sort_dir = $ngg_options&#91;'galSortDir'&#93;; &#160; if &#40; $gal_sort_dir == 'RAND' &#41; [...]]]></description>
			<content:encoded><![CDATA[<p>The changing the sort options of WordPress plugin &#8220;NextGEN Gallery&#8221; doesn&#8217;t affect on the images of the gallery sorted by tags. To fix the bug, do the following changes in nextgen-gallery\lib\ngg-db.php<span id="more-129"></span></p>
<p>set</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #666666; font-style: italic;">// Check for the exclude setting</span>
&nbsp;
<span style="color: #000088;">$ngg_options</span> <span style="color: #339933;">=</span> get_option<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'ngg_options'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$gal_sort</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$ngg_options</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'galSort'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$gal_sort_dir</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$ngg_options</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'galSortDir'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span> <span style="color: #000088;">$gal_sort_dir</span> <span style="color: #339933;">==</span> <span style="color: #0000ff;">'RAND'</span> <span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
   <span style="color: #000088;">$order_clause</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">'ORDER BY rand() '</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span> <span style="color: #b1b100;">elseif</span> <span style="color: #009900;">&#40;</span> <span style="color: #000088;">$gal_sort_dir</span> <span style="color: #339933;">==</span> <span style="color: #0000ff;">'DESC'</span> <span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
   <span style="color: #000088;">$order_clause</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">' ORDER BY t.'</span><span style="color: #339933;">.</span><span style="color: #000088;">$gal_sort</span><span style="color: #339933;">.</span><span style="color: #0000ff;">' DESC'</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span> <span style="color: #b1b100;">else</span> <span style="color: #009900;">&#123;</span>
   <span style="color: #000088;">$order_clause</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">' ORDER BY t.'</span><span style="color: #339933;">.</span><span style="color: #000088;">$gal_sort</span><span style="color: #339933;">.</span><span style="color: #0000ff;">' ASC'</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span></pre></div></div>

<p>instead of</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #666666; font-style: italic;">// Check for the exclude setting</span>
&nbsp;
<span style="color: #000088;">$order_clause</span> <span style="color: #339933;">=</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$order</span> <span style="color: #339933;">==</span> <span style="color: #0000ff;">'RAND'</span><span style="color: #009900;">&#41;</span> ? <span style="color: #0000ff;">'ORDER BY rand() '</span> <span style="color: #339933;">:</span> <span style="color: #0000ff;">' ORDER BY t.pid ASC'</span> <span style="color: #339933;">;</span></pre></div></div>

<p>in the function <span style="color: #993300;">find_images_in_list</span>.</p>
<p>Getting the sort options from the database that is set in this function for not affecting on the work of other functions.</p>
]]></content:encoded>
			<wfw:commentRss>http://rubensargsyan.com/wordpress-plugin-nextgen-gallery-sorting-bugfix/feed/</wfw:commentRss>
		<slash:comments>11</slash:comments>
		</item>
	</channel>
</rss>

