Narutopedia
m (ec reply)
m (fixes)
Line 85: Line 85:
   
 
Yes, Cerez-senpai. That would lock the forum page. ~[[User:IndxcvNovelist|IndxcvNovelist]] <sup>([[User talk:IndxcvNovelist|talk]] | [[Special:Contributions/IndxcvNovelist|contribs]] | [[w:c:phoenixrising|PR]] | [[w:c:rockleespinoff|RLS]])</sup> 10:37, June 15, 2012 (UTC)
 
Yes, Cerez-senpai. That would lock the forum page. ~[[User:IndxcvNovelist|IndxcvNovelist]] <sup>([[User talk:IndxcvNovelist|talk]] | [[Special:Contributions/IndxcvNovelist|contribs]] | [[w:c:phoenixrising|PR]] | [[w:c:rockleespinoff|RLS]])</sup> 10:37, June 15, 2012 (UTC)
::{{ec}}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 [[MediaWiki:common.js|common.js]] is below:
+
::<small>(edit conflict) </small> 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 [[MediaWiki:common.js|common.js]] is below:
 
<source lang="javascript">
 
<source lang="javascript">
 
/** Archive edit tab disabling *************************************
 
/** Archive edit tab disabling *************************************
Line 141: Line 141:
 
::This code works in conjunction with the [http://community.wikia.com/wiki/Template:Forumheader?action=edit Forumheader] on central. The forumheader template checks for the time since the last edit with the code <pre>{{#ifexpr:{{#expr:{{#time: U}} - {{#time: U | {{REVISIONTIMESTAMP}}}} }} > 2592000|</pre> - this expression returns true when the time since the last edit is greater than 2592000 seconds (30 days).
 
::This code works in conjunction with the [http://community.wikia.com/wiki/Template:Forumheader?action=edit Forumheader] on central. The forumheader template checks for the time since the last edit with the code <pre>{{#ifexpr:{{#expr:{{#time: U}} - {{#time: U | {{REVISIONTIMESTAMP}}}} }} > 2592000|</pre> - 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 <pre>|<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__}}</pre>. The "<nowiki><div id="old-forum-warning"</nowiki>" 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.
 
::When the expression returns true, the forum is older than 30 days, and is therefore marked as locked, this outputs the code <pre>|<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__}}</pre>. The "<nowiki><div id="old-forum-warning"</nowiki>" 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 <source lang="javascript">if(wgNamespaceNumber == 110) {</source> instead of <source lang="javascript">if(wgNamespaceNumber == 110 ||wgNamespaceNumber === 114 ) {</source> as Central has 2 Forum namespaces (Forum: and Admin Forum:) - whilst namespace 114 on the Naruto wiki is the Quotes: namespace. Hope this helps -- '''[[User:Randomtime|<span style="color:black;">Random</span>]][[User talk:Randomtime|<span style="color:#EE2C2C;">Time</span>]]''' 10:41, June 15, 2012 (UTC)
::Note that you'll need to change the code to read
 
<source lang="javascript">if(wgNamespaceNumber == 110) {</source> instead of <source lang="javascript">if(wgNamespaceNumber == 110 ||wgNamespaceNumber === 114 ) {</source> as Central has 2 Forum namespaces (Forum: and Admin Forum:) - whilst namespace 114 on the Naruto wiki is the Quotes: namespace. Hope this helps -- '''[[User:Randomtime|<span style="color:black;">Random</span>]][[User talk:Randomtime|<span style="color:#EE2C2C;">Time</span>]]''' 10:41, June 15, 2012 (UTC)
 

Revision as of 10:42, 15 June 2012

Forums: Index Narutopedia Discussion Prevent editing of old discussions
Note: This topic has been unedited for 4326 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.

<source lang="javascript">/* 
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)