SubDevo Co-Admin Code Support member is offline
![[avatar] [avatar]](http://i486.photobucket.com/albums/rr230/FridayFiles/598px-Lunar_libration_109.gif)
Creator of LSD...
![[homepage] [homepage]](http://vegasfoxxgfx.com/IOD/GOTS-Images/Misc/MP-ContactIcons/GOTS-Homepage_off.png) Joined: Mar 2009 Gender: Male  Posts: 2,594 Location: MI, USA Karma: 102 |  | Post Background Image Global-Certain Users « Thread Started on Apr 8, 2012, 8:23pm » | |
Post Background Image Global-Certain Users by SubDevo Tested in IE, FF, Opera, Safari and Chrome.
Allows you to use a background image for posts and PMs for your entire forum. Allows you to give certain users a different background of your choosing. Option to not use a global image and only use an image for certain users. Option to use the image for the whole post cell or just the post only.
PREVIEW: You are looking at it! We use this code here at IOD! 
Using a global post 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!
Enjoy!!! SubDevo 
Variable Descriptions:
var gType=0; // 0=Total cell, 1=Post only Change this to 1 to use the image for the actual post only. For example, if a user only posts one line of text, the background image will only appear on that one line. Code default is to use the whole cell.
var gI="URL TO IMAGE"; // URL to Global Image. Enter the URL to your global post background image. This image will be used for all posts 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 Yellow 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 posts 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 FooterCode:<script type="text/javascript"> /* Post Background Image Global-Certain Users by SubDevo */ /* Global Footer - Please leave this header intact. Do not repost. */ /* [url]http://interoceandesigns.com[/url] or [url]http://lsdp.proboards.com[/url] */
var gType=0; // 0=Total cell, 1=Post only var gI="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"),b,i,n,pU,gN,x=-1,nx=/user=(.+?)\"/i; function chBack(a){a.style.backgroundImage="url("+gN+")";} if(/(calendar|pm|pre)view|search2|display/i.test(pb_action)){ while(td[++x]){ b=td[x]; n=b.nextSibling; if(b.width=="20%"&&n&&n.width=="80%"&&nx.test(b.innerHTML)){ b=n.getElementsByTagName("td"); pU=RegExp.$1; gN=(uI[pU])?uI[pU]:gI; if(/^http:/i.test(gN)){ if(gType){ n=n.firstChild.rows[1].cells[0].getElementsByTagName("font")[0]; n.style.display="block"; chBack(n); }else{ chBack(n); i=-1; while(b[++i]){ b[i].style.background="transparent none"; b[i].className="";} }}}}} </script> |
|
|
![[image] [image]](http://i486.photobucket.com/albums/rr230/FridayFiles/siganimation6left_off.gif) ![[image] [image]](http://i486.photobucket.com/albums/rr230/FridayFiles/siganimation6right_off.gif)
![[image] [image]](http://vegasfoxxgfx.com/IOD/GOTS-Images/Sigs/IOD-MB-SubDevo-3.png) Why are you looking at my signature, [ME]? |
|
JJ Senior Member IOD Supporter member is offline
![[avatar] [avatar]](http://i36.photobucket.com/albums/e31/AlsoJJ/Album4/Hootyowl%20Specific/smlgry5237.gif)
![[homepage] [homepage]](http://vegasfoxxgfx.com/IOD/GOTS-Images/Misc/MP-ContactIcons/GOTS-Homepage_off.png) Joined: Jan 2011 Gender: Female  Posts: 934 Location: Kentucky USA Karma: 21 |  | Re: Post Background Image Global-Certain Users « Reply #1 on Apr 9, 2012, 8:01pm » | |
Interesting. I used to use a background for the post area. I was wondering if it is possible to have a line for Window 1 and Window 2? I like to have a demarcation since I think it makes long threads easier to scroll up and down when you are looking for something.
|
|
|
SubDevo Co-Admin Code Support member is offline
![[avatar] [avatar]](http://i486.photobucket.com/albums/rr230/FridayFiles/598px-Lunar_libration_109.gif)
Creator of LSD...
![[homepage] [homepage]](http://vegasfoxxgfx.com/IOD/GOTS-Images/Misc/MP-ContactIcons/GOTS-Homepage_off.png) Joined: Mar 2009 Gender: Male  Posts: 2,594 Location: MI, USA Karma: 102 |  | Re: Post Background Image Global-Certain Users « Reply #2 on Apr 9, 2012, 8:48pm » | |
That would be a nice touch JJ!  So basically the post backgrounds would alternate every other post right? Give this a shot...
var bg1="URL TO IMAGE"; // URL to windowbg1 Image. var bg2="URL TO IMAGE"; // URL to windowbg2 Image. Basically, I replaced the global variable in the other code with two lines now. Should be self explanatory. Using the same URL in both variables would (of course) use the same image for all posts. Any individual users listed will overide these two images.
Code:<script type="text/javascript"> /* Post Background Image Global-Certain Users by SubDevo */ /* Global Footer - Please leave this header intact. Do not repost. */ /* [url]http://interoceandesigns.com[/url] or [url]http://lsdp.proboards.com[/url] */
var gType=0; // 0=Total cell, 1=Post only var bg1="URL TO IMAGE"; // URL to windowbg1 Image. var bg2="URL TO IMAGE"; // URL to windowbg2 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"),b,i,n,pU,gN,x=-1,nx=/user=(.+?)\"/i; function chBack(a){a.style.backgroundImage="url("+gN+")";} if(/(calendar|pm|pre)view|search2|display/i.test(pb_action)){ while(td[++x]){ b=td[x]; n=b.nextSibling; if(b.width=="20%"&&n&&n.width=="80%"&&nx.test(b.innerHTML)){ b=n.getElementsByTagName("td"); pU=RegExp.$1; gN=(uI[pU])?uI[pU]:(/wbg2/i.test(n.className))?bg2:bg1; if(/^http:/i.test(gN)){ if(gType){ n=n.firstChild.rows[1].cells[0].getElementsByTagName("font")[0]; n.style.display="block"; chBack(n); }else{ chBack(n); i=-1; while(b[++i]){ b[i].style.background="transparent none"; b[i].className="";} }}}}} </script> |
|
|
![[image] [image]](http://i486.photobucket.com/albums/rr230/FridayFiles/siganimation6left_off.gif) ![[image] [image]](http://i486.photobucket.com/albums/rr230/FridayFiles/siganimation6right_off.gif)
![[image] [image]](http://vegasfoxxgfx.com/IOD/GOTS-Images/Sigs/IOD-MB-SubDevo-3.png) Why are you looking at my signature, [ME]? |
|
JJ Senior Member IOD Supporter member is offline
![[avatar] [avatar]](http://i36.photobucket.com/albums/e31/AlsoJJ/Album4/Hootyowl%20Specific/smlgry5237.gif)
![[homepage] [homepage]](http://vegasfoxxgfx.com/IOD/GOTS-Images/Misc/MP-ContactIcons/GOTS-Homepage_off.png) Joined: Jan 2011 Gender: Female  Posts: 934 Location: Kentucky USA Karma: 21 |  | Re: Post Background Image Global-Certain Users « Reply #3 on Apr 9, 2012, 9:00pm » | |
Thanks, Sub, that's more my style.
|
|
|
aRMY83 Elite Member IOD Supporter member is offline
![[avatar] [avatar]](http://i1043.photobucket.com/albums/b436/army83_2010/ronsAvatar.jpg)
It's me!
![[homepage] [homepage]](http://vegasfoxxgfx.com/IOD/GOTS-Images/Misc/MP-ContactIcons/GOTS-Homepage_off.png) Joined: Mar 2010 Gender: Male  Posts: 1,083 Location: Just a Stone's Throw Away! Karma: 40 |  | Re: Post Background Image Global-Certain Users « Reply #4 on Apr 20, 2012, 4:09pm » | |
Sub...
Would it be possible to add a var for text color within the textareas while inputing only?
|
|
|
aRMY83 Elite Member IOD Supporter member is offline
![[avatar] [avatar]](http://i1043.photobucket.com/albums/b436/army83_2010/ronsAvatar.jpg)
It's me!
![[homepage] [homepage]](http://vegasfoxxgfx.com/IOD/GOTS-Images/Misc/MP-ContactIcons/GOTS-Homepage_off.png) Joined: Mar 2010 Gender: Male  Posts: 1,083 Location: Just a Stone's Throw Away! Karma: 40 |  | Re: Post Background Image Global-Certain Users « Reply #5 on Apr 22, 2012, 10:23am » | |
Sub...
Once again, should have checked the code index area and I would have found 'Individual Text Area Styles' which does exactly what I wanted and much more.
|
|
|
SubDevo Co-Admin Code Support member is offline
![[avatar] [avatar]](http://i486.photobucket.com/albums/rr230/FridayFiles/598px-Lunar_libration_109.gif)
Creator of LSD...
![[homepage] [homepage]](http://vegasfoxxgfx.com/IOD/GOTS-Images/Misc/MP-ContactIcons/GOTS-Homepage_off.png) Joined: Mar 2009 Gender: Male  Posts: 2,594 Location: MI, USA Karma: 102 |  | Re: Post Background Image Global-Certain Users « Reply #6 on Apr 30, 2012, 1:56pm » | |
Apr 22, 2012, 10:23am, aRMY83 wrote:Sub...
Once again, should have checked the code index area and I would have found 'Individual Text Area Styles' which does exactly what I wanted and much more. |
| Sorry. Was gone a few days... Glad you found the code. Any other questions, just ask!
|
![[image] [image]](http://i486.photobucket.com/albums/rr230/FridayFiles/siganimation6left_off.gif) ![[image] [image]](http://i486.photobucket.com/albums/rr230/FridayFiles/siganimation6right_off.gif)
![[image] [image]](http://vegasfoxxgfx.com/IOD/GOTS-Images/Sigs/IOD-MB-SubDevo-3.png) Why are you looking at my signature, [ME]? |
|
LunyRed Senior Member member is offline
![[avatar] [avatar]](http://i208.photobucket.com/albums/bb261/Sid_Jr0602/Avatars_II/Upset_Kuro_Usagi_100x100.gif)
![[homepage] [homepage]](http://vegasfoxxgfx.com/IOD/GOTS-Images/Misc/MP-ContactIcons/GOTS-Homepage_off.png) Joined: Sept 2009 Gender: Male  Posts: 542 Location: An archipelago in SE Asia Karma: 14 |  | Re: Post Background Image Global-Certain Users « Reply #7 on May 10, 2012, 12:52am » | |
![[image] [image]](http://i925.photobucket.com/albums/ad94/4udonge/main/006.jpg)
Finally! It's about time! Thank you so much for sharing this code, Sub! I have a feeling my members would be very delighted to have this! =D
Better test it in my test forum.
Hmmm... Question. Since the code asks for the member's user name and NOT the display name, does that mean this code wouldn't have any conflicts with other codes involving the member's display names such as "Multi-colored Display Names" or "Replace User Name with Image by SubDevo" codes? I asked this just to play it safe... ^^;
|
![[image] [image]](http://i741.photobucket.com/albums/xx54/44udonge/Mine/GOTS-ProudMember-LunyRed.png) [ME] and I are best buddies~ Unlike me, [ME] is obsessed with Justin Bieber.. o_o' |
|
Pebble Code Helper IOD Supporter member is offline
![[avatar] [avatar]](http://i1136.photobucket.com/albums/n494/pebbleleague/FootballGif.gif)
![[homepage] [homepage]](http://vegasfoxxgfx.com/IOD/GOTS-Images/Misc/MP-ContactIcons/GOTS-Homepage_off.png) Joined: Mar 2011 Gender: Male  Posts: 1,212 Location: Here & There Karma: 157 |  | Re: Post Background Image Global-Certain Users « Reply #8 on May 10, 2012, 12:06pm » | |
No, there shouldn't be any conflicts with those codes. If you have any trouble, let us know, but it should work fine.
|
|
|