[WordPress] 外掛分享: Cricket Moods

首頁外掛目錄 › Cricket Moods
10+
安裝啟用
尚無評分
6307 天前
最後更新
問題解決
WordPress 2.6+ v3.7.2 上架:2005-05-01

內容簡介

Cricket Moods是一個靈活的「心情標籤」WordPress外掛程式。它允許作者在每篇文章中新增一個或多個「心情」。每種心情都可以與一個圖像檔相關聯。這樣,作者就可以在她想要的每篇文章旁邊加入一個動畫的快樂笑臉圖像,並標註「我很高興!」等字眼。

當您創建或編輯文章時,Cricket Moods會向您顯示可用心情的清單。您無需記住您的心情清單。您可以使用WordPress管理功能表中的選項面板來重新命名您的心情標籤,甚至可以更改會影響使用該心情的每篇文章的圖像,而不必修改每篇文章。

儘管這個外掛的名稱和我的不斷提到「心情」,但這個外掛也可以用於更多的用途。例如,您可以顯示當前所在地的天氣情況,而不是顯示您當前的心情。您可以將心情標籤重新命名為像「晴天」、「陰天」和「狂風暴雨」等名稱。然後,您可以上傳小的雲和太陽圖像,並將其與標籤一起使用,而不是預定義的心情笑臉圖像。您甚至可以將標籤文本或標籤圖像留空,以僅顯示文本或圖像。

請注意,自現在開始,Cricket Moods只會收到重要的錯誤修復(如果我們很幸運)。我正在編寫一個名為PostBits的完整重寫版本。它的代碼尚未完成,需要進行大量的工作。如果您想提供幫助,請讓我知道。請至以下網站查看:

默認情況下,Cricket Moods會自動在每篇文章的內容上方列印每篇文章的心情標籤。您還可以更改Cricket Moods選項面板中的相應選項,使它自動在內容下方列印標籤。

在WordPress管理區域的「管理」中使用「心情」面板,您可以隨意添加、修改和刪除心情。將「心情名稱」留空將使Cricket Moods不顯示該心情圖像的任何文字,僅純粹呈現心情的圖像表示。反之,您可以將「圖像檔」留空,這樣該心情就不會顯示笑臉或其他圖像了。刪除一個心情也將從您的博客文章中刪除對該心情的任何引用。

`cm_the_moods()`

如果您希望在內容上方或下方以外的某處顯示您的心情,您必須在The Loop中放置cm_the_moods(),並在Cricket Moods選項中禁用AutoPrint。當不帶任何參數調用時,cm_the_moods()僅會列印心情圖像,後跟心情名稱、一個加號和更多的心情圖像,並以加號分隔。例如,在帶有「快樂」和「無聊」兩種心情的文章上,它會列印:

<img src="/wp-images/smilies/icon_happy.gif" alt="Happy emoticon" /> Happy
&amp; <img src="/wp-images/smilies/icon_neutral.gif" alt="Bored emoticon" />
Bored

如果當前文章沒有任何心情,它將不顯示任何內容。

cm_the_moods()可以帶有三個參數:

separator (字串)多個心情之間放置的文字。默認值為' &amp; '。

外掛標籤

開發者團隊

⬇ 下載最新版 (v3.7.2) 或搜尋安裝

① 下載 ZIP → 後台「外掛 › 安裝外掛 › 上傳外掛」
② 後台搜尋「Cricket Moods」→ 直接安裝(推薦)
📦 歷史版本下載

原文外掛簡介

Cricket Moods is a flexible “mood tag” WordPress plugin. It allows an author to
add one or more “moods” to every post. Each mood can be associated with an
image file. The result would be that the author could have an animated happy
smiley face next to the words I’m Happy! for every post she wishes.
Cricket Moods presents you with a list of available moods when you go to create
or edit a post. There is no need for you to remember your list of moods. Using
an option panel in WordPress’ administrative menus, you can rename your moods or
even change a mood’s graphic without modifying every post that uses that mood.
Despite this plugin’s name and my continual references to “moods”, this plugin
can be used for more than just moods. For example, instead of displaying your
current mood, you could give your readers the current weather where you are.
You could rename the mood tags to things like “Sunny”, “Overcast”, and “Raining
Cats and Dogs.” You could then upload little cloud and sun images and use those
with the tags instead of the pre-defined mood smilies. You could even leave the
tag text or the tag images blank to have either just text or just images.
Please note that Cricket Moods will only be receiving critical bug fixes from
this point forth (if we’re lucky). I am working on a complete rewrite of the
plugin called PostBits. The code for it isn’t complete and needs a lot of
work. If you’d like to help, let me know. Check it out at:
http://code.google.com/p/postbits/
Usage
By default, Cricket Moods will automatically print each post’s moods just above
each post’s content. You may also have it automatically print the mood just
below the post content by changing the appropriate option in the Cricket Moods
options panel.
Using the “Moods” panel under “Manage” in the WordPress administrative area, you
can add, modify, and delete moods as you see fit. Leaving the “Mood Name” blank
will cause Cricket Moods not to display any text with that mood’s image for a
purely pictorial representation of your mood. Conversely, you can leave the
“Image File” blank and no smilie or other image will be shown with that mood.
Deleting a mood will also remove any references to that mood from your blog
posts.
`cm_the_moods()`
If you want your moods to be displayed somewhere other than directly above or
below the content, you must place cm_the_moods() somewhere inside The Loop and
disable AutoPrint in the Cricket Moods options. When called with no parameters,
cm_the_moods() only prints the mood image followed by the mood name, an
ampersand, and any more moods followed by ampersands. For example, on a post
with the moods “Happy” and “Bored” it will print:
Happy emoticon Happy
& Bored emoticon
Bored

If there are no moods for the current post, it will print nothing.
cm_the_moods() can take three parameters:

separator (string) Text to place in between multiple moods. Default is ' & '.
before (string) Text to place before the first mood. Default is nothing.
after (string) Text to place after the last mood. Default is nothing.

A good way to implement this would be:
My mood is: ', '.

'); ?>

`cm_has_moods()`
You can also use cm_has_moods() to determine if the current post or a specific
post has moods associated with it. It will return true or false accordingly.
cm_has_moods() can take one parameter:

post_id (integer) The ID of the post you are inquiring about. Default is the ID of the current post.
cm_has_moods() must be used inside The Loop if post_id is not provided.
Known Issues

Things get a little fuzzy when you change the author of an existing post with
mood tags. If the two authors do not have the exact same mood list, the
associated moods may seem to unexpectedly change or not show at all. It is
recommended that you disassociate all the moods from a post before changing the
post’s author.
Editing the post of another user will cause that user’s moods to be
displayed, not yours. This is an unavoidable feature.

Copying
Cricket Moods: A flexible mood tag plugin for the WordPress publishing platform.
Copyright (c) 2008 Keith Constable
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License along
with this program; if not, write to the Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.

延伸相關外掛

文章
Filter
Mastodon