Jump to content
Search In
  • More options...
Find results that contain...
Find results in...
  • Sign Up
Thyme

 Coding Guest/member-group specific viewing

Recommended Posts

I've seen this on so many skins and on so many boards, but of course now that I'm looking around for how to do it for myself nothing to be found.

 

Basically, I'd love to have an announcement banner that is a welcome for guests, and another different banner for people applying characters (giving a quick reminder of a common pend issue).

 

But members and already accepted characters have no need of this... and I hate clutter with a passion of a thousand suns.

 

I know there is a way to do it -- I just don't know how (and can't seem to choose the key words to get google to help me out), so hopefully someone on the Initiative can toss me the code for how to get things to only appear for one member group. T_T

 

<3 Thanks in advance, guys~

Share this post


Link to post
Share on other sites

 

This is done through the magic of group IDs and it's my favourite thing! In jcink, the group variable is <!-- |g_id| --> and it returns the user's group number. When you go to manage user groups in your ACP, you'll see a list of your groups. On the left hand side is their group ID number. Guests are 2. When users join your forum, they should be in group 3.

 

So what I would do is put this where ever you want:

<div class="guest-announcement g<!-- |g_id| -->">
  Stuff here
</div>

By putting the space between group and g<!-- |g_id| --> I'm basically giving that div two classes, which will save you a whole lot of typing in the CSS.

 

So now you go into your CSS and put this in

.guest-announcement {
  display: none;
}

This will hide that div for everyone. But we want to display it just for guests. Below the above CSS put this in

.guest-announcement.g2 {
  display: block;
}

Now the div is visible to guests!

 

Now for new members:

<div class="newmem-announcement g<!-- |g_id| -->">
  Stuff here
</div>

 

As above:

.newmem-announcement { 
  display: none;
}

.newmem-announcement.g3 {
  display: block;
}

 

I hope that makes sense! Give a yell if anything is unclear or if you get stuck.

  • I read this! 1

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Recently Browsing   0 members

    No registered users viewing this page.



×

Important Information

By using this site, you agree to our Terms of Use, Guidelines and Privacy Policy. We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.