Title: Sentimeter
Author: swinton
Published: <strong>2009 年 12 月 24 日</strong>
Last modified: 2009 年 12 月 24 日

---

搜尋外掛

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

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

# Sentimeter

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

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

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

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

## 外掛說明

This plugin allows users to express sentiments (a la getsatisfaction.com, e.g. happy,
neutral, outraged etc.) through the WordPress commenting system. Users can also 
associate their comment with a pre-defined ‘topic’. Overall sentiment, and comment
topics, can be viewed as pie charts in the admin system, within a user-defined date
range. Additionally, comments (along with their sentiment, and topic, if specified)
can be exported as a CSV for further offline analysis.

Note that, in order to fully incorporate this plugin, you will need to modify your
theme. This is so that theme developers have full control over the markup that is
generated. The following [Loop](https://codex.wordpress.org/The_Loop)-inspired template
tags are provided in order to render the defined sentiments and topics:

 * `smtr_has_sentiments` – determines whether their are any sentiments to display
 * `smtr_the_sentiment` – initializes the current sentiment for display
 * `smtr_the_sentiment_name` – echoes the current sentiment name (“Happy”, “Neutral”,“
   Outraged” etc.), first escaping any HTML
 * `smtr_the_sentiment_value` – echoes the current sentiment value (“happy”, “neutral”,“
   outraged” etc.), first escaping any HTML
 * `smtr_has_topics` – determines whether their are any topics to display
 * `smtr_the_topic` – initializes the current topic for display
 * `smtr_the_topic_name` – echoes the current topic name (“Help”, “Ideas”, “Suggestions”
   etc.), first escaping any HTML
 * `smtr_the_topic_value` – echoes the current topic value (“help”, “ideas”, “suggestions”
   etc.), first escaping any HTML
 * `smtr_is_topic_selected` – returns TRUE if the current topic should be selected(
   intended for use when rendering a select formm element with multiple topic options)

One suggested arrangement of these template tags is:

    ```
    <form action="<?php echo get_option('siteurl'); ?>/wp-comments-post.php" method="post" id="commentform"> <ul>      <?php if ( function_exists('smtr_has_topics') ) : // ensure 'Sentimeter' plugin is installed ?>         <li>             <?php if ( smtr_has_topics() ) : ?>             <label for="smtr_topic">This is about</label>             <select id="smtr_topic" name="smtr_topic">             <?php while ( smtr_has_topics() ) : smtr_the_topic(); ?>                 <option value="<?php smtr_the_topic_value() ?>"<?php echo smtr_is_topic_selected() ? ' selected="selected"' : ''; ?>"><?php smtr_the_topic_name() ?></option>             <?php endwhile; ?>             </select>             <?php endif; ?>         </li>          <li>             <?php if ( smtr_has_sentiments() ) : ?>             <fieldset class="radio-group">                 <legend>I'm feeling</legend>                 <ul class="formatRadio">                     <?php $i = 0; while ( smtr_has_sentiments() ) : smtr_the_sentiment(); ?>                     <li>                         <label for="smtr_sentiment_<?php smtr_the_sentiment_value() ?>"><?php smtr_the_sentiment_name() ?></label>                         <input type="radio" id="smtr_sentiment_<?php smtr_the_sentiment_value() ?>" name="smtr_sentiment" value="<?php smtr_the_sentiment_value() ?>"/>                     </li>                     <?php $i++; endwhile; ?>                 </ul>             </fieldset>             <?php endif; ?>         </li>     <?php endif; ?>         <li>             <?php  // Other existing comment fields here (name, email, comment etc.) ... ?> 
    ```

## 螢幕擷圖

[⌊This screen shot shows an example sentiment analysis, broken down both by sentiment
and topic, within the WordPress admin UI.⌉⌊This screen shot shows an example sentiment
analysis, broken down both by sentiment and topic, within the WordPress admin UI
.⌉[

This screen shot shows an example sentiment analysis, broken down both by sentiment
and topic, within the WordPress admin UI.

## 安裝方式

 1. Upload the `sentimeter` folder to your `/wp-content/plugins/` directory
 2. Activate the plugin through the ‘Plugins’ menu in WordPress
 3. Modify your existing comments form to include options for sentiment and/or topic
    using the installed template tags
 4. Monitor sentiment through the admin UI, by navigating to the Sentimeter page, located
    under the Tools menu

## 常見問題集

#### How do I specify my own sentiments and/or topics?

Currently, there is no admin UI to override the default sentiments or topics, this
is planned for a future release.

However, the default sentiments and topics are just options in the `wp_option` database
table. The following PHP script, when placed in the root of your WordPress install,
can be used to override the default sentiments and topics after the plugin has been
installed:

    ```
    <?php // Load up WordPress include 'wp-load.php';  // Define sentiments/topics (edit as required, but maintaining the data structure) $sentiments = array(     array(         'name' => 'Happy',        // name is show to the end user         'value' => 'happy'        // value is stored in the database     ),     array(         'name' => 'Neutral',         'value' => 'neutral'     ),     array(         'name' => 'Outraged',         'value' => 'outraged'     ) ); $topics = array(     array(         'name' => 'Help',         'value' => 'help'     ),     array(         'name' => 'Ideas',         'value' => 'ideas'     ),     array(         'name' => 'Improvements',         'value' => 'improvements'     ),     array(         'name' => 'Something else',         'value' => 'other',         'default' => 'true'       // this will cause Something else to be pre-selected in a drop-down     ) );  // Load sentiments/topics update_option('smtr_sentiments', $sentiments); update_option('smtr_topics', $topics); ?> 
    ```

#### How can I use my own emoticons/icons for the sentiments, a la getsatisfaction.com?

Excellent question. We’ve had success with [Ryan Fait’s](http://ryanfait.com/) [custom form elements script](http://ryanfait.com/resources/custom-checkboxes-and-radio-buttons/).

#### Where is that awesome pie-chart generator from?

We’re using the [](http://g.raphaeljs.com/). Yes, it is awesome, isn’t it? 🙂

#### I have another question!

[Get in touch](http://twitter.com/steveWINton) with [me](http://www.nixonmcinnes.co.uk/people/steve/).

## 使用者評論

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

## 參與者及開發者

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

參與者

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

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

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

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

## 變更記錄

#### 1.0

 * First release.

## 中繼資料

 *  版本 **1.0**
 *  最後更新 **17 年前**
 *  啟用安裝數 **少於 10 次**
 *  WordPress 版本需求 ** 2.9 或更新版本 **
 *  已測試相容的 WordPress 版本 **2.9.2**
 *  語言
 * [English (US)](https://wordpress.org/plugins/sentimeter/)
 *  [進階檢視](https://tw.wordpress.org/plugins/sentimeter/advanced/)

## 評分

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

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

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

## 參與者

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

## 技術支援

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

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