Simple Machines Community Forum

Customizing SMF => Tips and Tricks => Thema gestartet von: A.M.A in April 10, 2004, 07:06:47 NACHMITTAGS

Titel: logout gray effect!
Beitrag von: A.M.A in April 10, 2004, 07:06:47 NACHMITTAGS
while surfing one of my favorites Arab VB's forums I've notice this feature, that will gray screen when clicking the logout button .. a similar effect found in windows XP when clicking  Log off.

in script.js add the following code at the end of the file:
// Logout effect like in WindowsXP gray logoff effect!
function log_out()
{
ht = document.getElementsByTagName("html");
ht[0].style.filter = "progid:DXImageTransform.Microsoft.BasicImage(grayscale=1)";
if (confirm('Are you sure you want to logout?'))
{
return true;
}
else
{
ht[0].style.filter = "";
return false;
}
}

in (index.template.php) look for
<a href="', $scripturl, '?action=logout;sesc=', $context['session_id'], '">', ($settings['use_image_buttons'] ? '<img src="' . $settings['images_url'] . '/' . $context['user']['language'] . '/logout.gif" alt="' . $txt[108] . '" style="margin: 2px 0;" border="0" />' : $txt[108]), '</a>';
and replace it with:
<a onclick="return log_out()" href="', $scripturl, '?action=logout;sesc=', $context['session_id'], '">', ($settings['use_image_buttons'] ? '<img src="' . $settings['images_url'] . '/' . $context['user']['language'] . '/logout.gif" alt="' . $txt[108] . '" style="margin: 2px 0;" border="0" />' : $txt[108]), '</a>';
we just add this : onclick="return log_out()"

note that this will work only with IE.
Titel: Re: logout gray effect!
Beitrag von: Ben_S in April 10, 2004, 07:10:08 NACHMITTAGS
Nice :)
Titel: Re: logout gray effect!
Beitrag von: Homie in April 10, 2004, 07:34:46 NACHMITTAGS
WOW Awesome it worked for me YAYAYAYYYYYAAAAA  :o  :D GOOD Job A.M.A YOU Know Simple machines should ad this to there forum
Titel: Re: logout gray effect!
Beitrag von: Homie in April 16, 2004, 08:09:40 VORMITTAG
I just found a forum with the Log Out Gray Effect Its Jin The MC Forum

http://www.holla-front.com/forum/index.php?
Titel: Re: logout gray effect!
Beitrag von: Ben_S in April 16, 2004, 12:28:02 NACHMITTAGS
Homie, thats nice but its of no relevance, considering it's not even an SMF board.
Titel: Re: logout gray effect!
Beitrag von: Peter Duggan in April 16, 2004, 04:30:20 NACHMITTAGS
Zitat von: Homie in April 10, 2004, 07:34:46 NACHMITTAGS
YOU Know Simple machines should ad this to there forum

Since you could have said 'could' but chose to say 'should', I should say you could be wrong there!
Titel: Re: logout gray effect!
Beitrag von: Oldiesmann in April 16, 2004, 05:05:07 NACHMITTAGS
Interesting feature, but usually logging out happens pretty quickly (unless you're on a 56k modem ;)), so I don't know if that would be useful or not.
Titel: Re: logout gray effect!
Beitrag von: A.M.A in April 16, 2004, 07:36:10 NACHMITTAGS
Zitat von: Oldiesmann in April 16, 2004, 05:05:07 NACHMITTAGS
Interesting feature, but usually logging out happens pretty quickly (unless you're on a 56k modem ;)), so I don't know if that would be useful or not.
Even if you got very fast connection .. you will *notice* this one, trust me  ;)
Titel: Re: logout gray effect!
Beitrag von: [Unknown] in April 16, 2004, 10:01:22 NACHMITTAGS
Not in Firefox.  Unless it can work in Opera/Mozilla as well, I'm not interested :P.

-[Unknown]
Titel: Re: logout gray effect!
Beitrag von: vkot in Dezember 03, 2004, 05:47:47 VORMITTAG
I think it could be done using CSS & JavaScript...
The JS would have a loop that changes all the colors on the page little by little until everything is black.
Titel: Re: logout gray effect!
Beitrag von: Trekkie101 in Dezember 03, 2004, 06:35:07 VORMITTAG
If it doesnt work in firefox its not worth the trouble, plus i have Netscape, Opera, Mozilla Suite, Crazy Browser, Avant  just so i can make sure things work right for all. Im still trying to get Lynx to work, but god its hard! No installer file.
Titel: Re: logout gray effect!
Beitrag von: Webby in Dezember 03, 2004, 08:44:31 VORMITTAG
Nice trick ;)  Works like a charm !
Titel: Re: logout gray effect!
Beitrag von: npeelman in Dezember 16, 2004, 09:44:55 VORMITTAG
Zitat von: [Unknown] in April 16, 2004, 10:01:22 NACHMITTAGS
Not in Firefox.  Unless it can work in Opera/Mozilla as well, I'm not interested :P.

