Skyrider
02-19-2016, 08:42 AM
Oke, so.. I am using the steam plugin, with the following targeting postbit_display_start:
global $vbulletin;
include_once(DIR . '/includes/functions_steamconnect.php');
if (THIS_SCRIPT == 'private') {
global $pm;
$stc_user_info = fetch_userinfo($pm['fromuserid']);
$steam_info = fetch_steam_info(get_user_steamid($stc_user_info), $vbulletin->options['stc_apikey']);
if (!empty($steam_info)) {
$this->post['steamavatarfull'] = $steam_info['avatarfull'];
$this->post['steamavatar'] = $steam_info['avatar'];
$this->post['steamavatarmedium'] = $steam_info['avatarmedium'];
}
} else {
$stc_user_info = fetch_userinfo($post['userid']);
$steam_info = fetch_steam_info(get_user_steamid($stc_user_info), $vbulletin->options['stc_apikey']);
if (!empty($steam_info)) {
$this->post['steamavatarfull'] = $steam_info['avatarfull'];
$this->post['steamavatar'] = $steam_info['avatar'];
$this->post['steamavatarmedium'] = $steam_info['avatarmedium'];
}
}
At the end, I added:
var_dump($steam_info['avatarfull']);
Results in a thread were:
string(123) "https://steamcdn-a.akamaihd.net/steamcommunity/public/images/avatars/7e/7e35511d79a0734bc975ddefbf84f76fe05a8800_medium.jp g" string(123) "https://steamcdn-a.akamaihd.net/steamcommunity/public/images/avatars/64/64a693386d3647d74f48f6da659e19ffdefc9f71_medium.jp g" string(123) "https://steamcdn-a.akamaihd.net/steamcommunity/public/images/avatars/e2/e22f276e1de68aeaff357d1a40792e1aaefa350c_medium.jp g" string(123) "https://steamcdn-a.akamaihd.net/steamcommunity/public/images/avatars/e9/e9d4b42fd3734cb71fb2475019d6e8fafb5a78a4_medium.jp g" string(123) "https://steamcdn-a.akamaihd.net/steamcommunity/public/images/avatars/a8/a8387bdd76aa295bb3056c9f902ab5c07ecac138_medium.jp g" string(123) "https://steamcdn-a.akamaihd.net/steamcommunity/public/images/avatars/ea/eaf8dd354ce9418ec1da2488715110158f395209_medium.jp g" string(123) "https://steamcdn-a.akamaihd.net/steamcommunity/public/images/avatars/ea/eaf8dd354ce9418ec1da2488715110158f395209_medium.jp g" string(123) "https://steamcdn-a.akamaihd.net/steamcommunity/public/images/avatars/e0/e00ec9e849be38667112ecd5f0d524077e08dd48_medium.jp g" string(123) "https://steamcdn-a.akamaihd.net/steamcommunity/public/images/avatars/1c/1c5e36c2e186e3b726748a9c17dbf57cea502663_medium.jp g"
Yay, it works! It shows all the steam images of the users who have posted in the thread. Now.. for some reason, when I use the following template code in postbit_legacy:
<vb:if condition="$show['avatar']">
<a class="postuseravatar" href="{vb:link member, {vb:raw post}}">
<vb:if condition="$post.avatarurl">
<img src="/{vb:raw post.avatarurl}" alt="{vb:rawphrase xs_avatar, {vb:raw post.username}}" />
</vb:if>
</a>
<vb:elseif condition="is_member_of($bbuserinfo, 13)" />
<img class="postuseravatar" src="{vb:raw steam_info.avatarfull}" alt="{vb:rawphrase xs_avatar, {vb:raw post.username}}" />
<vb:else />
<img class="postuseravatar" src="/{vb:stylevar imgdir_misc}/avatar.png" alt="{vb:rawphrase xs_avatar, {vb:raw post.username}}" />
</vb:if>
The avatar url is not being implemented.. While the var_dump worked just fine. (see bold code above that I added) I cannot figure out why. I've been trying to figure out for quite some time why it doesn't work, already tried adding a src with the img target being {vb:raw steam_info.avatarfull} outside the avatar area.. still not working. Any idea anyone?
global $vbulletin;
include_once(DIR . '/includes/functions_steamconnect.php');
if (THIS_SCRIPT == 'private') {
global $pm;
$stc_user_info = fetch_userinfo($pm['fromuserid']);
$steam_info = fetch_steam_info(get_user_steamid($stc_user_info), $vbulletin->options['stc_apikey']);
if (!empty($steam_info)) {
$this->post['steamavatarfull'] = $steam_info['avatarfull'];
$this->post['steamavatar'] = $steam_info['avatar'];
$this->post['steamavatarmedium'] = $steam_info['avatarmedium'];
}
} else {
$stc_user_info = fetch_userinfo($post['userid']);
$steam_info = fetch_steam_info(get_user_steamid($stc_user_info), $vbulletin->options['stc_apikey']);
if (!empty($steam_info)) {
$this->post['steamavatarfull'] = $steam_info['avatarfull'];
$this->post['steamavatar'] = $steam_info['avatar'];
$this->post['steamavatarmedium'] = $steam_info['avatarmedium'];
}
}
At the end, I added:
var_dump($steam_info['avatarfull']);
Results in a thread were:
string(123) "https://steamcdn-a.akamaihd.net/steamcommunity/public/images/avatars/7e/7e35511d79a0734bc975ddefbf84f76fe05a8800_medium.jp g" string(123) "https://steamcdn-a.akamaihd.net/steamcommunity/public/images/avatars/64/64a693386d3647d74f48f6da659e19ffdefc9f71_medium.jp g" string(123) "https://steamcdn-a.akamaihd.net/steamcommunity/public/images/avatars/e2/e22f276e1de68aeaff357d1a40792e1aaefa350c_medium.jp g" string(123) "https://steamcdn-a.akamaihd.net/steamcommunity/public/images/avatars/e9/e9d4b42fd3734cb71fb2475019d6e8fafb5a78a4_medium.jp g" string(123) "https://steamcdn-a.akamaihd.net/steamcommunity/public/images/avatars/a8/a8387bdd76aa295bb3056c9f902ab5c07ecac138_medium.jp g" string(123) "https://steamcdn-a.akamaihd.net/steamcommunity/public/images/avatars/ea/eaf8dd354ce9418ec1da2488715110158f395209_medium.jp g" string(123) "https://steamcdn-a.akamaihd.net/steamcommunity/public/images/avatars/ea/eaf8dd354ce9418ec1da2488715110158f395209_medium.jp g" string(123) "https://steamcdn-a.akamaihd.net/steamcommunity/public/images/avatars/e0/e00ec9e849be38667112ecd5f0d524077e08dd48_medium.jp g" string(123) "https://steamcdn-a.akamaihd.net/steamcommunity/public/images/avatars/1c/1c5e36c2e186e3b726748a9c17dbf57cea502663_medium.jp g"
Yay, it works! It shows all the steam images of the users who have posted in the thread. Now.. for some reason, when I use the following template code in postbit_legacy:
<vb:if condition="$show['avatar']">
<a class="postuseravatar" href="{vb:link member, {vb:raw post}}">
<vb:if condition="$post.avatarurl">
<img src="/{vb:raw post.avatarurl}" alt="{vb:rawphrase xs_avatar, {vb:raw post.username}}" />
</vb:if>
</a>
<vb:elseif condition="is_member_of($bbuserinfo, 13)" />
<img class="postuseravatar" src="{vb:raw steam_info.avatarfull}" alt="{vb:rawphrase xs_avatar, {vb:raw post.username}}" />
<vb:else />
<img class="postuseravatar" src="/{vb:stylevar imgdir_misc}/avatar.png" alt="{vb:rawphrase xs_avatar, {vb:raw post.username}}" />
</vb:if>
The avatar url is not being implemented.. While the var_dump worked just fine. (see bold code above that I added) I cannot figure out why. I've been trying to figure out for quite some time why it doesn't work, already tried adding a src with the img target being {vb:raw steam_info.avatarfull} outside the avatar area.. still not working. Any idea anyone?