Wikipedia:WikiProject User scripts/Scripts/WikiBreak Enforcer
Appearance
Functionality:
- Prevents user from logging in before a certain date.
- If the user logs in, they are automatically logged back out.
- User can still view/edit as an anon.
Usage:
- Copy the code below into your monobook.js, adjusting the end date as required. Save the page.
- Reload a wikipedia page. Mozilla/Safari/Konqueror: hold down Shift while clicking Reload (or press Ctrl-Shift-R), IE: press Ctrl-F5, Opera: press F5.
- Enjoy your wikibreak!
/* <pre><nowiki> */ function EnforceWikiBreak() { var currentdate = new Date(); // YYYY, MM, DD, HH, MM, SS var enforced_break_end = new Date(2006, 03, 11, 17, 00, 00); // *** IMPORTANT: Subtract 1 from month, i.e. january = 0 *** if (currentdate > enforced_break_end) { // alert ("Welcome back from your enforced wikibreak!"); } else { alert ("Enforced wikibreak until " + enforced_break_end.toLocaleString() + " (currently " + currentdate.toLocaleString() + "). Bye!"); window.location = "http://en.wikipedia.org/w/index.php?title=Special:Userlogout&returnto=Main_page"; } } addOnloadHook(EnforceWikiBreak); /* </nowiki></pre> */