Create A Forum - Support Forums

Support => Create a Forum Codes and Support => Topic started by: aIURbliS on October 28, 2012, 09:28:14 pm

Title: [Code] Color Membergroup Posts
Post by: aIURbliS on October 28, 2012, 09:28:14 pm
Description: Colors the membergroups' posts of your choice.


This code utilizes jQuery, please use the latest version found in this thread: http://support.createaforum.com/5/jquery-v1-8-update/ (http://support.createaforum.com/5/jquery-v1-8-update/)
Footers:
Code: [Select]
<script>function xboi209_colormembergroupposts(membergroup,color){$("li.membergroup:contains('"+membergroup+"')").closest("div.post_wrapper").css("background-color",color)}xboi209_colormembergroupposts("MEMBERGROUP","COLOR");</script>


Editing instructions: Look towards end of the code for MEMBERGROUP and COLOR and replace that with the title of the membergroup and the color that you want for its posts. To do this for more membergroups, add xboi209_colormembergroupposts("MEMBERGROUP","COLOR"); before </script>.
Title: Re: [Code] Color Membergroup Posts
Post by: terrel8125 on January 30, 2013, 05:00:23 am
would the color be in color code or just red or wht?
Title: Re: [Code] Color Membergroup Posts
Post by: aIURbliS on January 30, 2013, 08:26:16 pm
You can type in stuff like red or you can use hex codes.
Title: Re: [Code] Color Membergroup Posts
Post by: Thornton136 on January 30, 2013, 09:50:54 pm
Doesn't work
the code I inserted
Code: [Select]
<script>function xboi209_colormembergroupposts(membergroup,color){$("li.membergroup:contains('"+membergroup+"')").closest("div.post_wrapper").css("background-color",color)}xboi209_colormembergroupposts("The Staff","Green");</script>
Title: Re: [Code] Color Membergroup Posts
Post by: aIURbliS on January 30, 2013, 11:25:46 pm
Can you show me a webpage where it isn't working?
Title: Re: [Code] Color Membergroup Posts
Post by: Thornton136 on February 01, 2013, 03:12:29 pm
you can delete this post after, but here is my entire footers.. the headers has the uptodate jquery in it too.

Code: [Select]
<script>function xboi209_colormembergroupposts(membergroup,color){$("li.membergroup:contains('"+membergroup+"')").closest("div.post_wrapper").css("background-color",color)}xboi209_colormembergroupposts("The Staff","Green");</script>
<form action="https://www.paypal.com/cgi-bin/webscr" method="post">
<input type="hidden" name="cmd" value="_s-xclick">
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hkiG9w0BCQEWDXJlQHBheXBhbC5jb20CAQAwCQYFKw4DAhoFAKBdMBgGCSqGSIb3DQEJAzELBgkqhkiG9w0BBwEwHAYJKoZIhvcNAQkFMQ8XDTEwMDgwMzIxMDgxMVowIwYJKoZIhvcNAQkEMRYEFKRiMIv13rm4IzswNVNrj9RV6rd+MA0GCSqGSIb3DQEBAQUABIGACPgl6LNdoThMUg278h7kl+wQdCtA3LflM9haKdmvZf5OlLcIrsM0xBLUAKxn4cLre7gIqnJsZt/1WuwEn4z3VvJnAt+TSkL0SSxwaXNNO9yonM0xLAfj6h03xmIANPpkBjmCMHJoyIsOMRa259W/fyPjYLMXraAPm4E3ZC3uXR4=-----END PKCS7-----
">
<input type="image" src="https://www.paypal.com/en_US/GB/i/btn/btn_donateCC_LG.gif" border="0" name="submit" alt="PayPal - The safer, easier way to pay online.">
<img alt="" border="0" src="https://www.paypal.com/en_GB/i/scr/pixel.gif" width="1" height="1">
</form>

<script type='text/javascript'>
/* Image Changes on Page
SMF For Free 2009 - WWX */
function swap_img(){
var img_b = new Array();
img_b[img_b.length++] = [ "http://images.smfboards.com/ranks/borderchrome/mod.gif" , "http://i725.photobucket.com/albums/ww252/Thornton136/th_Forummod.gif?t=1281282158" ]
img_b[img_b.length++] = [ "http://images.smfboards.com/ranks/3yellow.gif" , "http://i725.photobucket.com/albums/ww252/Thornton136/th_Banneduser.gif?t=1281282158" ]
img_b[img_b.length++] = [ "http://images.smfboards.com/ranks/mxRed/admin.gif" , "http://i725.photobucket.com/albums/ww252/Thornton136/th_Serveradmin.gif?t=1281949528" ]
img_b[img_b.length++] = [ "http://images.smfboards.com/ranks/borderchrome/siteowner.gif" , "http://i725.photobucket.com/albums/ww252/Thornton136/th_Ownerblue.gif?t=1282306522" ]
img_b[img_b.length++] = [ "http://images.smfboards.com/ranks/cf_moderator.jpg" , "http://t3.gstatic.com/images?q=tbn:ANd9GcQLzdAPtBROYjq2zRX7YuklHM-ZhYfQ-7UUMp8XPiszjgJJZbiF" ]
img_b[img_b.length++] = [ "http://images.smfboards.com/ranks/3invert.gif" , "https://elite.callofduty.com/assets/stats/mw3/prestiges/3_image.png" ]
img_b[img_b.length++] = [ "http://images.smfboards.com/ranks/Staff.bmp" , "http://i725.photobucket.com/albums/ww252/Thornton136/th_Thestaffdarkblue.gif?t=1281282158" ]
img_b[img_b.length++] = [ "http://images.smfboards.com/ranks/Staff.bmp" , "http://forums.l33tsig.net/style_images/1/folder_team_icons/beta.png" ]

var a_i = document.getElementsByTagName('IMG');
for(i=a_i.length-1;i>=0;i--) for(j=0;j<img_b.length;j++) if(a_i[i].src == img_b[j][0]) a_i[i].src = img_b[j][1];
}
swap_img();
</script>