-[Unknown]

Since 'filters' are pretty much IE specific (maybe Mozilla) I doubt they would work in anything but IE.  Now maybe some Javascript with a DIV (tiled graphic). Have JS bring the DIV to the front then either change the colors of the graphic or whatever...

Norm
Titel: Re: logout gray effect!
Beitrag von: Jan in Dezember 17, 2004, 11:36:43 NACHMITTAGS
Nice effect  :)
Titel: Re: logout gray effect!
Beitrag von: mediman in Februar 05, 2005, 01:51:12 NACHMITTAGS
Zitat von: [Unknown] in April 16, 2004, 10:01:22 NACHMITTAGS
Not in Firefox.  Unless it can work in Opera/Mozilla as well, I'm not interested :P.

-[Unknown]
:P
Titel: Re: logout gray effect!
Beitrag von: Elmacik in August 18, 2005, 02:21:59 VORMITTAG
its been more than 120 days this topic is not replied :)
ok, maybe the posters still alive, i will try my chance.

when this hack is done, the grey fonts turn into green in internet explorer.
everything is ok in opera and firefox. but in ie, the greys turns to green :S
Titel: Re: logout gray effect!
Beitrag von: IncubuS in November 24, 2005, 08:55:44 NACHMITTAGS
Just one wierd question , I cant find any script.js lol in all forum folder .
Titel: Re: logout gray effect!
Beitrag von: JayBachatero in November 24, 2005, 09:36:03 NACHMITTAGS
It located in Themes/{your_theme}/script.js
Titel: Re: logout gray effect!
Beitrag von: Sheepy in November 25, 2005, 02:47:09 VORMITTAG
Zitat von: [Unknown] in April 16, 2004, 10:01:22 NACHMITTAGS
Not in Firefox.  Unless it can work in Opera/Mozilla as well, I'm not interested :P.
Agree.  However perhaps we can do fade out instead by adding a semi-transparent png on these browsers? (However the png may have to be pre-loaded to guarentee it displays fast... when the mouse moves into logout command, at least, if you do not show a dialog like the original trick does)

If consistancy is in mind, Ie can also do fade out with filter.
Titel: Re: logout gray effect!
Beitrag von: CeZa in Juni 15, 2006, 04:55:00 VORMITTAG
For RC2 ? ::)
Titel: Re: logout gray effect!
Beitrag von: Elmacik in Juni 15, 2006, 10:16:21 VORMITTAG
It works for RC2 too. Just index.template.php changed a bit.
Code (Find) Auswählen

<a href="', $scripturl, '?action=logout;sesc=', $context['session_id'], '">' , $txt[108] , '</a>

Code (Replace) Auswählen

<a onclick="return log_out()" href="', $scripturl, '?action=logout;sesc=', $context['session_id'], '">' , $txt[108] , '</a>
Titel: Re: logout gray effect!
Beitrag von: husmen73 (Gulhin) in Juni 20, 2006, 12:12:47 NACHMITTAGS
Zitat von: Elmacik in Juni 15, 2006, 10:16:21 VORMITTAG
It works for RC2 too. Just index.template.php changed a bit.
Code (Find) Auswählen

<a href="', $scripturl, '?action=logout;sesc=', $context['session_id'], '">' , $txt[108] , '</a>

Code (Replace) Auswählen

<a onclick="return log_out()" href="', $scripturl, '?action=logout;sesc=', $context['session_id'], '">' , $txt[108] , '</a>

thanx Elmacik.

----------------------
thanx A.M.A
Titel: Re: logout gray effect!
Beitrag von: özgür şahin in Januar 19, 2007, 08:14:44 NACHMITTAGS
for 1.1.1?
Titel: Re: logout gray effect!
Beitrag von: husmen73 (Gulhin) in Januar 21, 2007, 12:36:11 NACHMITTAGS
osahin aynısını uygula. index.template.php'de ise kodları bulamazsan, benzer kodları ara ve değiştir. Herhangi bir problem çıkacağını sanmam. JS kodu ne de olsa.
Titel: Re: logout gray effect!
Beitrag von: özgür şahin in Januar 21, 2007, 01:13:34 NACHMITTAGS
Olmuyor. Onun için sordum.
Titel: Re: logout gray effect!
Beitrag von: Alan S in Januar 24, 2007, 04:00:56 NACHMITTAGS
Zitat von: osahin in Januar 19, 2007, 08:14:44 NACHMITTAGS
for 1.1.1?

Same code

Script.js


