|
Post by Dragon on Apr 15, 2011 18:58:54 GMT -8
Well the point of this code is to make a board for my eyes or a handful of peoples eyes only. Well the way my site operates, I end up linking to a hidden board from one main board for each topic. Since I dont want people to see the hidden board..... It just so happens theres a bunch of boards like that. I didnt mean to make it sound so bad, just that it would be more than 1 board that I'd be hiding and its a tiny bit easier to use 1 code to hide multiple boards than multiple codes. D:
|
|
|
Post by Wormopolis on Apr 15, 2011 19:37:24 GMT -8
version upgrade 2.1: multiple board support
|
|
|
Post by Wormopolis on Apr 15, 2011 19:37:32 GMT -8
try that version
|
|
watercrystals
Not New Member
Posts: 7
watercrystals said 0 great things
|
Post by watercrystals on May 15, 2011 23:59:05 GMT -8
I read the option you gave dragon: vanish(/^dragon$/,'ladiesonly'); used for hiding it from everone but that one username. I've tried a few edited variations to try and make it the way I want it, but I can't seem to make it work, so I was wondering, how do you use that code ^ and instead of the 1 username, add a few more exceptions? Basically I need to be able to hide a few boards from everyone except a few specific members that are the only ones able to see and use that board (some boards will have different members allowed, so it would be best if I could just enter into the code which usernames for each hidden board). Is there a way to do this?
|
|
|
Post by Wormopolis on May 16, 2011 2:42:17 GMT -8
vanish(/^(user1|user2|user3)$/,'ladiesonly');
try that
|
|
watercrystals
Not New Member
Posts: 7
watercrystals said 0 great things
|
Post by watercrystals on May 17, 2011 1:28:03 GMT -8
Okay. It won't work beyond the first name. Such as, it works for user1 but none of the others entered; the board is still hidden from them Is there something else I can try? I don't care if I have to use a line of code for every member, I really need this and it's exactly what I've been searching for, if we can only make it work for more than a single member.
|
|
|
Post by Wormopolis on May 17, 2011 1:57:40 GMT -8
show me what you put
|
|
watercrystals
Not New Member
Posts: 7
watercrystals said 0 great things
|
Post by watercrystals on May 17, 2011 23:27:38 GMT -8
I put this in the global footer:<script type="text/javascript"> <!-- function vanish(u_name, b_name) { if ((pb_username.match(u_name) || u_name=='all') && pb_username!='admin') { var rgx=new RegExp("board="+b_name,''); var rgx2=new RegExp("board-"+b_name,''); if (location.href.match(rgx)) location.href="/index.cgi"; iTrw=document.getElementsByTagName('tr'); for (j=0; j<iTrw.length; j++) { if ((iTrw[j].innerHTML.match(rgx) || iTrw[j].innerHTML.match(rgx2)) && !iTrw[j].innerHTML.match(/<table/i) && iTrw[j].innerHTML.match(/forumjump/i)) { iTsel=iTrw[j].getElementsByTagName('select'); for (m=0; m<iTsel.length; m++) { iTopt=iTsel[m].options; for (n=0; n<iTopt.length; n++) { if (iTopt[n].value.match(rgx)) { iTopt[n]=null; while(iTopt[n].innerHTML.match('---')) iTopt[n]=null; } } } } } var holdit = document.getElementsByTagName('body')[0]; if (holdit.innerHTML.match(rgx) || holdit.innerHTML.match(rgx2)) { // if it does THEN scan page and remove iTrw=document.getElementsByTagName('tr'); for (j=0; j<iTrw.length; j++) { if ( (iTrw[j].innerHTML.match(rgx) || iTrw[j].innerHTML.match(rgx2)) && !iTrw[j].innerHTML.match(/<table/i)) { if (!iTrw[j].innerHTML.match(/topic:/i)) { if (location.href.match(/search/i)) { iTrw[j].getElementsByTagName('input')[0].checked=false; p=j+1; while(iTrw .cells.length>1) { if (iTrw .cells[1].getElementsByTagName('font')[0].innerHTML.slice(0,2).match('-')=='-') { iTrw .getElementsByTagName('input')[0].checked=false; iTrw[p++].style.display='none'; } } } iTrw[j].style.display='none'; } else { iTlnk=iTrw[j].getElementsByTagName('a'); for (k=0; k<iTlnk.length; k++) { if (iTlnk[k].href.match(rgx)) { iTlnk[k].href=''; iTlnk[k].innerHTML="hidden"; } } } } } } } } vanish(/^(admin|amara)$/,'moaningmbathroom'); vanish(/^(admin|amara|sophie)$/,'dumbledoreoffice');
// --> </script>
|
|
|
Post by Wormopolis on May 18, 2011 1:41:11 GMT -8
hmm.. thats tricky since it concerns negated or groups.. try this:
vanish(/(admin|amara|sophie){0}/,'dumbledoreoffice');
|
|
watercrystals
Not New Member
Posts: 7
watercrystals said 0 great things
|
Post by watercrystals on May 18, 2011 4:03:37 GMT -8
Still doesn't work past the first listed user
|
|
|
Post by Wormopolis on May 18, 2011 18:50:21 GMT -8
version upgrade 2.5: hide negation. set third parameter to true to invert the hide
|
|
watercrystals
Not New Member
Posts: 7
watercrystals said 0 great things
|
Post by watercrystals on May 18, 2011 23:54:48 GMT -8
I'm sorry, but I don't quite understand what that means. Could you please explain a little more?
|
|
|
Post by Wormopolis on May 19, 2011 4:20:45 GMT -8
look at the example at the end of the code. I added in a third parameter to invert the purpose of the function.
|
|
watercrystals
Not New Member
Posts: 7
watercrystals said 0 great things
|
Post by watercrystals on May 22, 2011 8:27:27 GMT -8
Are you refering to this section:
function vanish(u_name, b_name, negated) { if (negated==undefined) negated=false;
Where is says false there, should I change it to true in order to use the vanish(/^(user1|user2|user3)$/,'testboard'); part? Just checking
|
|
|
Post by Wormopolis on May 24, 2011 13:16:54 GMT -8
no dont change the upper part, just add your vanish call at the end like you have been, but you will put the 2 usernames, the board id, and true
vanish(/user1|user2/,'boardid',true);
|
|