inherit
40786
0
Aug 12, 2005 6:06:14 GMT -8
theguy
114
May 2005
mrheadless
|
rank?
Jun 20, 2005 15:33:31 GMT -8
Post by theguy on Jun 20, 2005 15:33:31 GMT -8
not sure if this is the right place to ask, sorry if its not
i want to know if there is a variable in javascript that i can use that will tell me wether the user is an admin, global mod, mod, member, or guest.
such as
if(usertype="admin") { etc. etc.
where usertype is the variable name and the value of usertype is "admin"
i just need the variable name, and possible values of that variable.
|
|
inherit
Frozen in Time
1515
0
Nov 18, 2012 23:46:48 GMT -8
snap2000
29,317
October 2001
snap2000
|
rank?
Jun 20, 2005 15:55:03 GMT -8
Post by snap2000 on Jun 20, 2005 15:55:03 GMT -8
There is no way for this information to be available on all pages. The only way you could do it would be to locate a link to the user's profile (such as in the info center) and use the classname to determine their membergroup (i.e. "group1" would be an administrator).
|
|
inherit
Dork
7641
0
Jul 5, 2007 15:11:01 GMT -8
Jay
12,589
February 2003
trugie
|
rank?
Jun 20, 2005 16:38:50 GMT -8
Post by Jay on Jun 20, 2005 16:38:50 GMT -8
Yeah, there's a way. You can use cookies. For example, this will return 'admin' if you are the main admin.
<script type="text/javascript"> <!--
if (document.cookie.match(new RegExp('user=(.*);', 'g'))) { document.write(RegExp.$1); }
//--> </script>
|
|
inherit
40786
0
Aug 12, 2005 6:06:14 GMT -8
theguy
114
May 2005
mrheadless
|
rank?
Jun 20, 2005 16:57:43 GMT -8
Post by theguy on Jun 20, 2005 16:57:43 GMT -8
how do i put the value of the cookie into a variable? and how can i do global mod or mod, or an additional admin?
|
|
inherit
Beware the ever changing head
33588
0
Nov 18, 2023 0:32:44 GMT -8
Ross
19,039
November 2004
elindir
|
rank?
Jun 20, 2005 17:06:08 GMT -8
Post by Ross on Jun 20, 2005 17:06:08 GMT -8
Maybe something like: var admin = /user=( admin1|admin2|admin3);/i; var gmod = /user=( gmod1|gmod2|gmod3);/i; var mod = /user=( mod1|mod2|mod3);/i; Where the purple is the members usernames
|
|
inherit
40786
0
Aug 12, 2005 6:06:14 GMT -8
theguy
114
May 2005
mrheadless
|
rank?
Jun 20, 2005 17:09:36 GMT -8
Post by theguy on Jun 20, 2005 17:09:36 GMT -8
i could do that
but then i would need the usernames in variables to identify wether or not they are an admin
and i am assuming that is an array, which i have no experince in
|
|
inherit
22349
0
Sept 20, 2012 18:44:14 GMT -8
Nuclear
Less is More
1,158
April 2004
nuclear3
|
rank?
Jun 20, 2005 17:11:15 GMT -8
Post by Nuclear on Jun 20, 2005 17:11:15 GMT -8
I think I know what this guy is referring to do. I tryed to do the same thing before. For some reason it does not work. Let me guess, you are trying to have things only appear for a certain user. Let me play around with some coding. I maybe able to figure it out.
|
|
inherit
40786
0
Aug 12, 2005 6:06:14 GMT -8
theguy
114
May 2005
mrheadless
|
rank?
Jun 20, 2005 17:14:22 GMT -8
Post by theguy on Jun 20, 2005 17:14:22 GMT -8
that exactly it, nuclear. thanks
|
|
inherit
22349
0
Sept 20, 2012 18:44:14 GMT -8
Nuclear
Less is More
1,158
April 2004
nuclear3
|
rank?
Jun 20, 2005 17:28:06 GMT -8
Post by Nuclear on Jun 20, 2005 17:28:06 GMT -8
Darn, I just do not know how to do it. The group thing seems not to work, and having user == someusername does not seem to work either. Humm, I still have some other ideas to try out.
|
|
inherit
22349
0
Sept 20, 2012 18:44:14 GMT -8
Nuclear
Less is More
1,158
April 2004
nuclear3
|
rank?
Jun 20, 2005 17:36:24 GMT -8
Post by Nuclear on Jun 20, 2005 17:36:24 GMT -8
Sorry man, all of my ideas do not work. I know what you want, I just have no way of making it happen.
|
|
inherit
40786
0
Aug 12, 2005 6:06:14 GMT -8
theguy
114
May 2005
mrheadless
|
rank?
Jun 20, 2005 17:43:46 GMT -8
Post by theguy on Jun 20, 2005 17:43:46 GMT -8
ok thanks anyway though
it would be convenient for us to have access to the actual code through ftp maybe like on phpbb but oh well
|
|
inherit
Proboards Legend
212
0
May 11, 2006 12:32:55 GMT -8
california
21,035
December 1999
california
|
rank?
Jun 20, 2005 23:11:57 GMT -8
Post by california on Jun 20, 2005 23:11:57 GMT -8
You want for a code to be displayed for a certain user?
<script type="text/javascript"> <!-- if(document.cookie.match(/user=joebob;/)){ document.write("This code can only be seen by joebob"); } // --> </script>
|
|