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.
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>
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.
it checks if your admin and group: 1, check your group value in the source code and change as needed.
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.
Fixed bug, try now =]
all good, thank you.