Jump to content

Community

Aiwa

Steam Profile Integration (3.4.x)

Recommended Posts

Steam Profile Integration (3.4.x)


IPS Community 4.1.x version available here.

This hook will obtain data from Steam for your users and place it in your IP.Board database for use anywhere on your site. Your board will re-load your members Steam information, in batches, every 15 minutes, time can be changed, so you always have up to date information without impacting load times of your community pages.
 
This hook, out of the box, will display steam information in the following places

  • Member Profile
  • userInfoPane (Next to all of their posts)
  • Board Index
  • IP.Content page (IP.Content Block included)
  • Member Hovercards (Steam Online Status only)

More detailed information about the members Steam profile are displayed on the Members Profile page.  Including an optional list of games the member owns.  Out of the box the list of games can be shown in either an image grid layout, or list view.  If you'd like to see other layouts, let me know or tweak the templates to your liking.
 
This hook integrates seamlessly with Lavo's Sign in through Steam.. It will automatically detect if it is installed and pull that users information. 
 
Don't have Lavo's sign in installed? No problem, this hook works with a Custom Profile field also. Want to use both a custom profile field AND Lavo's hook? Not a problem, this hook seamlessly pulls information from both locations to create a single list of users to pull information. 
 

Valid Steam Input format for Custom Profile Field:

  • Steam Name: ex. ' Aiwa '
  • 17 digit Steam ID: ex. 76561197964468370
  • Old school Steam ID: ex. STEAM_0:0:2101321

If there are any other places you'd like to see a users steam information displayed, let me know. It's a very simple matter to output this data on other parts of your IPS Community. 
 
In order for this hook to pull your information, your Steam profile status must be set to Public.  
 
For support, please create an account then submit a ticket.

http://steamcommunity.com/id/Aiwa
http://steamcommunity.com/profiles/76561197964468370

Share this post


Link to post
Share on other sites

Hi, I'm having an issue where this is not working at all. I've followed the instructions to the letter but no joy. Seems strange as I've had other Steam profile integrations working fine but this one doesn't seem to for me, real shame as I like the potential extra features over the others I tried.

Anything I can check or try?

Share this post


Link to post
Share on other sites

Check and make sure the task is running.

ACP . System Scheduler . Members . Steam profiles.

Is the task locked? Did you upload the files included in the download?

Thanks for the swift reply.

I have checked and yes the system task is running and says locked, also I did upload all the files as I usually would.

Share this post


Link to post
Share on other sites

If the task is locked, it failed to run

Make sure the files uploaded and unlock and manually run the task.

Do you get any errors?

Tried to unlock the task and run manually but still no luck. Re-uploaded and re-installed but no go, it seems to be unlocked for a while after installing but then proceeds to lock again after a while

.

I also enabled logging for the task but it doesn't generate any logs or errors.

Share this post


Link to post
Share on other sites

It won't if it's failing. Did you get any errors when manually running the task?

Manually trigger the task and contact your host and request a copy of your php error logs.

Have you renamed your admin directory? Was the task file uploaded to the correct admin directory?

Edited by Aiwa

Share this post


Link to post
Share on other sites

It won't if it's failing. Did you get any errors when manually running the task?

Manually trigger the task and contact your host and request a copy of your php error logs.

Have you renamed your admin directory? Was the task file uploaded to the correct admin directory?

No errors in a Error log or the scheduler logs I'm afraid.

I manually ran the task again and can find no related errors in the logs in my hostgator CP, are there different logs I have to contact them separately for?

Nope, I've not renamed the admin directory. I've checked and it definitely is in the correct directory (same one I always upload apps to)

Many thanks for the support so far, very much appreciated.

Share this post


Link to post
Share on other sites

It wouldn't be in the error logs in your ACP. It would be in the server php error logs. If you have cPanel, it may be in the 'error log' section of your cPanel. If no logs there, contact your host and request them.

Try this first, though, we might be able to get your server to print the error to the screen.

Add this to your initdata.php file just after the <?php (second line of the file) then manually run the task again. Do you get any errors on the screen when the task fails?

ini_set(display_errors,1);

If the task is going (locked) it means it's not completing properly and there has to be an error thrown.

Share this post


Link to post
Share on other sites

It wouldn't be in the error logs in your ACP. It would be in the server php error logs. If you have cPanel, it may be in the 'error log' section of your cPanel. If no logs there, contact your host and request them.

Try this first, though, we might be able to get your server to print the error to the screen.

Add this to your initdata.php file just after the <?php (second line of the file) then manually run the task again. Do you get any errors on the screen when the task fails?

ini_set(display_errors,1);

If the task is going (locked) it means it's not completing properly and there has to be an error thrown.

Ok so the only thing I seem to get now when running the task manually is a "ERROR 500 - INTERNAL SERVER ERROR"

I have spoken to my hosting company and they have found an error which may be of use:

[Mon Dec 09 12:49:06 2013] [error] [client *.*.*.*] Script timed out before returning headers: index.php, referer:

http://www.deadlygaming.com/forum/admin/index.php?adsess=8673655b03b3cabb5fdc4a9c4529183b&app=core&module=system&section=taskmanager&do=task_unlock&task_id=48&tab=members

Share this post


Link to post
Share on other sites

Ask your host (or look at ACP > Support > Diagnostics > Overview > PHPInfo) for max_execution_time in case this is set too low. I cannot remember what the default is as it may depend on your php version certainly no less than 30 seconds though, some hosts have it at 60.

