{"id":21817,"date":"2013-01-30T09:56:09","date_gmt":"2013-01-30T09:56:09","guid":{"rendered":"https:\/\/wordpress.org\/plugins-wp\/bbpress-pencil-unread\/"},"modified":"2020-01-13T23:18:08","modified_gmt":"2020-01-13T23:18:08","slug":"bbpress-pencil-unread","status":"publish","type":"plugin","link":"https:\/\/pcd.wordpress.org\/plugins\/bbpress-pencil-unread\/","author":245975,"comment_status":"closed","ping_status":"closed","template":"","meta":{"_crdt_document":"","version":"1.3.2","stable_tag":"trunk","tested":"5.3.21","requires":"","requires_php":"5.6","requires_plugins":"","header_name":"bbPress Pencil Unread","header_author":"G.Breant","header_description":"","assets_banners_color":"f7f7e4","last_updated":"2020-01-13 23:18:08","external_support_url":"","external_repository_url":"","donate_link":"http:\/\/bit.ly\/gbreant","header_plugin_uri":"http:\/\/wordpress.org\/extend\/plugins\/bbpress-pencil-unread","header_author_uri":"https:\/\/profiles.wordpress.org\/grosbouff\/","rating":4.9,"author_block_rating":0,"active_installs":100,"downloads":16168,"num_ratings":11,"support_threads":0,"support_threads_resolved":0,"author_block_count":0,"sections":["description","installation","faq","changelog"],"tags":[],"upgrade_notice":[],"ratings":{"1":0,"2":0,"3":0,"4":"1","5":"10"},"assets_icons":[],"assets_banners":{"banner-772x250.jpg":{"filename":"banner-772x250.jpg","revision":"1496040","resolution":"772x250","location":"assets","locale":""},"banner-772x250.png":{"filename":"banner-772x250.png","revision":"1496782","resolution":"772x250","location":"assets","locale":""}},"assets_blueprints":{},"all_blocks":[],"tagged_versions":["1.0.0"],"block_files":[],"assets_screenshots":{"screenshot-1.png":{"filename":"screenshot-1.png","revision":"1496040","resolution":"1","location":"assets","locale":""},"screenshot-2.png":{"filename":"screenshot-2.png","revision":"1496040","resolution":"2","location":"assets","locale":""}},"screenshots":{"1":"Style of the read \/ non-read forums.  The flag icon is a link to reach the last read reply.","2":"Options page"},"jetpack_post_was_ever_published":false},"plugin_section":[],"plugin_tags":[2770,11307,3896,11219,11280],"plugin_category":[44],"plugin_contributors":[83793],"plugin_business_model":[],"class_list":["post-21817","plugin","type-plugin","status-publish","hentry","plugin_tags-bbpress","plugin_tags-mark-as-read","plugin_tags-new","plugin_tags-topics","plugin_tags-unread","plugin_category-discussion-and-community","plugin_contributors-grosbouff","plugin_committers-grosbouff"],"banners":{"banner":"https:\/\/ps.w.org\/bbpress-pencil-unread\/assets\/banner-772x250.png?rev=1496782","banner_2x":false,"banner_rtl":false,"banner_2x_rtl":false},"icons":{"svg":false,"icon":"https:\/\/s.w.org\/plugins\/geopattern-icon\/bbpress-pencil-unread_f7f7e4.svg","icon_2x":false,"generated":true},"screenshots":[{"src":"https:\/\/ps.w.org\/bbpress-pencil-unread\/assets\/screenshot-1.png?rev=1496040","caption":"Style of the read \/ non-read forums.  The flag icon is a link to reach the last read reply."},{"src":"https:\/\/ps.w.org\/bbpress-pencil-unread\/assets\/screenshot-2.png?rev=1496040","caption":"Options page"}],"raw_content":"<!--section=description-->\n<p>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.\nCompatible with BuddyPress Groups Forums feature.<\/p>\n\n<ul>\n<li>For <strong>forums<\/strong>, it checks if the user has read all topics since last visit.<\/li>\n<li>For <strong>topics<\/strong>, it checks if the user opened the topic since it was last active.<\/li>\n<li><em>Mark as read<\/em> (optional) mark all topics of a forum as read.<\/li>\n<li><em>Bookmarks<\/em> : (optional) adds a link after the topics titles; that goes directly to the last read reply of a topic.<\/li>\n<li>Option to set as read topics that where created before the user's registration<\/li>\n<\/ul>\n\n<h4>Demo<\/h4>\n\n<p>We don't have a running demo anymore.  If you use this plugin and would like to be featured here, please <a href=\"https:\/\/github.com\/gordielachance\/bbpress-pencil-unread\/issues\/5\">contact us<\/a><\/p>\n\n<h4>Donate<\/h4>\n\n<p>Donations are needed to help maintain this plugin.  Please consider <a href=\"http:\/\/bit.ly\/gbreant\">supporting us<\/a>.\nThis would be very appreciated \u2014 Thanks !<\/p>\n\n<h4>Contributors<\/h4>\n\n<p>Contributors <a href=\"https:\/\/github.com\/gordielachance\/bbpress-pencil-unread\/contributors\">are listed here<\/a><\/p>\n\n<h4>Bugs\/Development<\/h4>\n\n<p>For feature request and bug reports, please use the <a href=\"https:\/\/github.com\/gordielachance\/bbpress-pencil-unread\/issues\">Github Issues Tracker<\/a>.<\/p>\n\n<p>If you are a plugin developer, <a href=\"https:\/\/github.com\/gordielachance\/bbpress-pencil-unread\">we would like to hear from you<\/a>. Any contribution would be very welcome.<\/p>\n\n<h3>Localization<\/h3>\n\n<p>If it hasn't been done already, you can translate the plugin and send me the translation.  I recommand <a href=\"https:\/\/fr.wordpress.org\/plugins\/loco-translate\/\">Loco Translate<\/a> to work on your translations within Wordpress.<\/p>\n\n<!--section=installation-->\n<ol>\n<li>Upload the plugin to your blog and Activate it.<\/li>\n<\/ol>\n\n<!--section=faq-->\n<dl>\n<dt>It doesn't work \/ CSS styling is bad !<\/dt>\n<dd><p>Styling has been setup for the bbPress default theme.<br \/>\nIf it doesn't work for you, please try to check\/override our CSS styles (bbppu.css)<\/p><\/dd>\n<dt>How can I filter topics to display only the unread or read ones ?<\/dt>\n<dd><p>Just add the <strong>bbppu<\/strong> arg to your <a href=\"https:\/\/codex.wordpress.org\/Class_Reference\/WP_Query\">Wordpress queries<\/a>.  You can set it either to <em>read<\/em> or <em>unread<\/em>.\nOf course, this works for the current logged user and will be skipped if the visitor is not logged.<\/p>\n\n<p>Example :<\/p>\n\n<pre><code>&lt;?php\n$last_unread_topics_query_args = array(\n  'post_type'       =&gt; bbp_topic_post_type(), \/\/or 'topic'\n  'posts_per_page'  =&gt; 5,\n  'bbppu'       =&gt; 'unread' \/\/only unread ones\n);\n\n$last_unread_topics_query = new WP_Query( $last_unread_topics_query_args );\n?&gt;\n<\/code><\/pre><\/dd>\n<dt>How does it work?<\/dt>\n<dd><p><em>bbPress Pencil Unread<\/em> handles differently the way forums &amp; topics are set as read.<\/p>\n\n<ul>\n<li><p>For <strong>topics<\/strong>, a post meta <em>bbppu_read_by<\/em> is attached to the topic each time a someone visits it; the meta value is the user ID. \u00a0When a new reply is added, all those metas are deleted.<\/p><\/li>\n<li><p>For <strong>forums<\/strong>, 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.<\/p><\/li>\n<li><p>Marking a forum (<em>Mark all as read<\/em>) adds an entry with the forum ID and timestamp in <em>bbppu_marked_forums<\/em> (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.<\/p><\/li>\n<li><p>Marking a forum will only set the topics from this forum as read.  If there is <strong>super sticky topics<\/strong> displayed and that they belong to other forums, they will not be marked as read.<\/p><\/li>\n<\/ul><\/dd>\n<dt>How can I use those functions outside of the plugin ?<\/dt>\n<dd><p>Have a look at the file \/bbppu-template.php, which contains functions you could need.<\/p><\/dd>\n<dt>How can I see the plugin's log ?<\/dt>\n<dd><p>The plugin will generate various notices and informations in the debug.log file, if <a href=\"https:\/\/codex.wordpress.org\/Debugging_in_WordPress\">debugging is enabled<\/a>.<\/p><\/dd>\n\n<\/dl>\n\n<!--section=changelog-->\n<h4>1.3.0<\/h4>\n\n<ul>\n<li>Try to optimize queries that count forum topics in has_user_read_all_forum_topics():<\/li>\n<li>'no_found_rows' =&gt; true (see https:\/\/wpartisan.me\/tutorials\/wordpress-database-queries-speed-sql_calc_found_rows); so use count() instead of found-&gt;posts<\/li>\n<li>'update_post_term_cache' =&gt; false<\/li>\n<\/ul>\n\n<h4>1.2.9<\/h4>\n\n<ul>\n<li>when comparing the topics read, only fetch IDs instead of full post<\/li>\n<li>better debug.log report<\/li>\n<\/ul>\n\n<h4>1.2.7<\/h4>\n\n<ul>\n<li>Added the 'bookmark' option, which adds (by default) a link after topics titles to go directly to the last read reply of that topic.<\/li>\n<li>Forums marks is now an option<\/li>\n<\/ul>\n\n<h4>1.2.6<\/h4>\n\n<ul>\n<li>Added meta query in has_user_read_all_forum_topics() to ignore posts below timestamp generated in get_skip_timestamp()<\/li>\n<li>New function get_skip_timestamp()<\/li>\n<\/ul>\n\n<h4>1.2.4<\/h4>\n\n<ul>\n<li>Use utf8 encoding when running $dom-&gt;loadHTML() to avoid problems with foreign languages (http:\/\/stackoverflow.com\/questions\/8218230\/php-domdocument-loadhtml-not-encoding-utf-8-correctly)<\/li>\n<\/ul>\n\n<h4>1.2.3<\/h4>\n\n<ul>\n<li>No faking anymore !  Now the plugin <strong>really<\/strong> checks if a forum has its topics all read; while before, it was checking if the forum had been <strong>opened<\/strong>.<\/li>\n<li>Allow to filter queries to get topics by read\/unread status (see FAQ)<\/li>\n<li>fixed loadHTML() error (https:\/\/wordpress.org\/support\/topic\/just-upgraded-to-v-1-2-errors\/#post-8169136)<\/li>\n<li>Arabic translation (thanks to Mohammad Sy)<\/li>\n<li>has_user_read_all_forum_topics() : store the results in a short transient (5s) to avoid querying several times the same stuff.<\/li>\n<li>deleted 'bbppu_forums_visits' usermetas and related functions (+ upgrade function)<\/li>\n<li>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<\/li>\n<\/ul>\n\n<h4>1.2.2<\/h4>\n\n<ul>\n<li>Do not show 'Mark as read' link if no activity since last marked.<\/li>\n<li>fixed localization + french translation<\/li>\n<li>stylesheet : RTL support<\/li>\n<li>code cleanup<\/li>\n<li>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)<\/li>\n<\/ul>\n\n<h4>1.2.1<\/h4>\n\n<ul>\n<li>bug fixes : https:\/\/wordpress.org\/support\/topic\/just-upgraded-to-v-1-2-errors\/<\/li>\n<\/ul>\n\n<h4>1.2<\/h4>\n\n<ul>\n<li>SCSS<\/li>\n<li>options page<\/li>\n<li>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\/<\/li>\n<li>includes fontAwesome (loading icon : glyph instead of image)<\/li>\n<li>Improved function get_user_mark_as_read_link()<\/li>\n<li>Improved function process_mark_as_read()<\/li>\n<li>improved ajax and nonces checks<\/li>\n<li>supports forums hierarchy<\/li>\n<\/ul>\n\n<h4>1.1.1<\/h4>\n\n<ul>\n<li>Removed first forum visit stuff.  Remove old metas.  Now check users registration time.<\/li>\n<li>Lots of code cleanup<\/li>\n<li>Improved has_user_read() function<\/li>\n<\/ul>\n\n<h4>1.1.0<\/h4>\n\n<ul>\n<li>Improved marking as read - among others, checks if a parent forum has been marked.<\/li>\n<li>Merged multiple \"bbppu_marked_forum_XX\" user meta keys into \"bbppu_marked_forums\" + upgrade function for older versions of the plugin.<\/li>\n<li>New debug_log() function<\/li>\n<li>Now handles forum categories<\/li>\n<li>Merged functions 'has_user_read_forum' and 'has_user_read_topic' to 'has_user_read'<\/li>\n<li>Merged functions 'forum_status_class' and 'topic_status_class' to 'post_status_class'<\/li>\n<li>Removed bbP_Pencil_Unread variable 'prefix'<\/li>\n<\/ul>\n\n<h4>1.0.9<\/h4>\n\n<ul>\n<li>Undefined index bug fix (http:\/\/wordpress.org\/support\/topic\/php-notice-for-mark_as_read_single_forum_link?replies=3#post-4842854)<\/li>\n<\/ul>\n\n<h4>1.0.7<\/h4>\n\n<ul>\n<li>Fixed minor bug (http:\/\/wordpress.org\/support\/topic\/php-notice-for-mark_as_read_single_forum_link)<\/li>\n<\/ul>\n\n<h4>1.0.6<\/h4>\n\n<ul>\n<li>Fixed minor bugs from 1.0.5<\/li>\n<\/ul>\n\n<h4>1.0.5<\/h4>\n\n<ul>\n<li>Compatible with BuddyPress Groups Forums !<\/li>\n<li>Backend integration (new_topic_backend,new_reply_backend)<\/li>\n<li>Better firing sequence<\/li>\n<li>Fixed styles for \"mark as read\" link<\/li>\n<\/ul>\n\n<h4>1.0.4<\/h4>\n\n<ul>\n<li>Now saving the user's first visit (user meta key \"bbppu_first_visit\") to define older content as \"read\".<\/li>\n<li>In 'setup_actions()', replaced wordpress hooks by bbpress hooks (to avoid plugin to crash while bbPress is not enabled)<\/li>\n<\/ul>\n\n<h4>1.0.3<\/h4>\n\n<ul>\n<li>Added link \"mark as read\" for forums<\/li>\n<li>Added filter 'bbppu_user_has_read_forum' on has_user_read_forum() and 'bbppu_user_has_read_topic' on has_user_read_topic()<\/li>\n<\/ul>\n\n<h4>1.0.2<\/h4>\n\n<ul>\n<li>Timezone bug fix (thanks to Ruben!)<\/li>\n<\/ul>\n\n<h4>1.0.1<\/h4>\n\n<ul>\n<li>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)<\/li>\n<li>Store plugin version<\/li>\n<li>Cleaned up the code<\/li>\n<\/ul>\n\n<h4>1.0.0<\/h4>\n\n<ul>\n<li>First release<\/li>\n<\/ul>","raw_excerpt":"bbPress Pencil Unread display which bbPress forums\/topics have already been read by the user.","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/pcd.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin\/21817","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/pcd.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin"}],"about":[{"href":"https:\/\/pcd.wordpress.org\/plugins\/wp-json\/wp\/v2\/types\/plugin"}],"replies":[{"embeddable":true,"href":"https:\/\/pcd.wordpress.org\/plugins\/wp-json\/wp\/v2\/comments?post=21817"}],"author":[{"embeddable":true,"href":"https:\/\/pcd.wordpress.org\/plugins\/wp-json\/wporg\/v1\/users\/grosbouff"}],"wp:attachment":[{"href":"https:\/\/pcd.wordpress.org\/plugins\/wp-json\/wp\/v2\/media?parent=21817"}],"wp:term":[{"taxonomy":"plugin_section","embeddable":true,"href":"https:\/\/pcd.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_section?post=21817"},{"taxonomy":"plugin_tags","embeddable":true,"href":"https:\/\/pcd.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_tags?post=21817"},{"taxonomy":"plugin_category","embeddable":true,"href":"https:\/\/pcd.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_category?post=21817"},{"taxonomy":"plugin_contributors","embeddable":true,"href":"https:\/\/pcd.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_contributors?post=21817"},{"taxonomy":"plugin_business_model","embeddable":true,"href":"https:\/\/pcd.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_business_model?post=21817"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}