• Welcome to Simple Machines Community Forum. Please login or sign up.

New messages flashing mail

Started by edi67, April 07, 2004, 10:53:22 AM

Previous topic - Next topic

edi67

April 07, 2004, 10:53:22 AM Last Edit: September 29, 2004, 02:27:40 AM by A.M.A
will be very useful have one little window for advise you that have one PM in your email box of forum

[edit] changed topic title [/edit]
CrazyZone - My SMF Forum


From the difficult the hardening of the man you can see

klumy

you mean a popup window.

yeah this would be cool
YabbSE already supported such a feature,

[Unknown]

Quote from: klumy on April 07, 2004, 01:34:33 PM
YabbSE already supported such a feature,

If you mean supported as in had, you are wrong.  If you mean supported as in could do, so can SMF.

-[Unknown]

edi67

great ADMIN this will be very nice addon one popup window that advise you for PM and clicking u will able to see your PM in another window
CrazyZone - My SMF Forum


From the difficult the hardening of the man you can see

dschwab9

April 07, 2004, 11:40:11 PM #4 Last Edit: April 07, 2004, 11:41:50 PM by dschwab9
I did this on mine:


<?php
// 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'] . '/newim.gif" border="0" />(' $context['user']['unread_messages'] . ')</a> ' $context['menu_separator'] . '';
?>




It puts a little flashing mail icon in the menu when they have new messages.

edi67

where this u code must be write?
CrazyZone - My SMF Forum


From the difficult the hardening of the man you can see

tmlfever

Can someone answer this please.

I would be interested in knowing also.


"Every time you wake up, ask yourself, "What good am I going to do today?", remember that when the sun goes down at sunset, it will take a part of your life with it."

I've seen the Leaf jersey everywhere from Kabul to Tonga. I've never seen it in a Stanley Cup final.

dschwab9

Index.template.php

Find:

// Show the menu up top.  Something like [home] [help] [profile] [logout]...
function template_menu()
{
global $context, $settings, $options, $scripturl, $txt;



Add after:

// 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="' . $settings['images_url'] . '/newim.gif" border="0" />(' . $context['user']['unread_messages'] . ')</a> ' . $context['menu_separator'] . '';


change newim.gif to whatever the name of the image is (mine is a flashing envelope)

Menu ends up looking like this.  Number in () is the number of new messages:

(4) | Home | Help | Search | Admin | Profile | Calendar |

Elijah Bliss

Quote from: dschwab9 on August 27, 2004, 06:27:33 PM
Index.template.php

Find:

// Show the menu up top.  Something like [home] [help] [profile] [logout]...
function template_menu()
{
        global $context, $settings, $options, $scripturl, $txt;



Add after:

  // Show Flashy icon if user has new messages and it not a guest
   if (!$context['user']['is_guest'] && $context['user']['unread_messages'])
                      echo '
                              (' . $context['user']['unread_messages'] . ') ' . $context['menu_separator'] . '';


change newim.gif to whatever the name of the image is (mine is a flashing envelope)

Menu ends up looking like this.  Number in () is the number of new messages:

(4) | Home | Help | Search | Admin | Profile | Calendar |

Looks cool! I'll try it out tonight!

tmlfever

August 28, 2004, 12:03:58 AM #9 Last Edit: August 28, 2004, 12:16:47 AM by tmlfever


Thank you that was Brilliant!!

Can I ask another question please?

My forum is www.tmlforum.net You can log on with the user name, test and pasword also, test

How do I get it to show in the middle where the mail info is now.


"Every time you wake up, ask yourself, "What good am I going to do today?", remember that when the sun goes down at sunset, it will take a part of your life with it."

I've seen the Leaf jersey everywhere from Kabul to Tonga. I've never seen it in a Stanley Cup final.

Metho

In index.template.php FIND: // Only tell them about their messages if they can read their messages!
if ($context['allow_pm'])
echo ', ', $txt[152], ' <a href="', $scripturl, '?action=pm">', $context['user']['messages'], ' ', $context['user']['messages'] != 1 ? $txt[153] : $txt[471], '</a>', $txt['newmessages4'], ' ', $context['user']['unread_messages'], ' ', $context['user']['unread_messages'] == 1 ? $txt['newmessages0'] : $txt['newmessages1'];
echo '.';


That's where it displays the Hey, username, you have X messages, x are new. I think that's where you wanted it, yes?

- Methonis
Joshua "Methonis" Frazer
Support Specialist
The Simple Machines Team

tmlfever

August 28, 2004, 12:14:17 AM #11 Last Edit: August 28, 2004, 12:23:44 AM by tmlfever
Yes, that is exactly where I would like to have it, Once I find the code above what do I do?

Thank you for your time on this.


"Every time you wake up, ask yourself, "What good am I going to do today?", remember that when the sun goes down at sunset, it will take a part of your life with it."

I've seen the Leaf jersey everywhere from Kabul to Tonga. I've never seen it in a Stanley Cup final.

Metho

AFTER that code ADD: // 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="' . $settings['images_url'] . '/newim.gif" border="0" />(' . $context['user']['unread_messages'] . ')</a> ' . $context['menu_separator'] . '';


Where is says newim.gif, change it to whatever image you want displayed and make sure it's uploaded to Themes/yourtheme/images

- Methonis
Joshua "Methonis" Frazer
Support Specialist
The Simple Machines Team

dschwab9

If you're putting it up there, you don't want the menu separator in it.  Probably something like this:


// 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="' . $settings['images_url'] . '/newim.gif" border="0" />(' . $context['user']['unread_messages'] . ')</a> ';

Metho

Err, yeah, forgot to clip that part out. :D

- Methonis
Joshua "Methonis" Frazer
Support Specialist
The Simple Machines Team

tmlfever

Metho, I copied dschwab9  code and it looked fine with your code or his they both worked.

Should I know what this menu separator is?

Thanks a million guys.


"Every time you wake up, ask yourself, "What good am I going to do today?", remember that when the sun goes down at sunset, it will take a part of your life with it."

I've seen the Leaf jersey everywhere from Kabul to Tonga. I've never seen it in a Stanley Cup final.

Metho

He just had the original code put a | character between it because he'd had his on his menu. Not a big deal. :)

- Methonis
Joshua "Methonis" Frazer
Support Specialist
The Simple Machines Team

tmlfever

Thank You so much it looks GREAT :D


"Every time you wake up, ask yourself, "What good am I going to do today?", remember that when the sun goes down at sunset, it will take a part of your life with it."

I've seen the Leaf jersey everywhere from Kabul to Tonga. I've never seen it in a Stanley Cup final.

dschwab9

If the | is not actually showing, then it is probably causing "Undefined index" errors or something.  Not sure if that variable is defined at that point or not.  Basically, if they both look the same, and you are happy with the way it looks, use my code.

johnm

as the line above in index.template.php all ready displays new messages there no need to display the (n) of new messages again

if (!$context['user']['is_guest'] && $context['user']['unread_messages'])
echo '<a href="' . $scripturl . '?action=pm"><img src="' . $settings['images_url'] . '/newpm.gif" border="0" /></a> ';

Advertisement: