CQ-CSER

计算机爱好者

啊~Asaph, Setting up your own FFFFound

Posted on | 十一月 26, 2009 | 1 Comment

asaph-bookmarkfavescreen

只是借鉴下某人的标题,ASAPH确实很NX啊,在作者网站问了个很挫的问题后,突然发现会用了。

只是在我的蜗牛网速下,IE8用似乎不太好。CHROM还是比较强的。

其实就是把BOOKMARK添加到搜藏夹里,哪个页面看到中意的就点那个书签。我之前一直认为是点书签添加图片。囧

  • Asaph不是一个wordpress插件,而是一个独立的博客系统
  • 确保你已经安装好Asaph,否则请看该文

其实接下来很简单,之需要一个步骤,就是复制下面的代码,放到你的WordPress主题下的sidebar.php(或是其他你要显示的地方).

<?php // Get RSS Feed
include_once(ABSPATH . WPINC . '/rss.php');
$rss = fetch_rss('your-asaph-feed');
$maxitems = 24;
$items = array_slice($rss->items, 0, $maxitems);
?>
<ul>
<?php if (empty($items)) echo ‘<li>No items</li>’;
else
foreach ( $items as $item ) : ?>
<li><a href=’<?php echo $item['link']; ?>’>
<?php echo $item['description']; ?></a></li>
<?php endforeach; ?>
</ul>
请留意代码中的注释部分需要自行修改,也就是自己的feed地址以及显示的图片数量.
在将代码复制到模版文件中之后,如果一切顺利,那么你将会看到9张图片了,至于说大小问题,你需要在CSS中定义width:80px之类的.详细的可以用Firebug来查看我的CSS.

在这里,首先要感觉Asaph作者,再者感谢vikiworks的yichi大哥的文章.才让你我有机会认识与使用到如此优秀的功能.

下面是某人的原文:

Before we’re going to accomplished something like I did, you’ll need to download Asaph and make it work, it’s no hassle to set it up, give it a try.

Please note that Asaph isn’t a plugin for wordpress in anyway, it actually is a micro-blogging system but mainly focus on images like I introduced it before, they’re running separately on your server and never share a single database… which means that we need to figure another way out to cooking them. Originally, I was inspired by this recipe, it allows you to add display any rss feed on your blog by using WordPress native function – wp_rss. Yeah!

Call It!

I assumed that your asaph is up and running, and you already bookmarked a few images, now you need to edit your wordpress theme template. The tricky part is that we’re going to use wp_rss to call asaph’s feed, here is the complete codes, you can add where you want the rss content to be displayed (your sidebar or any other page template):

<?php // Get RSS Feed
include_once(ABSPATH . WPINC . '/rss.php');
$rss = fetch_rss('your-asaph-feed‘);
$maxitems = 24;
$items = array_slice($rss->items, 0, $maxitems);
?>
<ul>
<?php if (empty($items)) echo ‘<li>No items</li>’;
else
foreach ( $items as $item ) : ?>
<li><a href=’<?php echo $item['link']; ?>’>
<?php echo $item['description']; ?></a></li>
<?php endforeach; ?></ul>

where fetch_rss replace it with your actual feed url and $maxitems means how many items that you wanted to show, you can change the value you like. That’s it. yeah, it’s that simple.

More tweaks

since it works now it’s time for styling it, within CSS tweaks you can give it a nice looking, show your magic. It will be great if use some lightboxed effect, personally I use fancybox to visualized it in a better way. good luck!

相关文章:

  1. How to: Display any rss feed on your WordPress blog【Z】
  2. meta name 优化
  3. ASP.NET的sitemap和RSS
  4. RSS Feed地址
  5. wordpress备份数据导入

评论|Comments

One Response to “啊~Asaph, Setting up your own FFFFound”

  1. 啊~Asaph, Setting up your own FFFFound | ShareFavorite
    十一月 26th, 2009 @ 16:57

    [...] here to see the original: 啊~Asaph, Setting up your own FFFFound Related [...]

留言|Leave a Reply





  • Archives

  • SUNSHINE

  • About

    本博客采用创作共用版权协议,要求署名、非商业用途和保持一致. 转载本博客内容也遵循“署名-非商业用途-保持一致”的创作共用协议.

    订阅

    Search

    Admin