Wikia

Narutopedia

Prevent editing of old discussions

5,531pages on
this wiki

Forum page

Revision as of 09:44, June 29, 2012 by UltimateSupreme (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

This Forum has been archived

Visit the new Forums
Forums: Index Narutopedia Discussion Prevent editing of old discussions
Note: This topic has been unedited for 821 days. It is considered archived - the discussion is over. Do not add to unless it really needs a response.


Should we put a code in MediaWiki:Common.js to prevent editing of old discussions? — ¤ULTIMATE SUPREME¤(T@lk)☺ 10:25, June 11, 2012 (UTC)

If someone knows Javascript, they could do. --Speysider Talk Page | My Image Uploads | Tabber Code | My Wiki | Channel 10:30, June 11, 2012 (UTC)
Is that even possible? -White Flash-(Talk)- 10:33, June 11, 2012 (UTC)
Don't think it is tbh. --Speysider Talk Page | My Image Uploads | Tabber Code | My Wiki | Channel 10:35, June 11, 2012 (UTC)

Just saw it on some other wiki. I dont know if it would work here or not.

/* 
This code is loaded on all skins.
*/
 
importScriptPage('ShowHide/code.js', 'dev');
 
/** Archive edit tab disabling *************************************
 * Disables the edit tab on old forum topic pages to stop new people bumping old topics.
 * Page can still be edited by going via the edit tab on the history etc, or by 
 * typing the edit address manually.
 */
 
if(wgNamespaceNumber == 110 ||wgNamespaceNumber === 114 ) {
 
function disableOldForumEdit() {
if( typeof( enableOldForumEdit ) != 'undefined' && enableOldForumEdit ) {
return;
}
if( !document.getElementById('old-forum-warning') ) {
return;
}
 
if(skin == 'oasis') {
  $('#WikiaPageHeader .wikia-menu-button > a').html('Archived').removeAttr('href');
  return;
 }
if( !document.getElementById('ca-edit') ) {
return;
}
var editLink = null;
if( skin == 'monaco' )
{
editLink = document.getElementById('ca-edit');
}
else if( skin == 'monobook' )
{
editLink = document.getElementById('ca-edit').firstChild;
}
else
{
return;
}
 
 
editLink.removeAttribute('href', 0);
editLink.removeAttribute('title', 0);
editLink.style.color = 'gray';
editLink.innerHTML = 'Archived';
 
$('span.editsection-upper').remove();
 
}
addOnloadHook( disableOldForumEdit );
}

¤ULTIMATE SUPREME¤(T@lk)☺ 10:47, June 11, 2012 (UTC)

Can you provide a link to this "other" wiki you saw it on? -White Flash-(Talk)- 10:44, June 11, 2012 (UTC)
This wiki. Lol — ¤ULTIMATE SUPREME¤(T@lk)☺ 10:47, June 11, 2012 (UTC)
Linking to Community Central's RC is not helpful, link it to where you saw it on, we aren't psychics. -White Flash-(Talk)- 10:59, June 11, 2012 (UTC)

What do you mean. Ofcourse its here¤ULTIMATE SUPREME¤(T@lk)☺ 11:04, June 11, 2012 (UTC)

Why? — ¤ULTIMATE SUPREME¤(T@lk)☺ 13:48, June 11, 2012 (UTC)

They have something like this at the Avatar wiki, but I don't know if it's automatic or if it's a template. Omnibender - Talk - Contributions 21:53, June 13, 2012 (UTC)

Community Central use something like this on blogs, whenever a blog is not commented in 30 days other users can't leave comments. -White Flash-(Talk)- 07:43, June 14, 2012 (UTC)

This is good. But there are some times that a user would open again the discussion if consensus wasn't reached. However I do agree implementing this. ~IndxcvNovelist (talk | contribs | PR | RLS) 08:42, June 15, 2012 (UTC)

We dont know how this code works. But I think I know someone, who can help. — ¤ULTIMATE SUPREME ¤ (T@lk) 10:14, June 15, 2012 (UTC)

Such as? -White Flash-(Talk)- 10:16, June 15, 2012 (UTC)

Question, is it something that will prevent people from editing the section altogether or just a template that will be put there asking them not to? Because if it's the latter, that isn't going to stop people. It's just going to create additional work for people to do.--Cerez365Hyūga Symbol(talk) 10:29, June 15, 2012 (UTC)

Yes, Cerez-senpai. That would lock the forum page. ~IndxcvNovelist (talk | contribs | PR | RLS) 10:37, June 15, 2012 (UTC)

(edit conflict) Hey, first off - UltimateSupreme copied a segment of the code for importing the show/hide box, not the code for disabling edits - secondly, for some reason he removed the attribution for the author of the code, for reference, the code you need to add to your common.js is below:
/** Archive edit tab disabling *************************************
 * Disables the edit tab on old forum topic pages to stop new people bumping old topics.
 * Page can still be edited by going via the edit tab on the history etc, or by
 * typing the edit address manually.
 * By [[User:Spang|Spang]]
 * Monaco support by [[User:Uberfuzzy|Uberfuzzy]]
 * Oasis support by [[User:Uberfuzzy|Uberfuzzy]]
 */
 
if(wgNamespaceNumber == 110 ||wgNamespaceNumber === 114 ) {
 
function disableOldForumEdit() {
    if( typeof( enableOldForumEdit ) != 'undefined' && enableOldForumEdit ) {
        return;
    }
    if( !document.getElementById('old-forum-warning') ) {
        return;
    }
 
if(skin == 'oasis') {
  $('#WikiaPageHeader .wikia-menu-button > a').html('Archived').removeAttr('href');
  return;
 }
    if( !document.getElementById('ca-edit') ) {
        return;
    }
    var editLink = null;
    if( skin == 'monaco' )
    {
        editLink = document.getElementById('ca-edit');
    }
    else if( skin == 'monobook' )
    {
        editLink = document.getElementById('ca-edit').firstChild;
    }
    else
    {
        return;
    }
 
 
    editLink.removeAttribute('href', 0);
    editLink.removeAttribute('title', 0);
    editLink.style.color = 'gray';
    editLink.innerHTML = 'Archived';
 
    $('span.editsection-upper').remove();
 
}
addOnloadHook( disableOldForumEdit );
}
This code works in conjunction with the Forumheader on central. The forumheader template checks for the time since the last edit with the code
{{#ifexpr:{{#expr:{{#time: U}} - {{#time: U | {{REVISIONTIMESTAMP}}}} }} > 2592000|
- this expression returns true when the time since the last edit is greater than 2592000 seconds (30 days).
When the expression returns true, the forum is older than 30 days, and is therefore marked as locked, this outputs the code
|<div id="old-forum-warning" style="margin: 0.8em 0; padding: 0.5em 12px; border: 2px solid #F66; background-color: whitesmoke; color: black">'''<span style="color: maroon">Note</span>''': This topic has been unedited for '''{{#expr:({{#time: U}} - {{#time: U | {{REVISIONTIMESTAMP}}}}) / 86400 round 0}} days'''. It is considered '''archived''' - the discussion is over. Do not add to unless it ''really'' needs a response.</div>__NOEDITSECTION__}}
. The "<div id="old-forum-warning"" is the code that the javascript above looks for, and - if the script finds it in the forum namespace - then it disables the edit button.
Note that you'll need to change the code to read
if(wgNamespaceNumber == 110) {
instead of
if(wgNamespaceNumber == 110 ||wgNamespaceNumber === 114 ) {
as Central has 2 Forum namespaces (Forum: and Admin Forum:) - whilst namespace 114 on the Naruto wiki is the Quotes: namespace. Hope this helps -- RandomTime 10:41, June 15, 2012 (UTC)
Thank you for that.--Cerez365Hyūga Symbol(talk) 10:44, June 15, 2012 (UTC)

@white flash: This^ — ¤ULTIMATE SUPREME ¤ (T@lk) 10:47, June 15, 2012 (UTC)

@RT:Thanks!
@UltimateSupreme:This what? -White Flash-(Talk)- 10:49, June 15, 2012 (UTC)
such as?
¤ULTIMATE SUPREME ¤ (T@lk) 10:58, June 15, 2012 (UTC)
CLARIFY. CLARIFY. Salil is talking about Randomtime or even Simant. ~IndxcvNovelist (talk | contribs | PR | RLS) 11:00, June 15, 2012 (UTC)
Perhaps Salil should've been a little more specific. -White Flash-(Talk)- 11:09, June 15, 2012 (UTC)

Salil? Who is that? Lol. I was talking about Randomtime. — ¤ULTIMATE SUPREME ¤ (T@lk) 11:35, June 15, 2012 (UTC)

Oh LOL you Salil. Don't get angry at me mentioning your name. ~IndxcvNovelist (talk | contribs | PR | RLS) 12:09, June 15, 2012 (UTC)

I am not angry ^_^ — ¤ULTIMATE SUPREME ¤ (T@lk) 12:10, June 15, 2012 (UTC)

Hahaha. I remembered when you get angry at me for giving the link…. ~IndxcvNovelist (talk | contribs | PR | RLS) 12:13, June 15, 2012 (UTC)
So, should we do it? — ¤ULTIMATE SUPREME ¤ (T@lk) 04:54, June 17, 2012 (UTC)

No. Using JS to block something is a ridiculous idea. That's the kind of solution I give in to when dealing with a technologically moronic client that I just want to get rid of. ~ Daniel Friesen (DanTMan, Nadir Seen Fire) (Local TalkAnimanga Talk)

If you don't like JS, how about inserting a template? ~IndxcvNovelist (talk | contribs | PR | RLS) 19:53, June 20, 2012 (UTC)

(Late). It can still be edited by the methods mentioned above. Its not a complete block — ¤ULTIMATE SUPREME ¤ (T@lk) 09:44, June 29, 2012 (UTC)

Around Wikia's network

Random Wiki