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 (927 Views)
Reid Oct 14 2009, 08:58 PM Post #21
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
Either will do. :)
The Resource Board
Offline Profile Goto Top
 
habs1 Oct 14 2009, 09:07 PM Post #22


Posts:
40
Group:
Member
Member
#3,471
Joined:
Sep 6, 2009
Code:
 
<script type='text/javascript'>
/* <![CDATA[ */
var s_groups = [
['Under Pressure', '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>
Offline Profile Goto Top
 
Reid Oct 14 2009, 09:37 PM Post #23
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
Very odd. Try this:
Code:
 
<script type='text/javascript'>
/* <![CDATA[ */
var s_groups = [
['Under Pressure', '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;
alert("Because you are a " + g + ", you can (" + can_see + ") see " + s_groups[l][0]);
if (!can_see)
$('#setskin option').each(function(){
if (this.innerHTML.indexOf(s_groups[l][0]) == 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>
That should work, but who knows anymore... :P
The Resource Board
Offline Profile Goto Top
 
habs1 Oct 14 2009, 10:54 PM Post #24


Posts:
40
Group:
Member
Member
#3,471
Joined:
Sep 6, 2009
Ok, that works better, it gives the users a message, I was wondering if it was possible to change that message, and it stillmakes the theme chooser disappear in I.E.

Also, when other browsers refresh, the message pops up again.
Edited by habs1, Oct 14 2009, 11:04 PM.
Offline Profile Goto Top
 
Reid Oct 15 2009, 12:21 AM Post #25
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
Oops, I'm so sorry. I stuck that in for debugging.
Code:
 
<script type='text/javascript'>
/* <![CDATA[ */
var s_groups = [
['Under Pressure', '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.indexOf(s_groups[l][0]) == 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>
Sometimes the best way to fix problems is to create stuff like that. :P

Sorry once again.
The Resource Board
Offline Profile Goto Top
 
habs1 Oct 15 2009, 08:16 AM Post #26


Posts:
40
Group:
Member
Member
#3,471
Joined:
Sep 6, 2009
No problem, but will there be any way to fix it not showing up in I.E.? Other than that it works perfectly.
Offline Profile Goto Top
 
Reid Oct 15 2009, 11:47 AM Post #27
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
To be entirely honest I don't see any reason that it wouldn't work in IE.. maybe someone else can shed light on the situation.
The Resource Board
Offline Profile Goto Top
 
habs1 Oct 15 2009, 03:43 PM Post #28


Posts:
40
Group:
Member
Member
#3,471
Joined:
Sep 6, 2009
Yes, any help would be appreciated, here is a picture of what it looks like.

http://img49.imageshack.us/img49/5416/nothemechooserf.png
Offline Profile Goto Top
 
RedBldSandman Oct 23 2009, 06:41 PM Post #29
Member Avatar
ZIPPY!

Posts:
482
Group:
Coding Staff
Member
#2,122
Joined:
Jan 25, 2009
I've tested Reid's code in IE and it does, oddly, dissapear. However, it seems to work fine if you declare all the themes, even if you want don't want them to be hidden from anyone (Just remember to write the names of all the groups!) xD
Posted Image
"To iterate is human, to recurse divine."

Offline Profile Goto Top
 
Garath531. Nov 5 2009, 11:58 PM Post #30


Posts:
156
Group:
Dedicated
Member
#3,232
Joined:
Jun 17, 2009
There's an extra comma in there that IE doesn't like:
Code:
 

<script type='text/javascript'>
/* <![CDATA[ */
var s_groups = [
['Under Pressure', '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.indexOf(s_groups[l][0]) == 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>
I'm back after an unexpected hiatus. If I've forgotten about a code I was working on for you, just drop me a PM and let me know. :)
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