The forum of the forums
Welcome to the Official Support Forum of Forumotion!

To take full advantage of everything offered by our forum, please log in if you are already a member, or join our community if you've not yet.



Create a free forum like this one.

(former) (new problem) Avatar missing in member list (code issue)

View previous topic View next topic Go down

In progress (former) (new problem) Avatar missing in member list (code issue)

Post by Global Federation on Wed 15 Jul - 0:20

[Former issue: Individual Username Colors: Status: solved]

[New Issue: code issue removing avatar from memberlist due to username color code]

[defunct: I was wondering if it was possible to edit individual usernames by coloring them without adding them to a group.

If there's some sort of code or something, please let me know. Smile]




[edit] With the help of some friendly people, I have figured out how to change individual user-name colors but, in applying the respected code to the forum, it has removed the avatar from my memberlist.

This is not particularly urgent as I could easily remove the code but I choose not to as I'm using a test forum.

If any of you know a "fix" for this it would be greatly appreciated. Smile



Last edited by Global Federation on Thu 23 Jul - 0:55; edited 1 time in total

Global Federation
Forumember

Posts : 49
Reputation : 1
Language : English

http://globalfederation.forumotion.com/

Back to top Go down

In progress Re: (former) (new problem) Avatar missing in member list (code issue)

Post by Global Federation on Wed 15 Jul - 0:36

Anyone going to deal with the ad-bot?

Global Federation
Forumember

Posts : 49
Reputation : 1
Language : English

http://globalfederation.forumotion.com/

Back to top Go down

In progress Re: (former) (new problem) Avatar missing in member list (code issue)

Post by Ange Tuteur on Wed 15 Jul - 5:21

Hi @Global Federation,

You can find an answer in this topic, or this one.

If none of those match what you're looking for, just let me know.

@Global Federation wrote:Anyone going to deal with the ad-bot?
When ever a staff member is online they will ban the bots. However, only certain members can moderate a section, so sometimes they need to wait until a member gets on who can move the spam elsewhere. If you feel the need, you can report the post to staff.

Ange Tuteur
Forumaster

Male Posts : 13028
Reputation : 2704
Language : EN10, FR5
Location : Pennsylvania

http://fmdesign.forumotion.com

Back to top Go down

In progress Re: (former) (new problem) Avatar missing in member list (code issue)

Post by Global Federation on Wed 15 Jul - 10:40

Alright, will do! Smile

Code:
$(function() {
var users = {
'u1' : '<span style="color:red">MY</span> <span style="color:blue">NAME</span>',
'u2' : '<span style="color:purple">ANOTHER</span> <span style="color:pink">NAME</span>'
},
a = document.getElementsByTagName('A'), i = 0, j = a.length, k;

for (; i<j; i++) for (k in users) $(a[i]).attr('href') == ('/' + k).toLowerCase() && (a[i].innerHTML = users[k]);
});

I'm wondering however if this could be used to color just one username and if this will affect group coloring in anyway or vice versa.

Global Federation
Forumember

Posts : 49
Reputation : 1
Language : English

http://globalfederation.forumotion.com/

Back to top Go down

In progress Re: (former) (new problem) Avatar missing in member list (code issue)

Post by Ange Tuteur on Thu 16 Jul - 2:55

Yes, it can be used for one name as long as you only include one property in the object. ( e.g. keep u1's line and remove u2's line. )

Code:
$(function() {
  var users = {
    'u1' : '<span style="color:red">MY</span> <span style="color:blue">NAME</span>'
  },
  a = document.getElementsByTagName('A'), i = 0, j = a.length, k;
 
  for (; i<j; i++) for (k in users) $(a[i]).attr('href') == ('/' + k).toLowerCase() && (a[i].innerHTML = users[k]);
});

It will affect group coloring as once the script finds an element that matches the conditions it will overwrite that element's HTML with the HTML you specified. The element in question is a link which matches your user id.

Ange Tuteur
Forumaster

Male Posts : 13028
Reputation : 2704
Language : EN10, FR5
Location : Pennsylvania

http://fmdesign.forumotion.com

Back to top Go down

In progress Re: (former) (new problem) Avatar missing in member list (code issue)

Post by Global Federation on Sun 19 Jul - 22:11

Where would I place it?

And would I have to update this every-time someone changes their username?

Global Federation
Forumember

Posts : 49
Reputation : 1
Language : English

http://globalfederation.forumotion.com/

Back to top Go down

In progress Re: (former) (new problem) Avatar missing in member list (code issue)

Post by Pizza Boi on Sun 19 Jul - 22:40

Hi Very Happy

You would have to place them in Javascript Management < In all pages.

And yes, unfortunately you have to change, else the name appearing won't appear the same to the one they changed it.

Regards,
Pizza Boi

Pizza Boi
Hyperactive

Male Posts : 2016
Reputation : 160
Language : French
Location : Pizza Hut!

http://redlustempire.forumtl.com/

Back to top Go down

In progress Re: (former) (new problem) Avatar missing in member list (code issue)

Post by Global Federation on Mon 20 Jul - 10:33

Thank you guys for all your help, however, I'm having trouble setting it up, could you show me how the fields have to be filled?

[edit] I'm sorry I couldn't thank two people. I was seeing if I could.

Global Federation
Forumember

Posts : 49
Reputation : 1
Language : English

http://globalfederation.forumotion.com/

Back to top Go down

In progress Re: (former) (new problem) Avatar missing in member list (code issue)

Post by Pizza Boi on Mon 20 Jul - 12:03

Hi Very Happy

Something like this: http://prntscr.com/7uwkie

Regards,
Pizza Boi

Pizza Boi
Hyperactive

Male Posts : 2016
Reputation : 160
Language : French
Location : Pizza Hut!

http://redlustempire.forumtl.com/

Back to top Go down

In progress Re: (former) (new problem) Avatar missing in member list (code issue)

Post by Global Federation on Mon 20 Jul - 23:14

Thank you, but I meant the fields within the script. I'm not one for knowledge based on code. xD

Global Federation
Forumember

Posts : 49
Reputation : 1
Language : English

http://globalfederation.forumotion.com/

Back to top Go down

In progress Re: (former) (new problem) Avatar missing in member list (code issue)

Post by Pizza Boi on Tue 21 Jul - 0:01

Hi Very Happy

I marked them in red boxes Smile http://prntscr.com/7v4dmx

You can change the u1 to any username value and the other box with style. See how My has a </span> after? It means that you can start changing the 2nd name when the second <span> starts. As for <span style="color: red;">, you can change red to any hexadecimal value for the colors (You can google the values).

Regards,
Pizza Boi

Pizza Boi
Hyperactive

Male Posts : 2016
Reputation : 160
Language : French
Location : Pizza Hut!

http://redlustempire.forumtl.com/

Back to top Go down

In progress Re: (former) (new problem) Avatar missing in member list (code issue)

Post by Global Federation on Tue 21 Jul - 0:21

Code:
$(function() {
var users = {
'Saleena' : '<span style="color:red">Saleena</span>'
},
a = document.getElementsByTagName('A'), i = 0, j = a.length, k;

for (; i<j; i++) for (k in users) $(a[i]).attr('href') == ('/' + k).toLowerCase() && (a[i].innerHTML = users[k]);
});

Am I doing this right or do I have to have the second span bracket for it to work. I'm trying to influence one username.

Global Federation
Forumember

Posts : 49
Reputation : 1
Language : English

http://globalfederation.forumotion.com/

Back to top Go down

In progress Re: (former) (new problem) Avatar missing in member list (code issue)

Post by Pizza Boi on Tue 21 Jul - 0:29

Hi Very Happy

You have to re-write it as this:

Code:
$(function() {
  var users = {
    '/u# of Saleena' : '<span style="color:red">Saleena</span>'
  },
  a = document.getElementsByTagName('A'), i = 0, j = a.length, k;
 
  for (; i<j; i++) for (k in users) $(a[i]).attr('href') == ('/' + k).toLowerCase() && (a[i].innerHTML = users[k]);
});

As for the one <span> tag, that's okay. Also, see this: /u# of Saleena. You have to change that to Saleena's user #. You can find out by clicking the user's profile and check your address bar for this: http://prntscr.com/7v4k9p

Regards,
Pizza Boi

Pizza Boi
Hyperactive

Male Posts : 2016
Reputation : 160
Language : French
Location : Pizza Hut!

http://redlustempire.forumtl.com/

Back to top Go down

In progress Re: (former) (new problem) Avatar missing in member list (code issue)

Post by Global Federation on Tue 21 Jul - 0:40

Code:
$(function() {
var users = {
'/u6' : '<span style="color:red">Saleena</span>'
},
a = document.getElementsByTagName('A'), i = 0, j = a.length, k;

for (; i<j; i++) for (k in users) $(a[i]).attr('href') == ('/' + k).toLowerCase() && (a[i].innerHTML = users[k]);
});

Okay, do i have to have "u6" like it is? I've tried multiple variations and nothing so far has worked.

Global Federation
Forumember

Posts : 49
Reputation : 1
Language : English

http://globalfederation.forumotion.com/

Back to top Go down

In progress Re: (former) (new problem) Avatar missing in member list (code issue)

Post by Pizza Boi on Tue 21 Jul - 0:53

Hi Very Happy

Oh sorry, remove / from it. My apologies; however it should work now.

Regards,
Pizza Boi

Pizza Boi
Hyperactive

Male Posts : 2016
Reputation : 160
Language : French
Location : Pizza Hut!

http://redlustempire.forumtl.com/

Back to top Go down

In progress Re: (former) (new problem) Avatar missing in member list (code issue)

Post by Global Federation on Tue 21 Jul - 1:01

Thank you so much, it worked, however it removed the avatar from my memberlist.

Global Federation
Forumember

Posts : 49
Reputation : 1
Language : English

http://globalfederation.forumotion.com/

Back to top Go down

In progress Re: (former) (new problem) Avatar missing in member list (code issue)

Post by Pizza Boi on Tue 21 Jul - 1:17

Hi Very Happy

o.O" oh wow... I apologize but I know nothing of that now.

Regards,
Pizza Boi

Pizza Boi
Hyperactive

Male Posts : 2016
Reputation : 160
Language : French
Location : Pizza Hut!

http://redlustempire.forumtl.com/

Back to top Go down

In progress Re: (former) (new problem) Avatar missing in member list (code issue)

Post by Global Federation on Tue 21 Jul - 1:37

Hmm, alright, thanks much! Smile

Hopefully someone will come around who does.

Global Federation
Forumember

Posts : 49
Reputation : 1
Language : English

http://globalfederation.forumotion.com/

Back to top Go down

In progress Re: (former) (new problem) Avatar missing in member list (code issue)

Post by Global Federation on Thu 23 Jul - 0:56

My first post now explains my problem if anyone of you is able to help. Smile

Global Federation
Forumember

Posts : 49
Reputation : 1
Language : English

http://globalfederation.forumotion.com/

Back to top Go down

In progress Re: (former) (new problem) Avatar missing in member list (code issue)

Post by Global Federation on Tue 28 Jul - 10:36

5-day bump.

Global Federation
Forumember

Posts : 49
Reputation : 1
Language : English

http://globalfederation.forumotion.com/

Back to top Go down

In progress Re: (former) (new problem) Avatar missing in member list (code issue)

Post by Global Federation on Tue 4 Aug - 11:54

Bump

Global Federation
Forumember

Posts : 49
Reputation : 1
Language : English

http://globalfederation.forumotion.com/

Back to top Go down

In progress Re: (former) (new problem) Avatar missing in member list (code issue)

Post by Ange Tuteur on Tue 4 Aug - 12:09

Hi @Global Federation,

I apologize for the late reply, but see if this works for you :
Code:
$(function() {
  var users = {
    'u6' : '<span style="color:red">Saleena</span>'
  },
  a = document.getElementsByTagName('A'), i = 0, j = a.length, k, img;
 
  for (; i<j; i++) {
    for (k in users) {
     
      if ($(a[i]).attr('href') == ('/' + k).toLowerCase()) {
        img = null;
       
        if (a[i].getElementsByTagName('IMG')[0]) {
          img = document.createElement('IMG');
          img.src = a[i].getElementsByTagName('IMG')[0].src;
        }
       
        a[i].innerHTML = users[k];
        img && a[i].insertBefore(img, a[i].firstChild);
      }
   
    }
  }
});

Just replace your currently existing script.

Ange Tuteur
Forumaster

Male Posts : 13028
Reputation : 2704
Language : EN10, FR5
Location : Pennsylvania

http://fmdesign.forumotion.com

Back to top Go down

View previous topic View next topic Back to top


 
Permissions in this forum:
You cannot reply to topics in this forum