News:

Wondering if this will always be free?  See why free is better.

Main Menu

Where do I place this?

Started by Lay, January 04, 2012, 12:10:12 PM

Previous topic - Next topic

Lay

<script src="/jquery.js"></script>


<script type="text/javascript">
function GroupImage(Name,Image){
//Created by Agent Moose (revolutionx.smfforfree3.com)
var DiV1 = document.getElementsByTagName("DiV");
var DiV2 = DiV1.length;
while(DiV2--){
if(DiV1[DiV2].innerHTML.indexOf(Name) != -1 && DiV1[DiV2].previousSibling.innerHTML){
DiV1[DiV2].previousSibling.firstChild.innerHTML = "<img src='" + Image + "' />" + DiV1[DiV2].previousSibling.firstChild.innerHTML;
}else if(DiV1[DiV2].innerHTML.indexOf(Name) != -1 && DiV1[DiV2].previousSibling.previousSibling.innerHTML){
DiV1[DiV2].previousSibling.previousSibling.firstChild.innerHTML = "<img src='" + Image + "' />" + DiV1[DiV2].previousSibling.previousSibling.firstChild.innerHTML;
};
};
};
GroupImage("GROUP NAME","IMAGE URL");
</script>


where would I place that?
Im trying to add crowns besides name btu the OP said in header and footer but idk where xD

mashby

A few things of note. The code below was posted on a free SMF forum service (using 1.1.16) where users don't have full control over site files. It's certainly a creative solution in those conditions. Do you have full control over your site files? I'm also wondering what this really does. In any case, the place to put this code would be in Themes/default/Display.template.php, and I'd recommend just adding this:

<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js" type="text/javascript"></script>
<script type="text/javascript">
function GroupImage(Name,Image){
//Created by Agent Moose (revolutionx.smfforfree3.com)
var DiV1 = document.getElementsByTagName("DiV");
var DiV2 = DiV1.length;
while(DiV2--){
if(DiV1[DiV2].innerHTML.indexOf(Name) != -1 && DiV1[DiV2].previousSibling.innerHTML){
DiV1[DiV2].previousSibling.firstChild.innerHTML = "<img src='" + Image + "' />" + DiV1[DiV2].previousSibling.firstChild.innerHTML;
}else if(DiV1[DiV2].innerHTML.indexOf(Name) != -1 && DiV1[DiV2].previousSibling.previousSibling.innerHTML){
DiV1[DiV2].previousSibling.previousSibling.firstChild.innerHTML = "<img src='" + Image + "' />" + DiV1[DiV2].previousSibling.previousSibling.firstChild.innerHTML;
};
};
};
GroupImage("GROUP NAME","IMAGE URL");
</script>
And obviously change GROUP NAME and IMAGE URL accordingly. You can put it before this snippet (near the top of the file):
// Let them know, if their report was a success!
I'm still curious as to what this thing is doing though. I have a feeling it won't even work in 2.x. I'd be wary of trying myself.
Always be a little kinder than necessary.
- James M. Barrie

Lay

This will add a crown next to a users name

Thank you so much ima try it now

Lay



mashby

There ya go...a mod is so much nicer a way to achieve it. :)
Always be a little kinder than necessary.
- James M. Barrie

Lay

Nope tried 4 mods none of them works :(
well when i upload a mod it will say Unable to connect to site ect :(

Illori

where are you uploading the mod? it should not come back with that message.

Advertisement: