‘flickrRSS’ 标签下的文章
2009/0325

flickrRSS高阶应用三部曲之新版本flickrRss 5.0补录

分类:wordpress | 发表评论(12 条评论) | 点击量:1630次

因为wordpress更新的原因,flickrRSS也相应做了更新,改变了函数参数的编写方式,并加入了更易于配置的html参数。总之,更强大了,使用也更复制了。

我在flickrRSS高阶使用三部曲之二:在WordPress博客中显示与文章内容相关的Flickr图片中提到的在文章后面显示与文章内容相关的flickr图片的功能如果不加以修改是不能使用的。拖了好几个星期,今天因为改了域名(www.shidelai.cn),所以想有个好的开始,把新的代码搞出来了,和原来的效果一样,接近完美。你可以根据我的代码加以修改成自己的代码,比如如果你的页面比较窄,那么可以把’num_items’ => 8修改为’num_items’ => 5等等。

具体方法如下:

flickrRSS高阶使用三部曲之二:在WordPress博客中显示与文章内容相关的Flickr图片

<?php get_(8, “community”, “$first_tag”, “square”, “&nbsp;”, “&nbsp;”); ?>

修改为:

<?php get_flickrRSS(array(‘num_items’ => 8, ‘type’ => ‘public’, ‘tags’ => “$first_tag”, ‘html’ => ‘&nbsp;<a href=”%_page%” title=”%title%”><img src=”%image_square%” alt=”%title%”/></a>&nbsp;’)); ?>

就OK了。

参数解释:

The Parameters

‘type’ => ‘user’ – The type of Flickr images that you want to show. Possible values: ‘user’, ‘favorite’, ‘set’, ‘group’, ‘public’

‘tags’ => ” – Optional: Can be used with type = ‘user’ or ‘public’, comma separated

‘set’ => ” – Optional: To be used with type = ‘set’

‘id’ => ” – Optional: Your Group or User ID. To be used with type = ‘user’ or ‘group’

do_cache’ => false – Enable the image cache

‘cache_sizes’ => array(‘square’) – What are the image sizes we want to cache locally? Possible values: ‘square’, ‘thumbnail’, ‘small’, ‘medium’ or ‘large’

‘cache_path’ => ” – Where the images are saved (server path)

‘cache_uri’ => ” – The URI associated to the cache path (web address)

Presentational params

‘num_items’ => 4 – The number of images that you want to display

‘before_list’ => ‘ – The HTML to print before the list of images

‘html’ => ‘<a href=”%flickr_page%” title=”%title%”><img src=”%image_square%” alt=”%title%”/></a>’ – the code to print out for each image.

Meta tags available: %flickr_page%, %title%, %image_small%, %image_square%, %image_thumbnail%, %image_medium%, %image_large%

‘default_title’ => “Untitled Flickr photo” – the default title

‘after_list’ => – the HTML to print after the list of images

Examples

<?php get_flickrRSS(array(‘num_items’ => 4, ’type’ => ‘public’, ’tags’ => ‘sunflowers’)); ?> – This will display four photos from the public stream that are tagged with sunflowers

<?php get_flickrRSS(array(‘set’ => ’1234567890′, ’num_items’ => 6, ’type’ => ‘set’)); ?> – This will display six photos from a specified set

另外可以参考下本站的源码

2008/0613

flickrRSS高阶使用三部曲之一:显示flickr上的图片

分类:wordpress | 发表评论(6 条评论) | 点击量:23568次

通过flickrRSS你不仅仅是可以显示你自己flickr帐号上的图片,你也可以在WordPress博客中任何你想要的位置显示你所设定的flickr上的图片。比如:本网页留言框下面显示的是flickr上Tag为杭州的最新上传的图片,侧边栏上“养眼美图”部分就是flickrRSS的Widget,通过后台添加即可。

下载&安装

flickrRSS 4.0 — for WP 2.5
flickrRSS 3.5 — for WP 2.3

解压缩后复制到plugins目录下即可,然后后台激活。

注意:由于flickr是国外网站,速度会比较慢,如果需要将图片在本地缓存,你需要新建一个可写的目录用于缓存图片。这样,图片第一次被浏览时候会下载到改目录下,下次就直接从该目录读取图片了。

比如在wp-content目录下新建一个文件夹命名为cache

设置

2008/0506

关于本站

分类: | 发表评论(48 条评论) | 点击量:29006次

基本情况

本站是我的个人博客,于2008年5月创建,目前使用的是wordpress博客系统和Dreamhost主机,关注时事、生活、IT。

自我介绍

施德来,男,浙江温州瑞安人氏,目前是浙江大学计算机学院研二学生。

E-mail:

G-Talk:

MSN:

QQ:84378265

My Google Profile:http://www.google.com/profiles/shidelai

My photostream:http://www.flickr.com/photos/delai

友情链接

本博客渴望与任何合法的网站交换友情链接,请在网站上做好友情链接后在本页面留意或者发E-mail与我联系。

我的链接样式:

名称:阿德日志

网址:http://www.soulward.cn

描述:施德来的个人博客,关注时事、IT、生活、Linux、

版权声明

无特别说明,本站内容全部为原创,遵循署名-非商业性使用-相同方式共享 2.5的创作共用协议,转载文章请注明 : 阿德日志(htpp://www.soulward.cn)。