News:

SMF 2.1.4 has been released! Take it for a spin! Read more.

Main Menu

Logout Prompt

Started by Arantor, December 17, 2013, 02:17:25 AM

Previous topic - Next topic

Arantor

Link to Mod

Logout Prompt really is as simple as it sounds: ask the user before logging out, just in case they actually pressed it by accident.

For 2.0 only - the mod cannot be backported to 1.1.x because of 1.1.x's theme handling, and it's impossible for me to support every theme properly for 1.1.x. (Not that 1.1.x should be encouraged because it's being phased out before long)

Note: it uses the standard browser request (like other parts of SMF) for compatibility reasons. Please do not ask me to change this, because it's not practical to do so in 2.0.

As far as licensing goes, the mod is hereby licensed under the CC0 licence - http://creativecommons.org/publicdomain/zero/1.0/ - it's a one line change plus language strings. It's not really large enough to warrant copyrighting.
Holder of controversial views, all of which my own.


Burke ♞ Knight

* BurkeKnight has waited for a long time for someone to come up with this idea.

Great job, my friend. :)

Matthew K.

With how simple this idea is, it's nice to see someone wrote this. Although I'd honestly never thought of it.

It could fairly easily be ported to 1.1, using similar methodology as this should probably be using. Attaching the confirm box to an event handler for click with JavaScript rather than using the onclick="" attribute in the markup. Very possible then it could be done using hooks in 2.0, and definitely plausible for all themes on 1.1.

Arantor

Except there is a very very good reason I *didn't* use that: Pretty URLs.
Holder of controversial views, all of which my own.


Matthew K.

So there would be two options then. Either $scripturl . '?action=logout or $scripturl . '/action/logout, or however PrettyURLs handles it.

Arantor

I'm not changing it. This is the simplest way of doing it in the practical sense. Not everything is about some 'ideal' approach.

As for hooks, I absolutely refuse to load a PHP file every single page for a 1 line function.

As for 1.1, I have zero interest in supporting it. The platform is going to be officially declared unsupported sometime next year. My time would be far better spent helping people migrate to a current platform rather than a 7 year old platform whose time is limited by PHP deprecating functions...
Holder of controversial views, all of which my own.


Shambles

Fantastically simple idea. Nice one.

An interesting query, though...

Should the prompt be "Log out" or "Logout" ?

Arantor

For 15 minutes work I didn't really worry about it. Either seems to be pretty interchangeable.
Holder of controversial views, all of which my own.


onepiece

"logout" is the noun form, whereas "log out" the verb. So having it separate in the confirmation box and together for the mod title (the way it's currently) sounds right to me. However, it might be better to change the menu button link to "log out" in SMF itself.

French

#9
Nice one......good and simple application,thanks

Dutch translation with a personal touch
Modifications.dutch-utf8.php
Quote// Logout Prompt
$txt['logout_msg'] = 'U staat op het punt om uit te loggen,klik op Ok om dit te bevestigen.Bedankt voor u bezoek en e.v.t bijdrage in onze Forum Topics.';

Arantor

Thanks :) I'll update the package when I get a chance, hopefully the next few days.
Holder of controversial views, all of which my own.


Impsat-1

Hi.... If any need, this is the MOD for SMF 2.0.7 "spanish_latin-utf8.php"... Great Job, Thanks Arantor :)

Thanks & Regards
Have a Great Time 8)
Vive Cáda Momento De Tu Vida Como Si Fueras a Irte Mañana, Más Planificala Cómo Si Jamás Fueras a Irte ;).-

Advertisement: