TinyPortal

Development => Block Codes => Topic started by: USO_Joe on December 03, 2005, 11:45:40 AM

Title: Animated PM icon
Post by: USO_Joe on December 03, 2005, 11:45:40 AM
I added a nice little feature to my sites, just a .gif which makes the "Register" button flash red when someone is not logged in, .. basically drawing new people to the site to the register button. I was wondering if anyone knows how, and would do me the favor of making me a little snippet or something that will make my (https://www.tinyportal.net/proxy.php?request=http%3A%2F%2Fwww.sotg.us%2FForum%2FThemes%2Fhelios_multi_tp%2Fimages%2Fpm.gif&hash=c25b78f4ed2339def9188e9e2e64b98cca1618dd) button flash when someone has an unread PM. I'm sure it's pretty easy... I'm just a NEWB! lol..... if someone could hook me up with that, I'd greatly appreciate it!

Thank you!

Joe
Title: Animated PM icon
Post by: bloc on December 03, 2005, 12:05:22 PM
Great ideas! :)

for the PM button you need to check if there are new pm's..like:

if($context['user']['is_logged'] && $context['user']['unread_messages']>0)
  echo 'flashing PM button code here.....';
elseif($context['user']['is_logged'] && $context['user']['unread_messages']==0)
  echo 'normal PM button code here...';


You might want to show the button only to members..if not you need remove the $context['user']['is_logged'] part.
Title: Re: Animated PM icon
Post by: spoilddog on December 03, 2005, 08:22:47 PM
I love these ideas.... Thanks.
Title: Re: Animated PM icon
Post by: USO_Joe on December 03, 2005, 10:25:07 PM
You can see what the register button looks like at:

www.hawaiifighter.com  and www.sotg.us/Forum
Title: Re: Animated PM icon
Post by: USO_Joe on December 04, 2005, 06:50:30 AM
Thanks Bloc.

That worked great!
Title: Re: Animated PM icon
Post by: Nokonium on December 04, 2005, 04:47:27 PM
If you have a prog like Photoshop or Paint Shop Pro take the original icon/button (gif format), select all and invert the colours, then save it as a seperate gif. Then with Image Ready, Animation Shop or similar make an animated gif out of the two gif's.
Title: Re: Animated PM icon
Post by: USO_Joe on December 04, 2005, 05:48:46 PM
I already made the buttons, I was just looking for the code.

(https://www.tinyportal.net/proxy.php?request=http%3A%2F%2Fwww.sotg.us%2FForum%2FThemes%2Fhelios_multi_tp%2Fimages%2Fpmred.gif&hash=8ee7e089569372e79830806cd47612387df50439)(https://www.tinyportal.net/proxy.php?request=http%3A%2F%2Fwww.sotg.us%2FForum%2FThemes%2Fhelios_multi_tp%2Fimages%2Fenglish%2Fregister.gif&hash=04d47387de5c14ad8dae208df841cc2e90bd7924)
Title: Re: Animated PM icon
Post by: JDMhustle on December 06, 2005, 05:22:59 PM
Thanks for the buttons ;)
Title: Re: Animated PM icon
Post by: erikman on December 10, 2005, 02:46:42 PM
Is it possible to get the Register button in norwegian with the text "Registrer" ?
Title: Re: Animated PM icon
Post by: IchBin on December 10, 2005, 03:54:11 PM
You can make your own buttons right here.
http://www.tinyportal.net/smf/index.php?page=13
Title: Re: Animated PM icon
Post by: erikman on December 10, 2005, 04:01:51 PM
But how do I make them flashing?? (The only pic. program I have is Paint..)
Title: Re: Animated PM icon
Post by: IchBin on December 10, 2005, 04:17:00 PM
Its not hard to change colors of something. Even in paint.:)


[attachment deleted by admin]
Title: Re: Animated PM icon
Post by: erikman on December 10, 2005, 04:37:17 PM
Well, the picture is corrupt.....  :buck2:

