• This forum has been archived. New threads and replies may not be made. All add-ons/resources that are active should be migrated to the Resource Manager. See this thread for more information.

ragtek Unread Thread Counter

  • Thread starter Thread starter ragtek
  • Start date Start date
PHP:
   public function getPhraseName(){
       return (self::$counter != 0) ? 'ragtek_unreadPost': 'ragtek_unreadPosts';
   }

This seems to return the "ragtek_unreadPost" phrase if there are more than 0 unread threads. Even if it's 1, or 2, or 3, or 4, or 100. That phrase has the number "1" hardcoded in it. If you change the 1 to {postcounter} in that phrase, it will return the correct number of unread threads.

The problem still is: it returns the number of unread THREADS, not posts.

PHP:
self::$counter = count($threadModel->getUnreadThreadIds(XenForo_Visitor::getInstance()->getUserId()));

This will only tell you how many unread threads you have, not the actual number of unread messages.
 
thx for reporting this.

Don't know how this could happen:D
I'll try to fix this ASAP.

Sorry
 
Better yet, change that "0" to "1" in the above code, and then there's no need to change any of the phrases. Then it becomes "0 posts", "1 post", "2 posts", "3 posts" etc.

My biggest concern is that it only returns the number of threads. :( I changed the phrase to say threads so it's okay for now, but it would be great to have the postcount displayed. (Or even both, "you have 56 unread messages in 12 threads"... maybe this is a little overkill... :))
 
the funny thing is, that this was planed as a unread thread counter (that's why it's named utc ) don't know why i thought it's for the posts:D
 
************update********

BEcause this add-on counts the THREADS and not the phrases, i renamed the add-on and the 2 phrases
 
the funny thing is, that this was planed as a unread thread counter (that's why it's named utc ) don't know why i thought it's for the posts:D

Hmm, indeed that's what it says in the first post... :) The title mislead me. :)

Do you have any plans to extend this to unread posts?
 
i would love to install this when all known bugs and more feature included
so far it looks ok but let's see whats hidden in xf 1.1

thx for the mod
 
Top Bottom