dog199200 Guest | Modify Profile ReLinking (10th Sep 09 at 3:02am UTC) Resolved | | I need a code that will allow me to change where the Modify profile button is linked to unless the user is an administrator. The reason for this is because i'm using the api and have it so the information is updated off the forum so I can keep information in all the databases up to date at the same time. | |
|
Dreg[Bot] Moderator
Broken Posts: 415 Status: Offline Gender: Male Age: 37 Joined:
Additional Groups: Coding Team
pmYesh im sneaky! | Re: Modify Profile ReLinking (10th Sep 09 at 4:48pm UTC) | | Code: - <script type="text/javascript">
- <!--
-
- var vf_admin = false;
-
- for (var i = 0; i < vf_usergroup.length; i ++)
- {
- if(vf_usergroup[i] == '1')
- {
- vf_admin = true;
- }
- }
-
- if ( ! vf_admin && get('profile_links', ID))
- {
- var pro_link = get('profile_links', ID).getElementsByTagName('a')[0];
-
- if (pro_link.href.match(/modify_profile/i))
- {
- pro_link.href = 'http://google.com';
- }
- }
-
- //-->
- </script>
-
-
| |
Now obsession rules my mind This commotion makes me blind Searching out who ever runs Or has stolen away my life
But i've already said
Don't ever back down Don't ever turn around My end has come So now I come for you.... |
|
dog199200 Guest | Re: Modify Profile ReLinking (10th Sep 09 at 5:25pm UTC) | | it does the redirect perfectly fine, but it doesn't check to see if the user is an admin in order to remove the redirect. | |
|
Dreg[Bot] Moderator
Broken Posts: 415 Status: Offline Gender: Male Age: 37 Joined:
Additional Groups: Coding Team
pmYesh im sneaky! | Re: Modify Profile ReLinking (10th Sep 09 at 8:03pm UTC) | | it checks if your admin and group: 1, check your group value in the source code and change as needed. | |
Now obsession rules my mind This commotion makes me blind Searching out who ever runs Or has stolen away my life
But i've already said
Don't ever back down Don't ever turn around My end has come So now I come for you.... |
|
dog199200 Guest | Re: Modify Profile ReLinking (10th Sep 09 at 10:04pm UTC) | | i'm still clueless the admin group is 1, "var vf_usergroup = Array('1', '4');" 1 = Admin, 4 = Paid Member. I'm not sure why I can't get the group check to work at all.... I might have to add all the admins in manually by their username, which would just be redundant over time. | |
|
Dreg[Bot] Moderator
Broken Posts: 415 Status: Offline Gender: Male Age: 37 Joined:
Additional Groups: Coding Team
pmYesh im sneaky! | Re: Modify Profile ReLinking (11th Sep 09 at 1:35am UTC) | | Fixed bug, try now =] | |
Now obsession rules my mind This commotion makes me blind Searching out who ever runs Or has stolen away my life
But i've already said
Don't ever back down Don't ever turn around My end has come So now I come for you.... |
|
dog199200 Guest | Re: Modify Profile ReLinking (11th Sep 09 at 2:21am UTC) | | all good, thank you. | |
|
Dreg[Bot] Moderator
Broken Posts: 415 Status: Offline Gender: Male Age: 37 Joined:
Additional Groups: Coding Team
pmYesh im sneaky! | Re: Modify Profile ReLinking (11th Sep 09 at 8:00am UTC) | | | |
Now obsession rules my mind This commotion makes me blind Searching out who ever runs Or has stolen away my life
But i've already said
Don't ever back down Don't ever turn around My end has come So now I come for you.... |
|