Saving Members Work

Post new topic   Reply to topic

View previous topic View next topic Go down

Re: Saving Members Work

Post by Cman on August 27th 2009, 6:28 pm


Saving Members' Work


This only works or administrators with template editing.


Go to Admin Panel > Display > Post & Private Messages under Templates > Posting Body.

Once you are there, post this code as the VERY last thing.

Code:
<SCRIPT language=JavaScript type=text/javascript>
// Cross browser event handling for IE 5+, NS6+ and Gecko
function addEvent(elm, evType, fn, useCapture)
{
if (elm.addEventListener)
{
// Gecko
elm.addEventListener(evType, fn, useCapture);
return true;
}
else if (elm.attachEvent)
{
// Internet Explorer
var r = elm.attachEvent('on' + evType, fn);
return r;
}
else
{
// nutscrape?
elm['on' + evType] = fn;
}
}

// Add Listeners
function addListeners(e)
{
// Before unload listener
addEvent(window, 'beforeunload', exitAlert, false);
}

// Exit Alert
function exitAlert(e)
{
// default warning message
var msg = "You will lose information if it has not already been saved.";

// set event
if (!e) { e = window.event; }
if (e) { e.returnValue = msg; }

// return warning message
return msg;
}

// Initialise
addEvent(window, 'load', addListeners, false);
</SCRIPT>


Now before a member leaves the topic, post reply, and quote pages, it will ask the member if they have saved their work. This also works for PMs and gallery commenting. This does not work with quick reply.

Spoiler:


Written by Cman

Cman
Forumotion Member

Male
Posts: 574
Age: 14
Language: English
Location: Indianatlantic, Florida
Country:
Join date: 2009-05-29

http://www.justcorbin.com/

Back to top Go down

View previous topic View next topic Back to top


Permissions of this forum:
You cannot reply to topics in this forum