Getting profile image

32 views
Skip to first unread message

Millennial Memelord

unread,
Apr 28, 2016, 1:22:13 AM4/28/16
to Steam Condenser
Having some trouble obtaining the profile picture of someone who connects to a server. I'm using this for a gmod loadingurl. I don't know php very well, and there's some stuff I've removed, but you get the gist - it should retrieve and display the user's profile image 30x30px and nick.

<h4> <img border="0" src="<?php $steamUser->getFullAvatarUrl(); ?>" width="30" height="30"/> <?php echo "  " . $nickname; ?> </h4>

I'm not sure what exactly is wrong, the getFullAvatarUrl seems to obtain the correct address, but it doesn't load. If I echo the url it gives me a working image url, 
If I replace the php with this address, the image does load!

I need some guidance, maybe I'm terrible with php, but I don't have a clue why it won't load... if you know what I'm doing wrong it would be a great help for you to tell me, thanks.

Sebastian Staudt

unread,
Apr 28, 2016, 1:33:26 AM4/28/16
to steam-c...@googlegroups.com
Looks like you’re simply missing an `echo`:

    <h4> <img border="0" src="<?php echo $steamUser->getFullAvatarUrl(); ?>" width="30" height="30"/> <?php echo " " . $nickname; ?> </h4>

or shorter:

    <h4> <img border="0" src="<?= $steamUser->getFullAvatarUrl(); ?>" width="30" height="30"/> <?= " " . $nickname; ?> </h4>

--
You received this message because you are subscribed to the Google Groups "Steam Condenser" group.
To unsubscribe from this group and stop receiving emails from it, send an email to steam-condens...@googlegroups.com.
To post to this group, send email to steam-c...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/steam-condenser/36ea3a09-48d7-4b6f-8e3b-9a4776495867%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply all
Reply to author
Forward
0 new messages