Create A Forum - Support Forums
Support => Create a Forum Codes and Support => Topic started by: Agent Moose on August 06, 2010, 03:41:31 am
-
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:
<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>
Original Request: http://support.createaforum.com/create-a-forum-codes-and-support/runescape-crown-request/ (http://support.createaforum.com/create-a-forum-codes-and-support/runescape-crown-request/)
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)
Enjoy :)
EDIT:
Due to popular demand, I created a code that will add the crown (and whatever else you would like) to your username across the board!
http://support.createaforum.com/5/%28code%29-name-across-board/msg14864/#msg14864
-
Very nice. I think that this is gonna come in handy. Thanks again, Moose. (:
-
What do you add in header?
-
Nope, add it to the footers :)
-
He's asking what he should add to the headers. It might be nothing, but we don't know...
-
What kind of Image can I use? A crown right?
-
Yes, or any image that you feel would fit nicely. :) You can always experiment until you find something to your liking.
-
Do you need to use the BBC image code inside the code??
-
No, simply replace "IMAGE" with the URL of the image you want to use.
-
Not working for me. :|
-
Make sure "Hide post group titles for grouped members" is set to on like Agent Moose mentioned.
Post the code you're using please. :)
-
Not working for me. :|
I think my mind reading ability is slowly fading... so you're gonna have to help me out by giving me a LITTLE more info ;) lol
1. Board URL
2. The code you tried.
Then we can help you :)
-
ruckascape.createaforum.com
<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("Owner", "http://i766.photobucket.com/albums/xx305/Lion2126/OWNER1.gif");
GroupImage("In-Game Admin", "http://i734.photobucket.com/albums/ww344/Iomsscape/Mega%20Forum%20Images/admincrown-1.jpg");
GroupImage("Forum Admin", "http://i734.photobucket.com/albums/ww344/Iomsscape/Mega%20Forum%20Images/admincrown-1.jpg");
GroupImage("In-Game Mod", "http://i8.photobucket.com/albums/a38/StSquiggy/Runescape/ModCrown.png");
GroupImage("Forum Mod", "http://i756.photobucket.com/albums/xx204/shad0w_bucket/forumsstaffcrown.jpg");
</script>
-
I went to your forum and I can see the images.
Is it just for one group that it's not working? Or for all of them?
-
I tested the following code on my forums and it worked like a charm ;)
<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("Owner", "http://i766.photobucket.com/albums/xx305/Lion2126/OWNER1.gif");
GroupImage("In-Game Admin", "http://i734.photobucket.com/albums/ww344/Iomsscape/Mega%20Forum%20Images/admincrown-1.jpg");
GroupImage("Forum Admin", "http://i734.photobucket.com/albums/ww344/Iomsscape/Mega%20Forum%20Images/admincrown-1.jpg");
GroupImage("In-Game Mod", "http://i8.photobucket.com/albums/a38/StSquiggy/Runescape/ModCrown.png");
GroupImage("Forum Mod", "http://i756.photobucket.com/albums/xx204/shad0w_bucket/forumsstaffcrown.jpg");
</script>
On your forum, I only see the image for Kane - since his membergroup is "Owner".
Make sure the "GROUP" MATCHES the membergroup name (Admin>Members>Membergroups).
-
Ok, it should only work for Kane. I guess I just didn't let the page load completely... He thinks I should be a "hidden" staff member... NOTE: this code only applies for your primary membergroup..
-
From what I see, he only has it for the admins and mods, so it would only show for the primary group, since those are primary groups.
-
Yeah... Good thing it doesn't apply for hidden staff or it wouldn'tbe very hidden..
-
The forums has a member legend built in that i enable it. i like it.
thanks for this tho mate.
-
thanks moose.
:)
-
Please where can i put this code in my forum help me.
-
Please follow the directions in the first post of this topic. The code goes in the footers section of the forum. ;)
-
im trying to do this but it isnt working..
using his code:
and yes i followed all the directions.
<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("Owner", "http://i766.photobucket.com/albums/xx305/Lion2126/OWNER1.gif");
</script>
can someone make a code for just single users and not groups?
thanks
-
It does work, you just gotta read the note:
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)
As for editing the code, I do not have permission to do that.
-
it's really hard to put codes if you are not that knowledgeable in formating codes but this codes are just to easy to put just to copy and paste will do.
-
I need A code but I cant get can someone make it for me, GROUP"Administrator" IMAGE" http://i277.photobucket.com/albums/kk51/jssmiles/10qhzb8.png"
http://ascendancyx.createaforum.com/index.php-FORUMS
-
The code is already in the first post with clear instructions.
-
Everytime I try it's doesn't ork, please bro.
-
1) Post the code that you tried to use.
2) Did you read the note in the first post?
3) What web browser and its version are you using?
-
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js (https://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.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.className === "membergroup" && PostGroup.innerHTML.toLowerCase() === Group.toLowerCase()){ $(PostGroup).parent().prev().find("a:last").prepend("<img src='" + Image + "' />"); }; if(PostGroup.className !== "membergroup" && PostGroup.className === "postgroup" && PostGroup.innerHTML.toLowerCase() === Group.toLowerCase()){ $(PostGroup).parent().prev().find("a:last").prepend("<img src='" + Image + "' />"); }; }; }; GroupImage("Administrator", " http://i277.photobucket.com/albums/kk51/jssmiles/10qhzb8.png (http://i277.photobucket.com/albums/kk51/jssmiles/10qhzb8.png) "); </script>
Yes, I did.
And the one before 2.0, ivthink idk.
-
When I compared the code you used with the original code, I noticed that you were missing a couple of things in there which would cause it to not work. Did you use any sort of compression tool on this code or something? I don't have any other explanation on how you missed some parts of the code unless you didn't copy and paste it.
Use this code instead:
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.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("Administrator", "http://i277.photobucket.com/albums/kk51/jssmiles/10qhzb8.png");
</script>
What exactly do you mean by "the one before 2.0"?
-
That code didnt work...so im guessing we have a dif version?
-
We never updated our forums so its the reg one, request another code.
-
I've just checked your forum right now and it DOES work. The problem is that you need to update your web browser to latest version available or get a new one.
Chrome: http://www.google.com/intl/en/chrome/
Firefox: http://www.mozilla.org/en-US/firefox/new/
IE9(Windows Vista/7 only): http://windows.microsoft.com/en-US/internet-explorer/downloads/ie-9/worldwide-languages
-
It matter?
-
Yes it actually does
-
So once i dl that firefox is should work ?
-
Yes, any of the 3 I listed above will work.
-
Once i dled do i go on that browser of firefox and re enter code?
-
You don't have to re-enter the code again, you will see the code work because the image will appear next to your name.
-
Thanks it worked.
-
How do i change the colour of name? I change the color in memeber group thinkingit would change it but it didnt
-
There isn't an option or a code for that yet.
-
How do I do this?
-
Instructions are already in the original post, if you be more specific then I can help you
-
Well.... let's see.... there aren't any instructions.
-
The whole post is the instructions with the exception of the original request link and the original poster saying enjoy with a emoticon....
-
^^; Okay, so everything worked up until I tried to add the last one.
On the last one, there wasn't anymore starfile ones. So I tried to do multiple other ones, but it just wouldn't work. :/ Is there any way to still do the last one? Or, for lack of a better phrase, am I just S.O.L? XD
Nevermind! (: I found a file that worked. <3
-
I know this is basically gravedigging but I really need help with this. I added the code
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.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("Administrator", "http://i277.photobucket.com/albums/kk51/jssmiles/10qhzb8.png");
</script>
to my footers and it didn't work. My web browser is updated too. My forum is http://divinpk.createaforum.com (http://divinpk.createaforum.com)
-
Did you read the note?
-
Yeah
-
I will take a look at this later
-
Actually, I just realized the crown only shows when you post. I want the crown to be next to your name in Online Users, Recent Topics, everywhere.
-
Ugh, this code wasn't designed for that
-
Ugh, this code wasn't designed for that
Do you have a code designed for that?
-
no
-
Hey can someone make it like that we can change color of nickname too?
And that the crown shows in online list too?
Like the code on smfforfree.com.
http://www.smfsupport.com/support/smf-for-free-codes-and-support/(code)-membergroup-color/ (http://www.smfsupport.com/support/smf-for-free-codes-and-support/(code)-membergroup-color/)
-
Edited original post, now points to another topic for the latest version of jQuery.
-
Is there a way I can alter it so it displays the image on the online list?
-
Cool, added the code, only to pick what pic to add. Maybe a crown or something. Any suggestions?
-
Tony, ipvpforum and CyanProductions, your request has been filled! :D I'm surprised I never made a code like taht for this forum.
http://support.createaforum.com/5/%28code%29-name-across-board/msg14864/#msg14864