// Logout effect like in WindowsXP gray logoff effect!
function log_out()
{
ht = document.getElementsByTagName("html");
ht[0].style.filter = "progid:DXImageTransform.Microsoft.BasicImage(grayscale=1)";
if (confirm('Are you sure you want to logout?'))
{
return true;
}
else
{
ht[0].style.filter = "";
return false;
}
}


Index.template.php

Find

<a href="', $scripturl, '?action=logout;sesc=', $context['session_id'], '">' , $txt[108] , '</a>


Replace With


<a onclick="return log_out()" href="', $scripturl, '?action=logout;sesc=', $context['session_id'], '">' , $txt[108] , '</a>
Titel: Re: logout gray effect!
Beitrag von: houston in Januar 26, 2007, 12:05:31 NACHMITTAGS
Zitat von: Alan S in Januar 24, 2007, 04:00:56 NACHMITTAGS
Zitat von: osahin in Januar 19, 2007, 08:14:44 NACHMITTAGS
for 1.1.1?

Same code

Script.js


// Logout effect like in WindowsXP gray logoff effect!
function log_out()
{
ht = document.getElementsByTagName("html");
ht[0].style.filter = "progid:DXImageTransform.Microsoft.BasicImage(grayscale=1)";
if (confirm('Are you sure you want to logout?'))
{
return true;
}
else
{
ht[0].style.filter = "";
return false;
}
}


Index.template.php

Find

<a href="', $scripturl, '?action=logout;sesc=', $context['session_id'], '">' , $txt[108] , '</a>


Replace With


<a onclick="return log_out()" href="', $scripturl, '?action=logout;sesc=', $context['session_id'], '">' , $txt[108] , '</a>


Thanks for the code. It works great
Titel: Re: logout gray effect!
Beitrag von: teamvtec in Januar 26, 2007, 12:24:35 NACHMITTAGS
Is it possible to delay the greyeffect like in windows?
Titel: Re: logout gray effect!
Beitrag von: eriktm in März 19, 2007, 12:28:01 NACHMITTAGS
I don't know, but it's fantastic!

PS: I've tried it on v.1.1.2, it works ;)
Titel: Re: logout gray effect!
Beitrag von: dDOTr2 in April 02, 2007, 05:00:21 VORMITTAG
really awesome. thanks for the code. tried and works on 1.1.2 with IE alone.
Titel: Re: logout gray effect!
Beitrag von: geniusrohit in April 25, 2007, 09:37:50 NACHMITTAGS
Thanx its working fine and most of end users still choose bydefault browser i.e IE so still impressive
Titel: Re: logout gray effect!
Beitrag von: msvdm in Juni 08, 2007, 02:49:07 NACHMITTAGS
i find some problem with this hack like Erik™ i put this in 1.1.2 work fine but when im login and pres logout it ask me i want to log out ore cancel when i press cancel it redirect me out from the forum dont redirect me back in the forum
Titel: Re: logout gray effect!
Beitrag von: John S in Juli 09, 2007, 01:39:02 NACHMITTAGS
its too fast.. is it supposed to fade? because it doesnt 'fade' just turns grey.. how can i control the speed of the fade?
Titel: Re: logout gray effect!
Beitrag von: macuser9214 in Juli 15, 2007, 07:13:17 NACHMITTAGS
not working for me. in the VB green theme, there was no script.js file, so I made one and it didn't work.
Titel: Re: logout gray effect!
Beitrag von: speak121 in Juli 15, 2007, 08:41:51 NACHMITTAGS
Zitat von: SimplMachnsforum_user in Juli 15, 2007, 07:13:17 NACHMITTAGS
not working for me. in the VB green theme, there was no script.js file, so I made one and it didn't work.

Put on script.js of default theme.
Titel: Re: logout gray effect!
Beitrag von: diplomat. in Juli 16, 2007, 01:14:17 VORMITTAG
Had this on my site for a while, sexy little addition (although I hardly ever log out ;))
Titel: Re: logout gray effect!
Beitrag von: asdas2 in August 22, 2007, 01:41:30 VORMITTAG
this one working with default theme .... not the other theme that i m using riht now ... i m using dilber mc theme ....

