Post by SubDevo on Sept 3, 2009 23:22:58 GMT -8
Mini-Profile Background Image Global/Certain Users by SubDevo
Tested in IE, FF, Opera, Safari and Chrome.
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["username"]="URL TO IMAGE"; // URL to Image.
Enter the user name (NOT display name) in the first Maroon 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 change the username and URL to the image.
Example:
uI["admin"]="URL TO IMAGE"; // URL to Image.
uI["joe2000"]="URL TO IMAGE"; // URL to Image.
uI["maryjp"]="URL TO IMAGE"; // 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.
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. */
/* interoceandesigns.com or lsdp.proboards.com */
var gImg="URL TO IMAGE"; // URL to Global Image.
var uI=[]; // DO NOT TOUCH
// FORMAT uI["username"]="URL TO IMAGE";
uI["username"]="URL TO IMAGE"; // URL to Image.
var td=document.getElementsByTagName("td"),rm=/user=(.+?)\"/i,a,n,x=0,pU;
if(/(calendar|pm|pre)view|viewprofile|search2|display/i.test(pb_action)){
while(td[++x]){a=td[x-1];
if(td[x].width=="80%"&& a.width=="20%"&&rm.test(a.innerHTML)){
pU=RegExp.$1; n=gImg;
if(uI[pU]&&/^http:/i.test(uI[pU])){n=uI[pU];}
if(n&&/^http:/i.test(n)){a.style.backgroundImage="url("+n+")";}
}}}
</script>
EDIT (6/10/2011):
Slight bug fix and made code smaller and faster.
If you did a forum search and displayed the results as "threads", the last post cell was getting a background image. This is now fixed!
Tested in IE, FF, Opera, Safari and Chrome.
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["username"]="URL TO IMAGE"; // URL to Image.
Enter the user name (NOT display name) in the first Maroon 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 change the username and URL to the image.
Example:
uI["admin"]="URL TO IMAGE"; // URL to Image.
uI["joe2000"]="URL TO IMAGE"; // URL to Image.
uI["maryjp"]="URL TO IMAGE"; // 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.
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. */
/* interoceandesigns.com or lsdp.proboards.com */
var gImg="URL TO IMAGE"; // URL to Global Image.
var uI=[]; // DO NOT TOUCH
// FORMAT uI["username"]="URL TO IMAGE";
uI["username"]="URL TO IMAGE"; // URL to Image.
var td=document.getElementsByTagName("td"),rm=/user=(.+?)\"/i,a,n,x=0,pU;
if(/(calendar|pm|pre)view|viewprofile|search2|display/i.test(pb_action)){
while(td[++x]){a=td[x-1];
if(td[x].width=="80%"&& a.width=="20%"&&rm.test(a.innerHTML)){
pU=RegExp.$1; n=gImg;
if(uI[pU]&&/^http:/i.test(uI[pU])){n=uI[pU];}
if(n&&/^http:/i.test(n)){a.style.backgroundImage="url("+n+")";}
}}}
</script>
EDIT (6/10/2011):
Slight bug fix and made code smaller and faster.
If you did a forum search and displayed the results as "threads", the last post cell was getting a background image. This is now fixed!