Issue when linking user avatar via CSS

AI-generated summary

Issue when linking user avatar via CSS

Thomas_G is experiencing issues linking user profiles from the Infinite Flight community to a website using CSS. The avatar image link is generated using PHP code, but sometimes it works and sometimes it doesn’t.

Canapin pointed out the potential issue is the capitalization of the username in the URL. The correct URL has a lowercase “l” in “legendaryroro88”, whereas the generated URL has a capitalized “L” in “LegendaryRoro88”.

Thomas_G explained that the goal is to track and update user avatars dynamically, but the current code may not work consistently due to this capitalization issue.

Canapin noted that the capitalized link redirects to the non-capitalized one, which adds to the confusion.

Thomas_G stated that the username is automatically added to the query and cannot be changed, making it challenging to resolve the issue.

Hello!

I am trying to link one’s profile from https://community.infiniteflight.com to appear on this website: IFVARB

I am using the following code:

<img src=“https://sea2.discourse-cdn.com/infiniteflight/user_avatar/community.infiniteflight.com/<? echo $z["ifc"]; ?>/120/352328_2.png” alt=“Avatar” style=“width:20px; height:20px; border-radius: 50%; vertical-align: text-bottom;”>

and one day it is working fine, the other day I am getting this:

Does anyone know whether there is a false statement in the code line?

Hi Thomas :slight_smile:

The user’s avatar URL from Discourse is:

https://sea2.discourse-cdn.com/infiniteflight/user_avatar/community.infiniteflight.com/legendaryroro88/120/704016_2.png

The output of your link, including what your PHP code returns, is:

https://sea2.discourse-cdn.com/infiniteflight/user_avatar/community.infiniteflight.com/LegendaryRoro88/120/352328_2.png

Spot the difference and it will help you solve your problem. :jigsaw:

Hello!

Thank you very much for your response.

This is the user’s final ending.png. We want a code that will track everyone’s user avatar and update it on the frontend accordingly. For some weird reason, the code I am using now works fine. Tomorrow though, it might not work. This is where I am a bit confused.

I was pointing at:

legendaryroro88 Vs LegendaryRoro88

Because when, I loaded one URL, I had an error, and the other one worked.

I assumed it was because of the capitalized letters, but now the capitalized letters link redirects to the non-capitalized one :thinking:

The name is something I can not change / edit, since it is automatically added to the query.