inherit
130228
0
Jul 11, 2024 19:19:59 GMT -8
Charles Stover
1,731
August 2008
gamechief
|
Post by Charles Stover on Nov 10, 2009 10:12:00 GMT -8
>.> People hate me You could just use: if(pb_username === "admin"){} I know some javascript, just trying to help out x.x You wouldn't need the third =. Just pb_username == "admin". However, that doesn't solve his problem of adding multiple users for multiple usergroups, hence using RegEx to specific each user.
|
|
inherit
139476
0
Jan 19, 2020 4:24:42 GMT -8
Auburn
I will steal your smile and treasure it
263
April 2009
auburneye
|
Post by Auburn on Nov 10, 2009 10:50:11 GMT -8
Woa, epic replies. So let's see here; to recap:
Guests Only:
<script type="text/javascript"> if(pb_username == 'Guest') { //Code Here } </script>
Members Only:
<script type="text/javascript"> if(pb_username!='Guest') { //Code Here } </script>
Specific Members Only:
<script type="text/javascript"> if (pb_username.match(/^(admin|user1|user2|user3)$/)) { //Code Here } </script>
|
|
#00AF33
14306
0
1
Sept 8, 2023 8:54:17 GMT -8
Jordan
What is truth?
11,838
October 2003
jab2
|
Post by Jordan on Nov 10, 2009 13:45:58 GMT -8
Yep, looks like you got it.
|
|
inherit
97216
0
Nov 26, 2024 13:53:14 GMT -8
Bennett 🚀
Formerly iPokemon.
3,622
January 2007
catattack
iPokemon's Mini-Profile
|
Post by Bennett 🚀 on Nov 10, 2009 15:28:30 GMT -8
The third "=" means it has to be the exact same as what is after the equal signs in "".
|
|
inherit
100824
0
May 13, 2012 5:37:49 GMT -8
Michael
14,585
March 2007
wrighty
|
Post by Michael on Nov 10, 2009 16:23:15 GMT -8
The third "=" means it has to be the exact same as what is after the equal signs in "". Yes, but in this scenario, 2 will suffice. As already stated, it requires RegEx to resolve this.
|
|
inherit
97216
0
Nov 26, 2024 13:53:14 GMT -8
Bennett 🚀
Formerly iPokemon.
3,622
January 2007
catattack
iPokemon's Mini-Profile
|
Post by Bennett 🚀 on Nov 10, 2009 17:55:20 GMT -8
Just tryign to prove a point
|
|
inherit
130228
0
Jul 11, 2024 19:19:59 GMT -8
Charles Stover
1,731
August 2008
gamechief
|
Post by Charles Stover on Nov 10, 2009 21:22:44 GMT -8
When you're comparing strings, that doesn't matter. The third = is for when you're comparing things of two different types. For example "" == 0 == false But "" !== 0 !== false because the first is a string, second is an integer, and third is a boolean. Hence you don't need the extra = when comparing two strings.
|
|
jadw2k9
inherit
-3799070
0
Dec 3, 2024 5:45:47 GMT -8
jadw2k9
0
January 1970
GUEST
|
Post by jadw2k9 on Nov 20, 2009 14:07:13 GMT -8
Could you use something like getComputedStyle (or whatever it is) to get the CSS group color property or something. i.e. users have different colour names depending on their group.
|
|
inherit
100824
0
May 13, 2012 5:37:49 GMT -8
Michael
14,585
March 2007
wrighty
|
Post by Michael on Nov 20, 2009 15:07:05 GMT -8
Could you use something like getComputedStyle (or whatever it is) to get the CSS group color property or something. i.e. users have different colour names depending on their group. No need, just get the className from a link with their username as the .href.
|
|
inherit
130228
0
Jul 11, 2024 19:19:59 GMT -8
Charles Stover
1,731
August 2008
gamechief
|
Post by Charles Stover on Nov 20, 2009 22:43:47 GMT -8
But there's no guarantee that a link with their name in it will be on the page, hence the problem. >_>
|
|
inherit
100824
0
May 13, 2012 5:37:49 GMT -8
Michael
14,585
March 2007
wrighty
|
Post by Michael on Nov 21, 2009 7:53:27 GMT -8
But there's no guarantee that a link with their name in it will be on the page, hence the problem. >_> That is very true, hence why you come across a link which fits the criteria, you save their group in cookies!
|
|
inherit
130228
0
Jul 11, 2024 19:19:59 GMT -8
Charles Stover
1,731
August 2008
gamechief
|
Post by Charles Stover on Nov 21, 2009 13:12:36 GMT -8
Rendering the code useless until the link is displayed (have fun explaining that to your members).
|
|
inherit
100824
0
May 13, 2012 5:37:49 GMT -8
Michael
14,585
March 2007
wrighty
|
Post by Michael on Nov 21, 2009 13:21:48 GMT -8
Rendering the code useless until the link is displayed (have fun explaining that to your members). when someone logs in, they're redirected to the home page that WILL contain a link to their profile!
|
|
inherit
130228
0
Jul 11, 2024 19:19:59 GMT -8
Charles Stover
1,731
August 2008
gamechief
|
Post by Charles Stover on Nov 22, 2009 1:01:56 GMT -8
But not a link that will contain the group. I don't think.
Although maybe in the Users Online. Lest they be invisible (possibly). It requires testing, so someone make this.
|
|
inherit
100824
0
May 13, 2012 5:37:49 GMT -8
Michael
14,585
March 2007
wrighty
|
Post by Michael on Nov 22, 2009 9:17:06 GMT -8
But not a link that will contain the group. I don't think. Although maybe in the Users Online. Lest they be invisible (possibly). It requires testing, so someone make this. Yea, in the Users Online ... Hm.. didn't think about them being invisible tbh.
|
|