Welcome Guest [Log In] [Register]
Search Members Calendar | Rules ZB Code Index IF Code Index
ZBCode
  • Navigation
  • ZBCode
  • Coding Resources
  • Code Requests
  • Completed Requests
  • [Completed] [ZB] Make Certain Skins Viewable Only To Certain Groups
Hey, welcome to ZBCode, the premier coding forum for ZB. Here you fill find some of the best Invisionfree and Zetaboards Codes on the network! Unfortunately, you're sorta hovering around in guest mode at the moment; why not join in on the fun? Register an account and you can start accessing the wealth of resources we have available here. Enjoy your stay at ZBCode, and remember to tell all your friends about us; the more members, the more codes available. ;)

Interested in joining? Click here.


If you are already a member of ZBCode, feel free to login right here:

Username:   Password:
Locked Topic
  • Pages:
  • 1
  • 2
  • 3
  • 4
[Completed] [ZB] Make Certain Skins Viewable Only To Certain Groups; Take 2, I now have 10 posts.
Tweet Topic Started: Sep 6 2009, 09:28 PM (928 Views)
habs1 Oct 12 2009, 10:34 AM Post #11


Posts:
40
Group:
Member
Member
#3,471
Joined:
Sep 6, 2009
So there wouldn't be a way to just take a groups right to see certain skins away, or even just hide it from the drop down skin menu?
Offline Profile Goto Top
 
slayer766 Oct 12 2009, 10:51 AM Post #12
Member Avatar
Hello all

Posts:
1,653
Group:
Distinguished Coder
Member
#12
Joined:
Jul 9, 2008
Coding language
PHP
Of course, but as I said:

Quote:
 
this will require an extra page view on just about every page...meaning it will slow your forum down a little and it will use up 1 extra ad credit if you had ad credits purchased. The extra page is needed to get the group the user is in.


;)
Offline Profile Goto Top
 
habs1 Oct 12 2009, 06:54 PM Post #13


Posts:
40
Group:
Member
Member
#3,471
Joined:
Sep 6, 2009
Theres no other way to do this then?
Offline Profile Goto Top
 
slayer766 Oct 12 2009, 07:42 PM Post #14
Member Avatar
Hello all

Posts:
1,653
Group:
Distinguished Coder
Member
#12
Joined:
Jul 9, 2008
Coding language
PHP
No.
Offline Profile Goto Top
 
habs1 Oct 12 2009, 07:55 PM Post #15


Posts:
40
Group:
Member
Member
#3,471
Joined:
Sep 6, 2009
Ok, well, I guess I will try it out.
Offline Profile Goto Top
 
Reid Oct 14 2009, 08:04 AM Post #16
Member Avatar
What? The land of the free? Whoever told you that was your enemy.

Posts:
1,790
Group:
Distinguished Coder
Member
#148
Joined:
Jul 20, 2008
I'll make this script when I get home today.
The Resource Board
Offline Profile Goto Top
 
Reid Oct 14 2009, 09:54 AM Post #17
Member Avatar
What? The land of the free? Whoever told you that was your enemy.

Posts:
1,790
Group:
Distinguished Coder
Member
#148
Joined:
Jul 20, 2008
Code:
 
<script type='text/javascript'>
/* <![CDATA[ */
var s_groups = [
['Acerbic', 'Admins'],
['Augeas', 'Admins', 'Guests'],
['Kyrite', 'Members']
];
// stop editing
$('#setskin').hide();
function handle_g(g) {
var l = s_groups.length;
while (l--) {
var k = s_groups[l].length, can_see = false;
while (k--)
if (k != 0 && s_groups[l][k] == g)
can_see = true;
if (!can_see)
$('#setskin option').each(function(){
if (this.innerHTML == s_groups[l][0])
$(this).remove();
});
}
$('#setskin').show();
}
var url = $('#top_info strong a').attr('href');
if (!url)
handle_g('Guests');
else {
$.get(url, function(r) {
handle_g($('dt:contains(Group:)', r).next().text());
});
}
/* ]]> */
</script>
The setup is pretty simple (to me). Here's the layout (or the syntax...):
Code:
 
var s_groups = [
['Acerbic', 'Admins'],
['Augeas', 'Admins', 'Guests'],
['Kyrite', 'Members']
];
So highlighted with the pink are the skin names. Highlighted in the green are the names of the groups that can see the skins. So if you put this on your board, it'd hide the Acerbic skin from everyone except admins. Augeas would be hidden from everyone except admins and guests. Kyrite would be hidden from everyone except members.

The names are case sensitive - that is, capitalization does indeed matter.

Also, if you have the 'Guests' group renamed, then still call it 'Guests' in the code, because you can't check the group of a guest on your board in a script.

Here's another example...
Code:
 
var s_groups = [
['Acerbic', 'Admins'],
['Augeas', 'Admins', 'Guests'],
['Kyrite', 'Members', 'Moderators'],
['iFusion', 'Coding Staff', 'Moderators', 'Admins'],
['ZBCode', 'Members']
];
Just add/remove skins as needed.

This goes in the 'Above the Copyright' section, by the way.
The Resource Board
Offline Profile Goto Top
 
habs1 Oct 14 2009, 04:34 PM Post #18


Posts:
40
Group:
Member
Member
#3,471
Joined:
Sep 6, 2009
If theres a skin that everyone uses, do I have to put it in there?

It seems to take the Theme Chooser Right off for me in IE, but in FF and Chrome its still there, but the skin doesn't disappear.
Edited by habs1, Oct 14 2009, 04:54 PM.
Offline Profile Goto Top
 
Reid Oct 14 2009, 07:04 PM Post #19
Member Avatar
What? The land of the free? Whoever told you that was your enemy.

Posts:
1,790
Group:
Distinguished Coder
Member
#148
Joined:
Jul 20, 2008
habs1
Oct 14 2009, 04:34 PM
If theres a skin that everyone uses, do I have to put it in there?

It seems to take the Theme Chooser Right off for me in IE, but in FF and Chrome its still there, but the skin doesn't disappear.
Nope, only put the skins you want to hide.

Can I see your setup? I looked on the board link you provided in the last request I filled (music on members' profile) but I didn't see the code there.
The Resource Board
Offline Profile Goto Top
 
habs1 Oct 14 2009, 08:57 PM Post #20


Posts:
40
Group:
Member
Member
#3,471
Joined:
Sep 6, 2009
I took it off, because it didn't seem to work. Want me to readd it, or just post what I had here?
Offline Profile Goto Top
 
1 user reading this topic (1 Guest and 0 Anonymous)
Go to Next Page
« Previous Topic · Completed Requests · Next Topic »
Locked Topic
  • Pages:
  • 1
  • 2
  • 3
  • 4

Track Topic · E-mail Topic Time: 2:26 PM Jul 11
Hosted for free by ZetaBoards · Privacy Policy