<?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.delai.me/tag/%e5%9b%be%e7%89%87/feed" rel="self" type="application/rss+xml" />
	<link>http://blog.delai.me</link>
	<description>我的自留地</description>
	<lastBuildDate>Thu, 29 Dec 2011 03:33:58 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>flickrRSS高阶应用三部曲之新版本flickrRss 5.0补录</title>
		<link>http://blog.delai.me/2009/03/flickrrss-50.html</link>
		<comments>http://blog.delai.me/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>因为wordpress更新的原因，flickrRSS也相应做了更新，改变了函数参数的编写方式，并加入了更易于配置的html参数。总之，更强大了，使用也更复制了。</p>
<p>我在<a title="Permanent Link: flickrRSS高阶使用三部曲之二：在WordPress博客中显示与文章内容相关的Flickr图片" rel="bookmark" href="../2008/06/essay-photo.html">flickrRSS高阶使用三部曲之二：在WordPress博客中显示与文章内容相关的Flickr图片</a>中提到的在文章后面显示与文章内容相关的flickr图片的功能如果不加以修改是不能使用的。拖了好几个星期，今天因为改了域名（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_<a href="http://blog.delai.me/tag/flickrrss" class="st_tag internal_tag" rel="tag" title="Posts tagged with flickrRSS">flickrRSS</a>(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;%<a href="http://blog.delai.me/tag/flickr" class="st_tag internal_tag" rel="tag" title="Posts tagged with flickr">flickr</a>_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 Flickr 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 Flickr 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>
<hr /><h2>Comments</h2><ul><li><a href="http://blog.delai.me/2009/03/flickrrss-50.html">2009-04-2</a>, <a href='http://www.olihe.com' rel='external nofollow' class='url'>盒子</a> writes: 先留言 再接着看</li><li><a href="http://blog.delai.me/2009/03/flickrrss-50.html">2009-04-9</a>, <a href='http://www.ou9i.com/wddh/' rel='external nofollow' class='url'>淘宝网店</a> writes: 先支持下，慢慢学习~！~</li><li><a href="http://blog.delai.me/2009/03/flickrrss-50.html">2009-04-17</a>, pc412 writes: 可不可以给个5.0的源文件？弄了半天都没效果 =（</li><li><a href="http://blog.delai.me/2009/03/flickrrss-50.html">2009-04-17</a>, <a href='http://www.soulward.cn' rel='external nofollow' class='url'>阿德</a> writes: 放到文章后面了,右键另存为就可以了</li><li><a href="http://blog.delai.me/2009/03/flickrrss-50.html">2009-04-18</a>, pc412 writes: 谢谢。。不过你有MSN吗？有些问题想问你 =）</li><li><a href="http://blog.delai.me/2009/03/flickrrss-50.html">2009-04-18</a>, pc412 writes: pc412_7@hotmail.com

这是我的～</li><li><a href="http://blog.delai.me/2009/03/flickrrss-50.html">2009-05-2</a>, <a href='http://www.soulward.cn' rel='external nofollow' class='url'>阿德</a> writes: 俺比较低端，都没用MSN。。。 我去下一个再加你。。， 不好意思回得有点晚</li><li><a href="http://blog.delai.me/2009/03/flickrrss-50.html">2010-03-22</a>, <a href='http://www.eureka321.com' rel='external nofollow' class='url'>Eureka</a> writes: 你好 我用了flickrRSS后一行只能显示一张图片 怎么才能想你的边栏一样一行显示3张？谢谢！</li><li><a href="http://blog.delai.me/2009/03/flickrrss-50.html">2010-03-23</a>, <a href='http://www.shidelai.cn' rel='external nofollow' class='url'>阿德</a> writes: 是不是本来就只有4张照片呀？</li><li><a href="http://blog.delai.me/2009/03/flickrrss-50.html">2010-03-23</a>, <a href='http://www.eureka321.com' rel='external nofollow' class='url'>Eureka</a> writes: 请看一下www.eureka321.com 我设置显示六张照片 但只能单列显示 我希望一行能显示三张</li><li><a href="http://blog.delai.me/2009/03/flickrrss-50.html">2010-03-25</a>, <a href='http://www.shidelai.cn' rel='external nofollow' class='url'>阿德</a> writes: 我右边栏上面8张照片也是单列显示的，是不是用widget显示这些照片的啊？
下面6张照片分两行，每行3张是将flickrRSS的代码放到siderbar.php里才达到的效果。</li><li><a href="http://blog.delai.me/2009/03/flickrrss-50.html">2010-03-25</a>, <a href='http://www.eureka321.com' rel='external nofollow' class='url'>Eureka</a> writes: 哦 原来如此 谢谢谢谢</li></ul><hr /><h2>Related posts:</h2><ul><li><a href="http://blog.delai.me/2008/06/how-to-flickrrss.html" rel="bookmark" title="Permanent Link: flickrRSS高阶使用三部曲之一：显示flickr上的图片">flickrRSS高阶使用三部曲之一：显示flickr上的图片</a></li><li><a href="http://blog.delai.me/2008/07/gravatars2-flickrrss.html" rel="bookmark" title="Permanent Link: flickrRSS高阶使用三部曲之三：配合Gravatar2让flickr的图片作为WordPress留言的随机头像">flickrRSS高阶使用三部曲之三：配合Gravatar2让flickr的图片作为WordPress留言的随机头像</a></li><li><a href="http://blog.delai.me/2008/06/essay-photo.html" rel="bookmark" title="Permanent Link: flickrRSS高阶使用三部曲之二：在WordPress博客中显示与文章内容相关的Flickr图片">flickrRSS高阶使用三部曲之二：在WordPress博客中显示与文章内容相关的Flickr图片</a></li></ul><hr /><strong>[原文链接：<a href="http://blog.delai.me/2009/03/flickrrss-50.html">http://blog.delai.me/2009/03/flickrrss-50.html</a>] </strong>]]></content:encoded>
			<wfw:commentRss>http://blog.delai.me/2009/03/flickrrss-50.html/feed</wfw:commentRss>
		<slash:comments>12</slash:comments>
		</item>
		<item>
		<title>不同浏览器里图片大小不同的解决方法</title>
		<link>http://blog.delai.me/2008/12/photo-css-max.html</link>
		<comments>http://blog.delai.me/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.delai.me/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的容器里面，<a href="http://blog.delai.me/tag/%e5%9b%be%e7%89%87" class="st_tag internal_tag" rel="tag" title="Posts tagged with 图片">图片</a>(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_<a href="http://blog.delai.me/tag/flickrrss" class="st_tag internal_tag" rel="tag" title="Posts tagged with flickrRSS">flickrRSS</a>(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>
<hr /><h2>Comments</h2><ul><li><a href="http://blog.delai.me/2008/12/photo-css-max.html">2009-01-18</a>, aibenwu writes: 博主你好，我想问您一下。我在Google Blogger 开的博客。在Chrome,火狐显示图片是正常的。但是在IE，傲游上显示的图片间隔变小，而挤在一起。让我很困扰。请问博主应该怎么解决这个问题呢？谢谢</li><li><a href="http://blog.delai.me/2008/12/photo-css-max.html">2009-01-20</a>, <a href='http://www.soulward.cn' rel='external nofollow' class='url'>阿德</a> writes: Blogger我没用过，如果能编辑HTML的话，你在图片之间加入代表空格的HTML代码， &nbsp;
貌似也只能这样了，
或者在HTML里面嵌入CSS代码，如我我文中最后一个例子</li></ul><hr /><h2>Related posts:</h2><ul><li><a href="http://blog.delai.me/2008/06/essay-photo.html" rel="bookmark" title="Permanent Link: flickrRSS高阶使用三部曲之二：在WordPress博客中显示与文章内容相关的Flickr图片">flickrRSS高阶使用三部曲之二：在WordPress博客中显示与文章内容相关的Flickr图片</a></li><li><a href="http://blog.delai.me/2008/07/gravatars2-flickrrss.html" rel="bookmark" title="Permanent Link: flickrRSS高阶使用三部曲之三：配合Gravatar2让flickr的图片作为WordPress留言的随机头像">flickrRSS高阶使用三部曲之三：配合Gravatar2让flickr的图片作为WordPress留言的随机头像</a></li><li><a href="http://blog.delai.me/2008/04/firefox-logo-in-deep-space.html" rel="bookmark" title="Permanent Link: Firefox Logo Spied In Deep Space(火狐标志在宇宙深处出现）">Firefox Logo Spied In Deep Space(火狐标志在宇宙深处出现）</a></li><li><a href="http://blog.delai.me/2008/11/zju-bachelor-2.html" rel="bookmark" title="Permanent Link: 11月11号，实验室团购了11件纪念浙大建校111周年的光棍衫">11月11号，实验室团购了11件纪念浙大建校111周年的光棍衫</a></li><li><a href="http://blog.delai.me/2008/08/photo-record.html" rel="bookmark" title="Permanent Link: 图片&#038;记录">图片&#038;记录</a></li></ul><hr /><strong>[原文链接：<a href="http://blog.delai.me/2008/12/photo-css-max.html">http://blog.delai.me/2008/12/photo-css-max.html</a>] </strong>]]></content:encoded>
			<wfw:commentRss>http://blog.delai.me/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.delai.me/2008/10/national-travel.html</link>
		<comments>http://blog.delai.me/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多啊，队伍前面还打起架来了 好一副田园风光啊 入住的宝根足球宾馆，位于宝根足球基地里面，环境不错~~~~~ 下面是深林公园 我貌似很... ]]></description>
			<content:encoded><![CDATA[<p style="text-align: center;">经过商量打算一群人去崇明岛玩两天</p>
<p style="text-align: center;">
<a href="http://blog.delai.me/wp-content/gallery/2008-shanghai/dscf0104.jpg" title="" class="shutterset_singlepic195" >
	<img class="ngg-singlepic ngg-center" src="http://blog.delai.me/wp-content/gallery/cache/195__480x360_dscf0104.jpg" alt="dscf0104" title="dscf0104" />
</a>
</p>
<p style="text-align: center;">
<p style="text-align: center;">国庆去崇明岛的人N多啊，队伍前面还打起架来了</p>
<p style="text-align: center;">
<p style="text-align: center;">
<a href="http://blog.delai.me/wp-content/gallery/2008-shanghai/dscf0023.jpg" title="" class="shutterset_singlepic194" >
	<img class="ngg-singlepic ngg-center" src="http://blog.delai.me/wp-content/gallery/cache/194__480x360_dscf0023.jpg" alt="dscf0023" title="dscf0023" />
</a>
</p>
<p><!--inline-more--></p>
<p style="text-align: center;">
<p style="text-align: center;">好一副田园风光啊</p>
<p style="text-align: center;">
<a href="http://blog.delai.me/wp-content/gallery/2008-shanghai/dscf0156.jpg" title="" class="shutterset_singlepic196" >
	<img class="ngg-singlepic ngg-center" src="http://blog.delai.me/wp-content/gallery/cache/196__480x360_dscf0156.jpg" alt="dscf0156" title="dscf0156" />
</a>
</p>
<p style="text-align: center;">
<p style="text-align: center;">入住的宝根足球宾馆，位于宝根足球基地里面，环境不错~~~~~</p>
<p style="text-align: center;">
<p style="text-align: center;">
<p style="text-align: center;">
<p style="text-align: center;">下面是深林公园</p>
<p style="text-align: center;">
<p style="text-align: center;"><a title="DSCF0021 by 阿德Delai, on Flickr" href="http://www.flickr.com/photos/delai/2926008491/"><img src="http://67.195.19.66/3289/2926008491_641d522af8.jpg" alt="DSCF0021" width="500" height="375" /></a></p>
<p style="text-align: center;">
<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://67.195.19.66/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://67.195.19.66/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://67.195.19.66/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://67.195.19.66/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://67.195.19.66/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://67.195.19.66/3250/2926864812_e848f49464.jpg" alt="DSCF0110" width="500" height="411" /></a></p>
<p style="text-align: center;">这个还是蛮有意思的</p>
<p style="text-align: center;"><a title="SNV31908 by 阿德Delai, on Flickr" href="http://www.flickr.com/photos/delai/2925952977/"><img src="http://67.195.19.66/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://67.195.19.66/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://67.195.19.66/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://67.195.19.66/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://67.195.19.66/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://67.195.19.66/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://67.195.19.66/3134/2926860906_1116614eb0.jpg" alt="DSCF0009" width="500" height="375" /></a></p>
<p style="text-align: center;">小show一下</p>
<hr /><h2>Comments</h2><ul><li><a href="http://blog.delai.me/2008/10/national-travel.html">2010-04-4</a>, <a href='http://luzhilong.host4.uzidc.cn/flickrrss%e9%ab%98%e9%98%b6%e5%ba%94%e7%94%a8%e4%b8%89%e9%83%a8%e6%9b%b2%e4%b9%8b%e6%96%b0%e7%89%88%e6%9c%acflickrrss-5-0%e8%a1%a5%e5%bd%95.html' rel='external nofollow' class='url'>flickrRSS高阶应用三部曲之新版本flickrRss 5.0补录 - 小龙的个人博客</a> writes: [...] 国庆游记（9月30~10月1） (0) [...]</li></ul><hr /><h2>Related posts:</h2><ul><li><a href="http://blog.delai.me/2008/09/national-day-travel.html" rel="bookmark" title="Permanent Link: 国庆游记(9月28号~9月29号)">国庆游记(9月28号~9月29号)</a></li><li><a href="http://blog.delai.me/2008/10/national-day-travel-2.html" rel="bookmark" title="Permanent Link: 国庆游记（10月2~3）">国庆游记（10月2~3）</a></li></ul><hr /><strong>[原文链接：<a href="http://blog.delai.me/2008/10/national-travel.html">http://blog.delai.me/2008/10/national-travel.html</a>] </strong>]]></content:encoded>
			<wfw:commentRss>http://blog.delai.me/2008/10/national-travel.html/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>flickrRSS高阶使用三部曲之二：在WordPress博客中显示与文章内容相关的Flickr图片</title>
		<link>http://blog.delai.me/2008/06/essay-photo.html</link>
		<comments>http://blog.delai.me/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>中我介绍了flickrRSS插件的简单应用，也列举了如何在留言框下面显示flickr上最新发布的标签为：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_<a href="http://blog.delai.me/tag/flickrrss" class="st_tag internal_tag" rel="tag" title="Posts tagged with flickrRSS">flickrRSS</a>(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>就是显示flickr上标签与文章第一个标签相同的图片，但是<span style="color: #ff0000;"><strong>注意：文章的第一个标签并不是你在编辑时候输入的第一个标签，而是按照字母排序的第一个标签。</strong></span></p>
<p>当然你也可以再这设置个$second_tag让它显示包含头2个标签的图片。不过我发现这样会很少有符合条件的图片，很多情况下一张都没有（主要是因为flickr上的标签英文居多，我们博客的标签中文居多）。</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>
<hr /><h2>Comments</h2><ul><li><a href="http://blog.delai.me/2008/06/essay-photo.html">2008-07-4</a>, <a href='http://www.soulward.cn/2008/07/gravatars2-flickrrss.html' rel='external nofollow' class='url'>让flickr的图片作为WordPress留言的随机头像 @ 阿德日志 ( 留言框, 随机头像, flickr, gravatar2, wordpress, )</a> writes: [...] WordPress博客中显示与文章内容相关的Flickr图片 [...]</li><li><a href="http://blog.delai.me/2008/06/essay-photo.html">2008-12-11</a>, <a href='http://ts12316.cn' rel='external nofollow' class='url'>tsman</a> writes: 学习了2天了，问一下，你的评论栏下的图片之间的空格怎么控制？为甚麽我的都是紧挨着的！</li><li><a href="http://blog.delai.me/2008/06/essay-photo.html">2008-12-11</a>, <a href='http://www.soulward.cn' rel='external nofollow' class='url'>阿德Delai</a> writes: # $before_image - html appearing before each photo  插入每张图片之前的html代码
# $after_image - html appearing after each photo   插入每张图片之后的html代码

这两项可以用 html语言的空格
你试试
<?php get_flickrRSS(8, "community", "$first_tag", "square", "&nbsp;", "&nbsp;"); ?></li><li><a href="http://blog.delai.me/2008/06/essay-photo.html">2008-12-11</a>, <a href='http://www.soulward.cn' rel='external nofollow' class='url'>阿德Delai</a> writes: 最后没那两个参数，实际上是
"& nbsp;", "& nbsp;" （nbsp前面的空格去掉）
是html语言里的空格，我原原本本把代码拷过来，浏览器还是会把它解析成空格给你看的，
所以你看到的是
< ?php get_flickrRSS(8, "community", "$first_tag", "square", " ", " "); ?>
你试试将最后两个双引号里面的空格改成   & nbsp      （nbsp前面的空格去掉）</li><li><a href="http://blog.delai.me/2008/06/essay-photo.html">2008-12-11</a>, <a href='http://www.soulward.cn' rel='external nofollow' class='url'>阿德Delai</a> writes: 文章内的代码部分已经用图片代替了</li><li><a href="http://blog.delai.me/2008/06/essay-photo.html">2008-12-15</a>, <a href='http://ts12316.cn' rel='external nofollow' class='url'>tsman</a> writes: 谢谢！再调整调整</li><li><a href="http://blog.delai.me/2008/06/essay-photo.html">2010-04-4</a>, <a href='http://luzhilong.host4.uzidc.cn/flickrrss%e9%ab%98%e9%98%b6%e5%ba%94%e7%94%a8%e4%b8%89%e9%83%a8%e6%9b%b2%e4%b9%8b%e6%96%b0%e7%89%88%e6%9c%acflickrrss-5-0%e8%a1%a5%e5%bd%95.html' rel='external nofollow' class='url'>flickrRSS高阶应用三部曲之新版本flickrRss 5.0补录 - 小龙的个人博客</a> writes: [...] flickrRSS 高阶使用三部曲之二：在WordPress博客中显示与文章内容相关的Flickr图... (6) [...]</li></ul><hr /><h2>Related posts:</h2><ul><li><a href="http://blog.delai.me/2008/12/photo-css-max.html" rel="bookmark" title="Permanent Link: 不同浏览器里图片大小不同的解决方法">不同浏览器里图片大小不同的解决方法</a></li><li><a href="http://blog.delai.me/2008/07/gravatars2-flickrrss.html" rel="bookmark" title="Permanent Link: flickrRSS高阶使用三部曲之三：配合Gravatar2让flickr的图片作为WordPress留言的随机头像">flickrRSS高阶使用三部曲之三：配合Gravatar2让flickr的图片作为WordPress留言的随机头像</a></li><li><a href="http://blog.delai.me/2009/03/flickrrss-50.html" rel="bookmark" title="Permanent Link: flickrRSS高阶应用三部曲之新版本flickrRss 5.0补录">flickrRSS高阶应用三部曲之新版本flickrRss 5.0补录</a></li><li><a href="http://blog.delai.me/2008/04/firefox-logo-in-deep-space.html" rel="bookmark" title="Permanent Link: Firefox Logo Spied In Deep Space(火狐标志在宇宙深处出现）">Firefox Logo Spied In Deep Space(火狐标志在宇宙深处出现）</a></li><li><a href="http://blog.delai.me/2008/11/zju-bachelor-2.html" rel="bookmark" title="Permanent Link: 11月11号，实验室团购了11件纪念浙大建校111周年的光棍衫">11月11号，实验室团购了11件纪念浙大建校111周年的光棍衫</a></li></ul><hr /><strong>[原文链接：<a href="http://blog.delai.me/2008/06/essay-photo.html">http://blog.delai.me/2008/06/essay-photo.html</a>] </strong>]]></content:encoded>
			<wfw:commentRss>http://blog.delai.me/2008/06/essay-photo.html/feed</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
	</channel>
</rss>

