Thread: Steam Avatar
View Single Post
  #1  
Old 08-09-2010, 05:19 AM
Deep-X Deep-X is offline
 
Join Date: Mar 2006
Location: Southern New Jersey
Posts: 18
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default Steam Avatar

I dont know much of php / xml

But after reviewing some forums that I see that private users are able to "get" information from Steam/Valve, communities / profiles.

This is the function that I have so far

"field7" is actually the Steam Profile link such as

http://www.noobsticks.com/home.php?pageid=lookup



Code:
<!-- Steam Avatar hack -->
<if condition="$post['field7']">
<a href=http://steamcommunity.com/profiles/$post[field7]>
<img src="$post['field7']_medium.jpg" align="center" width="254" height="48" scrolling="no" marginheight="0" marginwidth="0" frameborder="0"></a>
</if>
<!-- Steam Avatar hack -->
This is my Steam profile

http://steamcommunity.com/profiles/$post['field7']/?xml=1

http://steamcommunity.com/profiles/7...4246361/?xml=1

http://media.steampowered.com/steamc...d0b_medium.jpg

How do I get this link which is the <avatarMedium><![CDATA[http://media.steampowered.com/steamcommunity/public/images/avatars/f2/f2a6ad2b7f7c7feb43e237b66e6838034640ad0b_medium.jp g]]></avatarMedium>

Sounds all confusing to myself.

Here is a external link for help this would be a great mod for many of our communities are based off of Steam.

--------------- Added [DATE]1281344926[/DATE] at [TIME]1281344926[/TIME] ---------------

actually found some code that works with this

Code:
 if (($p1=strpos($data,'<div class="avatarFull">'))!==false){
                $p1=strpos($data,'<',$p1+24);
                $p2=strpos($data,'>',$p1+1);
                $tmp=substr($data,$p1,$p2-$p1+1);
                $link_full=get_link_src($tmp);
                download($link_full,'/folder/where/avatars/should/be/stored/prefix_full'.$ret['uid'].'.jpg');
                $ret['img_full']=$tmp;
                
                $tmp=str_replace('_full','',$tmp);
                $link_small=get_link_src($tmp);
                download($link_small,'/folder/where/avatars/should/be/stored/prefix_small'.$ret['uid'].'.jpg');
                $ret['img_small']=$tmp;
            }

function get_link_src($data){
    $p1=strpos($data,chr(34));
    $p2=strpos($data,chr(34),$p1+1);
    return substr($data,$p1+1,$p2-$p1-1);
}
 
function download ($url,$target){    
    $data=file_get_contents($url);
    if ($data) {
        file_put_contents($target,$data);    
    }
}
Reply With Quote
 
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01328 seconds
  • Memory Usage 1,770KB
  • Queries Executed 11 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD_SHOWPOST
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (2)bbcode_code
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_box
  • (1)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (1)post_thanks_postbit_info
  • (1)postbit
  • (1)postbit_onlinestatus
  • (1)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • reputationlevel
  • showthread
Included Files:
  • ./showpost.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_postinfo_query
  • fetch_postinfo
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • showpost_start
  • bbcode_fetch_tags
  • bbcode_create
  • postbit_factory
  • showpost_post
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • showpost_complete