A little useful hack for the new Core Theme (NDT).
When you get a message you'll se a fashing icon next to the message button in the top menu.
Without this flashing icon it is hard to notice when u get a message, at least for me ;)
Find index.template.php in Themes/default
// Go to PM center... [pm]
if ($context['user']['is_logged'] && $context['allow_pm'])
echo ($current_action == 'pm' || $context['browser']['is_ie4']) ? '<td class="maintab_active_' . $first . '"> </td>' : '' , '
<td valign="top" class="maintab_' , $current_action == 'pm' ? 'active_back' : 'back' , '">
<a href="', $scripturl, '?action=pm">' , $txt['pm_short'] , ' ', $context['user']['unread_messages'] > 0 ? '[<strong>'. $context['user']['unread_messages'] . '</strong>]' : '' , '</a>
Replace with:
// Go to PM center... [pm]
if ($context['user']['is_logged'] && $context['allow_pm'])
echo ($current_action == 'pm' || $context['browser']['is_ie4']) ? '<td class="maintab_active_' . $first . '"> </td>' : '' , '
<td valign="top" class="maintab_' , $current_action == 'pm' ? 'active_back' : 'back' , '">
<a href="', $scripturl, '?action=pm">' , $txt['pm_short'] , ' ', $context['user']['unread_messages'] > 0 ? '[<strong>'. $context['user']['unread_messages'] . '</strong>] <img src="' . $settings['images_url'] . '/newpm.gif" border="0" />' : '' , '</a>
You also need the flashing image newpm.gif and upload that to Themes/default/images.
I put the one I use here, so just right click on it and save it to your computer.
(https://www.simplemachines.org/community/proxy.php?request=http%3A%2F%2Fwww.hellasob.com%2Fw3timages%2Fnewpm.gif&hash=9ef1e9ce83ab59ce03ddc2915a895bc894a29fd6)
http://www.hellasob.com/w3timages/newpm.gif
Absolutely way cool.
Thanks for doing this!
who made that icon? it looks very familiar...
we could use any flashing icon though right ? and yep it does look familiar, just dont know from where.
Quote from: Bigguy on January 12, 2006, 09:40:57 PM
we could use any flashing icon though right ? and yep it does look familiar, just dont know from where.
yes, and it's already in tip and tricks...which is why it looks familiar..i use this one -->
Quote from: Bigguy on January 12, 2006, 09:40:57 PM
we could use any flashing icon though right ? and yep it does look familiar, just dont know from where.
Yes you can use any icon you want, just remember to name it right or rename the image in the code.
Well I have seen that icon in many places too, I just used Google and found some and did choose this one :D
Quote from: snork13 on January 12, 2006, 09:45:11 PM
Quote from: Bigguy on January 12, 2006, 09:40:57 PM
we could use any flashing icon though right ? and yep it does look familiar, just dont know from where.
yes, and it's already in tip and tricks...which is why it looks familiar..i use this one -->
It is in tip and trick?? You mean a hack for RC2 NDT ..? Anyway your icon looks so much nicer so I think I will use that one instead :)
I just put it on my board and it works like a charm. Thanks for this. :)
I cant find
// Go to PM center... [pm]
if ($context['user']['is_logged'] && $context['allow_pm'])
echo ($current_action == 'pm' || $context['browser']['is_ie4']) ? '<td class="maintab_active_' . $first . '"> </td>' : '' , '
<td valign="top" class="maintab_' , $current_action == 'pm' ? 'active_back' : 'back' , '">
<a href="', $scripturl, '?action=pm">' , $txt['pm_short'] , ' ', $context['user']['unread_messages'] > 0 ? '[<strong>'. $context['user']['unread_messages'] . '</strong>]' : '' , '</a>
in index.template.php
p.s. i am using macvision theme, is that problem?
Can this be used also in the default SMF theme?
I used this on the default smf 1.1 RC2 theme and it works fine.
Way cool I'm going to put it right away.
Theres also one around that plays a sound file "You`ve got mail" when you recieve a PM.
Hello again.
It is rather simple if you also want the sound "You`ve got mail" also.
In the code here i have used the IE tag "bgsound", but bgsound is a proprietary IE tag it isn't W3C standard so it won't work in Firefox, it should work in Opera though.
To allow playback of bgsound or embedded tags in Firefox you need an extension/plugin.
look for the same code as above. ( Still this is only for the New Default Theme for 1.1 RC2 )
Find index.template.php in Themes/default
// Go to PM center... [pm]
if ($context['user']['is_logged'] && $context['allow_pm'])
echo ($current_action == 'pm' || $context['browser']['is_ie4']) ? '<td class="maintab_active_' . $first . '"> </td>' : '' , '
<td valign="top" class="maintab_' , $current_action == 'pm' ? 'active_back' : 'back' , '">
<a href="', $scripturl, '?action=pm">' , $txt['pm_short'] , ' ', $context['user']['unread_messages'] > 0 ? '[<strong>'. $context['user']['unread_messages'] . '</strong>]' : '' , '</a>
Replace with:
// Go to PM center... [pm]
if ($context['user']['is_logged'] && $context['allow_pm'])
echo ($current_action == 'pm' || $context['browser']['is_ie4']) ? '<td class="maintab_active_' . $first . '"> </td>' : '' , '
<td valign="top" class="maintab_' , $current_action == 'pm' ? 'active_back' : 'back' , '">
<a href="', $scripturl, '?action=pm">' , $txt['pm_short'] , ' ', $context['user']['unread_messages'] > 0 ? '[<strong>'. $context['user']['unread_messages'] . '</strong>] <img src="' . $settings['images_url'] . '/newpm.gif" border="0"><bgsound src="' . $settings['images_url'] . '/mail.wav" border="0">' : '' , '</a>
I have used a WAV file in this example called "mail.wav" so don't forget to change the name to what u want.
Upload the mail.wav file to Themes/default/images
You can find "You`ve got mail" wav files at this site ( I use - Mail03.wav Typical, "You've got mail". )
http://www.ilovewavs.com/Events/GotMail/GotMail.htm (http://www.ilovewavs.com/Events/GotMail/GotMail.htm)
Psyclones has made a hack to almost the same as this, he also has one I do believe for playing swf instead of wav. Which means of course no plugin is necessary, thats always nice.
I have SMF 1.0.5. is there any hack for this version?
tnx
Quote from: Dexy on January 15, 2006, 05:26:37 AM
I have SMF 1.0.5. is there any hack for this version?
tnx
Yes it is Tips and Tricks, at least I think it is for 1.05 , as someone pointed out here above ( I have never used that version myself ).
http://www.simplemachines.org/community/index.php?topic=9017.0 (http://www.simplemachines.org/community/index.php?topic=9017.0)
Quote from: Bigguy on January 14, 2006, 09:20:00 PM
Psyclones has made a hack to almost the same as this, he also has one I do believe for playing swf instead of wav. Which means of course no plugin is necessary, thats always nice.
If so and it works with swf it will be a better choice ( havn't checked the hack ) , I don't use sound on my own board, only the animated icon, and u are right IF users have SWF turned on. Many users have that function turned OFF in their browers, because so many don't like SWF.. so my little hack work with most browsers except for Firefox witout a downloadable addon/extension to support BGSOUND. I dont't like sites either threre u visit websites with background musik, often MIDI files, and u can't turn it off BUT there are so many sites out there that uses bgsound and u can't hear the music then.
https://addons.mozilla.org/extensions/moreinfo.php?id=146 (https://addons.mozilla.org/extensions/moreinfo.php?id=146)
I have bad idea. For guest visitor, playing the applause.wav.
Visitor who didnt register/login into forum, they will heard applaus sound :)
Its weird and feel bad (I think). But useful, you can push visitor to register into your forum.
Here the code
Go find the code inside /Themes/index.template.php
// Otherwise they're a guest - so politely ask them to register or login.
else
{
echo '
', $txt['welcome_guest'], '<br />
', $context['current_time'], '<br />';
}
And add this code
Quoteecho '<bgsound src="http://www.yoursite.com/Applause.wav" border="0">';
And the full code are:
// Otherwise they're a guest - so politely ask them to register or login.
else
{
echo '
', $txt['welcome_guest'], '<br />
', $context['current_time'], '<br />';
echo '<bgsound src="http://www.yoursite.com/Applause.wav" border="0">';
}
Get the wav here (http://www.ilovewavs.com/Effects/People/People.htm)
Get the sample result at my forum here (http://www.forumbebas.com/forum)
Tested on IE and Opera
Its Bad Idea or Good idea? ;D
PS: You can record your own voice that speak "Welcome to my forum, please login.. bla.. bla.. bla"
I just added this to 1.1 RC2 and it works great. It's the simple things that make communication more effective. Thanks.
Quote from: marten on January 12, 2006, 08:40:11 PM
A little useful hack for the new Core Theme (NDT).
When you get a message you'll se a fashing icon next to the message button in the top menu.
Without this flashing icon it is hard to notice when u get a message, at least for me ;)
Find index.template.php in Themes/default
// Go to PM center... [pm]
if ($context['user']['is_logged'] && $context['allow_pm'])
echo ($current_action == 'pm' || $context['browser']['is_ie4']) ? '<td class="maintab_active_' . $first . '"> </td>' : '' , '
<td valign="top" class="maintab_' , $current_action == 'pm' ? 'active_back' : 'back' , '">
<a href="', $scripturl, '?action=pm">' , $txt['pm_short'] , ' ', $context['user']['unread_messages'] > 0 ? '[<strong>'. $context['user']['unread_messages'] . '</strong>]' : '' , '</a>
Replace with:
// Go to PM center... [pm]
if ($context['user']['is_logged'] && $context['allow_pm'])
echo ($current_action == 'pm' || $context['browser']['is_ie4']) ? '<td class="maintab_active_' . $first . '"> </td>' : '' , '
<td valign="top" class="maintab_' , $current_action == 'pm' ? 'active_back' : 'back' , '">
<a href="', $scripturl, '?action=pm">' , $txt['pm_short'] , ' ', $context['user']['unread_messages'] > 0 ? '[<strong>'. $context['user']['unread_messages'] . '</strong>] <img src="' . $settings['images_url'] . '/newpm.gif" border="0" />' : '' , '</a>
You also need the flashing image newpm.gif and upload that to Themes/default/images.
I put the one I use here, so just right click on it and save it to your computer.
(https://www.simplemachines.org/community/proxy.php?request=http%3A%2F%2Fwww.hellasob.com%2Fw3timages%2Fnewpm.gif&hash=9ef1e9ce83ab59ce03ddc2915a895bc894a29fd6)
http://www.hellasob.com/w3timages/newpm.gif
Ok, I inserted your code, heres what it looks like...
(https://www.simplemachines.org/community/proxy.php?request=http%3A%2F%2Fimg515.imageshack.us%2Fimg515%2F2249%2Fimage11wm.gif&hash=1ee3c066958c82503d5974836149cd4f8c98b9c1) (http://imageshack.us)
Any way to move the flashing icon to the center??
Or move it from where it's at?
If I could make it look like this, it woulld be great...
Thanks
(https://www.simplemachines.org/community/proxy.php?request=http%3A%2F%2Fimg502.imageshack.us%2Fimg502%2F65%2Fimage27tg.gif&hash=add7d89938e6ba8fecdc360313dd22ef214528b3) (http://imageshack.us)
i pacakged this up for 1.1rc2, check it out here (http://mods.simplemachines.org/index.php?mod=260)
Quote from: snork13 on February 24, 2006, 06:02:31 PM
i pacakged this up for 1.1rc2, check it out here (http://mods.simplemachines.org/index.php?mod=260)
I feel stupid for not seeing that !!!
Installed perfectly..
Thank You
How i can apply this tips in my the musiconia
code:
Quote
// Go to PM center... [pm]
if ($context['user']['is_logged'] && $context['allow_pm'])
{
echo ((isset($current_action) && $curent_action == 'pm') || $context['browser']['is_ie4']) ? '' : '' , '
<a href="', $scripturl, '?action=pm">Messages Privés</a>: ', $context['user']['unread_messages'], ' Non Lus, ', $context['user']['messages'], ' Total.<br />';
}
thank you
I'm using 1.1.1 and it's not possible to install
I got this:
QuoteThe package you are trying to download or install is either corrupt or not compatible with this version of SMF.
Contact Snork to update the mod or
Should work fine on 1.1.1 if you trick the package manager url.
Go to the package manager in your forum
In the address bar add
;version_emulate=1.1
To the url and hit enter to load the page or press go and you should be able to install the mod.
I didn use Mod Package Manager. Just using this code, work perfectly on any SMF version and themes (currently Simplicity). Just put it on index.template.php in any side (need html knowledge). Show Welcome screen and Flashing PM (if any).. :)
Windows Pop Up will show, if you have message. And at IE, directly opening New Windows.
// Show Flashy icon if user has new messages and it not a guest
if (!$context['user']['is_guest'] && $context['user']['unread_messages'])
echo '
<a href="' . $scripturl . '?action=pm"><img src="http://forumbebas.net/Themes/newpm.gif" border="0" /> klik here disini..</a> ' . $context['menu_separator'] . '';
}
else
echo $txt['welcome_guest'];
i musiconia theme you put this code
Quote// Go to PM center... [pm]
if ($context['user']['is_logged'] && $context['allow_pm'])
{
echo ((isset($current_action) && $curent_action == 'pm') || $context['browser']['is_ie4']) ? '' : '' , '
| <span class="smalltext"><a href="', $scripturl, '?action=pm">Messages Privés</a>: '. $context['user']['unread_messages'] . '', $context['user']['unread_messages'] > 0 ? '<img src="' . $settings['images_url'] . '/icons/pmnotify.gif" width="12" height="12" align="absmiddle" />' : '' , ' Non Lus, ', $context['user']['messages'], ' Total.</span><br />';
}
work fine
how about custom theme...
like
// Go to PM center... [pm]
if ($context['user']['is_logged'] && $context['allow_pm'])
echo'
<td align="center" class="menubg' , $current_action == 'pm' ? '2' : '' , '">
<a href="', $scripturl, '?action=pm">' , $txt['pm_short'] , ' ', $context['user']['unread_messages'] > 0 ? '[<strong>'. $context['user']['unread_messages'] . '</strong>]' : '' , '</a>
thank you for hack
Will this work with the latest version?
Yes...see Snork's official package of it in the mods pages http://custom.simplemachines.org/mods/index.php?mod=260 (http://custom.simplemachines.org/mods/index.php?mod=260)
I wonder if I can do the same thing with http://www.openhosting.co.uk/articles/webdev/6004/
Meaning when my user is inactive and someone send him a message, a warning will display to tell him.
Thanks Marten!
This is the ONLY mod I've been able to get to work so far and I love it. (thanks for a moment of accomplishment!)
In Dilber MC
Find index.template.php in Themes/dilbermc
// Go to PM center... [pm]
if ($context['user']['is_logged'] && $context['allow_pm'])
echo'
<td align="center" class="menubg' , $current_action == 'pm' ? '2' : '' , '">
<a href="', $scripturl, '?action=pm">' , $txt['pm_short'] , ' ', $context['user']['unread_messages'] > 0 ? '[<strong>'. $context['user']['unread_messages'] . '</strong>]' : '' , '</a>
Change with;
// Go to PM center... [pm]
if ($context['user']['is_logged'] && $context['allow_pm'])
echo'
<td align="center" class="menubg' , $current_action == 'pm' ? '2' : '' , '">
<a href="', $scripturl, '?action=pm">' , $txt['pm_short'] , ' ', $context['user']['unread_messages'] > 0 ? '[<strong>'. $context['user']['unread_messages'] . '</strong>] <img src="' . $settings['images_url'] . '/msg.gif" border="0">' : '' , '</a>
Works for me! ;D
Marten an excellent mod. I'm very much a newcomer to php so excuse me for asking a simple question. Do I have to replace the whole code section or can I just change the last bit to . '</strong>] <img src="' . $settings['images_url'] . '/newpm.gif" border="0" />' : '' , '</a>
thanks
Just change the last bit.
Thanks
@copfirearms:
to place the icon at the center you need to insert it in a div. i havn't look at the code, but you should have a part that gets the image. The changes you would do are:
<div id="msgicon" align="center" border=0> //before the icon thing
</div> //after the icon thing.
How can I put the flashing mail icon in other themes such as "Cool Mint and Blue"
I love this mod. I often hit the front page and click the box saying cancel on the PM and now I simply can not forget that I did that with that annoying flashing images.
Thanks. ;)
i installed this mod a while ago and had no probs until now ::)
i had my flashy icon flashing in the message tab (cannot remember how i did that)
but i have just centred my tabs and it is now flashing to the left again
i read reply to copfirearms but my code is not the same
any ideas ???
Quoteglobal $context, $settings, $options, $scripturl, $txt; // Show Flashy icon if user has new messages and it not a guest
if (!$context['user']['is_guest'] && $context['user']['unread_messages'])
echo '
<a href="' . $scripturl . '?action=im"><img src="' . $settings['images_url'] . '/newpm.gif" border="0" />(' . $context['user']['unread_messages'] . ')</a> ' . $context['menu_separator'] . '';
Yes, I know that this is an OLD topic, but I would like to use this method for my 2.0 RC2 upgrade. What changes are required ?
Quote from: TomW on January 24, 2010, 08:06:48 PM
Yes, I know that this is an OLD topic, but I would like to use this method for my 2.0 RC2 upgrade. What changes are required ?
Bueller ?
Guys, what code for SMF2.0 RC2? Thanks in advance :D
OK i made something and it worked for me.
As follows:
Copy the msg.gif file in the Main directory of your webspace.
Open Forum/Sources/Subs.php
Search for:
$context['menu_buttons'][$current_action]['active_button'] = true;
if (!$user_info['is_guest'] && $context['user']['unread_messages'] > 0 && isset($context['menu_buttons']['pm']))
{
$context['menu_buttons']['pm']['alttitle'] = $context['menu_buttons']['pm']['title'] . ' [' . $context['user']['unread_messages'] . ']';
$context['menu_buttons']['pm']['title'] .= ' [<strong>' . $context['user']['unread_messages'] . '</strong>]';
}
}
And Change it to:
$context['menu_buttons'][$current_action]['active_button'] = true;
if (!$user_info['is_guest'] && $context['user']['unread_messages'] > 0 && isset($context['menu_buttons']['pm']))
{
$context['menu_buttons']['pm']['alttitle'] = $context['menu_buttons']['pm']['title'] . ' [' . $context['user']['unread_messages'] . ']';
$context['menu_buttons']['pm']['title'] .= ' [<strong>' . $context['user']['unread_messages'] . '</strong>] <img src="' . $settings['images_url'] . '/msg.gif" border="0" />';
}
}
I hope thise mod is going to be updatet for smf rc3 ;D