Advertisement:

Author Topic: Unread PM Favicon  (Read 3731 times)

Offline SleePy

  • Site Team
  • SMF Master
  • *
  • Posts: 28,943
  • Gender: Male
  • Thats his happy face.
    • @jdarwood on Twitter
    • SleePy Code - My personal site
Unread PM Favicon
« on: April 07, 2012, 04:51:40 PM »
Link to Mod

SMF 2.0+ Modification.  I will not back support this mod to older versions.

This modification adds a unread PM counter to the favicon.  In addition it continues to check for PMs at a specified interval.  Setting this variable to lower can result in server degration/performance issues.  Use with caution.  The default timeout is 1 minute (60 seconds).

Prior to asking for support, check out the wiki: https://github.com/jdarwood007/smf-unreadPM_count/wiki

Credits for this ability go to Tom Moor for creating Tinycon: https://github.com/tommoor/tinycon

Browsers that support this:
Chrome 15+
Firefox 9+
Opera 11+

The following browsers will fall back to changing the title due to lack of support for this:
Internet Explorer 9
Safari 5

The modification is open source, released under the BSD 3 Clause license!  Check out the source code: https://github.com/jdarwood007/smf-unreadPM_count
Jeremy D — Site Team / SMF Developer
Support the SMF Support team!
Profiles:
GitHub
G+

Offline Bugo

  • SMF Friend
  • SMF Hero
  • *
  • Posts: 1,445
  • Gender: Male
    • @dragomano on Twitter
    • Review & translation for SMF mods
Re: Unread PM Favicon
« Reply #1 on: April 08, 2012, 02:22:43 AM »
You forgot to define global $txt in uPMs_hook_general_mod_settings function.

Offline SleePy

  • Site Team
  • SMF Master
  • *
  • Posts: 28,943
  • Gender: Male
  • Thats his happy face.
    • @jdarwood on Twitter
    • SleePy Code - My personal site
Re: Unread PM Favicon
« Reply #2 on: April 08, 2012, 11:45:33 PM »
So I did.  Fixed that
Jeremy D — Site Team / SMF Developer
Support the SMF Support team!
Profiles:
GitHub
G+

Offline Marcus Forsberg

  • SMF Friend
  • SMF Hero
  • *
  • Posts: 8,607
  • Gender: Male
    • marcus.t.forsberg on Facebook
    • marcusforsberg on LinkedIn
    • @marcusforsberg on Twitter
    • marcusforsberg.net
Re: Unread PM Favicon
« Reply #3 on: April 09, 2012, 07:03:25 AM »
Very cool! ;D

Offline Chalky

  • Support Specialist
  • SMF Hero
  • *
  • Posts: 3,098
  • Gender: Female
  • If in doubt, give me beer...
    • ChalkCat
Re: Unread PM Favicon
« Reply #4 on: April 09, 2012, 11:39:59 AM »
I love this!  It's working well and a great idea

Thank you  :) :)

Offline Chalky

  • Support Specialist
  • SMF Hero
  • *
  • Posts: 3,098
  • Gender: Female
  • If in doubt, give me beer...
    • ChalkCat
Re: Unread PM Favicon
« Reply #5 on: April 09, 2012, 01:31:55 PM »
Ok, itsy bitsy problem and I'm not sure whether I'm better posting it here or on the other thread.  I'm guessing it's a result of this mod's regular check, but because I also made this modification it has rendered my "Who's Online" pretty much useless  :P  I have extended the check time for the Unread PM Favicon mod to 360 seconds, but still my Who's Online looks like in the attached image most of the time.  I do absolutely love this mod, so it would be great to fix this.

Do you know of any way of preventing this mod from registering in the Who's Online?  Or should I ask over there?  Thanks :)


« Last Edit: April 09, 2012, 04:43:31 PM by Sabrinova »

Offline John.

  • Semi-Newbie
  • *
  • Posts: 99
  • Gender: Male
Re: Unread PM Favicon
« Reply #6 on: April 09, 2012, 05:29:17 PM »
And I have this problem..

Offline Chalky

  • Support Specialist
  • SMF Hero
  • *
  • Posts: 3,098
  • Gender: Female
  • If in doubt, give me beer...
    • ChalkCat
Re: Unread PM Favicon
« Reply #7 on: April 11, 2012, 03:51:23 PM »
Any ideas on this yet?

I uninstalled and installed again and it was the same, so I've deactivated it for the time being as I need my Who's Online to at least tell me who's really online.  With this mod keep refreshing members' activity, it always looks as though everybody is online and no members ever time out due to inactivity.

Offline John.

  • Semi-Newbie
  • *
  • Posts: 99
  • Gender: Male
