Author Topic: [Code] Color Membergroup Posts  (Read 1938 times)

0 Members and 0 Guests are viewing this topic.

Offline aIURbliS

  • Hero Member
  • *****
  • Posts: 1215
  • Karma: 45
  • Gender: Male
  • Location: U.S.
    • View Profile
[Code] Color Membergroup Posts
« 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/
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>.
All codes I make are tested on the latest version of Google Chrome and upon request of other browsers.

Share on Facebook Share on Twitter


Offline terrel8125

  • Jr. Member
  • **
  • Posts: 90
  • Karma: 3
    • View Profile
Re: [Code] Color Membergroup Posts
« Reply #1 on: January 30, 2013, 05:00:23 am »
would the color be in color code or just red or wht?

Offline aIURbliS

  • Hero Member
  • *****
  • Posts: 1215
  • Karma: 45
  • Gender: Male
  • Location: U.S.
    • View Profile
Re: [Code] Color Membergroup Posts
« Reply #2 on: January 30, 2013, 08:26:16 pm »
You can type in stuff like red or you can use hex codes.
All codes I make are tested on the latest version of Google Chrome and upon request of other browsers.

Offline Thornton136

  • Newbie
  • *
  • Posts: 32
  • Karma: -2
    • View Profile
Re: [Code] Color Membergroup Posts
« Reply #3 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>
« Last Edit: January 30, 2013, 09:55:31 pm by Thornton136 »

Offline aIURbliS

  • Hero Member
  • *****
  • Posts: 1215
  • Karma: 45
  • Gender: Male
  • Location: U.S.
    • View Profile
Re: [Code] Color Membergroup Posts
« Reply #4 on: January 30, 2013, 11:25:46 pm »
Can you show me a webpage where it isn't working?
« Last Edit: January 30, 2013, 11:29:39 pm by xboi209 »
All codes I make are tested on the latest version of Google Chrome and upon request of other browsers.

Offline Thornton136

  • Newbie
  • *
  • Posts: 32
  • Karma: -2
    • View Profile
Re: [Code] Color Membergroup Posts
« Reply #5 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">
<input type="hidden" name="encrypted" value="-----BEGIN PKCS7-----MIIHPwYJKoZIhvcNAQcEoIIHMDCCBywCAQExggEwMIIBLAIBADCBlDCBjjELMAkGA1UEBhMCVVMxCzAJBgNVBAgTAkNBMRYwFAYDVQQHEw1Nb3VudGFpbiBWaWV3MRQwEgYDVQQKEwtQYXlQYWwgSW5jLjETMBEGA1UECxQKbGl2ZV9jZXJ0czERMA8GA1UEAxQIbGl2ZV9hcGkxHDAaBgkqhkiG9w0BCQEWDXJlQHBheXBhbC5jb20CAQAwDQYJKoZIhvcNAQEBBQAEgYB9fyw0ZWjbRXBUkgNnJ47aHAAmCK3JwAFIMQSwOMGMLD2iN4vMylisUr78E8eOSlhSh22TH6J5PpEd2pbQ2VCARVWKabtR9ZPaoghF5N+ZbHu/e9OP1OEpiPVJ4EqXVfjAe+CyM5sGO8+EdkS0UxAK4b/S6at4O2S5EX0BubSUpTELMAkGBSsOAwIaBQAwgbwGCSqGSIb3DQEHATAUBggqhkiG9w0DBwQIJXQRslmspsaAgZg0doKl8YyyoVF0WyCxf/Q80NAG0xRz90ec/8S2PPmk20Masho1UPS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xETAPBgNVBAMUCGxpdmVfYXBpMRwwGgYJKoZIhvcNAQkBFg1yZUBwYXlwYWwuY29tggEAMAwGA1UdEwQFMAMBAf8wDQYJKoZIhvcNAQEFBQADgYEAgV86VpqAWuXvX6Oro4qJ1tYVIT5DgWpE692Ag422H7yRIr/9j/iKG4Thia/Oflx4TdL+IFJBAyPK9v6zZNZtBgPBynXb048hsP16l2vi0k5Q2JKiPDsEfBhGI+HnxLXEaUWAcVfCsQFvd2A1sxRr67ip5y2wwBelUecP3AjJ+YcxggGaMIIBlgIBATCBlDCBjjELMAkGA1UEBhMCVVMxCzAJBgNVBAgTAkNBMRYwFAYDVQQHEw1Nb3VudGFpbiBWaWV3MRQwEgYDVQQKEwtQYXlQYWwgSW5jLjETMBEGA1UECxQKbGl2ZV9jZXJ0czERMA8GA1UEAxQIbGl2ZV9hcGkxHDAaBgkqhkiG9w0BCQEWDXJlQHBheXBhbC5jb20CAQAwCQYFKw4DAhoFAKBdMBgGCSqGSIb3DQEJAzELBgkqhkiG9w0BBwEwHAYJKoZIhvcNAQkFMQ8XDTEwMDgwMzIxMDgxMVowIwYJKoZIhvcNAQkEMRYEFKRiMIv13rm4IzswNVNrj9RV6rd+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);
   };
};


« Last Edit: February 01, 2013, 03:14:56 pm by Thornton136 »

Offline aIURbliS

  • Hero Member
  • *****
  • Posts: 1215
  • Karma: 45
  • Gender: Male
  • Location: U.S.
    • View Profile
Re: [Code] Color Membergroup Posts
« Reply #6 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.
All codes I make are tested on the latest version of Google Chrome and upon request of other browsers.

Offline Thornton136

  • Newbie
  • *
  • Posts: 32
  • Karma: -2
    • View Profile
Re: [Code] Color Membergroup Posts
« Reply #7 on: February 07, 2013, 10:33:08 am »
Thanks! it worked, silly me.

Offline scottballa07

  • Newbie
  • *
  • Posts: 9
  • Karma: 0
    • View Profile
Re: [Code] Color Membergroup Posts
« Reply #8 on: March 13, 2013, 09:12:09 pm »
can i change this code at all so it can be "colormembergroupname"


?

Offline aIURbliS

  • Hero Member
  • *****
  • Posts: 1215
  • Karma: 45
  • Gender: Male
  • Location: U.S.
    • View Profile
Re: [Code] Color Membergroup Posts
« Reply #9 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.
All codes I make are tested on the latest version of Google Chrome and upon request of other browsers.

 

Related Topics

  Subject / Started by Replies Last post
2 Replies
867 Views
Last post March 19, 2011, 11:55:09 am
by Thornton136
9 Replies
2296 Views
Last post July 08, 2012, 10:09:37 pm
by Thornton136
1 Replies
512 Views
Last post November 04, 2012, 05:08:10 pm
by aIURbliS
4 Replies
622 Views
Last post February 07, 2013, 10:50:02 am
by Nienna
4 Replies
743 Views
Last post March 06, 2013, 08:42:22 pm
by AnonyMister