Post by SubDevo on Sept 3, 2009 5:49:11 GMT -5
Mini-Profile Background Image Global/Certain Users by SubDevo
Tested in IE, FF, Opera and Safari
Allows you to use a background image for the Mini-Profile for your entire forum.
Allows you to give certain users a different background of your choosing.
Using a global mini-profile image will give your forum a little more "character".
Admins can use the "certain users" background image as a "prize" or a "thank you" or whatever for a "special" member!
Let your staff have their own image too! This sets them apart from the regular members.
Enjoy!!!
SubDevo
Variable Descriptions:
var pImg="URL TO IMAGE"; // URL to Global Image.
Enter the URL to your global mini-profile background image. This image will be used for all mini-profiles except for the members listed in the next variable below.
uI[0]=["USERNAME","URL TO IMAGE"]; // Username, URL to Image.
Enter the user name (NOT display name) in the first part, and the URL to their image in the second part. Any users listed here will overide the global image. To add more users, simply copy/repeat this line and renumber them.
Example:
uI[0]=["admin","URL TO IMAGE"]; // Username, URL to Image.
uI[1]=["joe2000","URL TO IMAGE"]; // Username, URL to Image.
uI[2]=["maryjp","URL TO IMAGE"]; // Username, URL to Image.
To temporarily disable any user, just set the user name part to "". Using this method, you don't have to remove the entire line of code and you can reuse it later.
IMPORTANT!
The first line (the one with a "0"), MUST ALWAYS be in the code in order for the code to work!
uI[0]=["USERNAME","URL TO IMAGE"]; // Username, URL to Image.
You can disable it by setting the user name to "", but do NOT delete this line!
NOTE:
If you have a user in the list, and the url does not start with "http://", the global image will be shown instead. If the URL is "bad", even the global image will not show. In this case, correct the URL or disable the user in the list by setting the user name to "".
Another point... You can change the code to use the same image for ALL mini-profiles by setting all the user names in the list to "". Likewise, you may set the Global image to "", to only use a background image for certain users.
Location: Global Footer
Tested in IE, FF, Opera and Safari
Allows you to use a background image for the Mini-Profile for your entire forum.
Allows you to give certain users a different background of your choosing.
Using a global mini-profile image will give your forum a little more "character".
Admins can use the "certain users" background image as a "prize" or a "thank you" or whatever for a "special" member!
Let your staff have their own image too! This sets them apart from the regular members.
Enjoy!!!
SubDevo
Variable Descriptions:
var pImg="URL TO IMAGE"; // URL to Global Image.
Enter the URL to your global mini-profile background image. This image will be used for all mini-profiles except for the members listed in the next variable below.
uI[0]=["USERNAME","URL TO IMAGE"]; // Username, URL to Image.
Enter the user name (NOT display name) in the first part, and the URL to their image in the second part. Any users listed here will overide the global image. To add more users, simply copy/repeat this line and renumber them.
Example:
uI[0]=["admin","URL TO IMAGE"]; // Username, URL to Image.
uI[1]=["joe2000","URL TO IMAGE"]; // Username, URL to Image.
uI[2]=["maryjp","URL TO IMAGE"]; // Username, URL to Image.
To temporarily disable any user, just set the user name part to "". Using this method, you don't have to remove the entire line of code and you can reuse it later.
IMPORTANT!
The first line (the one with a "0"), MUST ALWAYS be in the code in order for the code to work!
uI[0]=["USERNAME","URL TO IMAGE"]; // Username, URL to Image.
You can disable it by setting the user name to "", but do NOT delete this line!
NOTE:
If you have a user in the list, and the url does not start with "http://", the global image will be shown instead. If the URL is "bad", even the global image will not show. In this case, correct the URL or disable the user in the list by setting the user name to "".
Another point... You can change the code to use the same image for ALL mini-profiles by setting all the user names in the list to "". Likewise, you may set the Global image to "", to only use a background image for certain users.
Location: Global Footer
<script type="text/Javascript">
<!--
/* Mini-Profile Background Image Global/Certain Users by SubDevo */
/* Global Footer - Please leave this header intact. Do not repost. */
/* [url]http://interoceandesigns.proboards.com[/url] or [url]http://lsdp.proboards.com[/url] */
var pImg="URL TO IMAGE"; // URL to Global Image.
var uI=[]; // DO NOT TOUCH
uI[0]=["USERNAME","URL TO IMAGE"]; // Username, URL to Image.
var td=document.getElementsByTagName("td"); var rm=/=viewprofile/i;
if(pb_action.match(/(calendar|pm|pre)view|viewprofile|search2|display/i)){
for(var x=0;x<td.length;x++){ var i=0;
if(td[x].width=="20%"&&td[x].innerHTML.match(rm)){ uImg=pImg;
var uN=td[x].getElementsByTagName("a"); while(!uN[i].href.match(rm)&i<uN.length){i++;}
with(uN[i].href){var pUser=slice(lastIndexOf("=")+1);}
if(uI[0][0]){for(var a=0;a<uI.length;a++){
if(pUser==uI[a][0]&&uI[a][1].match(/^http:\/\//i)){uImg=uI[a][1];break;}}}
if(uImg){td[x].style.backgroundImage="url("+uImg+")";}
}}}
// -->
</script>