Advertise Here

Author Topic: [Code] Membergroup Image  (Read 28625 times)

0 Members and 1 Guest are viewing this topic.

Offline Luke133

  • SMF For Free Newbie
  • *
  • Posts: 7
    • View Profile

  • Total Badges: 5
    Badges: (View All)
    Topic Starter Level 1 First Post Second year Anniversary One year Anniversary
Re: [Code] Membergroup Image
« Reply #15 on: July 19, 2009, 11:45:14 am »
Your code doesnt work, I tried this for administrators
Code: [Select]
<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("Administrator","http://i137.photobucket.com/albums/q232/LaundryLady1947/Runescape/admin.gif");

View staff list to see its wrong

To my administrator Dan, Dodian, Connor and doesnt work

My URL http://jirachiwishers.smfforfree.com/index.php

Note the navigation on my portal on the left on my forums sends you to google so use the usual one
</script>
« Last Edit: July 19, 2009, 11:50:46 am by Luke133 »

Offline [FailSafe]

  • SMF For Free Member
  • *
  • Posts: 51
    • View Profile

  • Total Badges: 11
    Badges: (View All)
    Topic Starter Combination Level 2 Level 1 50 Posts
Re: [Code] Membergroup Image
« Reply #16 on: July 19, 2009, 12:19:30 pm »
Sorry, i'm not that familiar with the EzPortal, but i'm assuming the block where the forum link is located is an HTML Block?

If thats the case what cose did you put in for that?

I don't get your administrator problem though. I just went to your site and Dan and Dodian are both in the Staff List.
The Reviewer Journey- Start writing your own entertainment reviews today!

Offline Luke133

  • SMF For Free Newbie
  • *
  • Posts: 7
    • View Profile

  • Total Badges: 5
    Badges: (View All)
    Topic Starter Level 1 First Post Second year Anniversary One year Anniversary
Re: [Code] Membergroup Image
« Reply #17 on: July 19, 2009, 12:51:46 pm »
D
Sorry, i'm not that familiar with the EzPortal, but i'm assuming the block where the forum link is located is an HTML Block?

If thats the case what cose did you put in for that?

I don't get your administrator problem though. I just went to your site and Dan and Dodian are both in the Staff List.

... Maybe you should read, im trying to get the Administrator rank to put the crown next to its name, not the rank

Offline simply sibyl

  • Helpers
  • *
  • Posts: 14347
  • On hiatus
    • View Profile
    • The Tent Dwellers

  • Total Badges: 31
    Badges: (View All)
    Level 6 Poll Voter Webmaster Arcade Highscore Windows User
Re: [Code] Membergroup Image
« Reply #18 on: July 19, 2009, 01:00:26 pm »
I see the crown next to Dan's name in a post on your forum.
Since I cannot see posts from the others I cannot know if its working for them or not.
Staff List page shows only Dan and Dodian as Administrators -  does not show Connor
IF they are set as Administrator as a secondary group and not primary that could be the issue.
It may be putting the crown in only if they are set as Administrator as a Primary Group.

I believe this code does it only in posts.   If you want it thruout the forum use the code for runescape crowns instead.
« Last Edit: July 19, 2009, 01:03:47 pm by simply sibyl »

Offline Tillian

  • SMF For Free Newbie
  • *
  • Posts: 18
    • View Profile

  • Total Badges: 9
    Badges: (View All)
    Topic Starter Combination Level 2 Level 1 10 Posts
Re: [Code] Membergroup Image
« Reply #19 on: September 07, 2009, 03:54:54 pm »
Hello Moose -

Is it possible for a version, so aswell as the image, it'll add color codes?  :coolsmiley:

Offline Kenshin

  • SMF For Free Newbie
  • *
  • Posts: 3
    • View Profile

  • Total Badges: 5
    Badges: (View All)
    Topic Starter Level 1 First Post Second year Anniversary One year Anniversary
Re: [Code] Membergroup Image
« Reply #20 on: October 30, 2009, 03:18:44 pm »
I am going to sound rather stupid, but im more of a gaming programmer. What file, and where abouts would i find the footer? My guess is in my theme file index.template.php, if thats right. Then i dont get where to look. I dont want to place it in the wrong spot and screw up my forums.

Offline simply sibyl

  • Helpers
  • *
  • Posts: 14347
  • On hiatus
    • View Profile
    • The Tent Dwellers

  • Total Badges: 31
    Badges: (View All)
    Level 6 Poll Voter Webmaster Arcade Highscore Windows User
Re: [Code] Membergroup Image
« Reply #21 on: October 30, 2009, 03:21:31 pm »
I am going to sound rather stupid, but im more of a gaming programmer. What file, and where abouts would i find the footer? My guess is in my theme file index.template.php, if thats right. Then i dont get where to look. I dont want to place it in the wrong spot and screw up my forums.

Since you have access to edit your index.template.php file that means you are not using one of our hosted forums. 
We do support here only for SMF for Free hosted forums.
Go to simplemachines.org's community support forum for support.

Offline Kenshin

  • SMF For Free Newbie
  • *
  • Posts: 3
    • View Profile

  • Total Badges: 5
    Badges: (View All)
    Topic Starter Level 1 First Post Second year Anniversary One year Anniversary
