[WordPress] 外掛分享: Wavatars

首頁外掛目錄 › Wavatars
10+
安裝啟用
★★★★★
5/5 分(1 則評價)
6611 天前
最後更新
問題解決
WordPress 2.0.2+ v1.1.3 上架:2007-12-16

內容簡介

Wavatars 是一個外掛,可以為在你的網站上留言的訪客生成並分配圖標。這些圖標基於電子郵件,因此每次留言的訪客都會得到相同的圖標。這使得評論串變得更加生動活潑,並為人們帶來可記憶的“臉孔”,以幫助他們跟進對話。它也很有趣。

功能:

Wavatars 可以生成 956,384 個不同形狀的圖標,有57,600 種不同的顏色組合,總共可以生成55,087,718,400(550億)個獨特的 Wavatar。是的,你應該會有足夠的Wavatars。在你用盡人類(或硬盤空間)之前,你的 Wavatars 就會用完了。
圖標是即時生成的,你可以調整圖標的大小。
為了方便部署,圖標會自動在留言者的名字之前顯示。你可以設置在圖標之前和之後放置 HTML(例如將其放在 <DIV> 標籤內),或者如果你不介意在你的主題中添加一行 PHP,也可以手動控制圖標的位置。
Wavatars 完全基於電子郵件,因此非常易於移植。即使在不同的網站上,同一個電子郵件將產生相同的 Wavatar,因此從哪裡看,該用戶都將具有相同的圖標。(當然,前提是有其他啟用了 Wavatar 的網站。我不知道是否有人會想使用這個插件。)
此外,此插件還支持 Gravatars。如果願意,它可以顯示給定用戶的 Gravatar(如果可用),並在他們沒有設置 Gravatar 的情況下僅使用他們的 Wavatar。這意味著用戶可以選擇為自己設置獨特的圖標,如果他們不這樣做,他們將被分配一個獨特的 Wavatar。這是一個偉大的系統,讓人們如果想要的話可以個性化,但也提供懶惰或漠不關心的人一個不錯的圖標。

修訂歷史
版本 1.1.3

修正了錯誤的編碼,如果評級不是空白,會防止 wavatars 出現。如果管理員未指定評級,則省略評級欄位。
修正了管理面板上的拼字錯誤。
wavatar url 現在已經 URL 編碼。
圖像標籤不再使用無意義的 border 標籤,並且現在已正確關閉。
刪除了多餘的(無害的)重複調用 strtolower()。

感謝 Gavin Lambert 做出了許多這些更改。

版本 1.1.2

進行了幾個小更改,以符合 gravatars.com 的更改。將 .jpg 附加到 $md5 散列,改用新的(更短)字段名。
修正了插件在不應該插入 wavatars 的地方(例如 RSS 評論提要和側邊欄小工具)的錯誤。自動放置現在僅當查看單個帖子或頁面時放置圖標。
當在其主題中手動放置圖標時,用戶應使用 wavatar_show($comment->comment_author_email),而不是先前版本指定的 wavatar_show($comment_author_email),因為後者在某些情況下會運行,但在其他情況下會失敗,所以前者更正確。自述文件和管理頁面已更新為反映此更改。
管理面板現在會顯示高速緩存中有多少 wavatars。

版本 1.1.0

修正了把 AVATAR_SIZE 設置為奇數時會導致 PHP 將浮點值傳遞給 imagefill() 的錯誤。
修正了 gravatars 總是以60×60的大小請求的錯誤,而不是在管理面板中定義的大小。

外掛標籤

開發者團隊

⬇ 下載最新版 (v1.1.3) 或搜尋安裝

① 下載 ZIP → 後台「外掛 › 安裝外掛 › 上傳外掛」
② 後台搜尋「Wavatars」→ 直接安裝(推薦)

原文外掛簡介

Wavatars 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 livens up comment threads and gives people memorable “faces” to
aid in following conversations. It’s also fun.
Features:

Wavatars can generate 956,384 different shapes in 57,600 different color combinations for a total of 55,087,718,400 (55 billion)
unique Wavatars. Yeah, you should have plenty. You’ll run out of human beings (or hard drive space) long before you run out of
Wavatars.
The icons are generated on-the-fly. You can adjust the desired size of the icons.
For easy deployment, 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

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.
Wavatars are based entirely on email and are thus very portable. The same email will result in the same Wavatar, even on different
sites, so users will have the same icon on all Wavatar-enabled sites. (Assuming, or course, that there are other Wavatar-enabled
sites. I don’t know if anyone will want this plugin or not.)
This plugin also supports Gravatars. If you like, it can show the Gravatar for a given user
(if available) and fall back on their Wavatar 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 Wavatar. This is a great system that lets people personalize if
they want, yet still provide a decent icon for the lazy or apathetic.

Revision History
Version 1.1.3

Fixed bad encoding which would prevent wavatars from appearing if the rating was NOT blank. If the admin does not specify a rating, the rating field is omitted.
Fixed a typo on the admin panel.
The wavatar url is now URL encoded.
The image tag no longer uses the pointless “border tag, and it is now properly closed.
Removed extra (pointless, harmless) repeated calls to strtolower ().

Thanks to Gavin Lambert for many of these changes.
Version 1.1.2

Made several small changes to comply with the changes at gravatars.com. Appended .jpg to the $md5 hash, switched to using the new (shorter) field names.
Fixed bug where the plugin was inserting wavatars in places it shouldn’t, such as RSS comment feeds and in sidebar wigits. The auto-placement will now ONLY place
icons when viewing a single post or a page.
When placing icons manually within their theme, users should use wavatar_show($comment->comment_author_email) as opposed to
wavatar_show($comment_author_email), as the eariler versions directed. The latter will work in some situations but fail in others, and so the former is more correct.
The readme and the admin panel have been updated to reflect this.
The admin panel will now list how many wavatars are in the cache.

Version 1.1.0

Fixed bug where setting AVATAR_SIZE to an odd number would cause PHP to pass floating-point values to imagefill (), which is not a good idea.
Fixed bug where gravatars were always requested at 60×60, instead of the size defined in the admin panel.
Added the function wavatar_get (email, size), which will return the url of the requested avatar instead of displaying it. This can be useful if you want to use the
image in other ways, such as making it the background of an HTML element. You could also use this if you need to display the image in a rectangular area instead of a square.
Added option for controlling the rating of gravatars. (G, PG, R, X)
Added options for how to handle users who leave the email field blank. You can choose to give them a wavatar anyway, to give them a blank image, or show no image at all.
The link back to the wavatars homepage in the footer is now actually a link and not just text.

Version 1.0.1

Initial release.

Advanced Tricks
Using wavatar_show ()
If you place Wavatars by calling wavatar_show () manually, note that you can also specify an optional “size” argument to override the
default. For example:
wavatar_show($comment->comment_author_email, '160');

This would cause the Wavatar 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 wavatar_get ()
If wavatar_show () STILL doesn’t give you enough control, you can call:
wavatar_get(email, size);

And it will return the URL to the created image without writing anything to the page.
Random Wavatar Field
Put this code in your theme:
for ($i = 0; $i < 100; $i++) wavatar_show ($i); It will generate a field of 100 random wavatars, which is amusing. This is how I generated the wavatar screenshot. It’s also a great way to quickly test you source images if you’re editing the composite parts to make new wavatar types.

延伸相關外掛

文章
Filter
Apply Filters
Mastodon