Unread Post Count

Unread Post Count 1.2.0

No permission to download
HI Chris, I notice on your xenmedia site, you have the unread post count displaying with xf1.2.

Has it worked since the update, or have you tweaked it on your site ? ;)
 
Well, my code targets the phrase whats_new which appears to still be in XenForo 1.2.

So actually I think it's just a simple case of changing the phrase whats_new to have the text of New Posts and it works.

upload_2013-6-25_20-7-39.webp
 
It targets the phrase whats_new so you will need to ensure that still exists.

My install still has the phrase whats_new.

You may need to update that whats_new phrase to read the same as new_posts
 
Tested on original style (1.2.0 RC1) and same problem nothing display.
In /library/UnreadPostCount/Listener.php check the section
Code:
                        $unread = XenForo_Model::create('UnreadPostCount_Model_Unread')->getUnreadPostCount($userId, $nodeIds);

                        $whatsNewPhrase = new XenForo_Phrase('whats_new');
                        $whatsNewPhraseQuoted = preg_quote($whatsNewPhrase->__toString());
and try changing the segment XenForo_Phrase('whats_new') where the whats_new reflects the phrase in the language you selected (if the base ACP phrases are in another language - if in English it probably won't do any good).
 
That's not what you need to do at all.

Just do as I said.

Make sure the contents of the whats_new phrase match the contents of the new_posts phrase.
 
In /library/UnreadPostCount/Listener.php check the section
Code:
                        $unread = XenForo_Model::create('UnreadPostCount_Model_Unread')->getUnreadPostCount($userId, $nodeIds);

                        $whatsNewPhrase = new XenForo_Phrase('whats_new');
                        $whatsNewPhraseQuoted = preg_quote($whatsNewPhrase->__toString());
and try changing the segment XenForo_Phrase('whats_new') where the whats_new reflects the phrase in the language you selected (if the base ACP phrases are in another language - if in English it probably won't do any good).
It's work now ! thank you Tracy (y)

Must replace :
Code:
$unread = XenForo_Model::create('UnreadPostCount_Model_Unread')->getUnreadPostCount($userId, $nodeIds);

                        $whatsNewPhrase = new XenForo_Phrase('whats_new');
                        $whatsNewPhraseQuoted = preg_quote($whatsNewPhrase->__toString());

By:

Code:
$unread = XenForo_Model::create('UnreadPostCount_Model_Unread')->getUnreadPostCount($userId, $nodeIds);

                        $whatsNewPhrase = new XenForo_Phrase('new_posts');
                        $whatsNewPhraseQuoted = preg_quote($whatsNewPhrase->__toString());

(Short) Replace Phrase -> whats_new by new_posts
 
It's work now ! thank you Tracy (y)

Must replace :

(Short) Replace Phrase -> whats_new by new_posts

In that case, you do not need to edit the Listener.php since you can go into the ACP -> Appearance -> Phrases and do the below
screenshot.webp
Otherwise when you update, your edit will be over-written.
 
That's what I said to do in the first place.
Yeah, but apparently it's not working for him, so I'm wondering if the whats_new title is actually set as new_posts instead of the default, which I think with his change taking in the listener.php may be what the problem is.
 
The expression whats_new is not used in the original style (template) now (tested on 1.2.0 RC1).

I think it will be removed in futures versions.
 
Top Bottom