Advertisement:

Author Topic: New messages flashing mail  (Read 71599 times)

Offline edi67

  • SMF Hero
  • ******
  • Posts: 1,532
  • Gender: Male
  • Italian Supporter
    • CrazyZone
New messages flashing mail
« on: April 07, 2004, 10:53:22 AM »
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]
« Last Edit: September 29, 2004, 02:27:40 AM by A.M.A »
CrazyZone - My SMF Forum


From the difficult the hardening of the man you can see

Offline klumy

  • SMF Hero
  • ******
  • Posts: 2,483
Re: window advise for PM
« Reply #1 on: April 07, 2004, 01:34:33 PM »
you mean a popup window.

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

Offline [Unknown]

  • SMF Friend
  • SMF Master
  • *
  • Posts: 36,102
  • Gender: Male
Re: window advise for PM
« Reply #2 on: April 07, 2004, 01:45:02 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]

Offline edi67

  • SMF Hero
  • ******
  • Posts: 1,532
  • Gender: Male
  • Italian Supporter
    • CrazyZone
Re: window advise for PM
« Reply #3 on: April 07, 2004, 04:35:47 PM »
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

Offline dschwab9

  • SMF Friend
  • SMF Hero
  • *
  • Posts: 5,320
  • Gender: Male
    • Technology, Ministry and Other Ramblings
Re: window advise for PM
« Reply #4 on: April 07, 2004, 11:40:11 PM »
I did this on mine:

Code: [Select]
<?php
// Show Flashy icon if user has new messages and it not a guest
if (!$context[&#39;user&#39;][&#39;is_guest&#39;] && $context[&#39;user&#39;][&#39;unread_messages&#39;])
                             
echo &#39;
<a href="&#39; . $scripturl . &#39;?action=im"><img src="&#39; . $settings[&#39;images_url&#39;] . &#39;/newim.gif" border="0" />(&#39; . $context[&#39;user&#39;][&#39;unread_messages&#39;] . &#39;)</a> &#39; . $context[&#39;menu_separator&#39;] . &#39;&#39;;
?>



It puts a little flashing mail icon in the menu when they have new messages.
« Last Edit: April 07, 2004, 11:41:50 PM by dschwab9 »

Offline edi67

  • SMF Hero
  • ******
  • Posts: 1,532
  • Gender: Male
  • Italian Supporter
    • CrazyZone
Re: window advise for PM
« Reply #5 on: April 08, 2004, 04:47:44 AM »
where this u code must be write?
CrazyZone - My SMF Forum


From the difficult the hardening of the man you can see

Offline tmlfever

  • Jr. Member
  • **
  • Posts: 190
  • Gender: Male
  • I take baby Steps!
    • Toronto Maple Leafs Disscussion Boards
Re: window advise for PM
« Reply #6 on: August 27, 2004, 02:37:38 PM »
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.

Offline dschwab9

  • SMF Friend
  • SMF Hero
  • *
  • Posts: 5,320
  • Gender: Male
    • Technology, Ministry and Other Ramblings
Re: window advise for PM
« Reply #7 on: August 27, 2004, 06:27:33 PM »
Index.template.php

Find:

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


Add after:

Code: [Select]
// 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 |

Offline Elijah Bliss

  • Sophist Member
  • *****
  • Posts: 1,340
Re: window advise for PM
« Reply #8 on: August 27, 2004, 07:56:22 PM »
Index.template.php

Find:

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


Add after:

Code: [Select]
  // 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!

Offline tmlfever

  • Jr. Member
  • **
  • Posts: 190
  • Gender: Male
  • I take baby Steps!
    • Toronto Maple Leafs Disscussion Boards
Re: window advise for PM
« Reply #9 on: August 28, 2004, 12:03:58 AM »


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.
« Last Edit: August 28, 2004, 12:16:47 AM by tmlfever »


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

Offline Metho

  • SMF Friend
  • Full Member
  • *
  • Posts: 564
  • Gender: Male
Re: window advise for PM
« Reply #10 on: August 28, 2004, 12:10:27 AM »
In index.template.php FIND:
Code: [Select]
// 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

Offline tmlfever

  • Jr. Member
  • **
  • Posts: 190
  • Gender: Male
  • I take baby Steps!
    • Toronto Maple Leafs Disscussion Boards
Re: window advise for PM
« Reply #11 on: August 28, 2004, 12:14:17 AM »
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.
« Last Edit: August 28, 2004, 12:23:44 AM by tmlfever »


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

Offline Metho

  • SMF Friend
  • Full Member
  • *
  • Posts: 564
  • Gender: Male
Re: window advise for PM
« Reply #12 on: August 28, 2004, 12:56:33 AM »
AFTER that code ADD:
Code: [Select]
// 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

Offline dschwab9

  • SMF Friend
  • SMF Hero
  • *
  • Posts: 5,320
  • Gender: Male
    • Technology, Ministry and Other Ramblings
Re: window advise for PM
« Reply #13 on: August 28, 2004, 01:02:18 AM »
If you're putting it up there, you don't want the menu separator in it.  Probably something like this:

Code: [Select]
// 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> ';

Offline Metho

  • SMF Friend
  • Full Member
  • *
  • Posts: 564
  • Gender: Male
Re: window advise for PM
« Reply #14 on: August 28, 2004, 01:03:16 AM »
Err, yeah, forgot to clip that part out. :D

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

Offline tmlfever

  • Jr. Member
  • **
  • Posts: 190
  • Gender: Male
  • I take baby Steps!
    • Toronto Maple Leafs Disscussion Boards
Re: window advise for PM
« Reply #15 on: August 28, 2004, 01:21:43 AM »
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.

Offline Metho

  • SMF Friend
  • Full Member
  • *
  • Posts: 564
  • Gender: Male
Re: window advise for PM
« Reply #16 on: August 28, 2004, 01:26:48 AM »
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

Offline tmlfever

  • Jr. Member
  • **
  • Posts: 190
  • Gender: Male
  • I take baby Steps!
    • Toronto Maple Leafs Disscussion Boards
Re: window advise for PM
« Reply #17 on: August 28, 2004, 01:30:46 AM »
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.

Offline dschwab9

  • SMF Friend
  • SMF Hero
  • *
  • Posts: 5,320
  • Gender: Male
    • Technology, Ministry and Other Ramblings
Re: window advise for PM
« Reply #18 on: August 28, 2004, 07:03:54 AM »
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

  • Guest
Re: New messages flashing mail
« Reply #19 on: November 20, 2004, 09:42:25 PM »
as the line above in index.template.php all ready displays new messages there no need to display the (n) of new messages again

Code: [Select]
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> ';