Title: bbPress Pencil Unread
Author: grosbouff
Published: <strong>2013 年 1 月 30 日</strong>
Last modified: 2020 年 1 月 13 日

---

搜尋外掛

![](https://ps.w.org/bbpress-pencil-unread/assets/banner-772x250.png?rev=1496782)

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

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

# bbPress Pencil Unread

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

[下載](https://downloads.wordpress.org/plugin/bbpress-pencil-unread.zip)

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

 [技術支援](https://wordpress.org/support/plugin/bbpress-pencil-unread/)

## 外掛說明

bbPress Pencil Unread display which bbPress forums/topics have already been read
by the logged user; and adds classes to forums/topics so you can customize your 
theme easily.
 Compatible with BuddyPress Groups Forums feature.

 * For **forums**, it checks if the user has read all topics since last visit.
 * For **topics**, it checks if the user opened the topic since it was last active.
 * _Mark as read_ (optional) mark all topics of a forum as read.
 * _Bookmarks_ : (optional) adds a link after the topics titles; that goes directly
   to the last read reply of a topic.
 * Option to set as read topics that where created before the user’s registration

#### Demo

We don’t have a running demo anymore. If you use this plugin and would like to be
featured here, please [contact us](https://github.com/gordielachance/bbpress-pencil-unread/issues/5)

#### Donate

Donations are needed to help maintain this plugin. Please consider [supporting us](http://bit.ly/gbreant).

This would be very appreciated — Thanks !

#### 貢獻者

Contributors [are listed here](https://github.com/gordielachance/bbpress-pencil-unread/contributors)

#### Bugs/Development

For feature request and bug reports, please use the [Github Issues Tracker](https://github.com/gordielachance/bbpress-pencil-unread/issues).

If you are a plugin developer, [we would like to hear from you](https://github.com/gordielachance/bbpress-pencil-unread).
Any contribution would be very welcome.

### Localization

If it hasn’t been done already, you can translate the plugin and send me the translation.
I recommand [Loco Translate](https://fr.wordpress.org/plugins/loco-translate/) to
work on your translations within WordPress.

## 螢幕擷圖

[⌊Style of the read / non-read forums.  The flag icon is a link to reach the last
read reply.⌉⌊Style of the read / non-read forums.  The flag icon is a link to reach
the last read reply.⌉[

Style of the read / non-read forums. The flag icon is a link to reach the last read
reply.

[⌊Options page⌉⌊Options page⌉[

Options page

## 安裝方式

 1. Upload the plugin to your blog and Activate it.

## 常見問題集

  It doesn’t work / CSS styling is bad !

Styling has been setup for the bbPress default theme.
 If it doesn’t work for you,
please try to check/override our CSS styles (bbppu.css)

  How can I filter topics to display only the unread or read ones ?

Just add the **bbppu** arg to your [WordPress queries](https://codex.wordpress.org/Class_Reference/WP_Query).
You can set it either to _read_ or _unread_.
 Of course, this works for the current
logged user and will be skipped if the visitor is not logged.

Example :

    ```
    <?php
    $last_unread_topics_query_args = array(
      'post_type'       => bbp_topic_post_type(), //or 'topic'
      'posts_per_page'  => 5,
      'bbppu'       => 'unread' //only unread ones
    );

    $last_unread_topics_query = new WP_Query( $last_unread_topics_query_args );
    ?>
    ```

  How does it work?

_bbPress Pencil Unread_ handles differently the way forums & topics are set as read.

 * For **topics**, a post meta _bbppu\_read\_by_ is attached to the topic each time
   a someone visits it; the meta value is the user ID.  When a new reply is added,
   all those metas are deleted.
 * For **forums**, we compare the total count of topics with the total count of 
   read topics for the current user. If it does not match, the forum is considered
   as unread.
 * Marking a forum (_Mark all as read_) adds an entry with the forum ID and timestamp
   in _bbppu\_marked\_forums_ (usermeta). When determining if a topic has been read,
   we check if the topic’s forum (or ancestors) has a mark more recent than the 
   topic time.
 * Marking a forum will only set the topics from this forum as read. If there is**
   super sticky topics** displayed and that they belong to other forums, they will
   not be marked as read.

  How can I use those functions outside of the plugin ?

Have a look at the file /bbppu-template.php, which contains functions you could 
need.

  How can I see the plugin’s log ?

The plugin will generate various notices and informations in the debug.log file,
if [debugging is enabled](https://codex.wordpress.org/Debugging_in_WordPress).

## 使用者評論

![](https://secure.gravatar.com/avatar/8d74933acc309e0ddd5d32c7db769333a4556fae203b48aa18258f8fb98d1c7f?
s=60&d=retro&r=g)

### 󠀁[Elegant and Effective](https://wordpress.org/support/topic/elegant-and-effective-3/)󠁿

 [dprendergast](https://profiles.wordpress.org/dprendergast/) 2020 年 9 月 1 日

Love it. Simple and attractive plugin that does exactly as needed/promised. Wish
they all were like this.

![](https://secure.gravatar.com/avatar/4081387e62d761d441db1276047b0437f6fcf2eb74451994da81014ee7f7b4a7?
s=60&d=retro&r=g)

### 󠀁[Exactly what I was looking for](https://wordpress.org/support/topic/exactly-what-i-was-looking-for-443/)󠁿

 [joed12](https://profiles.wordpress.org/joed12/) 2020 年 4 月 10 日

So far this plugin seems to be exactly what I was looking for. It marks unread topics
and lets you jump right to the new reply. Excellent work!

![](https://secure.gravatar.com/avatar/b57fbdf1a09e70972d19caa619a4f96d88bdc7509b6fb0aca47e33ebadca5a95?
s=60&d=retro&r=g)

### 󠀁[Essential](https://wordpress.org/support/topic/essential-214/)󠁿

 [somebodyelse](https://profiles.wordpress.org/somebodyelse/) 2019 年 3 月 5 日

worked as advertised. essential to using a forum that's busy and active.

![](https://secure.gravatar.com/avatar/cb95d39bb24b031a5a03b42fbee68ffbd98469da9059008dfb4821514f944aca?
s=60&d=retro&r=g)

### 󠀁[A really useful plugin indeed!](https://wordpress.org/support/topic/a-really-useful-plugin-indeed/)󠁿

 [abooster](https://profiles.wordpress.org/abooster/) 2016 年 9 月 3 日

This is a really useful plugin indeed. Thanks a lot!

![](https://secure.gravatar.com/avatar/97bbe4fe76251bd8de789468d4e055a2a38da2615beb64caba53e5aff6c24084?
s=60&d=retro&r=g)

### 󠀁[Works fine,thanks](https://wordpress.org/support/topic/works-finethanks-4/)󠁿

 [General Seed](https://profiles.wordpress.org/autocultivo/) 2016 年 9 月 3 日

Thanks, indispensable plugin.

 [ 閱讀全部 11 則使用者評論 ](https://wordpress.org/support/plugin/bbpress-pencil-unread/reviews/)

## 參與者及開發者

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

參與者

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

[將〈bbPress Pencil Unread〉外掛本地化為台灣繁體中文版](https://translate.wordpress.org/projects/wp-plugins/bbpress-pencil-unread)

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

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

## 變更記錄

#### 1.3.0

 * Try to optimize queries that count forum topics in has_user_read_all_forum_topics():
 * ‘no_found_rows’ => true (see https://wpartisan.me/tutorials/wordpress-database-
   queries-speed-sql_calc_found_rows); so use count() instead of found->posts
 * ‘update_post_term_cache’ => false

#### 1.2.9

 * when comparing the topics read, only fetch IDs instead of full post
 * better debug.log report

#### 1.2.7

 * Added the ‘bookmark’ option, which adds (by default) a link after topics titles
   to go directly to the last read reply of that topic.
 * Forums marks is now an option

#### 1.2.6

 * Added meta query in has_user_read_all_forum_topics() to ignore posts below timestamp
   generated in get_skip_timestamp()
 * New function get_skip_timestamp()

#### 1.2.4

 * Use utf8 encoding when running $dom->loadHTML() to avoid problems with foreign
   languages (http://stackoverflow.com/questions/8218230/php-domdocument-loadhtml-
   not-encoding-utf-8-correctly)

#### 1.2.3

 * No faking anymore ! Now the plugin **really** checks if a forum has its topics
   all read; while before, it was checking if the forum had been **opened**.
 * Allow to filter queries to get topics by read/unread status (see FAQ)
 * fixed loadHTML() error (https://wordpress.org/support/topic/just-upgraded-to-
   v-1-2-errors/#post-8169136)
 * Arabic translation (thanks to Mohammad Sy)
 * has_user_read_all_forum_topics() : store the results in a short transient (5s)
   to avoid querying several times the same stuff.
 * deleted ‘bbppu_forums_visits’ usermetas and related functions (+ upgrade function)
 * topic_readby_metaname is now multiple (+ upgrade function) : do not store array
   of user IDs in a single meta, but store multiple metas with single user ID each
   time

#### 1.2.2

 * Do not show ‘Mark as read’ link if no activity since last marked.
 * fixed localization + french translation
 * stylesheet : RTL support
 * code cleanup
 * jQuery : when marking a forum as read, give the ‘bbppu-read’ class only to the
   topics of that forum (super sticky topics could be from another forum so they
   should remain unread)

#### 1.2.1

 * bug fixes : https://wordpress.org/support/topic/just-upgraded-to-v-1-2-errors/

#### 1.2

 * SCSS
 * options page
 * option to choose if items created before first user’s visit should be marked 
   as read (‘test_registration_time’) – https://wordpress.org/support/topic/old-
   topics-as-unread/
 * includes fontAwesome (loading icon : glyph instead of image)
 * Improved function get_user_mark_as_read_link()
 * Improved function process_mark_as_read()
 * improved ajax and nonces checks
 * supports forums hierarchy

#### 1.1.1

 * Removed first forum visit stuff. Remove old metas. Now check users registration
   time.
 * Lots of code cleanup
 * Improved has_user_read() function

#### 1.1.0

 * Improved marking as read – among others, checks if a parent forum has been marked.
 * Merged multiple “bbppu_marked_forum_XX” user meta keys into “bbppu_marked_forums”
   + upgrade function for older versions of the plugin.
 * New debug_log() function
 * Now handles forum categories
 * Merged functions ‘has_user_read_forum’ and ‘has_user_read_topic’ to ‘has_user_read’
 * Merged functions ‘forum_status_class’ and ‘topic_status_class’ to ‘post_status_class’
 * Removed bbP_Pencil_Unread variable ‘prefix’

#### 1.0.9

 * Undefined index bug fix (https://wordpress.org/support/topic/php-notice-for-mark_as_read_single_forum_link?
   replies=3#post-4842854)

#### 1.0.7

 * Fixed minor bug (https://wordpress.org/support/topic/php-notice-for-mark_as_read_single_forum_link)

#### 1.0.6

 * Fixed minor bugs from 1.0.5

#### 1.0.5

 * Compatible with BuddyPress Groups Forums !
 * Backend integration (new_topic_backend,new_reply_backend)
 * Better firing sequence
 * Fixed styles for “mark as read” link

#### 1.0.4

 * Now saving the user’s first visit (user meta key “bbppu_first_visit”) to define
   older content as “read”.
 * In ‘setup_actions()’, replaced wordpress hooks by bbpress hooks (to avoid plugin
   to crash while bbPress is not enabled)

#### 1.0.3

 * Added link “mark as read” for forums
 * Added filter ‘bbppu_user_has_read_forum’ on has_user_read_forum() and ‘bbppu_user_has_read_topic’
   on has_user_read_topic()

#### 1.0.2

 * Timezone bug fix (thanks to Ruben!)

#### 1.0.1

 * If a forum was set as “read” when a user posts a new topic or reply, keep its
   status to read after the new post has been saved (see function related to var
   $forum_was_read_before_new_post)
 * Store plugin version
 * Cleaned up the code

#### 1.0.0

 * First release

## 中繼資料

 *  版本 **1.3.2**
 *  最後更新 **7 年前**
 *  啟用安裝數 **100+**
 *  已測試相容的 WordPress 版本 **5.3.27**
 *  PHP 版本需求 ** 5.6 或更新版本 **
 *  語言
 * [English (US)](https://wordpress.org/plugins/bbpress-pencil-unread/)
 * 標籤:
 * [bbPress](https://tw.wordpress.org/plugins/tags/bbpress/)[Mark as Read](https://tw.wordpress.org/plugins/tags/mark-as-read/)
   [new](https://tw.wordpress.org/plugins/tags/new/)[topics](https://tw.wordpress.org/plugins/tags/topics/)
   [unread](https://tw.wordpress.org/plugins/tags/unread/)
 *  [進階檢視](https://tw.wordpress.org/plugins/bbpress-pencil-unread/advanced/)

## 評分

 4.9 星，滿分為 5 星

 *  [  10 個 5 星使用者評論     ](https://wordpress.org/support/plugin/bbpress-pencil-unread/reviews/?filter=5)
 *  [  1 個 4 星使用者評論     ](https://wordpress.org/support/plugin/bbpress-pencil-unread/reviews/?filter=4)
 *  [  0 個 3 星使用者評論     ](https://wordpress.org/support/plugin/bbpress-pencil-unread/reviews/?filter=3)
 *  [  0 個 2 星使用者評論     ](https://wordpress.org/support/plugin/bbpress-pencil-unread/reviews/?filter=2)
 *  [  0 個 1 星使用者評論     ](https://wordpress.org/support/plugin/bbpress-pencil-unread/reviews/?filter=1)

[撰寫評分](https://wordpress.org/support/plugin/bbpress-pencil-unread/reviews/#new-post)

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

## 參與者

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

## 技術支援

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

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

## 贊助

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

 [ 贊助這個外掛 ](http://bit.ly/gbreant)