Re: [Code] Membergroup Image
« Reply #22 on: October 30, 2009, 03:27:11 pm »
Well if this deals with script editing. How can you get to your files without having your own site for them? I dont get that at all.

Offline simply sibyl

  • Helpers
  • *
  • Posts: 14347
  • On hiatus
    • View Profile
    • The Tent Dwellers

  • Total Badges: 31
    Badges: (View All)
    Level 6 Poll Voter Webmaster Arcade Highscore Windows User
Re: [Code] Membergroup Image
« Reply #23 on: October 30, 2009, 03:29:50 pm »
Well if this deals with script editing. How can you get to your files without having your own site for them? I dont get that at all.

Our host has modified the software so that our forum admins are able to modify the header and footer area via thier Admin Panel.    We cannot help you out with this as you do it much differently.   

You don't need and should not use the codes you find here for doing these things and could risk messing your forum up by using them as they were made to modify our hosted forums as members do not have access to edit those files.   You don't need to use a script to do this,  just css and php knowledge,  but you'll have to ask at simplemachines.org -  I cannot help you with that here.
« Last Edit: October 30, 2009, 03:36:06 pm by simply sibyl »

Offline Simply1Nick

  • SMF For Free Member
  • *
  • Posts: 51
    • View Profile

  • Total Badges: 10
    Badges: (View All)
    Topic Starter Combination Level 2 Level 1 50 Posts
Re: [Code] Membergroup Image
« Reply #24 on: November 01, 2009, 12:21:17 pm »
:s

Doesn't seem to be working for me.Anyone know why?

My code:

Code: [Select]
<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("Administrator","http://i137.photobucket.com/albums/q232/LaundryLady1947/Runescape/admin.gif");


Made by Gir.

Offline simply sibyl

  • Helpers
  • *
  • Posts: 14347
  • On hiatus
    • View Profile
    • The Tent Dwellers

  • Total Badges: 31
    Badges: (View All)
    Level 6 Poll Voter Webmaster Arcade Highscore Windows User
Re: [Code] Membergroup Image
« Reply #25 on: November 01, 2009, 01:12:02 pm »
</script> is missing at the end of the code you posted.
Did you include it when you put it on your forum?

Do you have this in your Header?

Code: [Select]
<script src="/jquery.js"></script>
If you fix those 2 things it'll work.   
It will put the image only in posts so remember that.
« Last Edit: November 01, 2009, 01:45:07 pm by simply sibyl »

Offline Simply1Nick

  • SMF For Free Member
  • *
  • Posts: 51
    • View Profile

  • Total Badges: 10
    Badges: (View All)
    Topic Starter Combination Level 2 Level 1 50 Posts
Re: [Code] Membergroup Image
« Reply #26 on: November 01, 2009, 02:14:31 pm »
omg,I feel like a retard now..

I forgot to copy the </script> part hhahahaha!!  :uglystupid2:

Lol thanks, I love you simply sibyl.  :smitten:


Made by Gir.

Offline simply sibyl

  • Helpers
  • *
  • Posts: 14347
  • On hiatus
    • View Profile
    • The Tent Dwellers

  • Total Badges: 31
    Badges: (View All)
    Level 6 Poll Voter Webmaster Arcade Highscore Windows User
Re: [Code] Membergroup Image
« Reply #27 on: November 01, 2009, 02:16:19 pm »
Please be very careful with scripts.   That could have broken your forum.

Offline Simply1Nick

  • SMF For Free Member
  • *
  • Posts: 51
    • View Profile

  • Total Badges: 10
    Badges: (View All)
    Topic Starter Combination Level 2 Level 1 50 Posts
Re: [Code] Membergroup Image
« Reply #28 on: November 01, 2009, 02:34:38 pm »
Actually,I had copied one above that didn't have the </script> at the end,And i assumed ( wongly ) that it had it,

Ah well. Thank you for your help sibyl.

(\.../)
 (=.=)
(")_(")


Made by Gir.

Offline Eviction of Max

  • SMF For Free Newbie
  • *
  • Posts: 6
    • View Profile

  • Total Badges: 5
    Badges: (View All)
    Topic Starter Level 1 First Post Second year Anniversary One year Anniversary
Re: [Code] Membergroup Image
« Reply #29 on: March 23, 2010, 03:48:29 pm »
I'm sorry for bumping this up, but I think the crowns are very useful and make a forum look proffesional.

1 thing, why isn't my code working?

Take a look;

Code: [Select]
</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("Donator","http://i40.tinypic.com/1qskjs.png");
</script>


And yeah, I do have the thing that goes in the header.

Thanks in advance!

 

Related Topics

  Subject / Started by Replies Last post
2 Replies
1040 Views
Last post August 21, 2007, 02:20:47 pm
by Xarjin
0 Replies
695 Views
Last post July 01, 2008, 04:00:16 pm
by raggi5
2 Replies
885 Views
Last post July 07, 2008, 11:17:17 am
by simply sibyl
2 Replies
1760 Views
Last post November 26, 2008, 03:38:15 pm
by - Lawrence -
1 Replies
2727 Views
Last post February 16, 2013, 07:22:58 pm
by simplyaura