If you are seeing this message, it is possible the page did not load properly. Please hit reload/refresh on your browser.
If you still see this message, you probably do not have a browser that supports web standards, although its content is accessible to any browser or Internet device.

Cool Tips & Tricks Cool Tips & Tricks

Help Communities:
Help Forums Bug Base
<< Prev Topic | Next Topic >>
Cool Tips & Tricks ::: Javascript FAQ ::: Block Anonymous except Board Staff
New Topic    Add Reply
Topic: Block Anonymous except Board Staff  (?)  Click to receive email notification of replies Click to stop receiving email notification of replies email this topic to a friend
ezNutrocker

EzNutz
Posts: 74
Posted: 6/12/05 2:51 pm    
Block Anonymous except Board Staff
Will return undesired anonymous users to their control centers. Requires EzURL!

<head> code </head> » (First Box):
    
<!-- Begin First Box Code --> 

<script type="text/javascript">
<!--  

function staffAnonymous (allowedMembers,blockOthers) {



/* Variables That Can Be Edited */

var Admin = new Array("admin1","admin2");
var Mods = new Array("mod1","mod2","mod3");
var Special = new Array("warshadows","exception2","exception3");

/* End Of Editable Variables */




var UserList = new Array();

switch (allowedMembers) {
                case "Admin":
                    UserList = UserList.concat(Admin);
                    UserList = UserList.join("|");
                break;
                case "Staff":
                    UserList = UserList.concat(Admin,Mods);
                    UserList = UserList.join("|");
                break;
                case "All":
                    UserList = UserList.concat(Admin,Mods,Special);
                    UserList = UserList.join("|");
                break;
                default:
                break;
}

if (blockOthers) {
         if (!ezUser.match(UserList)) {
              blockanonymous();
           }
     }
}

function getUser() {
        var ezUser = "";

        for ( dl = 0; dl < document.links.length; dl++ ) {
                 if ( document.links[dl].href.indexOf("showInBoxFolder") != -1 || document.links[dl].href.indexOf("InboxServer") != -1) {
                        ezUser = document.links[dl].href.match("u([a-zA-Z0-9\@]*)\.(showInBoxFolder|boardRedirectToInboxServer)")[1];
                        break;
                        }
                }
        return (ezUser == "" ? "" : ezUser);
}

function blockanonymous() {
        
                sBlockURL = "" + ezFullPub + ".ezboard.com/BBSUser.fromWeb?boardName=" + ezBoardID + "&back=" + ezBoardID + "&language=EN" ;
                
                if (ezUser.length > 0) {
                        allTables = document.getElementsByTagName("table");
                        for (at = 0; at < allTables.length; at++ ) {
                                if (allTables.item(at).className == "whosonline") {
                                        allTables.item(at).id = "whosonline";
        
                                        wotd = allTables.item(at).getElementsByTagName("td").item(1);
                                        if (wotd.innerHTML.indexOf("u" + ezUser + ".") == -1 && wotd.innerHTML.indexOf("login=" + ezUser) == -1) {
                                                document.location = sBlockURL;
                                }
                        }
                }
        }
}

// --> 
</script>

<!--   End First Box Code -->

Custom Footer » (Fourth Box):
    
<!-- Begin Fourth Box Code --> 

<script type="text/javascript">
<!--
/*  Begin Allow Staff Anonymity While Blocking Other Anonymous Users  */

if ( !(ezPage && ezQuery ) || ezIsBoard) {
ezUser = getUser();
if (ezUser.indexOf("@") != -1) { 
ezUser = ezUser.substr(0, ezUser.indexOf("@")); 
   }

staffAnonymous("All",true);

}

/*  End Allow Staff Anonymity While Blocking Other Anonymous Users  */

// --> 
</script>

<!--   End Fourth Box Code -->


Author :: WarShadows

Edited by: ezGoalieAunt at: 1/2/07 9:01 pm

  reply to this message

Click to receive email notification of replies Click to stop receiving email notification of replies email this topic to a friend

New Topic    Add Reply

jump to:
Topic Control Image::: Topic Commands
<< Prev Topic | Next Topic >>

Icon Legend

reply button:::Reply to Post Button   edit button:::Edit Post Button  delete button:::Delete Post Button (Moderator Only)

subscribe/unsubscribe to thread button:::Subscribe to Thread Button   email to friend button:::Email to Friend Button  



- Cool Tips & Tricks - Javascript FAQ -

Communitiesezboard Help Communities:

Help Forums Help Forums Bug Base Bug Base





Powered By ezboard® Ver. 7.32
Copyright ©1999-2007 ezboard, Inc.