Re: Unread PM Favicon
« Reply #8 on: April 11, 2012, 06:15:50 PM »
SleePy - When will you fix it?

Offline SleePy

  • Site Team
  • SMF Master
  • *
  • Posts: 28,943
  • Gender: Male
  • Thats his happy face.
    • @jdarwood on Twitter
    • SleePy Code - My personal site
Re: Unread PM Favicon
« Reply #9 on: April 14, 2012, 03:34:57 PM »
Yes I fixed it, I just needed time to get around to it.
In the future, you are welcome to open a ticket on its bug tracker on github: https://github.com/jdarwood007/smf-unreadPM_count/issues
Jeremy D — Site Team / SMF Developer
Support the SMF Support team!
Profiles:
GitHub
G+

Offline Chalky

  • Support Specialist
  • SMF Hero
  • *
  • Posts: 3,098
  • Gender: Female
  • If in doubt, give me beer...
    • ChalkCat
Re: Unread PM Favicon
« Reply #10 on: April 14, 2012, 04:06:35 PM »
Fantastic!  Thank you

Offline samborabora

  • Jr. Member
  • **
  • Posts: 330
Re: Unread PM Favicon
« Reply #11 on: June 17, 2014, 09:56:42 AM »
Sorry, I just realized this is for PM's only! This works perfectly for receiving PM's, can it be modded to also add a tinycon if you receive replies to topics you've started or posted in?

Offline Arantor

  • SMF Friend
  • SMF Legend
  • *
  • Posts: 61,702
Re: Unread PM Favicon
« Reply #12 on: June 17, 2014, 11:49:46 AM »
Not without a ridiculous amount of performance hit on your server.
And his eyes have all the seeming of a demon's that is dreaming,
And the lamp-light o'er him streaming throws his shadow on the floor

Offline samborabora

  • Jr. Member
  • **
  • Posts: 330
Re: Unread PM Favicon
« Reply #13 on: June 17, 2014, 02:31:37 PM »
I'd have thought if it was accomplished with AJAX, everything would be alright, performance wise? Is this mod particularly bad on the server even at the default 60 seconds? What if you don't have many users online at the time?

Offline Arantor

  • SMF Friend
  • SMF Legend
  • *
  • Posts: 61,702
Re: Unread PM Favicon
« Reply #14 on: June 17, 2014, 02:55:06 PM »
Not at all, no.

Getting the unread count of PMs requires 3-4 database queries per AJAX call, where you do authentication and get the current user and then the unread PM count is basically free from that point in time.

Getting unread posts or replies... no. That requires at least another 2 queries per AJAX call, and they are expensive calls, not cheap ones like getting the user data. In fact, unread replies is the second most expensive subsystem in SMF, unread topics is third most expensive (search is the most), so doing that every 60 seconds would be an insane performance hit.

This is not theoretical, I have actually sat and implemented and benchmarked this stuff.
And his eyes have all the seeming of a demon's that is dreaming,
And the lamp-light o'er him streaming throws his shadow on the floor

Offline samborabora

  • Jr. Member
  • **
  • Posts: 330
Re: Unread PM Favicon
« Reply #15 on: June 17, 2014, 05:11:37 PM »
Ahh, I see, well, it was worth a thought! How do these huge sites like facebook exist with this stuff going on?

Offline Arantor

  • SMF Friend
  • SMF Legend
  • *
  • Posts: 61,702
Re: Unread PM Favicon
« Reply #16 on: June 17, 2014, 05:14:42 PM »
By having their own *data centres*. They even published the standardised server design they use so that they can build them more cheaply.
And his eyes have all the seeming of a demon's that is dreaming,
And the lamp-light o'er him streaming throws his shadow on the floor

Offline Shuban

  • SMF Hero
  • ******
  • Posts: 2,367
    • Free Homework Help
Re: Unread PM Favicon
« Reply #17 on: June 18, 2014, 09:53:41 PM »
I'm using 1.x... I'm going to try to decode it to 1.x, thanks for the idea, Sleepy.

Offline m62power

  • Semi-Newbie
  • *
  • Posts: 14
Re: Unread PM Favicon
« Reply #18 on: August 19, 2014, 08:46:48 PM »
Are there admin settings for this mod? And where?Tested the modifation and nothing hapening.

Thanks in advance!

Offline SleePy

  • Site Team
  • SMF Master
  • *
  • Posts: 28,943
  • Gender: Male
  • Thats his happy face.
    • @jdarwood on Twitter
    • SleePy Code - My personal site
Re: Unread PM Favicon
« Reply #19 on: August 24, 2014, 01:14:26 AM »
There is one setting under the general mod settings section.  Read the browser requirements for more information on those limitations.
Jeremy D — Site Team / SMF Developer
Support the SMF Support team!
Profiles:
GitHub
G+