<div style="text-align:center;font-size:14px;">Style Created By GamesCo Graphics Team<>

<script type="text/javascript" src="http://smcodes.smfforfree3.com/jquery.js"></script>
<script type="text/javascript">
function GroupImage(Group, Image){
   //Created by Agent Moose
   var PostGroup = document.getElementsByTagName("li");
   for(x=0;x<PostGroup.length;x++){
      if(PostGroup[x].className === "membergroup" && PostGroup[x].innerHTML.toLowerCase() === Group.toLowerCase()){
         $(PostGroup[x]).parent().prev().find("a:last").prepend("<img src='" + Image + "' />");
      };
      if(PostGroup[x].className !== "membergroup" && PostGroup[x].className === "postgroup" && PostGroup[x].innerHTML.toLowerCase() === Group.toLowerCase()){
         $(PostGroup[x]).parent().prev().find("a:last").prepend("<img src='" + Image + "' />");
      };
   };
};
GroupImage("Owners", "http://i137.photobucket.com/albums/q232/LaundryLady1947/Runescape/deleteafteriu0.png");
GroupImage("Forum moderator", "http://runescape.salmoneus.net/assets/images/tips/runescape-moderators/mod_green.gif");
GroupImage("Forum Administrator", "http://i137.photobucket.com/albums/q232/LaundryLady1947/Runescape/11iek2d.png");
GroupImage("Server Moderator", "http://images2.wikia.nocookie.net/__cb20070320171043/runescape/images/archive/9/95/20080724153257!PMod_crown.png");
GroupImage("Server administrator", "http://i137.photobucket.com/albums/q232/LaundryLady1947/Runescape/mod_gold.gif");
GroupImage("Banned User", "http://images1.wikia.nocookie.net/__cb20091218022758/runescape/images/archive/4/4c/20100321144010!Abbys_Skull.png");
GroupImage("Board Moderator", "http://i175.photobucket.com/albums/w132/x_Cody_x/Mod%20Crowns/wmodcrown.gif");
GroupImage("The Staff", "http://grinderscape2.webs.com/Mod_-_crown.gif");
GroupImage("Support Officer", "http://i175.photobucket.com/albums/w132/x_Cody_x/Mod%20Crowns/robinhood.gif");
</script>

<script type="text/javascript">
var Name = "Credits";
var Sign = "";
var Amount = 0.01;

var Aug_02_2010 = document.getElementsByTagName("li");
//Created by Agent Moose
for(x=0;x<Aug_02_2010.length;x++){
   if(Aug_02_2010[x].className === "postcount" && Aug_02_2010[x].innerHTML.match(/posts: (.*)/i)){
      var li = document.createElement("li");
      li.className = "money";
      li.innerHTML = Name + ": " + Sign + (RegExp.$1 * Amount);
      Aug_02_2010[x].parentNode.insertBefore(li, Aug_02_2010[x].nextSibling);
   };
};


(https://support.createaforum.com/proxy.php?request=http%3A%2F%2Fi725.photobucket.com%2Falbums%2Fww252%2FThornton136%2Fnotworking_zps0c6c1518.png&hash=3dc1c1c10ed0d5a890650570404bc21ce4740f37)
Title: Re: [Code] Color Membergroup Posts
Post by: aIURbliS on February 01, 2013, 08:59:07 pm
In the code, you entered The Staff but the actual membergroup name is The staff. The lowercase s is necessary.
Title: Re: [Code] Color Membergroup Posts
Post by: Thornton136 on February 07, 2013, 10:33:08 am
Thanks! it worked, silly me.
Title: Re: [Code] Color Membergroup Posts
Post by: scottballa07 on March 13, 2013, 09:12:09 pm
can i change this code at all so it can be "colormembergroupname"


?
Title: Re: [Code] Color Membergroup Posts
Post by: aIURbliS on March 13, 2013, 10:51:19 pm
If you have the knowledge, then you can go ahead and change the code to whatever you want.