Resource icon

Steam Authentication & Integration 1.0.7

No permission to download
I've got a version sitting on my live forum that runs with the json api and uses just 1 extra request per page, but it's got a lot of changes tailored specifically to my board.

I'll see about putting together some kind of patch to this version if I get a chance
Any update on this luke :)
 
I have installed the latest one from page 10, everything was working fine. I even integrated my own steam account. Now my users are reporting that they cant integrate their account and is getting this error:

"A server error occurred. Please try again later."

Any ideas?
 
I like the idea of giving trophies for owning certain games, but is there a functionality of giving trophies for owning multiple games? Selecting multiple games as the criteria just gives a trophy for owning any one of the selected games.

EDIT: I believe the answer lies within these lines here in Criteria.php.
PHP:
            case 'steam_game':
                if(array_key_exists('steam_auth_id', $user) && $user['steam_auth_id'] > 0) {
                    // check if game is in users games table
                    $games = implode(",", $data['games']);
                    $db = XenForo_Application::get('db');
                    $results = $db->fetchAll("SELECT COUNT(*) AS count FROM xf_user_steam_games WHERE user_id = {$user['user_id']} AND game_id IN ($games);");
                    foreach($results as $row) {
                        if($row['count'] > 0) {
                            $returnValue = true;
                        } else {
                            $returnValue = false;
                        }
                        break;
                    }
                }
                break;
I have to change part of this code somehow. I know "if($row['count'] > 0)" means that the function returns true if at least one game in the criteria matches the user's. I don't know enough PHP to count the amount of titles selected in the criteria and check if "$row['count']" equals that. I'm guessing "$data['games']" holds that value.
 
NEW RESOURCE LINK IS HERE:

http://xenforo.com/community/resources/steam-authentication-integration.1336/



------------------

So I think I managed to put a band-aid over some bugs... I looked at this with fresh eyes (sorry that it took so long, ended up moving all the way across the country).

This seemed to fix my cron errors. I can't guarantee that it's bug free, but... yeah. Seems to be working for the moment.

Here's what I did so far:

1) I added some IF statements to Steam.php

PHP:
if (strpos($result,'<!DOCTYPE html>') !== false)
{
    $xml = '';
}
else
{
    $xml = simplexml_load_string($result);
}

This code should figure out if steam passed you a website that was unavailable and completely skip using simplexml_load_string (unless you're using safe_mode and open_basedir isn't set, sorry guys that aren't able to edit their php.ini). This means that some game data for users may not get updated in MySQL, but at least it won't error out. It's the only compromise I can make with the current code to leave the features in play on such short notice.

2) Fixed a bug with commas

It turns out, the other thing steam.php was doing was messing up queries. If a user had a comma in their number of hours played. The SQL query would explode.

So I added this into each game check to sanitize the data.

PHP:
$hours = str_replace(",", "",$hours);
$hoursRecent = str_replace(",", "",$hoursRecent);

I'm currently in the process of also attempting to code some sort user friendly message to tell them that it failed to load from steam instead of "A server error occurred. Please try again later."

I am also looking into fixing the registration problems by using the Steam API (API key will be required). I'll have a fix for this as soon as I can get it working on my site.

Update 12/30/2012: I think I have JSON working properly for registration (woot!). Now to implement an API input box in the admin CP so you guys don't have to hard code your API Key In. This will be unofficial release 1.0.8. If it works, I'd like to see about branching this into a new resource. Next stop will be seeing how to improve the steam badges. I won't make any promises on fixing the steam badges completely as it's a third party tool. Chances are, I have to hunt down a steambadge solution that uses JSON over XML.

Update 12/30/2012 5AM PST: A live version of 1.0.7d is currently running on my website (language warning, sorry). Please try testing it out by attempting to register and attempting to associate and disassociate your account. If things are stable, I'll release the beta build to you guys. 1.0.8 will be rolled out once beta is confirmed working and good.

Update 12/30/2012 7AM PST: One more surprise involving the upcoming build before I get some rest this morning. I've put in another option in the Admin Control Panel. This one lets you decide if you want to grab XML information for games. If it's unchecked, the code will just be skipped and no XML information will be taken and your MySQL database won't be queried. Great for when you want to avoid pounding the steam community servers and don't care about game statistics for your users.
 
I've got a version sitting on my live forum that runs with the json api and uses just 1 extra request per page, but it's got a lot of changes tailored specifically to my board.

I'll see about putting together some kind of patch to this version if I get a chance

As promised, https://github.com/darkimmortal/Steam-Authentication-for-XenForo

It's a massive mess though, I would be amazed if it installs. Note jsonproxy.php needs an api key.

Post directly above mine is what most people will want to use, looks like the better fork :P
 
Hey Luke, I got the aesthetics working in my release and it seems to install easily with no issues. Mind if I integrate some of your changes with the steam profile in my release above yours? Would be great to speed up loading time for the steam profile badges.
 
Hey Luke, I got the aesthetics working in my release and it seems to install easily with no issues. Mind if I integrate some of your changes with the steam profile in my release above yours? Would be great to speed up loading time for the steam profile badges.

Absolutely go for it :)

I was looking for an excuse to release my mess without having to package a proper installer/admin cp stuff, looks like I've found it :p

Also a side note, the steamprofile.js file to use is in the ajax folder
 
That sounds nice!

Request
Steam Profile Badge should be also optionally (new setting in options) viewable in User-Overlay (the default xenforo user overlay is showing, when clicking on a username/avatar in postings of a thread). Cause I don't want to show badge in postings and if a user wants to shortly view if the other user is in steam game/online, he doesn't have to click twice through to the profile, a short overlay-look can give the information too.
 
Installed and working but I see at the moment it is not bringing over any game information. Thanks for getting it this far and maybe it will continue to grow. (y)
 
Hey Straydog,

Make sure the option is checked on in the Steam Integration settings. You can also try manually running the cron. It may time out depending on how many users/games it has to go through, but it's a good way to test. It's scheduled to only run once a day, so you may have to wait that long for it to update.

Tools > Cron Entries > Steam User Polling Controls Drop-down > Run

It looks as though mine grabbed updates. Keep in mind it'll be a hit or miss based on how finicky the steam community is. Unfortunately the new Steam Web API doesn't have features to grab player game statistics, so I don't believe it can be obtained used the API key and through JSON. This is the most "reliable" method that I can see so far.

Also keep in mind, the 1.0.9 discussion is here:

http://xenforo.com/community/threads/steam-authentication-integration.42694/
 
Top Bottom