Share this post


Link to post
Share on other sites

Thanks for the reply Andy

max_execution_time has a local value of 0 and a master value of 30, I'm guessing the master value is the one that's significant

Should I change something to increase that value?

Share this post


Link to post
Share on other sites

30 may be enough (just trying to help a bit) if you can get it to 60 that would be a bit better, no higher than that though. If it persists need to await Aiwa to respond to this directly. :)

Share this post


Link to post
Share on other sites

The query to the steam servers does take a long time. About 10 seconds per member being requested.

Unfortunately, there is no way with steam to request data for all members in a single request, it has to be requested one at a time.

Can your host change the timeout and run it again?

Also how many members are you pulling data for?

Sorry for the delayed reply, I've been sick for the past few days.

Edited by Aiwa

Share this post


Link to post
Share on other sites

No worries about the late reply bud, I just appreciate you taking the time to help me get this sorted. Hope you feeling better.

Is there a value I could get them to change it to that would be more suitable? We have 2200+ members on the site but I doubt we have many at all that actually have the steam integration ..... maybe 50-100 at most as it's a fairly recent addition.

Also I was just checking through error logs for SQL in IPB and found an error that references "kc_steam". The error is:

Error: 2006 - MySQL server has gone away

IP Address: *.*.*.* - /forum/index.php?app=core&module=task

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

mySQL query error: INSERT INTO IPB_cache_store (`cs_array`,`cs_key`,`cs_value`,`cs_updated`,`cs_rebuild`) VALUES(1,'kc_steam_profile'

Share this post


Link to post
Share on other sites

That's the same thing basically. It's just your SQL servers way of saying 'something stopped'

Wether it be you lost connection to the server, or your server terminated the process and subsequently killed the SQL process it was using.

Please ask your host to increase your server timeouts.

Share this post


Link to post
Share on other sites

Just installed the plugin for our community as well. Running into time-out issues. Luckily we host ourselves, so I can change some PHP vars around. Would be nice to be able to run the scheduler in batches though. Will probably have ~100 users with steam profiles at first.

Running into 504 Gateway timeouts though. Tried to increase timeout variables, but no avail. Receive timeout error after 60 seconds.

2013/12/14 09:40:46 [error] 24107#0: *10777489 upstream timed out (110: Connection timed out) while reading response header from upstream, client: XX.XX.XX.XX, server: www.joinsg.net, request: "GET /admin/index.php?adsess=4fadf530686c710fb4634ac9b3c16b11&app=core&module=system&section=taskmanager&do=task_run_now&task_id=55&tab=members HTTP/1.1", upstream: "fastcgi://127.0.0.1:9000", host: "www.joinsg.net", referrer: "http://www.joinsg.net/admin/index.php?adsess=4fadf530686c710fb4634ac9b3c16b11&app=core&module=system&section=taskmanager&do=task_unlock&task_id=55&tab=members"

Have set the following nginx variables too:

fastcgi_send_timeout 300
fastcgi_read_timeout 300
client_header_timeout 300
client_body_timeout 300
send_timeout 300

My PHP.ini has max_execution_time set to 300 as well. Still times out after 60 seconds.. Would really love to get this hook working, it looks awesome!

EDIT:

Well stupid me forgot to put ';' characters at the end of the nginx vars. Doesn't time out at 60 seconds anymore. I believe it was the fastcgi_read_timeout var that was causing the issue.

DOUBLE EDIT:

This is taking way too long to run the scheduled task to be useful. It seems like it is running SQL queries for every single user on the forums rather than just pulling those that have a steamid from the Steam Login plugin. Could it just be set up to have a query that first selects members that actually have a steam id (meaning they used steam login to connect to the forums), then do the steam profile data parsing stuff? I would really love to use this feature on our forums, but in its current state it is cannot work.

Share this post


Link to post
Share on other sites

I apologize for any support delays. I've been very sick the past week and am still quite sick.

There is a query that pulls ONLY the members that have signed in through LAVO's plugin, and/or using a custom profile field if found. This query is run once and is not in any loop. The query is not the delay

The delay is due to steam. Steam servers take a very long time to respond to a request, 10-15 seconds in some case, per user. That delay is only seen with the execution of the task, your forum and topic page loads would be unaffected by this delay, hence why it is done this way rather than requesting the data from steam on page load.

I will look at adding batching to this hook.

Share this post


Link to post
Share on other sites

I apologize for any support delays. I've been very sick the past week and am still quite sick.

There is a query that pulls ONLY the members that have signed in through LAVO's plugin, and/or using a custom profile field if found. This query is run once and is not in any loop. The query is not the delay

The delay is due to steam. Steam servers take a very long time to respond to a request, 10-15 seconds in some case, per user. That delay is only seen with the execution of the task, your forum and topic page loads would be unaffected by this delay, hence why it is done this way rather than requesting the data from steam on page load.

I will look at adding batching to this hook.

Ah ok I see! Darn Steam. Thank you for your response, I hope you get feeling better soon!

Share this post


Link to post
Share on other sites

Also, I hope you don't mind, but I just tweaked the MySQL query in the task file to only select for users that have visited the forums in the past 3 days. We have 400+ people with SteamIDs connected to their account and by doing this it limits the update to only ~50-60 a run. Takes around 10-15 minutes each, however. Increased the duration between tasks to 20 minutes.

Share this post


Link to post
Share on other sites

  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...