<?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>阿德日志 &#187; 图片</title>
	<atom:link href="http://blog.shidelai.cn/tag/%e5%9b%be%e7%89%87/feed" rel="self" type="application/rss+xml" />
	<link>http://blog.shidelai.cn</link>
	<description>WordPress, Blog, linux, 杂文</description>
	<lastBuildDate>Thu, 29 Jul 2010 13:00:41 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<item>
		<title>flickrRSS高阶应用三部曲之新版本flickrRss 5.0补录</title>
		<link>http://blog.shidelai.cn/2009/03/flickrrss-50.html</link>
		<comments>http://blog.shidelai.cn/2009/03/flickrrss-50.html#comments</comments>
		<pubDate>Wed, 25 Mar 2009 15:28:31 +0000</pubDate>
		<dc:creator>阿德</dc:creator>
				<category><![CDATA[wordpress]]></category>
		<category><![CDATA[flickrRSS]]></category>
		<category><![CDATA[图片]]></category>

		<guid isPermaLink="false">http://blog.shidelai.cn/?p=794</guid>
		<description><![CDATA[因为wordpress更新的原因，flickrRSS也相应做了更新，改变了函数参数的编写方式，并加入了更易于配置的html参数。总之，更强大了，使用也更复制了。

我在flickrRSS高阶使用三部曲之二：在WordPr... ]]></description>
			<content:encoded><![CDATA[<p>因为<a href="http://blog.shidelai.cn/tag/wordpress" class="st_tag internal_tag" rel="tag nofollow" title="Posts tagged with wordpress">wordpress</a>更新的原因，<a href="http://blog.shidelai.cn/tag/flickrrss" class="st_tag internal_tag" rel="tag nofollow" title="Posts tagged with flickrRSS">flickrRSS</a>也相应做了更新，改变了函数参数的编写方式，并加入了更易于配置的html参数。总之，更强大了，使用也更复制了。</p>
<p>我在<a title="Permanent Link: flickrRSS高阶使用三部曲之二：在WordPress博客中显示与文章内容相关的Flickr图片" rel="bookmark" href="../2008/06/essay-photo.html">flickrRSS高阶使用三部曲之二：在WordPress博客中显示与文章内容相关的Flickr图片</a>中提到的在文章后面显示与文章内容相关的<a href="http://blog.shidelai.cn/tag/flickr" class="st_tag internal_tag" rel="tag nofollow" title="Posts tagged with flickr">flickr</a>图片的功能如果不加以修改是不能使用的。拖了好几个星期，今天因为改了域名（www.shidelai.cn），所以想有个好的开始，把新的代码搞出来了，和原来的效果一样，接近完美。你可以根据我的代码加以修改成自己的代码，比如如果你的页面比较窄，那么可以把&#8217;num_items&#8217; =&gt; 8修改为&#8217;num_items&#8217; =&gt; 5等等。</p>
<p>具体方法如下：</p>
<p>将<a title="Permanent Link: flickrRSS高阶使用三部曲之二：在WordPress博客中显示与文章内容相关的Flickr图片" rel="bookmark" href="../2008/06/essay-photo.html">flickrRSS高阶使用三部曲之二：在WordPress博客中显示与文章内容相关的Flickr图片</a></p>
<blockquote><p>&lt;?php get_flickrRSS(8, &#8220;community&#8221;, &#8220;$first_tag&#8221;, &#8220;square&#8221;, &#8220;&amp;nbsp;&#8221;, &#8220;&amp;nbsp;&#8221;); ?&gt;</p></blockquote>
<p>修改为：</p>
<blockquote><p>&lt;?php get_flickrRSS(array(&#8216;num_items&#8217; =&gt; 8, &#8216;type&#8217; =&gt; &#8216;public&#8217;, &#8216;tags&#8217; =&gt; &#8220;$first_tag&#8221;, &#8216;html&#8217; =&gt; &#8216;&amp;nbsp;&lt;a href=&#8221;%flickr_page%&#8221; title=&#8221;%title%&#8221;&gt;&lt;img src=&#8221;%image_square%&#8221; alt=&#8221;%title%&#8221;/&gt;&lt;/a&gt;&amp;nbsp;&#8217;)); ?&gt;</p></blockquote>
<p>就OK了。</p>
<h2>参数解释：</h2>
<h3>The Parameters</h3>
<p><span style="font-family: 'courier new',monospace;">&#8216;type&#8217; =&gt; &#8216;user&#8217;</span> – The type of <a href="http://blog.shidelai.cn/tag/flickr" class="st_tag internal_tag" rel="tag nofollow" title="Posts tagged with flickr">Flickr</a> images that you want to show. Possible values: &#8216;user&#8217;, &#8216;favorite&#8217;, &#8216;set&#8217;, &#8216;group&#8217;, &#8216;public&#8217;</p>
<p><span style="font-family: 'courier new',monospace;">&#8216;tags&#8217; =&gt; &#8221; </span>– Optional: Can be used with type = &#8216;user&#8217; or &#8216;public&#8217;, comma separated</p>
<p><span style="font-family: 'courier new',monospace;">&#8216;set&#8217; =&gt; &#8221;</span> – Optional: To be used with type = &#8216;set&#8217;</p>
<p><span style="font-family: 'courier new',monospace;">&#8216;id&#8217; =&gt; &#8221; </span>– Optional: Your Group or User ID. To be used with type = &#8216;user&#8217; or &#8216;group&#8217;</p>
<p>&#8216;<span style="font-family: 'courier new',monospace;">do_cache&#8217; =&gt; false</span> – Enable the image cache</p>
<p><span style="font-family: 'courier new',monospace;">&#8216;cache_sizes&#8217; =&gt; array(&#8216;square&#8217;) </span>– What are the image sizes we want to cache locally? Possible values: &#8216;square&#8217;, &#8216;thumbnail&#8217;, &#8216;small&#8217;, &#8216;medium&#8217; or &#8216;large&#8217;</p>
<p><span style="font-family: 'courier new',monospace;">&#8216;cache_path&#8217; =&gt; &#8221;</span> – Where the images are saved (server path)</p>
<p><span style="font-family: 'courier new',monospace;">&#8216;cache_uri&#8217; =&gt; &#8221;</span> – The URI associated to the cache path (web address)</p>
<p><span style="font-weight: bold;">Presentational params</span></p>
<p><span style="font-family: 'courier new',monospace;">&#8216;num_items&#8217; =&gt; 4</span> – The number of images that you want to display</p>
<p><span style="font-family: 'courier new',monospace;">&#8216;before_list&#8217; =&gt; &#8216;</span><span style="font-family: 'courier new',monospace;">&#8216;</span> – The HTML to print before the list of images</p>
<p><span style="font-family: 'courier new',monospace;">&#8216;html&#8217; =&gt; &#8216;&lt;a href=&#8221;%flickr_page%&#8221; title=&#8221;%title%&#8221;&gt;&lt;img src=&#8221;%image_square%&#8221; alt=&#8221;%title%&#8221;/&gt;&lt;/a</span><span style="font-family: 'courier new',monospace;">&gt;&#8217;</span> – the code to print out for each image.</p>
<p style="margin: 0px;"><span style="font-size: 10px;">Meta tags available:<span style="font-size: 13px;"> </span>%flickr_page%, %title%, %image_small%, %image_square%, %image_thumbnail%, %image_medium%, %image_large%</span></p>
<p><span style="font-family: 'courier new',monospace;">&#8216;default_title&#8217; =&gt; &#8220;Untitled <a href="http://blog.shidelai.cn/tag/flickr" class="st_tag internal_tag" rel="tag nofollow" title="Posts tagged with flickr">Flickr</a> photo&#8221;</span> – the default title</p>
<p><span style="font-family: 'courier new',monospace;">&#8216;after_list&#8217; =&gt; </span><span><span style="font-family: 'courier new',monospace;">&#8216;</span></span><span style="font-family: 'courier new',monospace;">&#8216;</span> – the HTML to print after the list of images</p>
<h3>Examples</h3>
<p><span style="border-collapse: collapse;"><span style="font-family: 'courier new',monospace;">&lt;?php get_flickrRSS(array(&#8216;num_items&#8217; =&gt; 4, &#8217;type&#8217; =&gt; &#8216;public&#8217;, &#8217;tags&#8217; =&gt; &#8216;sunflowers&#8217;)); ?&gt;</span> – This will display four photos from the public stream that are tagged with sunflowers</span></p>
<p><span style="font-family: 'courier new',monospace;">&lt;?php get_flickrRSS(array(&#8216;set&#8217; =&gt; &#8217;1234567890&#8242;, &#8217;num_items&#8217; =&gt; 6, &#8217;type&#8217; =&gt; &#8216;set&#8217;)); ?&gt;</span> – This will display six photos from a specified set</p>
<p>另外可以参考下本站的<a title="源码" href="http://blog.shidelai.cn/wp-content/uploads/2009/04/single.php" target="_blank">源码</a></p>

	<b>[相关文章]</b>
	<ul class="st-related-posts">
	<li><a href="http://blog.shidelai.cn/2008/10/national-travel.html" title="国庆游记（9月30~10月1） (2008-10-1)">国庆游记（9月30~10月1）</a> (1)</li>
	<li><a href="http://blog.shidelai.cn/about" title="关于本站 (2008-05-6)">关于本站</a> (41)</li>
	<li><a href="http://blog.shidelai.cn/2008/12/photo-css-max.html" title="不同浏览器里图片大小不同的解决方法 (2008-12-23)">不同浏览器里图片大小不同的解决方法</a> (2)</li>
	<li><a href="http://blog.shidelai.cn/2008/06/essay-photo.html" title="flickrRSS高阶使用三部曲之二：在WordPress博客中显示与文章内容相关的Flickr图片 (2008-06-14)">flickrRSS高阶使用三部曲之二：在WordPress博客中显示与文章内容相关的Flickr图片</a> (7)</li>
	<li><a href="http://blog.shidelai.cn/2008/06/how-to-flickrrss.html" title="flickrRSS高阶使用三部曲之一：显示flickr上的图片 (2008-06-13)">flickrRSS高阶使用三部曲之一：显示flickr上的图片</a> (5)</li>
</ul>

]]></content:encoded>
			<wfw:commentRss>http://blog.shidelai.cn/2009/03/flickrrss-50.html/feed</wfw:commentRss>
		<slash:comments>12</slash:comments>
		</item>
		<item>
		<title>不同浏览器里图片大小不同的解决方法</title>
		<link>http://blog.shidelai.cn/2008/12/photo-css-max.html</link>
		<comments>http://blog.shidelai.cn/2008/12/photo-css-max.html#comments</comments>
		<pubDate>Tue, 23 Dec 2008 14:39:43 +0000</pubDate>
		<dc:creator>阿德</dc:creator>
				<category><![CDATA[wordpress]]></category>
		<category><![CDATA[图片]]></category>
		<category><![CDATA[浏览器]]></category>

		<guid isPermaLink="false">http://www.soulward.cn/?p=630</guid>
		<description><![CDATA[我之前写过flickrRSS高阶使用三部曲之二：在WordPress博客中显示与文章内容相关的Flickr图片，后来发现一个问题：原本图片大小这个参数选择square的话，显示的应该是几张75×75的图片，这在firefox... ]]></description>
			<content:encoded><![CDATA[<a href='http://blog.shidelai.cn/2008/12/photo-css-max.html' target="_blank" rel="nofollow"><img src="http://blog.shidelai.cn/wp-content/gallery/icons/wordpress.jpg" style="border:0; float:left; margin: 0 1em .5em 0;" alt="不同浏览器里图片大小不同的解决方法" title="不同浏览器里图片大小不同的解决方法"/></a>
<p>我之前写过<a title="Permanent Link to flickrRSS高阶使用三部曲之二：在WordPress博客中显示与文章内容相关的Flickr图片" rel="bookmark" href="../2008/06/essay-photo.html">flickrRSS高阶使用三部曲之二：在WordPress博客中显示与文章内容相关的Flickr图片</a>，后来发现一个问题：原本图片大小这个参数选择square的话，显示的应该是几张75×75的图片，这在firefox里面一直是正常的，但IE里面就不是这样了，很多图片会被放大，影响总体效果。</p>
<p>前些天偶尔翻CSS手册，看到max-height属性，心想这正好可以解决这个问题。解决方法如下：</p>
<p>修改css文件添加如下代码：</p>
<blockquote><p>#related-pic img {<br />
max-height:75px;<br />
max-width:75px;<br />
width: expression( this.width&gt; 75 ? &#8220;75px&#8221; : (this.width+&#8221;px&#8221;) );<br />
height: expression( this.height&gt; 75 ? &#8220;75px&#8221; : (this.height+&#8221;px&#8221;) );<br />
}</p></blockquote>
<p>意思就是说，在id为related-pic的容器里面，图片(img)的最大宽度和长度是75px，如果发现宽度或长度大于75的，就改成75，如果小于75的就大小不变。</p>
<p>然后在single.php中出现75×75的图片的地方用id为related-pic的容器括进去就可以了：</p>
<blockquote><p>&lt;b&gt;[相关图片]&lt;/b&gt;&lt;br /&gt;<br />
&lt;div id=&#8221;related-pic&#8221;&gt;<br />
&lt;?php get_flickrRSS(8, &#8220;community&#8221;, &#8220;$first_tag&#8221;, &#8220;square&#8221;, &#8220;&amp;nbsp;&#8221;, &#8220;&amp;nbsp;&#8221;); ?&gt;<br />
&lt;/div&gt;</p></blockquote>
<p>这样，IE的显示就正常了。你当然也可以把上面这段CSS代码这届嵌入到HTML代码里面，如:</p>
<blockquote><p>&lt;div style=&#8221;css code&#8221;&gt;<br />
&lt;?php get_flickrRSS(8, &#8220;community&#8221;, &#8220;$first_tag&#8221;, &#8220;square&#8221;, &#8220;&amp;nbsp;&#8221;, &#8220;&amp;nbsp;&#8221;); ?&gt;<br />
&lt;/div&gt;</p></blockquote>
<p>类似的， 你也可以设定文章内容中图片的最大宽度，以免不小心用了太大的图，把页面撑得面目全非。</p>

	<b>[相关文章]</b>
	<ul class="st-related-posts">
	<li><a href="http://blog.shidelai.cn/2008/10/national-travel.html" title="国庆游记（9月30~10月1） (2008-10-1)">国庆游记（9月30~10月1）</a> (1)</li>
	<li><a href="http://blog.shidelai.cn/2009/03/flickrrss-50.html" title="flickrRSS高阶应用三部曲之新版本flickrRss 5.0补录 (2009-03-25)">flickrRSS高阶应用三部曲之新版本flickrRss 5.0补录</a> (12)</li>
	<li><a href="http://blog.shidelai.cn/2008/06/essay-photo.html" title="flickrRSS高阶使用三部曲之二：在WordPress博客中显示与文章内容相关的Flickr图片 (2008-06-14)">flickrRSS高阶使用三部曲之二：在WordPress博客中显示与文章内容相关的Flickr图片</a> (7)</li>
</ul>

]]></content:encoded>
			<wfw:commentRss>http://blog.shidelai.cn/2008/12/photo-css-max.html/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>国庆游记（9月30~10月1）</title>
		<link>http://blog.shidelai.cn/2008/10/national-travel.html</link>
		<comments>http://blog.shidelai.cn/2008/10/national-travel.html#comments</comments>
		<pubDate>Wed, 01 Oct 2008 12:40:55 +0000</pubDate>
		<dc:creator>阿德</dc:creator>
				<category><![CDATA[我的日记]]></category>
		<category><![CDATA[上海]]></category>
		<category><![CDATA[国庆]]></category>
		<category><![CDATA[图片]]></category>
		<category><![CDATA[崇明岛]]></category>

		<guid isPermaLink="false">http://www.soulward.cn/?p=490</guid>
		<description><![CDATA[经过商量打算一群人去崇明岛玩两天 国庆去崇明岛的人N多啊，队伍前面还打起架来了 三位MM 好一副田园风光啊 入住的宝根足球宾馆，位于宝根足球基地里面，环境不错~~~~~ 这样的景观到处都... ]]></description>
			<content:encoded><![CDATA[<p style="text-align: center;">经过商量打算一群人去崇明岛玩两天</p>
<p style="text-align: center;"><a title="DSCF0104 by 阿德Delai, on Flickr" href="http://www.flickr.com/photos/delai/2926871490/"><img class="aligncenter" src="http://76.13.18.77/3237/2926871490_864f722188.jpg" alt="DSCF0104" width="500" height="375" /></a></p>
<p style="text-align: center;">国庆去崇明岛的人N多啊，队伍前面还打起架来了</p>
<p style="text-align: center;"><a title="SNV31797 by 阿德Delai, on Flickr" href="http://www.flickr.com/photos/delai/2925948529/"><img class="aligncenter" src="http://76.13.18.77/3235/2925948529_c6d4f3d57f.jpg" alt="SNV31797" width="500" height="375" /></a></p>
<p style="text-align: center;">三位MM</p>
<p><!--inline-more--></p>
<p style="text-align: center;"><a title="SNV31820 by 阿德Delai, on Flickr" href="http://www.flickr.com/photos/delai/2926801004/"><img class="aligncenter" src="http://76.13.18.77/3190/2926801004_2fcb20954c.jpg" alt="SNV31820" width="500" height="375" /></a></p>
<p style="text-align: center;">好一副田园风光啊</p>
<p style="text-align: center;"><a title="SNV31839 by 阿德Delai, on Flickr" href="http://www.flickr.com/photos/delai/2926801196/"><img class="aligncenter" src="http://76.13.18.77/3051/2926801196_f7664fba82.jpg" alt="SNV31839" width="500" height="375" /></a></p>
<p style="text-align: center;">入住的宝根足球宾馆，位于宝根足球基地里面，环境不错~~~~~</p>
<p style="text-align: center;"><a title="SNV31845 by 阿德Delai, on Flickr" href="http://www.flickr.com/photos/delai/2926801346/"><img class="aligncenter" src="http://76.13.18.77/3053/2926801346_739a288a10.jpg" alt="SNV31845" width="375" height="500" /></a></p>
<p style="text-align: center;">这样的景观到处都是~~~~~~</p>
<p style="text-align: center;"><a href="http://blog.shidelai.cn/wp-content/uploads//2008/09/e58886e589b2e7babf.png"><img class="alignnone size-full wp-image-434" title="阿德日志（blog.shidelai.cn）" src="http://blog.shidelai.cn/wp-content/uploads//2008/09/e58886e589b2e7babf.png" alt="" width="500" height="16" /></a></p>
<p style="text-align: center;">下面是深林公园</p>
<p style="text-align: center;"><a title="SNV31868 by 阿德Delai, on Flickr" href="http://www.flickr.com/photos/delai/2925951095/"><img class="aligncenter" src="http://76.13.18.77/3251/2925951095_8fcdd798ea.jpg" alt="SNV31868" width="375" height="500" /></a></p>
<p style="text-align: center;"><a title="DSCF0021 by 阿德Delai, on Flickr" href="http://www.flickr.com/photos/delai/2926008491/"><img src="http://76.13.18.77/3289/2926008491_641d522af8.jpg" alt="DSCF0021" width="500" height="375" /></a></p>
<p style="text-align: center;"><a title="SNV31871 by 阿德Delai, on Flickr" href="http://www.flickr.com/photos/delai/2926803736/"><img class="aligncenter" src="http://76.13.18.77/3082/2926803736_356fb18805.jpg" alt="SNV31871" width="375" height="500" /></a></p>
<p style="text-align: center;"><a title="SNV31875 by 阿德Delai, on Flickr" href="http://www.flickr.com/photos/delai/2925951661/"><img class="aligncenter" src="http://76.13.18.77/3078/2925951661_67430e61e3.jpg" alt="SNV31875" width="375" height="500" /></a></p>
<p style="text-align: center;">我貌似很像伪军</p>
<p style="text-align: center;"><a title="SNV31876 by 阿德Delai, on Flickr" href="http://www.flickr.com/photos/delai/2926804176/"><img src="http://76.13.18.77/3174/2926804176_679686b64d.jpg" alt="SNV31876" width="500" height="375" /></a></p>
<p style="text-align: center;"><a title="SNV31882 by 阿德Delai, on Flickr" href="http://www.flickr.com/photos/delai/2926804462/"><img src="http://76.13.18.77/3105/2926804462_cd74ab225b.jpg" alt="SNV31882" width="500" height="375" /></a></p>
<p style="text-align: center;"><a title="SNV31888 by 阿德Delai, on Flickr" href="http://www.flickr.com/photos/delai/2926804738/"><img src="http://76.13.18.77/3163/2926804738_a62f9ac4e7.jpg" alt="SNV31888" width="500" height="375" /></a></p>
<p style="text-align: center;">有跑马场，但我们去的时候在中午～～～马儿要休息～～～～，。。还没骑过马嗯<br />
<a title="SNV31902 by 阿德Delai, on Flickr" href="http://www.flickr.com/photos/delai/2925952585/"><img src="http://76.13.18.77/3029/2925952585_fb0b0708f8.jpg" alt="SNV31902" width="500" height="375" /></a></p>
<p style="text-align: center;"><a title="DSCF0110 by 阿德Delai, on Flickr" href="http://www.flickr.com/photos/delai/2926864812/"><img src="http://76.13.18.77/3250/2926864812_e848f49464.jpg" alt="DSCF0110" width="500" height="411" /></a></p>
<p style="text-align: center;">这个还是蛮有意思的<br />
<a title="SNV31907 by 阿德Delai, on Flickr" href="http://www.flickr.com/photos/delai/2925952809/"><img src="http://76.13.18.77/3281/2925952809_f2acfb7c77.jpg" alt="SNV31907" width="500" height="375" /></a></p>
<p style="text-align: center;">这辆车～～～～～·<br />
<a title="SNV31908 by 阿德Delai, on Flickr" href="http://www.flickr.com/photos/delai/2925952977/"><img src="http://76.13.18.77/3240/2925952977_0a4b26c1ac.jpg" alt="SNV31908" width="500" height="375" /></a><br />
<a title="SNV31909 by 阿德Delai, on Flickr" href="http://www.flickr.com/photos/delai/2926805518/"><img src="http://76.13.18.77/3068/2926805518_05ea7f9fbb.jpg" alt="SNV31909" width="500" height="375" /></a><br />
<a title="DSCF0103 by 阿德Delai, on Flickr" href="http://www.flickr.com/photos/delai/2926826160/"><img src="http://76.13.18.77/3285/2926826160_89a44c23e2.jpg" alt="DSCF0103" width="500" height="375" /></a><br />
<a title="DSCF0126 by 阿德Delai, on Flickr" href="http://www.flickr.com/photos/delai/2926826498/"><img src="http://76.13.18.77/3001/2926826498_4f90958851.jpg" alt="DSCF0126" width="500" height="375" /></a><br />
<a title="DSCF0142 by 阿德Delai, on Flickr" href="http://www.flickr.com/photos/delai/2926826642/"><img src="http://76.13.18.77/3091/2926826642_b891caf7e6.jpg" alt="DSCF0142" width="500" height="375" /></a></p>
<p style="text-align: center;"><a title="DSCF0050 by 阿德Delai, on Flickr" href="http://www.flickr.com/photos/delai/2926011653/"><img src="http://76.13.18.77/3296/2926011653_3a5fcb5ac3.jpg" alt="DSCF0050" width="500" height="375" /></a></p>
<p style="text-align: center;">卡丁车哈哈</p>
<p style="text-align: center;"><a title="DSCF0009 by 阿德Delai, on Flickr" href="http://www.flickr.com/photos/delai/2926860906/"><img class="aligncenter" src="http://76.13.18.77/3134/2926860906_1116614eb0.jpg" alt="DSCF0009" width="500" height="375" /></a></p>
<p style="text-align: center;">小show一下</p>

	<b>[相关文章]</b>
	<ul class="st-related-posts">
	<li><a href="http://blog.shidelai.cn/2008/10/national-day-travel-2.html" title="国庆游记（10月2~3） (2008-10-3)">国庆游记（10月2~3）</a> (0)</li>
	<li><a href="http://blog.shidelai.cn/2008/09/national-day-travel.html" title="国庆游记(9月28号~9月29号) (2008-09-29)">国庆游记(9月28号~9月29号)</a> (0)</li>
	<li><a href="http://blog.shidelai.cn/2010/04/april-fools-day-daily.html" title="愚人节日记 (2010-04-1)">愚人节日记</a> (1)</li>
	<li><a href="http://blog.shidelai.cn/2008/12/photo-css-max.html" title="不同浏览器里图片大小不同的解决方法 (2008-12-23)">不同浏览器里图片大小不同的解决方法</a> (2)</li>
	<li><a href="http://blog.shidelai.cn/2010/04/south-shanghai-railway-station.html" title="上海火车南站小贴士 (2010-04-26)">上海火车南站小贴士</a> (0)</li>
</ul>

]]></content:encoded>
			<wfw:commentRss>http://blog.shidelai.cn/2008/10/national-travel.html/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>flickrRSS高阶使用三部曲之二：在WordPress博客中显示与文章内容相关的Flickr图片</title>
		<link>http://blog.shidelai.cn/2008/06/essay-photo.html</link>
		<comments>http://blog.shidelai.cn/2008/06/essay-photo.html#comments</comments>
		<pubDate>Sat, 14 Jun 2008 06:55:56 +0000</pubDate>
		<dc:creator>阿德</dc:creator>
				<category><![CDATA[wordpress]]></category>
		<category><![CDATA[flickr]]></category>
		<category><![CDATA[内容]]></category>
		<category><![CDATA[图片]]></category>
		<category><![CDATA[插件]]></category>
		<category><![CDATA[文章相关]]></category>

		<guid isPermaLink="false">http://www.soulward.cn/?p=214</guid>
		<description><![CDATA[在WordPress插件：显示flickr上的图片－flickrRSS使用详解中我介绍了flickrRSS插件的简单应用，也列举了如何在留言框下面显示flickr上最新发布的标签为：hangzhou的图片。但阿德总感觉这样太单调了，... ]]></description>
			<content:encoded><![CDATA[<p>在<a href="http://blog.shidelai.cn/2008/06/how-to-flickrrss.html/" target="_blank">WordPress插件：显示flickr上的图片－flickrRSS使用详解</a>中我介绍了<a href="http://blog.shidelai.cn/tag/flickrrss" class="st_tag internal_tag" rel="tag nofollow" title="Posts tagged with flickrRSS">flickrRSS</a>插件的简单应用，也列举了如何在留言框下面显示<a href="http://blog.shidelai.cn/tag/flickr" class="st_tag internal_tag" rel="tag nofollow" title="Posts tagged with flickr">flickr</a>上最新发布的标签为：hangzhou的图片。但阿德总感觉这样太单调了，可不可以在这个位置显示与这篇文章内容相关的图片呢？如果可以岂不是太爽了？答案当然是肯定的！要不就不会有这篇博文了，呵呵。<img onclick="grin(':cool:');" src="../wp-includes/images/smilies/icon_cool.gif" alt=":cool:" width="22" height="22" /></p>
<h2>方法</h2>
<p>1. 在打开主题文件夹下的single.php，在</p>
<blockquote><p>&lt;div class=&#8221;post&#8221; id=&#8221;post-&lt;?php the_ID(); ?&gt;&#8221;&gt;</p>
<p>&#8230;&#8230;&#8230;.</p>
<p>&lt;/div&gt;&lt;!&#8211;/post &#8211;&gt;</p></blockquote>
<p>之间添加如下代码：<br />
<!--inline-more--></p>
<blockquote><p>&lt;?php<br />
$tags = explode(&#8220;, &#8220;, get_the_tag_list(&#8221;,&#8217;, &#8216;,&#8221;));<br />
$first_tag=preg_replace(&#8216;|&lt;a\s.*?&gt;(.*?)&lt;/a&gt;|i&#8217;,   &#8216;\1&#8242;,   $tags[0]);<br />
?&gt;</p></blockquote>
<p>2. 将<a href="http://blog.shidelai.cn/2008/06/how-to-flickrrss.html/" target="_blank">flickrRSS使用详解</a>里面提到的</p>
<blockquote><p>&lt;div id=&#8221;related-pic&#8221;&gt;<br />
&lt;?php get_flickrRSS(8, &#8220;community&#8221;, &#8220;$first_tag&#8221;, &#8220;square&#8221;, &#8220;&amp;nbsp;&#8221;, &#8220;&amp;nbsp;&#8221;); ?&gt;<br />
&lt;/div&gt;</p></blockquote>
<p>修改为：</p>
<blockquote><p>&lt;div id=&#8221;related-pic&#8221;&gt;<br />
&lt;?php get_flickrRSS(8, &#8220;community&#8221;, &#8220;$first_tag&#8221;, &#8220;square&#8221;, &#8220;&amp;nbsp;&#8221;, &#8220;&amp;nbsp;&#8221;); ?&gt;<br />
&lt;/div&gt;</p>
<p>这段代码在新的flickr5.0版本中不适用了，具体解决方法看这里<a title="Permanent Link to flickrRSS高阶应用三部曲之新版本flickrRss 5.0补录" rel="bookmark" href="../2009/03/flickrrss-50.html">flickrRSS高阶应用三部曲之新版本flickrRss 5.0补录</a></p></blockquote>
<p>另外你可以参考<a title="Permanent Link to 不同浏览器里图片大小不同的解决方法" rel="bookmark" href="../2008/12/photo-css-max.html">不同浏览器里图片大小不同的解决方法</a></p>
<p><strong>原理</strong>就是显示<a href="http://blog.shidelai.cn/tag/flickr" class="st_tag internal_tag" rel="tag nofollow" title="Posts tagged with flickr">flickr</a>上标签与文章第一个标签相同的图片，但是<span style="color: #ff0000;"><strong>注意：文章的第一个标签并不是你在编辑时候输入的第一个标签，而是按照字母排序的第一个标签。</strong></span></p>
<p>当然你也可以再这设置个$second_tag让它显示包含头2个标签的图片。不过我发现这样会很少有符合条件的图片，很多情况下一张都没有（主要是因为<a href="http://blog.shidelai.cn/tag/flickr" class="st_tag internal_tag" rel="tag nofollow" title="Posts tagged with flickr">flickr</a>上的标签英文居多，我们博客的标签中文居多）。</p>
<h2>Advanced</h2>
<p>发挥你的想象力，get_flickrRSS()真的是很好很强大阿，它一共可以设置7个参数，下面的参数介绍你或许用得着。</p>
<ol>
<li><code>$num_items</code> &#8211; how many photos you want to appear   显示多少图片</li>
<li><code>$type</code> &#8211; specify <em>user, set, favorite, group or community</em> photosream    设置是在用户的所有图片，还是用户的收藏，还是。。。。中搜索</li>
<li><code>$tags</code> &#8211; a comma separated list of tags (with no spaces)  标签</li>
<li><code>$imagesize</code> &#8211; <em>square, thumbnail, medium or large  图片大小<br />
</em></li>
<li><code>$before_image</code> &#8211; html appearing before each photo  插入每张图片之前的html代码</li>
<li><code>$after_image</code> &#8211; html appearing after each photo   插入每张图片之后的html代码</li>
<li><code>$id_number</code> &#8211; specify a user id (or group name)   在特定的用户或者组中搜索</li>
<li><code>$set_id</code> &#8211; specify the set id (found in set url)</li>
</ol>

	<b>[相关文章]</b>
	<ul class="st-related-posts">
	<li><a href="http://blog.shidelai.cn/2008/06/how-to-flickrrss.html" title="flickrRSS高阶使用三部曲之一：显示flickr上的图片 (2008-06-13)">flickrRSS高阶使用三部曲之一：显示flickr上的图片</a> (5)</li>
	<li><a href="http://blog.shidelai.cn/2010/07/wptouch-iphone-theme.html" title="这个插件能为你的WordPress提供iphone, itouch主题 (2010-07-19)">这个插件能为你的WordPress提供iphone, itouch主题</a> (1)</li>
	<li><a href="http://blog.shidelai.cn/2008/07/plugins.html" title="WordPress运行原理学习笔记之二：插件机制初探 (2008-07-15)">WordPress运行原理学习笔记之二：插件机制初探</a> (7)</li>
	<li><a href="http://blog.shidelai.cn/2008/07/gravatars2-flickrrss.html" title="flickrRSS高阶使用三部曲之三：配合Gravatar2让flickr的图片作为WordPress留言的随机头像 (2008-07-4)">flickrRSS高阶使用三部曲之三：配合Gravatar2让flickr的图片作为WordPress留言的随机头像</a> (2)</li>
	<li><a href="http://blog.shidelai.cn/2008/06/wordpress-seo.html" title="抛弃All in One SEO Pack，WordPerss的SEO优化小结 (2008-06-29)">抛弃All in One SEO Pack，WordPerss的SEO优化小结</a> (3)</li>
</ul>

]]></content:encoded>
			<wfw:commentRss>http://blog.shidelai.cn/2008/06/essay-photo.html/feed</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
	</channel>
</rss>
