Support Forum

Steam Profile in Simple Press Forum?

ST stranded
stranded
Member

Is it possible to integrate this little thing: http://code.google.com/p/steamprofile/ with SPF? I mean something like a badge/custom icon below an avatar would be sweet, I have no idea how to code it to be honest and I would love to see this in SPF. I know that there's a working PHPBB3 plugin like this (user simply edits their profile info with their Steam login or ID and it displays below the avatar if he's online, playing a game etc.)

7 Answers

New Answer

YS Yellow Swordfish
Yellow Swordfish
Member

You could almost certainly use one of the program hooks. See the wiki pugin API section.

ST stranded
stranded
Member

Ok one question though, in which file can I put a javascript (.js) to load with forum only (not the whole site). Where's the forum header?

YS Yellow Swordfish
Yellow Swordfish
Member

have you looked at the program hooks in the wiki (p[lugin API section) ?

ST stranded
stranded
Member

yeah I did.

BUT the script does not load. I pasted the script into several hooks so far, header, profile view, profile post etc.

 

<script type="text/javascript" src="http://steamunpowered.eu/wp-content/plugins/simple-forum/steamprofile/steamprofile.js"></script>

 

somewhere to load only on the forum

 

and then this pasted to function sf_hook_post_profile_custom:

 

<div class="steamprofile" title="steamcommunity"></div> 

 

If I type any random text there it shows up without problems.

MP Mr Papa
Mr Papa
Member

If you use a hook, make sure you return the content and not echo it… and also be sure to account for proper quotation…

why do you think its not loading?  have you viewed the page source?

ST stranded
stranded
Member

It does show up in source code but not on site.

 

here it works ok:

http://steamunpowered.eu/example.html

 

on forums it doesn't but we'll look into it and let you guys know, if we manage to do it we will post a ready-to-use file/files or a guide for everyone else to use

MP Mr Papa
Mr Papa
Member

you might find it easier and more effective to use the wp_head hook to insert in the page header tags so its present at the page loading rather than with the content…  something like

add_filter('wp_head', 'mysteam_header');
function mysteam_header()
{
// load the steam js here
}

I would also recommend using the wp_enqueue_script() function to properly load js for wp…  put that stuff above in your theme functions.php file…  you can of course add additional logic if you only want to do it on forum pages…