<?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>Pieces of Life... &#187; Web development</title>
	<atom:link href="http://www.bogdanirimia.ro/category/technology/web-development/feed" rel="self" type="application/rss+xml" />
	<link>http://www.bogdanirimia.ro</link>
	<description>Bogdan Irimia&#039;s Web Space</description>
	<lastBuildDate>Fri, 18 Mar 2011 20:11:39 +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>New WordPress 3.0</title>
		<link>http://www.bogdanirimia.ro/new-wordpress-3-0/267</link>
		<comments>http://www.bogdanirimia.ro/new-wordpress-3-0/267#comments</comments>
		<pubDate>Mon, 21 Jun 2010 09:36:52 +0000</pubDate>
		<dc:creator>Myself</dc:creator>
				<category><![CDATA[Technology]]></category>
		<category><![CDATA[Web development]]></category>
		<category><![CDATA[CMS]]></category>
		<category><![CDATA[update]]></category>
		<category><![CDATA[WordPress]]></category>

		<guid isPermaLink="false">http://www.bogdanirimia.ro/?p=267</guid>
		<description><![CDATA[It seems that the long-awaited WordPress 3.0 is out and it also seems to have some new features that, in my opinion, brings WordPress closer to what a real CMS should be. I worked quite a lot with Drupal and now I consider WordPress to be a good alternative for all those projects. The most [...]]]></description>
			<content:encoded><![CDATA[<p>It seems that the long-awaited WordPress 3.0 is out and it also seems to have some new features that, in my opinion, brings WordPress closer to what a real CMS should be. I worked quite a lot with Drupal and now I consider WordPress to be a good alternative for all those projects.<br />
The most important feature I consider to be the new custom post type functionality, that should open up great ways for customization. Before, I had to use a plugin that extended the properties of a post. Now, a new post type can be created, with all the new features it needs. Just great!<br />
And I have to mention the new menu feature that was&#8230; just needed!<br />
Here&#8217;s a short video that presents the new features. Hmm&#8230; maybe I&#8217;ll update my site soon <img src='http://www.bogdanirimia.ro/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p><embed src="http://v.wordpress.com/wp-content/plugins/video/flvplayer.swf?ver=1.21" type="application/x-shockwave-flash" width="640" height="360" wmode="transparent" seamlesstabbing="true" allowfullscreen="true" allowscriptaccess="always" overstretch="true" flashvars="guid=BQtfIEY1&amp;width=640&amp;height=360&amp;locksize=no&amp;dynamicseek=false&amp;qc_publisherId=p-18-mFEk4J448M" title="Introducing WordPress 3.0 &quot;Thelonious&quot;"></embed></p>
]]></content:encoded>
			<wfw:commentRss>http://www.bogdanirimia.ro/new-wordpress-3-0/267/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Transparent text over images</title>
		<link>http://www.bogdanirimia.ro/transparent-text-over-images/265</link>
		<comments>http://www.bogdanirimia.ro/transparent-text-over-images/265#comments</comments>
		<pubDate>Mon, 15 Mar 2010 12:26:14 +0000</pubDate>
		<dc:creator>Myself</dc:creator>
				<category><![CDATA[Technology]]></category>
		<category><![CDATA[Web development]]></category>
		<category><![CDATA[css]]></category>
		<category><![CDATA[text]]></category>
		<category><![CDATA[transparent]]></category>

		<guid isPermaLink="false">http://www.bogdanirimia.ro/?p=265</guid>
		<description><![CDATA[I needed recently to overlap, on a web page, a text on an image, and the text was to be white, with a black background, with alpha. For this, the solution is to make two DIVs, both positioned in a container div. The container div has to have &#8220;position: relative&#8221;. The second div has to [...]]]></description>
			<content:encoded><![CDATA[<p>I needed recently to overlap, on a web page, a text on an image, and the text was to be white, with a black background, with alpha. For this, the solution is to make two DIVs, both positioned in a container div. The container div has to have &#8220;position: relative&#8221;. The second div has to have &#8220;position: absolute&#8221;, and to set &#8220;top&#8221; and &#8220;left&#8221; properties so that it would be positioned where you want.</p>
<p>So, to wrap things up:</p>
<p>- container div:</p>
<pre class="brush: css; title: ; notranslate">

#container {
position: relative;
}
</pre>
<p>- image div (or just image tag) &#8211; has nothing special, maybe remove its borders&#8230;</p>
<pre class="brush: css; title: ; notranslate">

#container img {
border: 0;
}
</pre>
<p>- text div (or a special tag, like &#8220;h2&#8243;)</p>
<pre class="brush: css; title: ; notranslate">

#container h2 {
display: block;
position: absolute;
top: 10px;
left: 0;
width: 100px;
height: 30px;
color: white;
background: rgb(0, 0, 0); /* fallback color */
background: rgba(0, 0, 0, 0.15);
}

#IEroot #container h2 {
background:transparent;
filter:progid:DXImageTransform.Microsoft.gradient(startColorstr=#40000000,endColorstr=#40000000);
zoom: 1;
}
</pre>
<p>For IE compatibility, you need to use conditional statements. This is done by adding this code before the container div:</p>
<pre class="brush: xml; title: ; notranslate">
&lt;!--[if IE]&gt;
&lt;div id=&quot;IEroot&quot;&gt;
&lt;![endif]--&gt;
</pre>
<p>and this code after the container div:</p>
<pre class="brush: xml; title: ; notranslate">
&lt;!--[if IE]&gt;
&lt;/div&gt;
&lt;![endif]--&gt;
</pre>
]]></content:encoded>
			<wfw:commentRss>http://www.bogdanirimia.ro/transparent-text-over-images/265/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Cross-domain AJAX</title>
		<link>http://www.bogdanirimia.ro/cross-domain-ajax/257</link>
		<comments>http://www.bogdanirimia.ro/cross-domain-ajax/257#comments</comments>
		<pubDate>Thu, 28 Jan 2010 12:30:35 +0000</pubDate>
		<dc:creator>Myself</dc:creator>
				<category><![CDATA[Technology]]></category>
		<category><![CDATA[Web development]]></category>
		<category><![CDATA[AJAX]]></category>
		<category><![CDATA[cross-domain]]></category>
		<category><![CDATA[jQuery]]></category>
		<category><![CDATA[JSON]]></category>
		<category><![CDATA[JSONP]]></category>

		<guid isPermaLink="false">http://www.bogdanirimia.ro/?p=257</guid>
		<description><![CDATA[When using AJAX, there is a cross-domain security restriction that does not allow accessing an URL with a different domain than the one of the page that contains the script (the script&#8217;s domain). For most AJAX applications, this is not an issue, as you can host the data on the same domain. But let&#8217;s consider [...]]]></description>
			<content:encoded><![CDATA[<p>When using AJAX, there is a cross-domain security restriction that does not allow accessing an URL with a different domain than the one of the page that contains the script (the script&#8217;s domain). For most AJAX applications, this is not an issue, as you can host the data on the same domain. But let&#8217;s consider the real case of developing a web page widget. The widget would be a piece of code that any site can put on their pages and the widget should appear there. If that piece of code has to have AJAX functions (like getting search results), you can&#8217;t use AJAX because the domain of the script (of the page that includes the script) is the one of the client, and the domain of the data-provider is our server&#8217;s domain.<br />
So the solution was to use JSONP (JSON with Padding). JSONP uses the following relaxation of the cross-domain restriction: you can include scripts on your page from another domains. So you can have two scripts on the same page, the scripts having two different domains, and one can call a function from the other one. Of course, calling a function allows exchanging data between those two scripts, so cross-domain communication is possible from JavaScript.<br />
jQuery includes and automates this feature. Here is how you can get JSON data from another domain, using jQuery:</p>
<pre class="brush: jscript; title: ; notranslate">
$.getJSON(&quot;http://just.another.domain/myscript.php?param=&quot;+param+&quot;&amp;callback=?&quot;, function(vals) {
	for(var i in vals) {
		// do something with each value
	}
} );
</pre>
<p>The code for myscript.php could be something like this:</p>
<pre class="brush: php; title: ; notranslate">
&lt;?php
// ... do some processing (based on $_GET['param'])
array_push($results, $val1);
array_push($results, $val2);

echo $_GET['callback'] . '(' . json_encode($results). ');';
?&gt;
</pre>
<p>jQuery automatically generates a function name and puts it in the place of the second &#8216;?&#8217;, so the function to be called from the PHP-generated JavaScript is available in the &#8216;callback&#8217; parameter. All that the PHP script has to do is to output a function call using that function name. As a parameter to that function, we put a string with JSON-encoded data. It has to be JSON-encoded, because the parameter is automatically eval&#8217;d in the jQuery.<br />
So, with these two restrictions (data has to be packed as JSON and the server script has to output a JavaScript function call), you can transmit data between cross-domain scripts.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.bogdanirimia.ro/cross-domain-ajax/257/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Rotating an image on a web page</title>
		<link>http://www.bogdanirimia.ro/rotating-an-image-on-a-web-page/77</link>
		<comments>http://www.bogdanirimia.ro/rotating-an-image-on-a-web-page/77#comments</comments>
		<pubDate>Sat, 21 Nov 2009 15:03:28 +0000</pubDate>
		<dc:creator>Myself</dc:creator>
				<category><![CDATA[Technology]]></category>
		<category><![CDATA[Web development]]></category>
		<category><![CDATA[canvas]]></category>
		<category><![CDATA[Gecko]]></category>
		<category><![CDATA[image]]></category>
		<category><![CDATA[Mozilla]]></category>
		<category><![CDATA[rotation]]></category>
		<category><![CDATA[Safari]]></category>
		<category><![CDATA[web page]]></category>
		<category><![CDATA[WebKit]]></category>
		<category><![CDATA[widget]]></category>

		<guid isPermaLink="false">http://www.bogdanirimia.ro/?p=77</guid>
		<description><![CDATA[This post is about rotating an image on a web page &#8211; that is not rotating more images (slide-showing them). It&#8217;s about rotating an image with an angle. Why would that be useful? If you want to put an image rotated by an angle on a web page, the easiest would be to make a [...]]]></description>
			<content:encoded><![CDATA[<p>This post is about rotating an image on a web page &#8211; that is not rotating more images (slide-showing them). It&#8217;s about rotating an image with an angle. Why would that be useful? If you want to put an image rotated by an angle on a web page, the easiest would be to make a new image, with the original image rotated.</p>
<p>Well, the need appeared when I started to build a Mac OS Dashboard Widget, that had to show some values on an analog display. I needed to rotate the image with the needle by an angle proportional to the value. The angle of rotation had to be modifiable from JavaScript. The Dashboard engine is based on WebKit component, and the widget itself is able to run on Safari as well. So the need to rotate an image on a web page is the generic issue that I had to solve.</p>
<p>The solution is to use the &lt;canvas&gt; tag, available in HTML 5 and  implemented by Safari browser, Gecko-based browsers (like Firefox) and Opera. The image would be drawn on the canvas that can rotate.</p>
<p>The issue with this method is that the canvas rotates around the top left corner. The needle has to be rotated around its rotation center, which is located somewhere inside the image, not on its corner. So a trigonometric transformation had to be implemented (which includes translation and rotation), so that the needle will appear to rotate around its rotation center, not the image corner.</p>
<p>The JavaScript code that implements the rotation is the following:</p>
<pre class="brush: jscript; title: ; notranslate">

function drawImg(canvas, src, angle, centru_ox_delta, centru_oy_delta, canvas_width) {
   var myImg = new Image();
   myImg.src = src;
   myImg.angle = angle;
   myImg.canvas = canvas;
   myImg.oxd = centru_ox_delta;
   myImg.oyd = centru_oy_delta;
   myImg.canvas_w = canvas_width;
   myImg.onload = imageLoadedRotate;
}

function imageLoadedRotate( evt ) {
   var canvas = document.getElementById(this.canvas);
   if(canvas)
      var ctx = document.getElementById(this.canvas).getContext('2d');
   if (ctx) {
      ctx.save();
      ctx.clearRect(0,0,250,250);
      ctx.translate( this.canvas_w*Math.sqrt(2)/2*(0.7 - Math.cos((this.angle+45) * Math.PI / 180)), this.canvas_w*Math.sqrt(2)/2*(0.7 - Math.sin((this.angle+45) * Math.PI / 180)) );
      ctx.rotate(this.angle * Math.PI / 180);
      ctx.drawImage(this, this.canvas_w/2-this.oxd, this.canvas_w/2-this.oyd);
      ctx.restore();
   };
}
</pre>
<p>The &#8220;drawImg&#8221; function creates a new Image object, sets its source (the URL of the needle image), sets its &#8220;loaded&#8221; callback and sets some other custom properties of the object, that will be used in the callback functon. The callback function is &#8220;imageLoadedRotate&#8221;, which obtains the 2d context of the canvas, with which we can draw images on the canvas. We first position the context to the new position, we rotate it, and then we draw the image. The image will appear rotated because the context is rotated. The context properties are first saved, so we can restore them afterwards, because the context will be reused and we need to rotate the images relative to their initial position (vertical, in our case).</p>
<p>The &#8220;imageLoadedRotate&#8221; function also makes the transformation between the degrees value that we use and the radians value that the rotation function understands.</p>
<p>The parameters of the &#8220;drawImg&#8221; function are:</p>
<ul>
<li>canvas &#8211; the id of the canvas to use (&lt;canvas id=&#8221;canvas_id&#8221; width=&#8221;250&#8243; height=&#8221;250&#8243;&gt;&lt;/canvas&gt;)</li>
<li>src &#8211; the URL of the image to draw</li>
<li>angle &#8211; the angle of rotation</li>
<li>centru_ox_delta &#8211; the Ox coordinate of the rotation center of the image, relative to the image&#8217;s left edge</li>
<li>centru_oy_delta &#8211; the Oy coordinate of the rotation center of the image, relative to the image&#8217;s top edge</li>
<li>canvas_width &#8211; the canvas size (width=height, because we used only square canvases, for ease of calculation</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://www.bogdanirimia.ro/rotating-an-image-on-a-web-page/77/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>ImageFlow on the first page</title>
		<link>http://www.bogdanirimia.ro/imageflow-on-the-first-page/45</link>
		<comments>http://www.bogdanirimia.ro/imageflow-on-the-first-page/45#comments</comments>
		<pubDate>Tue, 10 Nov 2009 12:29:45 +0000</pubDate>
		<dc:creator>Myself</dc:creator>
				<category><![CDATA[Technology]]></category>
		<category><![CDATA[Web development]]></category>
		<category><![CDATA[gallery]]></category>
		<category><![CDATA[ImageFlow]]></category>
		<category><![CDATA[Shadowbox]]></category>

		<guid isPermaLink="false">http://www.bogdanirimia.ro/?p=45</guid>
		<description><![CDATA[For this site I wanted to use an imageflow-type gallery on the index page. There I will upload several pictures of mine The first thing to try was searching an already-made module for wordpress. I couldn&#8217;t find one that was the way I wanted &#8211; either they were old, not working, bulky, slow, ugly, or [...]]]></description>
			<content:encoded><![CDATA[<p><img class="alignleft size-full wp-image-55" title="ImageFlow" src="http://www.bogdanirimia.ro/wp-content/uploads/2009/11/imageflow.jpg" alt="ImageFlow" width="350" height="178" />For this site I wanted to use an imageflow-type gallery on the index page. There I will upload several pictures of mine <img src='http://www.bogdanirimia.ro/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>The first thing to try was searching an already-made module for wordpress. I couldn&#8217;t find one that was the way I wanted &#8211; either they were old, not working, bulky, slow, ugly, or they were not free.</p>
<p>So then I decided to manufacture one myself. The first step was to find an imageflow control, not too complicated, free and nice-looking. I found this <a href="http://imageflow.finnrudolph.de/" target="_blank">ImageFlow </a>control which is customizable, free and cute. It isn&#8217;t exactly the fastest (it uses JavaScript quite a lot), but it is clean and straightforward. I uploaded the folder extracted from the downloaded archive in my theme folder (I integrated it directly in my theme). Then, in the header.php file I added the references:</p>
<pre class="brush: php; title: ; notranslate">
&lt;?php /* ImageFlow Object */ ?&gt;
&lt;?php if(is_home()) { ?&gt;
&lt;link rel=&quot;stylesheet&quot; href=&quot;&lt;?php echo bloginfo('template_url'); ?&gt;/ImageFlow/imageflow.css&quot; type=&quot;text/css&quot; /&gt;
&lt;script src=&quot;&lt;?php echo bloginfo('template_url'); ?&gt;/ImageFlow/imageflow.js&quot; type=&quot;text/javascript&quot;&gt;&lt;/script&gt;
&lt;?php } ?&gt;
</pre>
<p>In the index.php file, I added this:</p>
<pre class="brush: php; title: ; notranslate">
&lt;div id=&quot;myImageFlow&quot; style=&quot;width: 600px; &quot;&gt;
&lt;?php
// show all images in a folder
$dirname = &quot;/imageflow/&quot;;
$dir = opendir($dirname);
while(false != ($file = readdir($dir)))
{
   if(($file != &quot;.&quot;) and ($file != &quot;..&quot;) and strpos($file, 'refl_')!==0 )
   {
      echo &quot;&lt;img src=\&quot;/imageflow/{$file}\&quot; longdesc=\&quot;/imageflow/{$file}\&quot; alt=\&quot;\&quot; /&gt;\n&quot;;
   }
}
?&gt;
&lt;/div&gt;
</pre>
<p>The code above lists all the images in the &#8220;imageflow&#8221; folder. I rejected the files that have names starting with &#8220;refl_&#8221; because they are cache files created by ImageFlow for reflections. If I was to show them too, the reflection of reflection appeared, and so on&#8230;</p>
<p>I also wanted to display the images on white, to hide the slider and to open all the images in a LightBox. For this, I installed the plugin &#8220;Shadowbox JS&#8221;, an excellent plugin that allow to view images, movies, html in an shadowbox (like the lightbox). The plugin is based on the <a href="http://www.shadowbox-js.com/" target="_blank">Shadowbox.js</a> library. Then I modified the file &#8220;imageflow.js&#8221; to include the needed features:</p>
<pre class="brush: jscript; title: ; notranslate">
instanceOne.init({ ImageFlowID:'myImageFlow', buttons: true, captions: false, onClick: function() { Shadowbox.open({content:    this.url, player: &quot;img&quot;}) }, slider: false, reflectionGET: '&amp;bgc=ffffff', opacity: true });
</pre>
<p>This line is at the end of the file, in the function &#8220;domReady&#8221;. I included the onClick event to call for the Shadowbox.js library.</p>
<p>And&#8230; that was it. You can admire the result on the first page (at least for now <img src='http://www.bogdanirimia.ro/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  )</p>
<p>UPDATE:</p>
<p>I received some complaints that the ImageFlow control on the first page is slow. That was because I was loading with it high-res images, which were afterwards showed with Shadowbox. This wasn&#8217;t good at all, so I cropped and resized the images, so that now they are square and much smaller (150&#215;150 px). I renamed them &#8220;thumb_xxxx&#8221;, where xxxx is the original name of the file. Then, in the index.php file of the theme, I updated the ImageFlow code like this:</p>
<pre class="brush: php; title: ; notranslate">
$dirname = &quot;/imageflow/&quot;;
$dir = opendir($dirname);
$names = array();
while(false != ($file = readdir($dir)))
{
   if(($file != &quot;.&quot;) and ($file != &quot;..&quot;) and strpos($file, 'thumb_')===0 )
   {
      $val['thumb'] = $file;
      $val['img'] = substr($file, 6, strlen($file));
      $names[] = $val;
    }
}

asort($names);
foreach($names as $name) {
   echo &quot;&lt;img src=\&quot;//imageflow/&quot;.$name['thumb'].&quot;\&quot; longdesc=\&quot;/imageflow/&quot;.$name['img'].&quot;\&quot; alt=\&quot;\&quot; /&gt;\n&quot;;
}
</pre>
<p>I used an array to sort the images by their filename.</p>
<p>The second issue was that when viewing a large image with Shadowbox, I couldn&#8217;t browse through the rest of the gallery&#8217;s images. For this, I had to modify the imageflow.js file, so that the last function in it looks like this:</p>
<pre class="brush: jscript; title: ; notranslate">
domReady(function()
{
   var instanceOne = new ImageFlow();
   var myImages=new Array();

   var ImageFlowDiv = document.getElementById('myImageFlow');
   var max = ImageFlowDiv.childNodes.length;
   for(var index = 0; index &lt; max; index++)
   {
      node = ImageFlowDiv.childNodes[index];
      if (node &amp;&amp; node.nodeType == 1 &amp;&amp; node.nodeName == 'IMG')
      {
         var src = node.getAttribute('src',2);
         src=src.replace(&quot;/thumb_&quot;,&quot;/&quot;);
         myImages.push({content: src, player: &quot;img&quot;});
      }
   }

   instanceOne.init({ ImageFlowID:'myImageFlow', buttons: true, captions: false, slider: false, reflectionGET: '&amp;bgc=ffffff', opacity: true, aspectRatio: 2.65, startID: 5 });
   instanceOne.onClick = function() {
      var index=0;
      for(img in myImages) {
         if(myImages[img].content == this.url)
         index=parseInt(img);
      }
      Shadowbox.options.onOpen=function() {
         Shadowbox.current=index;
      }
      Shadowbox.open(myImages);
   }
});
</pre>
<p>The code now loads all the image files specified for ImageFlow, eliminates the &#8220;thumb_&#8221; prefix, and builds a gallery. Then, when opened, it identifies the image that has been clicked in ImageFlow (comparing their paths) and sets the current image to that one (so that when clicking, say, the second image, the Shadowbox gallery opens up and the second image is shown). This one was quite tricky, because I had problems finding a way to set the current image after loading a gallery in Shadowbox (I used the onOpen hook).</p>
<p>Oh, and for the ImageFlow to work, when using reflection the reflect2.php or reflect3.php file has to be copied in the root folder of your site!</p>
<p>So&#8230; this would be it <img src='http://www.bogdanirimia.ro/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://www.bogdanirimia.ro/imageflow-on-the-first-page/45/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>&#8220;deviant-thumbs&#8221; plugin</title>
		<link>http://www.bogdanirimia.ro/deviantart-plugin/29</link>
		<comments>http://www.bogdanirimia.ro/deviantart-plugin/29#comments</comments>
		<pubDate>Mon, 09 Nov 2009 21:55:14 +0000</pubDate>
		<dc:creator>Myself</dc:creator>
				<category><![CDATA[Technology]]></category>
		<category><![CDATA[Web development]]></category>
		<category><![CDATA[DeviantArt]]></category>
		<category><![CDATA[feed]]></category>
		<category><![CDATA[plugin]]></category>
		<category><![CDATA[scribu]]></category>
		<category><![CDATA[SimplePie]]></category>
		<category><![CDATA[WordPress]]></category>

		<guid isPermaLink="false">http://www.bogdanirimia.ro/?p=29</guid>
		<description><![CDATA[When building this site, I thought I should add some color to it. And because I am a fan of DeviantArt, I looked for a way of showing several images from there in the sidebar. I discovered, after some search, the plugin deviant-thumbs, which actually got updated to version 1.9.2. It works great &#8211; it [...]]]></description>
			<content:encoded><![CDATA[<p>When building this site, I thought I should add some color to it. And because I am a fan of <a href="http://www.deviantart.com" target="_blank">DeviantArt</a>, I looked for a way of showing several images from there in the sidebar.</p>
<p>I discovered, after some search, the plugin <a href="http://wordpress.org/extend/plugins/deviant-thumbs/" target="_blank">deviant-thumbs</a>, which actually got updated to version 1.9.2. It works great &#8211; it uses the SimplePie engine included in WordPress, which caches the data, offers the possibility to add several widgets to the sidebar and&#8230; looks ok. The only thing that I couldn&#8217;t figure out why isn&#8217;t working is the search string &#8211; I wanted to show just my favs, so I used the search string &#8220;favby: myusername&#8221;. It didn&#8217;t take into account any search string &#8211; it was showing random images. The feed content is saved in the table &#8220;wp_options&#8221;, in the records with the option_name like &#8220;_transient_timeout_feed_mod_xxxxxxxx&#8221;, &#8220;_transient_timeout_feed_xxxxxxxx&#8221;, &#8220;_transient_feed_mod_xxxxxxxx&#8221; and &#8220;_transient_feed_xxxxxxxx&#8221;. These records can be deleted to empty the feed cache. If you delete all the records with these names, the cache for all feeds of the site will be emptied. When refreshing the page, if you use the widget, the cache will be rebuilt.</p>
<p>The issue was in the function &#8220;remote_get&#8221;, found in the file &#8220;deviant-thumbs.php&#8221;, around line 75. There, the url used included the search string, but it wasn&#8217;t url-encoded.</p>
<p>You should modify the line 73 so that it looks like this:</p>
<pre class="brush: php; title: ; notranslate">$url  = add_query_arg('q', urlencode($query), 'http://backend.deviantart.com/rss.xml?type=deviation');</pre>
<p>Of course, when clicking on an image, a new window should be opened with the DeviantArt page, so that the user shouldn&#8217;t exit the current site. A small modification at line 110 in the same file solved the problem (I added &#8220;target=&#8217;_blank&#8217;&#8221;):</p>
<pre class="brush: php; title: ; notranslate">$thumbs[] = &quot;&lt;a title='$title' href='$link' target='_blank'&gt;&lt;img src='$src' /&gt;&lt;/a&gt;&quot;;</pre>
<p>So now I can enjoy scribu&#8217;s &#8220;deviant-thumbs&#8221; plugin at its fullest!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.bogdanirimia.ro/deviantart-plugin/29/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

