News:

Want to get involved in developing SMF, then why not lend a hand on our github!

Main Menu

Hack: new message flashing icon

Started by marten, January 12, 2006, 08:40:11 PM

Previous topic - Next topic

copfirearms

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 . '">&nbsp;</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 . '">&nbsp;</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>]&nbsp;&nbsp;<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.

  

http://www.hellasob.com/w3timages/newpm.gif


Ok, I inserted  your code, heres what it looks like...



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

It's God's Job To Forgive Bin Laden
It's Our Job To Set up The Meeting
-US Marines-

snork13

i pacakged this up for 1.1rc2, check it out here

Mods
Please DO NOT PM me with requests for individual support, but post your questions and concerns in the appropriate section of the forum where other users can benefit from them as well. Thank you.
I have been super busy as of late. Working on updates to all my modifications for 2.0.1

copfirearms

Quote from: snork13 on February 24, 2006, 06:02:31 PM
i pacakged this up for 1.1rc2, check it out here



I feel stupid for not seeing that !!!
Installed perfectly..
Thank You
It's God's Job To Forgive Bin Laden
It's Our Job To Set up The Meeting
-US Marines-

h4ni

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

AtelierGal

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.

vbgamer45

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.
Community Suite for SMF - Grow your forum with SMF, Gallery,Store,Classifieds,Downloads,more!

SMFHacks.com - Paid Modifications for SMF

Mods:
EzPortal - Portal System for SMF
SMF Gallery Pro
SMF Store SMF Classifieds Ad Seller Pro

FBI

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'];

h4ni

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']) ? '' : '' , '
         |&nbsp;<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" />' : '' , '&nbsp;Non Lus, ', $context['user']['messages'], ' Total.</span><br />';
   }

work fine

qubbah

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>   


ManilaGurL

Will this work with the latest version?

TrueSatan


saosangmo

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.

kpel

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!)

Fallen Angel

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>]&nbsp;<img src="' . $settings['images_url'] . '/msg.gif" border="0">' : '' , '</a>


Works for me!  ;D

spaarks

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>]&nbsp;&nbsp;<img src="' . $settings['images_url'] . '/newpm.gif" border="0" />' : '' , '</a>

thanks

vbgamer45

Community Suite for SMF - Grow your forum with SMF, Gallery,Store,Classifieds,Downloads,more!

SMFHacks.com - Paid Modifications for SMF

Mods:
EzPortal - Portal System for SMF
SMF Gallery Pro
SMF Store SMF Classifieds Ad Seller Pro


De4thPr00f

@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.

spaarks

How can I put the flashing mail icon in other themes such as "Cool Mint and Blue"

Advertisement: