We hope you enjoy your visit.

You're currently viewing our forum as a guest. This means you are limited to certain areas of the board and there are some features you can't use. If you join our community, you'll be able to access member-only sections, and use many member-only features such as customizing your profile, sending personal messages, and voting in polls. Registration is simple, fast, and completely free.


Join our community!


If you're already a member please log in to your account to access all of our features:

Username:   Password:
Add Reply
Forum Specific Edit Disabling; Could be useful; By IceMetalPunk
Topic Started: Jan 23 2010, 01:04 AM (99 Views)
Reid
Member Avatar
È una trappola!

This topic has been moved from our official support board.

Originally posted by: IceMetalPunk
Forum Specific Edit Disabling; Could be useful
 
This code disables editing for specified forums only, rather than disabling it per group for ALL forums.

Preview: http://z6.invisionfree.com/NoPassChange/index.php

Login as test, password test.

Notice you can edit your posts in the first forum, but not in the second forum.

Here's the code (Board Wrappers>>Footer:):

Quote:
 
<script>
forums=[];

/* Add the forums this code should be active in. */

forums[forums.length]=4;

/* Set the error message when trying to edit in a non-editable forum. */
errormessage="Editing of posts is disabled in this forum.";

/* Set whether this code should be disabled (inactive) for Admins and/or Mods */

disableAdmin=0;
disableMod=0;

/* Do not edit anything below here. */

loc=document.location.href;

function isAdmin() {
ulnk=document.all?document.all.userlinks:document.getElementById("userlinks");
return ulnk.innerHTML.match(/admin\.php/i)!=null;
}
function isMod() {
ulnk=document.all?document.all.userlinks:document.getElementById("userlinks");
return ulnk.innerHTML.match(/act=modcp/i)!=null;
}

if (!(disableAdmin && isAdmin()) && !(disableMod && isMod())) {
for (p=0; p<forums.length; p++) {
reg=new RegExp("act=Post.*?&CODE=08.*?&f="+forums[p],"i");
if (document.REPLIER && document.REPLIER.Post && loc.match(reg)!=null) {
pnode=document.REPLIER.Post.parentNode;
pnode.removeChild(document.REPLIER.Post);
sp=document.createElement("span");
sp.style.fontWeight='bold';
sp.style.color='#aa0000';
sp.innerHTML="<center>"+errormessage+"</center>";
pnode.appendChild(sp);
pnode=document.REPLIER.submit.parentNode;
pnode.removeChild(document.REPLIER.submit);
pnode.removeChild(document.REPLIER.preview);
break;
}
}
}
</script>


Copy/paste the ALL BOLD LINE as many times as you need (one per edit-disabled forum), changing the RED to the forum's number.

The BLUE is the error message to show when someone tries to edit in an edit-disabled forum.

The PURPLE is whether the code should also disable Admins from editing in those forums (1=yes, 0=no).

The ORANGE is whether the code should also disable Moderators from editing in those forums (1=yes, 0=no).

-IMP ;) :)
Offline Profile Quote Post Goto Top
 
1 user reading this topic (1 Guest and 0 Anonymous)
« Previous Topic · Codes & Modifications · Next Topic »
Add Reply