100% of the credit for making this code goes to Agent Moose
<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("GROUP", "IMAGE");
</script>
GROUP = The Group for which the selected image will show next to their names in posts.
IMAGE = the Image for the group you have selected.
To Add more images for certain membergroups, add more of these lines:
GroupImage("GROUP", "IMAGE");
NOTE:
The only way this code will work is if you remove "Post Group" title for Admins/Mods:
Admin-> Layout Settings-> Theme Settings-> Turn "Hide post group titles for grouped members" to on. (section two-subsection four-option six)
100% of the credit to making this code goes to Agent Moose