I can`t open it...
Title: Re: Animated PM icon
Post by: IchBin on December 10, 2005, 04:45:48 PM
Seems everything you download is corrupt today erikman. I just downloaded the file again and everything seems find here.
Title: Re: Animated PM icon
Post by: erikman on December 10, 2005, 04:51:36 PM
Could you try to send it to me by PM then?
Title: Re: Animated PM icon
Post by: IchBin on December 10, 2005, 05:02:57 PM
If you can see the picture in the post right click on the picture and choose save picture as. I can't attach to a PM.
Title: Re: Animated PM icon
Post by: Skhilled on December 11, 2005, 08:37:12 PM
How would this work on a theme using css links as buttons?
Title: Re: Animated PM icon
Post by: IchBin on December 11, 2005, 10:34:32 PM
You would have to change the link so that it does work. And you'd probably want a different button for it too. :)
Are you thinking of something specific?
Title: Re: Animated PM icon
Post by: Skhilled on December 12, 2005, 01:06:37 PM
well, most of the themes I use have css buttons and was just wondering how it would work. But looking at the index.templates of each one, I see they are all different so the coding would probably be different for each as well.

I guess I'll have to post in the appropriate thread for each since I have a question or 2 about some of them anyways. :)
Title: Re: Animated PM icon
Post by: crip on December 13, 2005, 10:33:56 PM
Here's one I have saw used for a new PM, came from that smf mod.



[attachment deleted by admin]
Title: Re: Animated PM icon
Post by: bhunted on February 06, 2006, 01:05:54 AM
Here is a Donate button for yaz too in case you would like to take donations...

(https://www.tinyportal.net/proxy.php?request=http%3A%2F%2Fbigjohnsbikes.net%2Fsmf%2FThemes%2FTP_helios_multi11_rc2%2Fimages%2Fanim_donate.gif&hash=883d181dc5ed670d32cc088010fc5f48d5e024cc)
Title: Re: Animated PM icon
Post by: bicho on March 02, 2006, 06:29:36 PM


Anibody know how to make an animated button to the default theme RC2, like this one that we are using here on the bloczone?

I already have put the button next to the members buttons called "DoaÇÃÆ'Ã,µes" and i want to know if it is possible  to make this one (DoaÇÃÆ'Ã,µes) animated and if i can how.


Thank you very much to you all.
Title: Re: Animated PM icon
Post by: ontap on March 03, 2006, 09:21:40 AM
another way....

YourTheme/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 '.';


Afer Add:

// Show Flashy icon if user has new messages but forget the guests
if (!$context['user']['is_guest'] && $context['user']['unread_messages'])
      echo '
<a href="' . $scripturl . '?action=pm"><img src="' . $settings['images_url'] . '/gif.gif" border="0" />(' . $context['user']['unread_messages'] . ')</a> ' . $context['menu_separator'] . '';


Add Image To YourTheme/Images/newpm.gif
Title: Re: Animated PM icon
Post by: crip on March 14, 2006, 09:32:57 PM
SMF has a mod for this now..goes in the Default Theme.
Title: Re: Animated PM icon
Post by: technodragon73 on March 14, 2006, 11:30:07 PM
I have edited the tportalblock.template.php (which is where it is handled for me anyway).  This is under the user block.

Find:
                   if($context['user']['unread_messages']>0)
                        echo '<br />'.$bullet.'<a style="font-weight: bold; " href="', $scripturl, '?action=pm">' .$txt['tp-pm2'].' ',$context['user']['unread_messages'] , '</a>';

Replace with:
                   if($context['user']['unread_messages']>0)
                        echo '<br />'.$bullet.'<a style="font-weight: bold; " href="', $scripturl, '?action=pm">' .$txt['tp-pm2'].' ',$context['user']['unread_messages'] , ' <img src="' . $settings['images_url'] . '/msg.gif" border="0"><bgsound src="' . $settings['images_url'] . '/Mail01.wav" border="0"></a>';


I couldn't attach the wav file, but you can easily find your own.  Just make sure to change the file name in the above code so it will work.
Title: Re: Animated PM icon
Post by: crip on March 14, 2006, 11:40:44 PM
That is indeed handy and a bit creative as well. ;)
Title: Re: Animated PM icon
Post by: technodragon73 on March 14, 2006, 11:52:15 PM
Plus using the portal blocks it is a lot easier...most themes use the default one so there is less editing to be done than if it was through the index.template
Title: Re: Animated PM icon
Post by: crip on March 15, 2006, 12:21:52 AM
Exactly..now go get in shape.. ;D ;D
Title: Re: Animated PM icon
Post by: technodragon73 on March 15, 2006, 12:50:53 AM
 :2funny: :knuppel2: :tickedoff:

I did...it is round... :2funny:
Title: Re: Animated PM icon
Post by: dkaye315 on April 21, 2006, 02:33:51 AM
Quote from: technodragon73 on March 14, 2006, 11:30:07 PM
I have edited the tportalblock.template.php (which is where it is handled for me anyway).  This is under the user block.

Find:
                   if($context['user']['unread_messages']>0)
                        echo '<br />'.$bullet.'<a style="font-weight: bold; " href="', $scripturl, '?action=pm">' .$txt['tp-pm2'].' ',$context['user']['unread_messages'] , '</a>';

Replace with:
                   if($context['user']['unread_messages']>0)
                        echo '<br />'.$bullet.'<a style="font-weight: bold; " href="', $scripturl, '?action=pm">' .$txt['tp-pm2'].' ',$context['user']['unread_messages'] , ' <img src="' . $settings['images_url'] . '/msg.gif" border="0"><bgsound src="' . $settings['images_url'] . '/Mail01.wav" border="0"></a>';


I couldn't attach the wav file, but you can easily find your own.  Just make sure to change the file name in the above code so it will work.
Thanks for posting this, added it to my boards.  Interestingly, the sound does not work in FF.  However, does work in both IE and Opera. ?? .
Title: Re: Animated PM icon
Post by: dreadkgt on June 14, 2006, 02:54:36 AM
I have tried this at my site

http://www.therisenguild.com

And it works great. The graphic (https://www.tinyportal.net/proxy.php?request=http%3A%2F%2Fwww.therisenguild.com%2FThemes%2Frisen%2Fimages%2Fenglish%2Fnewpm.gif&hash=51037de7e757f010ebdf803094d1813e10ab5410) shows up just fine when a New PM comes in. However..the code i'm using (I put in absolute a href to try to see if that would work but it doesn't anyhow) doesn't seem to make that picture a link. Dunno why.  Shows up fine, just ignore the whole <a href> no matter what I use in it.


if($context['user']['unread_messages']>0)
                        echo '<br />'.$bullet.'<a href="http://www.therisenguild.com/tinyportal/index.php?action=pm">'  , ' <img src="' . $settings['images_url'] . '/english/newpm.gif" border="0"></a>';

Title: Re: Animated PM icon
Post by: rebelrose on August 10, 2006, 06:20:42 PM
How do I get this to work in Tiny Portal User Block, 8.6 is the version I use.
Title: Re: Animated PM icon
Post by: IchBin on August 10, 2006, 06:42:47 PM
forum/Themes/default/TPortalBlocks.template.php

Open and find:
if($context['user']['unread_messages']>0)
echo '<br />'.$bullet.'<a style="font-weight: bold; " href="', $scripturl, '?action=pm">' .$txt['tp-pm2'].' ',$context['user']['unread_messages'] , '</a>';


Change to:

                   if($context['user']['unread_messages']>0)
                        echo '<br />'.$bullet.'<a style="font-weight: bold; " href="', $scripturl, '?action=pm">' .$txt['tp-pm2'].' ',$context['user']['unread_messages'] , ' <img src="' . $settings['images_url'] . '/msg.gif" border="0"><bgsound src="' . $settings['images_url'] . '/Mail01.wav" border="0"></a>';
Title: Re: Animated PM icon
Post by: rebelrose on August 10, 2006, 06:44:38 PM
Thank you IchBinâââ,¬Å¾Ã,¢
Title: Re: Animated PM icon
Post by: rebelrose on September 03, 2006, 09:33:58 PM
Will this work on a non Tiny Portal Site, not that I plan on getting rid of Tiny Portal, I love it.

I would like to know how to do this on a regular site if anyone knows
Title: Re: Animated PM icon
Post by: IchBin on September 04, 2006, 12:47:16 AM
If you go back a couple of pages you'll see how to make this work in any theme.

http://www.tinyportal.net/smf/index.php?topic=1570.msg26454#msg26454
Title: Re: Animated PM icon
Post by: rebelrose on September 04, 2006, 12:52:08 AM
Quote from: IchBinÃ,â,,¢ on September 04, 2006, 12:47:16 AM
If you go back a couple of pages you'll see how to make this work in any theme.

http://www.tinyportal.net/smf/index.php?topic=1570.msg26454#msg26454

Thanks, I will keep looking that code is not in the theme I was looking into, no worries. Thanks anyway
Title: Re: Animated PM icon
Post by: IchBin on September 04, 2006, 02:17:50 AM
The exact same code may not be found. But for those themes that have the PM info with user info on the main page just look for something like this in the theme.

$context['user']['unread_messages']
Title: Re: Animated PM icon
Post by: rebelrose on September 04, 2006, 02:49:51 AM
Great thank you
Title: Re: Animated PM icon
Post by: raffo on October 08, 2006, 08:21:51 AM
ok i tried and it works!

but to have a sense, should we put off the normal advise of a pm received? (i mean the one that apperas in a popup)
Title: Re: Animated PM icon
Post by: rebelrose on October 09, 2006, 08:57:22 AM
That would be a personal choice I would think, I have mine animated in the TP block as well with sound.
Title: Re: Animated PM icon
Post by: OzButcher on October 11, 2006, 04:41:15 AM
Very nice, works well :)
Title: Re: Animated PM icon
Post by: Crip on October 23, 2006, 11:04:23 PM
What about just in the index.template.php without TP??  ... the code MAX gave a few post ago doesn't work on SMF Default Theme.. 1.1RC3 ... ?

crip
Title: Re: Animated PM icon
Post by: rebelrose on October 23, 2006, 11:05:44 PM
There is a mod out for that now, BigGuy put it out.


http://mods.simplemachines.org/index.php?mod=454
Title: Re: Animated PM icon
Post by: Crip on October 27, 2006, 03:17:46 PM
Thanks, but I have it working without a mod.. just some simple code changes. :)
Title: Re: Animated PM icon
Post by: rebelrose on October 27, 2006, 03:19:36 PM
That is what I did also, changed the code. I have mine animated and with sound inn the TP Block and not the forum index.
Title: Re: Animated PM icon
Post by: Crip on October 27, 2006, 03:26:59 PM
I changed the code in the index.template.php < b  r  / >; one of those & an echo '
Title: Re: Animated PM icon
Post by: OzButcher on December 06, 2006, 02:21:27 PM
In my theme the mod doesn't work as I don't have any userinfo block.

I am using the 'userbox' code in a block to display when new PM's come in. Can somone tell me which code in this thread will display the image and sound for this purpose? :) Cheers.

http://unt.swisshut.com
Title: Re: Animated PM icon
Post by: rebelrose on December 06, 2006, 07:18:10 PM
Animated PM icon in the user block.

In the forum/Themes/default/TPortalBlocks.template.php



if($context['user']['unread_messages']>0)
echo '<br />'.$bullet.'<a style="font-weight: bold; " href="', $scripturl, '?action=pm">' .$txt['tp-pm2'].' ',$context['user']['unread_messages'] , '</a>';



replace with



if($context['user']['unread_messages']>0)
                        echo '<br />'.$bullet.'<a style="font-weight: bold; " href="', $scripturl, '?action=pm">' .$txt['tp-pm2'].' ',$context['user']['unread_messages'] , ' <img src="' . $settings['images_url'] . '/msg.gif" border="0"><bgsound src="' . $settings['images_url'] . '/Mail01.wav" border="0"></a>';



upload the msg.gif to your images

This was found on Tiny Portal Site Animated PM Icon (http://www.tinyportal.net/smf/index.php?topic=1570.20)

Make sure if you use sound that the sound file is correctly named, also you can use any image you like for the animation. I had one custom made for my site.
Title: Re: Animated PM icon
Post by: OzButcher on December 07, 2006, 02:39:08 AM
Thanks! That shows up the image :) I don't get the sound though, but I'm assuming it might be because I'm running firefox?
Title: Re: Animated PM icon
Post by: rebelrose on December 07, 2006, 02:40:08 AM
Quote from: OzButcher on December 07, 2006, 02:39:08 AM
Thanks! That shows up the image :) I don't get the sound though, but I'm assuming it might be because I'm running firefox?

Did you add a sound file?
Title: Re: Animated PM icon
Post by: TolerancE on December 16, 2006, 05:39:08 AM
Has this process changed for 1.1 and .97? I have tried and cannot find any of that code in the newer versions.
Title: Re: Animated PM icon
Post by: alhaudhie on April 05, 2008, 06:47:24 PM
Quote from: Kaye on April 21, 2006, 02:33:51 AM
Quote from: technodragon73 on March 14, 2006, 11:30:07 PM
I have edited the tportalblock.template.php (which is where it is handled for me anyway).  This is under the user block.

Find:
                   if($context['user']['unread_messages']>0)
                        echo '<br />'.$bullet.'<a style="font-weight: bold; " href="', $scripturl, '?action=pm">' .$txt['tp-pm2'].' ',$context['user']['unread_messages'] , '</a>';

Replace with:
                   if($context['user']['unread_messages']>0)
                        echo '<br />'.$bullet.'<a style="font-weight: bold; " href="', $scripturl, '?action=pm">' .$txt['tp-pm2'].' ',$context['user']['unread_messages'] , ' <img src="' . $settings['images_url'] . '/msg.gif" border="0"><bgsound src="' . $settings['images_url'] . '/Mail01.wav" border="0"></a>';


I couldn't attach the wav file, but you can easily find your own.  Just make sure to change the file name in the above code so it will work.
Thanks for posting this, added it to my boards.  Interestingly, the sound does not work in FF.  However, does work in both IE and Opera. ?? .

yes.. it not play with ff

anybody can resolve this?... tq
Title: Re: Animated PM icon
Post by: Crip on April 05, 2008, 06:57:30 PM
Just go here: http://www.tinyportal.net/index.php?topic=1570.msg26454#msg26454

add the code for it in your index.template.php .. couldn't be easier. :)
Title: Re: Animated PM icon
Post by: IchBin on April 06, 2008, 11:06:58 PM
A quick google on bgsound for Firefox and you'll discover that the bgsound tag is IE specific. You'll need to use embed. If you don't know how to use embed, then google again. :)