help plzzzz
Titel: Re: logout gray effect!
Beitrag von: asdas2 in September 07, 2007, 03:02:03 NACHMITTAGS
plzzz help :(
Titel: Re: logout gray effect!
Beitrag von: metallica48423 in Oktober 06, 2007, 08:43:36 NACHMITTAGS
Is this issue solved or do you still require assistance?

does that theme have its own script.js? Keep in mind this does NOT work in firefox.
Titel: Re: logout gray effect!
Beitrag von: asdas2 in Oktober 07, 2007, 12:01:52 VORMITTAG
No, its not solved yet

i m using INternet Explorer 7, and i m using Dilber Mc them, and smf 1.1.4

and i did not find any Script.js file in dilber mc folder.... so i guesss this theme dosent hov its own script.js


Titel: Re: logout gray effect!
Beitrag von: metallica48423 in Oktober 07, 2007, 03:13:46 VORMITTAG
and did you add it to the default theme's script.js?

do you get javascript errors on the page?
Titel: Re: logout gray effect!
Beitrag von: asdas2 in Oktober 07, 2007, 10:37:22 VORMITTAG
well, it works fine with dafault theme.
and i dun get any error on my dilber mc theeme
Titel: Re: logout gray effect!
Beitrag von: jagannath in Oktober 16, 2007, 03:50:28 VORMITTAG
ya it works well for me too in my new site www.techforums.in using the SoftMC Blue Theme
thanks for this tip.. even though this is small this is a great effect :D
Titel: Re: logout gray effect!
Beitrag von: Aileen in Oktober 26, 2007, 11:19:51 VORMITTAG
ths one is great
Titel: Re: logout gray effect!
Beitrag von: CultureGlue in Januar 18, 2010, 03:59:56 VORMITTAG
Does this work on smf 1.1.11 ?
On 2.0RC2 ?

I tried to modify my index.template.php file but it is not actually the same..
Titel: Re: logout gray effect!
Beitrag von: frenki in April 27, 2010, 01:59:34 NACHMITTAGS
i dont think it works for 2.0RC2 ,code is kinda completely different ?
Titel: Re: logout gray effect!
Beitrag von: Joe_Dean in September 26, 2010, 07:16:21 NACHMITTAGS
This is sad - roughly ~33k users use IE. Learn to browse the web the right way people! Mozilla > all. There is no competition.
Titel: Re: logout gray effect!
Beitrag von: KensonPlays in September 30, 2010, 10:31:01 VORMITTAG
Joe_Dean: yes there is compitition, Google Chrome
Titel: Re: logout gray effect!
Beitrag von: kysangel in Oktober 04, 2010, 07:35:19 NACHMITTAGS
Thanks for the help

kysangel
Titel: Re: logout gray effect!
Beitrag von: dzinerfusion in Oktober 09, 2010, 10:48:52 NACHMITTAGS
Does this work on the latest version of smf2?  :o
Titel: Re: logout gray effect!
Beitrag von: Masterd in Oktober 22, 2010, 10:28:00 VORMITTAG
I don't think that it will work.
Titel: Re: logout gray effect!
Beitrag von: waka_waka in November 13, 2010, 06:19:36 NACHMITTAGS
nice inf
Titel: Re: logout gray effect!
Beitrag von: uninvited13th in März 24, 2011, 06:00:59 VORMITTAG
2rc5 please.. :(
Titel: Re: logout gray effect!
Beitrag von: Arantor in März 24, 2011, 06:04:51 VORMITTAG
Even if it were available for RC5, the code would need to be rewritten because right now it's IE only. Though there's code posted for RC2 which should work just as well.
Titel: Re: logout gray effect!
Beitrag von: desibees in April 05, 2011, 06:44:40 NACHMITTAGS
I don't have
<a href="', $scripturl, '?action=logout;sesc=', $context['session_id'], '">', ($settings['use_image_buttons'] ? '<img src="' . $settings['images_url'] . '/' . $context['user']['language'] . '/logout.gif" alt="' . $txt[108] . '" style="margin: 2px 0;" border="0" />' : $txt[108]), '</a>';
in my.... index.template.php

Im using RC5.

Custom template. ( i checked all template files)

help?
Titel: Re: logout gray effect!
Beitrag von: pearpandas in April 08, 2011, 09:15:17 VORMITTAG
Love this trick thanks!
Titel: Re: logout gray effect!
Beitrag von: MotherBoard in April 11, 2011, 12:25:22 NACHMITTAGS
wow...this is nice. Good find!
Titel: Re: logout gray effect!
Beitrag von: agent47 in April 11, 2011, 03:54:47 NACHMITTAGS
Zitat von: desibees in April 05, 2011, 06:44:40 NACHMITTAGS
I don't have
<a href="', $scripturl, '?action=logout;sesc=', $context['session_id'], '">', ($settings['use_image_buttons'] ? '<img src="' . $settings['images_url'] . '/' . $context['user']['language'] . '/logout.gif" alt="' . $txt[108] . '" style="margin: 2px 0;" border="0" />' : $txt[108]), '</a>';
in my.... index.template.php

Im using RC5.

Custom template. ( i checked all template files)

help?
We all don't because this is a really old topic and is probably written for SMF V1. Just stay put and maybe someone will take the liberty to re-write the code for the current SMF versions.
Titel: Re: logout gray effect!
Beitrag von: pearpandas in April 14, 2011, 02:53:10 NACHMITTAGS
This is a really cool effect... thanks!