Simple Machines Community Forum

Customizing SMF => Modifications and Packages => Topic started by: Dzonny on March 15, 2009, 06:30:51 PM

Title: PM Notification Bar
Post by: Dzonny on March 15, 2009, 06:30:51 PM
Link to Mod (http://custom.simplemachines.org/mods/index.php?mod=1707)
PM Notification Bar
Originaly created by KahneFan

This is a simple PM notification bar which uses your theme's current style to create a bar alerting members of new PMs. Since this displays within your forum pop-up blockers won't give it trouble.

Attached is a screen shot of the mod in action. I would give a demo, but I'm sure people would keep checking the mail :D


Edit:
Updated to work with 1.1.9 and 1.1.8 versions. For that versions use pm_notification_bar_1.1.x.zip.

If you have some errors, bugs or something, please be kind to post your comment here, and we will try to help...
Title: Re: PM Notification Bar
Post by: cme1st2302 on March 15, 2009, 06:37:42 PM
Very nice mod KahneFan!!! Love the pop-up blockers but hate it when u need the pop-up.  This will prove to be quite handy.

Chris
Title: Re: PM Notification Bar
Post by: Özgür on March 16, 2009, 11:19:14 AM
What difference Pm Informer (http://www.simplemachines.org/community/index.php?topic=299276.0)?
Title: Re: PM Notification Bar
Post by: KahneFan on March 16, 2009, 12:07:02 PM
Hmm, guess I have not seen that mod before. TBH, doesn't appear to be a lot of difference. That mod allows you to edit your style in the admin, whereas mine uses styles already being used on your site. Other than that.... probably not much.
Title: Re: PM Notification Bar
Post by: the_shadow on March 16, 2009, 04:41:52 PM
i can't find

// Show the navigation tree.

in my custom template....some help please

thnkx
Title: Re: PM Notification Bar
Post by: KahneFan on March 16, 2009, 05:57:27 PM
I'm not familiar with .rar files. Can you post your regular index.template.php file?
Title: Re: PM Notification Bar
Post by: bullbreedluverz on March 16, 2009, 06:45:10 PM
nice mod KF, like the way it fits nicely with my theme although the 90% width is bit overkill (IMO) ive changed it to set px width at 340px


Quote from: the_shadow on March 16, 2009, 04:41:52 PM
i can't find

// Show the navigation tree.

in my custom template....some help please

thnkx

try this - make sure you have a back up tho as this may not work but ive placed it just before where // Show the navigation tree. should be in default theme
Title: Re: PM Notification Bar
Post by: KahneFan on March 16, 2009, 06:49:45 PM
I just wanted to make it stand out, but the width is definitely up to the forum owner :D
Title: Re: PM Notification Bar
Post by: bullbreedluverz on March 16, 2009, 07:23:40 PM
Quote from: Özgür´ on March 16, 2009, 11:19:14 AM
What difference Pm Informer (http://www.simplemachines.org/community/index.php?topic=299276.0)?

i think the difference being that KF's mod utilises the catbg image and adds the boarder around which blends well with the forum design, where as PM Informer just had a coloured background and no offence to the mod designer - it was very basic looking

my members liked PM Informer but i disliked its design as it didnt blend well with my forum but with my tweek, as is definately up to the forum owner  ;D, looks much better and fits in with my forum design
Title: Re: PM Notification Bar
Post by: Pleek on March 16, 2009, 09:04:44 PM
gona make this for 1.1.8? cause thats what im using now and i don't want to have a upgrade my whole site just to add this feature.
Title: Re: PM Notification Bar
Post by: KahneFan on March 16, 2009, 09:50:01 PM
I don't use 1.1.x, but I could try to look at it. It should be too tough to implement. I just need to know the text strings, the rest is basic HTML.
Title: Re: PM Notification Bar
Post by: the_shadow on March 17, 2009, 06:19:44 PM
Quote from: KahneFan on March 16, 2009, 05:57:27 PM
I'm not familiar with .rar files. Can you post your regular index.template.php file?


here u go KahneFan....


Quote from: stikkki
try this - make sure you have a back up tho as this may not work but ive placed it just before where // Show the navigation tree. should be in default theme

i made this modification in my default theme but i want it to work in my custum....this  is mine index.template of my cystum template...and i can´t find that frase!!!:(
Title: Re: PM Notification Bar
Post by: KahneFan on March 17, 2009, 06:33:34 PM
I don't know what your theme looks like, but the attached should work. Be sure to back up first... although the file attached above is basically a backup :D
Title: Re: PM Notification Bar
Post by: the_shadow on March 18, 2009, 11:46:50 AM
i will see....thankx!!!!
Title: Re: PM Notification Bar
Post by: fotografo74 on March 20, 2009, 03:06:28 AM
Nice Mod, thanks!
I installed on my forum, works ok :-)
How can i chanche the bar's background color ?
Thanks!
Antonio
Title: Re: PM Notification Bar
Post by: KahneFan on March 20, 2009, 03:19:00 AM
It uses the same class as your catbg's. You would need to either change your catbg, or create a whole new class just for the bar.

Or, you could use PM Informer (http://custom.simplemachines.org/mods/index.php?mod=1202) which allows you to adjust the bg color.
Title: Re: PM Notification Bar
Post by: fotografo74 on March 20, 2009, 04:52:38 AM
Quote from: KahneFan on March 20, 2009, 03:19:00 AM
It uses the same class as your catbg's. You would need to either change your catbg, or create a whole new class just for the bar.

Or, you could use PM Informer (http://custom.simplemachines.org/mods/index.php?mod=1202) which allows you to adjust the bg color.
Oh thanks for quick reply! :-)
Antonio
Title: Re: PM Notification Bar
Post by: JMantis on July 29, 2009, 10:19:43 AM
Just tried to install this plugin but I get the following error:

"The package you are trying to download or install is either corrupt or not compatible with this version of SMF"

I'm using SMF 1.1.10 with a custom theme.

Anyone know what could be the problem?
Title: Re: PM Notification Bar
Post by: KahneFan on July 29, 2009, 05:29:45 PM
The package info XML page just needs to be updated from:
<install for="1.1.8 - 1.1.9">

to
<install for="1.1.8 - 1.1.10">

or
<install for="1.1.x - 1.1.xx">
Title: Re: PM Notification Bar
Post by: Özgür on July 29, 2009, 05:46:05 PM
<install for="1.1.x - 1.1.xx">   dont work.
User should be use
<install for="1.1.0 - 1.1.99"> 
Title: Re: PM Notification Bar
Post by: Dzonny on July 29, 2009, 05:56:20 PM
Version 2.0 Realised.
Now it works with smf 1.1.x and with 2.0 versions include 1.1.10 and 2.0RC1.2...
Enjoy.  8)
Title: Re: PM Notification Bar
Post by: WIZARD87 on September 16, 2009, 09:56:50 PM
using a custom 2.0 RC 1.2 theme and your mod is not working at all. not sure why but nothing happens ?
Title: Re: PM Notification Bar
Post by: Dzonny on September 17, 2009, 04:30:24 AM
Quote from: WIZARD87 on September 16, 2009, 09:56:50 PM
using a custom 2.0 RC 1.2 theme and your mod is not working at all. not sure why but nothing happens ?
If you're using custom theme, you should add codes manually for Index.template.php
http://custom.simplemachines.org/mods/index.php?action=parse;mod=1707;attach=109029;smf_version=2.0_RC1.2
Title: Re: PM Notification Bar
Post by: Kyrna on October 14, 2009, 08:03:36 PM
Trying to install just now and got the "The package you are trying to download or install is either corrupt or not compatible with this version of SMF." I'm using 1.1.10. Can anyone help?
Title: Re: PM Notification Bar
Post by: Kyrna on October 14, 2009, 09:00:09 PM
OK, ignore the above. I made the changes to the package-info.html that someone else mentioned, zipped it up, and was able to install just fine. My question is - how do I make this work in other themes? I tried parsing the instructions but it says it isn't compatible no matter which of the 1.x version I choose and I don't know if the instructions for 2.0RC will work just fine with 1.1.10 since I have no clue what the differences are between versions.
Title: Re: PM Notification Bar
Post by: KahneFan on October 14, 2009, 09:38:44 PM
It parses for 1.1.8.
Title: Re: PM Notification Bar
Post by: Kyrna on October 14, 2009, 09:55:06 PM
Quote from: KahneFan on October 14, 2009, 09:38:44 PM
It parses for 1.1.8.
Not when I try. I tried for every version and it wouldn't parse any of the 1.x versions.
Title: Re: PM Notification Bar
Post by: KahneFan on October 14, 2009, 10:09:04 PM
./Themes/default/index.template.php

FIND:

// The main content should go here.


REPLACE WITH:

if(!empty($context['user']['unread_messages'])) {     
echo '<br /><br /><div class="categoryframe tborder" style="width: 90%; text-align: center; margin: auto;"><h3 class="catbg headerpadding"><center>';       
echo '<a href="', $scripturl, '?action=pm">', $txt['msg_alert_you_have'], ' ', $context['user']['messages'], ' ', $context['user']['messages'] != 1 ? $txt['msg_alert_messages'] : $txt['message_lowercase'], $txt['newmessages4'], ' ', $context['user']['unread_messages'], ' ', $context['user']['unread_messages'] == 1 ? $txt['newmessages0'] : $txt['newmessages1'] , '.</a>';       
echo '</center></h3></div>'; }

// The main content should go here.



./Themes/default/languages/Modifications.english.php

FIND:

?>


ADD BEFORE:


//Start Pm Notification Bar by Dzonny
$txt['msg_alert_you_have'] = 'You have';
$txt['msg_alert_messages'] = 'messages';
$txt['message_lowercase'] = 'messages';
$txt['newmessages4'] = ',';
$txt['newmessages0'] = 'new message';
$txt['newmessages1'] = 'new messages';
//End Pm Notification Bar by Dzonny

Title: Re: PM Notification Bar
Post by: Kyrna on October 14, 2009, 10:42:36 PM
That worked perfectly, thanks!

An awesome mod. :)
Title: Re: PM Notification Bar
Post by: C4G-TK on December 13, 2009, 07:02:32 PM
This installed fine on RC2, but I don't have a 2nd account on the test forum to test it.  Has anyone else installed this on an RC2 forum, yet?
Title: Re: PM Notification Bar
Post by: TheListener on January 26, 2010, 12:28:38 PM
Quote from: C4G-TK on December 13, 2009, 07:02:32 PM
This installed fine on RC2, but I don't have a 2nd account on the test forum to test it.  Has anyone else installed this on an RC2 forum, yet?

Have installed the mod onto www.parascifi.net

Will be testing the feature out later tonight.

EDIT:

The mod does work on RC2
Title: Re: PM Notification Bar
Post by: C4G-TK on January 30, 2010, 01:44:26 PM
Yepp, I upgraded last week or the week before (time is flying by) and it's working fine!
Title: Re: PM Notification Bar
Post by: Jack_the_ripper on December 07, 2010, 06:44:56 AM
It is working on rc4?
Title: Re: PM Notification Bar
Post by: Dzonny on December 07, 2010, 06:48:30 AM
Yes, it should work.
U just need to install it manually: (dont worry, just two changes)
http://custom.simplemachines.org/mods/index.php?action=parse;mod=1707;attach=109029;smf_version=2.0_RC1.2
Title: Re: PM Notification Bar
Post by: Jack_the_ripper on December 07, 2010, 06:57:28 AM
Thanks Dzonny :D
Title: Re: PM Notification Bar
Post by: 3mrhythm on March 02, 2011, 12:46:00 AM
i like the idea behind this.  do you think its possible to change the image used for the pm button to a different button when there is a new message?

instead of there being a bar with a notification..

my forum is www.nhfragswap.com/forum 

the theme is darkmark

i would love to be able to change the regular PM buttom  to a PM button with a exclaimation or something on it when there is a new message. I posted in the theme builders support thread a long time ago and never got a response.. figured you might have an idea of how i can make this happen :)


Thanks!
Title: Re: PM Notification Bar
Post by: SimpleGost on November 26, 2011, 08:20:55 AM
// The main content should go here.

I cant find this code in my theme....
Title: Re: PM Notification Bar
Post by: TheListener on November 26, 2011, 05:59:29 PM
Quote from: InternetFazoni on November 26, 2011, 08:20:55 AM
// The main content should go here.

I cant find this code in my theme....

Helps if you mention the theme you are using as a link.

Title: Re: PM Notification Bar
Post by: SimpleGost on November 27, 2011, 12:36:19 PM
whitebox
Title: Re: PM Notification Bar
Post by: TheListener on March 06, 2012, 12:58:37 PM
Am using this mod on my newly started forum (yesterday).

Installed with no errors.
Title: Re: PM Notification Bar
Post by: Dylert on August 31, 2013, 07:37:50 PM
How can I get a red background for this, or maybe red text?
Title: Re: PM Notification Bar
Post by: wolfetundra on September 22, 2013, 09:03:23 PM
I would like to remove the first post number. Instead of it saying "You have X messages, X new messages" I want it to say "You have X new messages".
Title: Re: PM Notification Bar
Post by: Dzonny on September 23, 2013, 06:13:42 AM
When you have a mod installed, open your index.template.php and find:

if(!empty($context['user']['unread_messages'])) {     
echo '<br /><br /><div class="categoryframe tborder" style="width: 90%; text-align: center; margin: auto;"><h3 class="catbg headerpadding"><center>';       
echo '<a href="', $scripturl, '?action=pm">', $txt['msg_alert_you_have'], ' ', $context['user']['messages'], ' ', $context['user']['messages'] != 1 ? $txt['msg_alert_messages'] : $txt['message_lowercase'], $txt['newmessages4'], ' ', $context['user']['unread_messages'], ' ', $context['user']['unread_messages'] == 1 ? $txt['newmessages0'] : $txt['newmessages1'] , '.</a>';       
echo '</center></h3></div>'; }

// The main content should go here.

And replace with:

if(!empty($context['user']['unread_messages'])) {     
echo '<br /><br /><div class="categoryframe tborder" style="width: 90%; text-align: center; margin: auto;"><h3 class="catbg headerpadding"><center>';       
echo '<a href="', $scripturl, '?action=pm">', $txt['msg_alert_you_have'], ' ', $context['user']['unread_messages'], ' ', $context['user']['unread_messages'] == 1 ? $txt['newmessages0'] : $txt['newmessages1'] , '.</a>';       
echo '</center></h3></div>'; }

// The main content should go here.



And that should do the trick. Let me know if you need any further help.

@Dylert - You can, but you must apply your own style to it, as it's using default ones now mainly. Take a look at "style" attributes inside the code this mod adds to index.template.php and you can see what i'm talking about.
Title: Re: PM Notification Bar
Post by: kamili34 on March 27, 2014, 02:14:02 PM
Where I can modify color of the bar? I'm using aqua style.
Title: Re: PM Notification Bar
Post by: Dzonny on March 31, 2014, 06:01:57 AM
Quote from: kamili34 on March 27, 2014, 02:14:02 PM
Where I can modify color of the bar? I'm using aqua style.
I'm not sure which bar you're trying to modify, but try with "categoryframe" class or "catbg headerpadding" class.