Title: Ravatars
Author: grokcode
Published: <strong>2008 年 3 月 5 日</strong>
Last modified: 2014 年 10 月 27 日

---

搜尋外掛

這個外掛**並未在最新的 3 個 WordPress 主要版本上進行測試**。開發者可能不再對這個
外掛進行維護或提供技術支援，並可能會與更新版本的 WordPress 產生使用上的相容性問題。

![](https://s.w.org/plugins/geopattern-icon/ravatar.svg)

# Ravatars

 由 [grokcode](https://profiles.wordpress.org/grokcode/) 開發

[下載](https://downloads.wordpress.org/plugin/ravatar.zip)

 * [詳細資料](https://tw.wordpress.org/plugins/ravatar/#description)
 * [使用者評論](https://tw.wordpress.org/plugins/ravatar/#reviews)
 *  [安裝方式](https://tw.wordpress.org/plugins/ravatar/#installation)
 * [開發資訊](https://tw.wordpress.org/plugins/ravatar/#developers)

 [技術支援](https://wordpress.org/support/plugin/ravatar/)

## 外掛說明

Ravatars is a plugin that will generate and assign icons to the visitors leaving
comments at your site. The icons are based on email,
 so a given visitor will get
the same icon each time they comment. It is easy to customize the avatars so that
they match your site’s topic or theme. It also makes comment threads easier to follow
when people have memorable “faces.”

This plugin is based on Shamus Young’s Wavatars plugin.

And a shout out to Gregory Weir for bugfixes. Thanks!

Features:

 1. You can customize the avatars your site will display to match your theme. Just 
    upload source images to the
     wp-content/plugins/ravatars/parts directory. Ravatars
    will create your custom avatars by choosing a random image and then cropping a 
    random part of the image
 2. The icons are generated on-the-fly. You can adjust the desired size of the icons.
 3. Easily integrates with avatar enabled themes
 4. For easy deployment in WordPress pre 2.5, icons will automatically precede the 
    commenter’s name. You can set HTML to come directly before and after the
     icon (
    to put it inside of a <DIV> tag, for example) or you can control the placement 
    of the icons manually if you don’t mind adding a single line of PHP to your theme.
 5. The same email will result in the same Ravatar every time, assuming that the source
    images don’t change the same. If you want avatars that are unique to your site,
    all you need to do is change the source images.
 6. This plugin also supports [Gravatars](http://site.gravatar.com/). If you like, 
    it can show the Gravatar for a given user
     (if available) and fall back on their
    Ravatar only if they don’t have a Gravatar set up. This means users can choose 
    to set up a unique icon for themselves, and if they don’t, they will be assigned
    a unique Ravatar. It’s a system that lets people personalize if they want, yet 
    still provide a decent icon for the lazy or apathetic.

### Revision History

### Version 1.0.1

 * Initial release.

### Advanced Tricks

#### If you get a memory error

Image manipulation functions are very memory intensive. If you get a memory error,
try reducing the size of your source images by lowering the resolution or cropping
them into smaller parts. You can also increase PHP’s memory_limit.

#### Using ravatar_show ()

If you place Ravatars by calling ravatar_show () manually, note that you can also
specify an optional “size” argument to override the
 default. For example:

    ```
    ravatar_show($comment->comment_author_email, '160');
    ```

This would cause the Ravatar to be 160×160 pixels, even if the default was set to
some other value. You could do this to make admin icons
 larger, for example.

#### Using ravatar_get ()

If ravatar_show () STILL doesn’t give you enough control, you can call:

    ```
    ravatar_get(email, size);
    ```

And it will return the URL to the created image without writing anything to the 
page.

#### Random Ravatar Field

Put this code in your theme:

    ```
    for ($i = 0; $i < 100; $i++)
        ravatar_show ($i);
    ```

It will generate a field of 100 random ravatars, which is cool. This is how I generated
the ravatar screenshot. It’s also a great way to quickly
 test your source images.

## 螢幕擷圖

 * [[
 * A random selection of Ravatars using the default source images. When choosing
   your own images, you may want to pick only images of certian colors that match
   your theme. Or you may want to use only nature shots if you have a blog about
   hiking. Also take a look at my site [grok-code.com](http://grok-code.com) for
   an example of Ravatars that can be created from a different set of source images.

## 安裝方式

 1. [Download](http://grok-code.com/7/ravatar-wordpress-plugin-for-randam-avatars/)
    the plugin.
 2. Copy it onto your website in the wordpress `/plugins` folder. Then enable the plugin.
    That’s it. Ravatars will
     instantly appear for all posts (even old ones) on your
    blog. If you don’t like how the image looks within your theme, read on…

To change the source images, replace the files within wp-content/plugins/ravatars/
parts with your own images. Supported image types are .jpg and .png. Its hard to
say how many images you should upload. The minimum for a good set of ravatars is
probably around 40, but you will want more if you have a lot of people posting and
you want avatars to be unique for everybody. Try to get images with a lot of distinctive
elements in them.

If you are using WordPress 2.5+ you need to have an avatar enabled theme, and ravatars
will automatically show up.

If you are using WordPress pre 2.5, read on for tips on how to position ravatars
on your site.

The administration panel is under Options » Ravatars. You can adjust the size of
the Ravatars, and assign HTML to come before and
 after each image to help nudge
it into place. Each image is also set with the CSS “ravatars” class, so you can 
fine-tune the avatar position in your CSS file.

If that still doesn’t give you enough control over ravatar placement and you don’t
mind editing your theme, just turn off automatic
 placement and add the line `ravatar_show(
$comment->comment_author_email);` to your comment loop wherever you want the image
to appear.

Your mileage may vary. How it will look depends largely on your current theme.

Note that the plugin requires that your install of PHP support the GD library. If
it doesn’t, the Ravatars won’t show up and you’ll get
 a warning in the Ravatar 
admin panel. You can still use this plugin to display Gravatars, even if the GD 
library isn’t available.

## 使用者評論

這個外掛目前沒有任何使用者評論。

## 參與者及開發者

以下人員參與了開源軟體〈Ravatars〉的開發相關工作。

參與者

 *   [ grokcode ](https://profiles.wordpress.org/grokcode/)

[將〈Ravatars〉外掛本地化為台灣繁體中文版](https://translate.wordpress.org/projects/wp-plugins/ravatar)

### 對開發相關資訊感興趣？

任何人均可[瀏覽程式碼](https://plugins.trac.wordpress.org/browser/ravatar/)、查看
[SVN 存放庫](https://plugins.svn.wordpress.org/ravatar/)，或透過 [RSS](https://plugins.trac.wordpress.org/log/ravatar/?limit=100&mode=stop_on_copy&format=rss)
訂閱[開發記錄](https://plugins.trac.wordpress.org/log/ravatar/)。

## 中繼資料

 *  版本 **2.0.4**
 *  最後更新 **12 年前**
 *  啟用安裝數 **10+**
 *  WordPress 版本需求 ** 2.0.2 或更新版本 **
 *  已測試相容的 WordPress 版本 **2.7**
 *  語言
 * [English (US)](https://wordpress.org/plugins/ravatar/)
 * 標籤:
 * [avatars](https://tw.wordpress.org/plugins/tags/avatars/)[comments](https://tw.wordpress.org/plugins/tags/comments/)
   [gravtars](https://tw.wordpress.org/plugins/tags/gravtars/)[icons](https://tw.wordpress.org/plugins/tags/icons/)
   [posts](https://tw.wordpress.org/plugins/tags/posts/)
 *  [進階檢視](https://tw.wordpress.org/plugins/ravatar/advanced/)

## 評分

這個項目尚無任何評論記錄。

[Your review](https://wordpress.org/support/plugin/ravatar/reviews/#new-post)

[查看全部使用者評論](https://wordpress.org/support/plugin/ravatar/reviews/)

## 參與者

 *   [ grokcode ](https://profiles.wordpress.org/grokcode/)

## 技術支援

使用者可在技術支援論壇提出意見反應或使用問題。

 [檢視技術支援論壇](https://wordpress.org/support/plugin/ravatar/)

## 贊助

想要支援這個外掛的發展嗎？

 [ 贊助這個外掛 ](https://www.paypal.com/cgi-bin/webscr?cmd=_donations&business=jess%40grok%2dcode%2ecom&no_shipping=0&no_note=1&tax=0&currency_code=USD&lc=US&bn=PP%2dDonationsBF&charset=UTF%2d8)