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: |
| Groups in ZB | |
|---|---|
| Tweet Topic Started: Jun 10 2009, 06:33 PM (592 Views) | |
| Dorith | Jun 10 2009, 06:33 PM Post #1 |
![]()
Has just entered the Matrix
![]()
|
So I'm sorta trying to get the hand of Javascript and am trying to learn some new things. I was wondering how to set up an if statement per group? I noticed that if you look at the source of the member list in the forums you will see a value for each forum group. How would you set up the if statement part of that code? Because right after that I would use something like
Correct? And that would work with showing that announcement only to the specific group? |
![]() (Made emoticon using Codes Rock's Smiley Generator) | |
![]() |
|
| Reid | Jun 10 2009, 06:42 PM Post #2 |
![]()
What? The land of the free? Whoever told you that was your enemy.
![]()
|
Okay, so, where are you trying to write this message exactly? |
| The Resource Board | |
![]() |
|
| Dorith | Jun 10 2009, 06:43 PM Post #3 |
![]()
Has just entered the Matrix
![]()
|
Where?? Err... I guess I'd have to do it on the forums for it to work... |
![]() (Made emoticon using Codes Rock's Smiley Generator) | |
![]() |
|
| Reid | Jun 10 2009, 06:45 PM Post #4 |
![]()
What? The land of the free? Whoever told you that was your enemy.
![]()
|
I mean. You have to put your script somewhere. Is it going to write at the top of every page? Only when you're on the members page? On a post somewhere? |
| The Resource Board | |
![]() |
|
| Dorith | Jun 10 2009, 06:48 PM Post #5 |
![]()
Has just entered the Matrix
![]()
|
Oh, I see what you're saying. No it's gonna be on every page, just like an announcement box up top. So the location will be everywhere. So I don't need a "location.href" right? Or do I actually gotta put that? |
![]() (Made emoticon using Codes Rock's Smiley Generator) | |
![]() |
|
| Reid | Jun 10 2009, 06:50 PM Post #6 |
![]()
What? The land of the free? Whoever told you that was your enemy.
![]()
|
If it's going to be on every page, then no. But there is a problem. How are you going to tell what group they are in on every page? It only says it in the member list (if they are on the page that includes their name), their profile, and when they post. And maybe a few other times. On the index, for instance. The only way you're going to be able to tell is the color - and that's if you have the legend on. But that requires some fancy javascript.
|
| The Resource Board | |
![]() |
|
| Dorith | Jun 10 2009, 06:56 PM Post #7 |
![]()
Has just entered the Matrix
![]()
|
But they are in a group. I see where you're getting at. So there's no place where the person is identified in a group? Because the person can see forums specific to their group/forum access. Perhaps it could be set up per forum access? The only problem with that is that I don't think that shows anywhere. It's most likely php right? |
![]() (Made emoticon using Codes Rock's Smiley Generator) | |
![]() |
|
| Reid | Jun 10 2009, 06:59 PM Post #8 |
![]()
What? The land of the free? Whoever told you that was your enemy.
![]()
|
Yeah it could be set up forumwise. If such and such forum exists, do this. Do you want jQuery or the classic JS way? |
| The Resource Board | |
![]() |
|
| Dorith | Jun 10 2009, 07:08 PM Post #9 |
![]()
Has just entered the Matrix
![]()
|
Oh! I get ya now. So it would be something like "if person can see this forum, then show this message" right? Err, would there be no other way? Cause the person has to be in a group, and something in the forum has to tell it that that person is in said group. Otherwise, please post the if part of the statement. I'm guessing it would something about what I quoted above about "if person can see location.href then document.write("blah"); correct? |
![]() (Made emoticon using Codes Rock's Smiley Generator) | |
![]() |
|
| Reid | Jun 10 2009, 07:34 PM Post #10 |
![]()
What? The land of the free? Whoever told you that was your enemy.
![]()
|
Not quite. ![]() If you want it the classic way, I went ahead and indented it so you can read it a little easier. I highly suggest downloading Notepad++, setting the 'Language' to javascript, and pasting this code in there, so the comments appear green and not the same color. |
| The Resource Board | |
![]() |
|
| 1 user reading this topic (1 Guest and 0 Anonymous) | |
| Go to Next Page | |
| « Previous Topic · Code University · Next Topic » |


















7:46 PM Jul 10