vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 4.x Add-ons (https://vborg.vbsupport.ru/forumdisplay.php?f=245)
-   -   Integration with vBulletin - Steam Connect - Sign in with your Steam Account! [RC3] (https://vborg.vbsupport.ru/showthread.php?t=266883)

rbrt508 03-27-2017 03:30 PM

Don't know about vb5.. definitely installs and works on vb4.2.4

I had an issue where it eventually after about a month stopped retrieving profile data for no reason at all but still worked, possibly because of a semi-domain change, but otherwise works if your settings are right.

About to give it a go on a reinstall on 4.2.4 after a host change.

Cadellin 03-27-2017 04:56 PM

Running vb4.2.4 I have recently started getting the following error when users try to login
Code:

There has been an error with your request. Please inform the Administrator, if the problem persists..
Nothing unfortunately it in the steam connect logs.

I've tried disabling quick registration but that just changes the error to:

Code:

There is no forum account which is linked to this Steam Account.

FIXED: I will leave this here for anyone having similar issues in the future. The issue for me was the API key. It may be worth resetting the key if you encounter similar issues which do not give error logs.

Cyborg_delta1 06-12-2017 12:51 PM

Any one know how I can get users to link there accounts after they have registered the normal way the steam link button is not showing up?

Kutzooi 09-09-2017 01:58 PM

worked like a charm, deleted 1 user and systemfail in this mod, cant reproduce it, the button just disapeared :(

Cyborg_delta1 02-15-2018 02:34 AM

Hi Guys I have been trying to get the Steam avatar to show up in the post bit but I can not get it to work any one have any ideas?

https://vborg.vbsupport.ru/showpost....8&postcount=18

Skyrider 09-08-2018 06:54 AM

I know this is no longer supported, but has steam changed something that breaks this system for the most part? Getting "FETCH ERROR" whenever I check my steam info through /profile.php?do=steamlink. The only thing that appears to be caching is the steam level (in the tmp files).

Arkool 09-26-2018 12:59 AM

So I tried to use this with Vbulletin 4.2.5, and I am only getting one error that is being logged:

Malformed cachefile: <file>.cache deleted.

I carefully reviewed the code and echoed out portions to see where it goes wrong.

It seems to not like something in the array "$match", and only returns an empty array. This results in the cache file being written with nothing or missing data to be considered malformed.

I figured if Steam did modify the API, some changes will need to be made. I am only a beginner in PHP so it'll be hard, and I have limited time. I'd share this to hopefully turn the bugfixing into a communal effort.

Any help is greatly appreciated, hoping to get this working!

jetkai 11-11-2018 08:34 PM

Match array no longer works as expected on 4.2.5 vb (PHP 7.1) :(
[shame this is no longer supported]

Had to do some modifications to the functions_steamconnect.php file to get Avatar, DisplayName & Community URL to show.

Replace Previous Code in (functions_steamconnect.php):

Code:

$match = array();
        preg_match_all("/\w*(\".+\": .+,?)\n/", $raw_json, $match);

        if (!isset($match[1]) || !is_array($match[1])) {
                DEVDEBUG("stc_profiling[] = Time: ".(microtime(1)-$time).", ret: http404");
                return false;
        }       

        $steam_info = array();
        // We filter just for the fields we actually need.
        $additional_fields2 = explode("\n",$vbulletin->options['stc_additionalfields']);
        $whitelist = array_unique(array_merge(array('steamid', 'communityvisibilitystate', 'personaname', 'profileurl', 'avatar', 'avatarmedium', 'avatarfull'),$additional_fields,$additional_fields2));
        $values = $match[1];
        foreach ($values AS $val) {
                $match = array();
                preg_match("/\"(.+)\": ([^,]*),?/", $val, $match);
                if (is_array($match) && count($match) == 3) {

                        $name = $match[1];
                        $value = trim($match[2]);
                        if (!in_array($name, $whitelist)) continue; // Not a setting we're looking for. skip..

                        // Strip quotes and slashes
                        if ($value{0} == '"' && $value{strlen($value)-1} == '"')
                                $value = stripslashes(substr($value, 1, -1));

                        $steam_info[$name] = $value;
                }
        }


With either options below

Code:

    $steam_info = array();
    $json_decoded = json_decode($raw_json);

    foreach ($json_decoded->response->players as $player) {

        $steam_info['steamid'] = $player->steamid;
        $steam_info['communityvisibilitystate'] = $player->communityvisibilitystate;
        $steam_info['personaname'] = $player->personaname;
        $steam_info['profileurl'] = $player->profileurl;
        $steam_info['avatar'] = $player->avatar;
        $steam_info['avatarfull'] = $player->avatarfull;
        $steam_info['avatarmedium'] = $player->avatarmedium;

    }


or

Code:

        $steam_info = array();
        $json_decoded = json_decode($raw_json);
        $steam_values = array('steamid', 'communityvisibilitystate', 'personaname', 'profileurl', 'avatar', 'avatarmedium', 'avatarfull');

        foreach ($json_decoded->response->players as $player) {

            foreach ($steam_values as $steam_value) {
                $data = $player->$steam_value;

                if($data != null && $player != null)
                    $steam_info[$steam_value] = $data;
            }

        }

No idea if this causes any further security issues, just a quick fix to showing Avatars & URL's. Haven't come across any other issues yet.

hunter1985 11-14-2018 07:38 PM

Quote:

Originally Posted by jetkai (Post 2597336)
Match array no longer works as expected on 4.2.5 vb (PHP 7.1) :(
[shame this is no longer supported]

Had to do some modifications to the functions_steamconnect.php file to get Avatar, DisplayName & Community URL to show.

Replace Previous Code in (functions_steamconnect.php):

Code:

$match = array();
        preg_match_all("/\w*(\".+\": .+,?)\n/", $raw_json, $match);

        if (!isset($match[1]) || !is_array($match[1])) {
                DEVDEBUG("stc_profiling[] = Time: ".(microtime(1)-$time).", ret: http404");
                return false;
        }       

        $steam_info = array();
        // We filter just for the fields we actually need.
        $additional_fields2 = explode("\n",$vbulletin->options['stc_additionalfields']);
        $whitelist = array_unique(array_merge(array('steamid', 'communityvisibilitystate', 'personaname', 'profileurl', 'avatar', 'avatarmedium', 'avatarfull'),$additional_fields,$additional_fields2));
        $values = $match[1];
        foreach ($values AS $val) {
                $match = array();
                preg_match("/\"(.+)\": ([^,]*),?/", $val, $match);
                if (is_array($match) && count($match) == 3) {

                        $name = $match[1];
                        $value = trim($match[2]);
                        if (!in_array($name, $whitelist)) continue; // Not a setting we're looking for. skip..

                        // Strip quotes and slashes
                        if ($value{0} == '"' && $value{strlen($value)-1} == '"')
                                $value = stripslashes(substr($value, 1, -1));

                        $steam_info[$name] = $value;
                }
        }


With either options below

Code:

    $steam_info = array();
    $json_decoded = json_decode($raw_json);

    foreach ($json_decoded->response->players as $player) {

        $steam_info['steamid'] = $player->steamid;
        $steam_info['communityvisibilitystate'] = $player->communityvisibilitystate;
        $steam_info['personaname'] = $player->personaname;
        $steam_info['profileurl'] = $player->profileurl;
        $steam_info['avatar'] = $player->avatar;
        $steam_info['avatarfull'] = $player->avatarfull;
        $steam_info['avatarmedium'] = $player->avatarmedium;

    }


or

Code:

        $steam_info = array();
        $json_decoded = json_decode($raw_json);
        $steam_values = array('steamid', 'communityvisibilitystate', 'personaname', 'profileurl', 'avatar', 'avatarmedium', 'avatarfull');

        foreach ($json_decoded->response->players as $player) {

            foreach ($steam_values as $steam_value) {
                $data = $player->$steam_value;

                if($data != null && $player != null)
                    $steam_info[$steam_value] = $data;
            }

        }

No idea if this causes any further security issues, just a quick fix to showing Avatars & URL's. Haven't come across any other issues yet.

Thanks for your help, that 1st fix worked fine on my side!

KHALIK 01-25-2019 01:45 AM

Quote:

Originally Posted by jetkai (Post 2597336)
Match array no longer works as expected on 4.2.5 vb (PHP 7.1) :(
[shame this is no longer supported]

Had to do some modifications to the functions_steamconnect.php file to get Avatar, DisplayName & Community URL to show.

Replace Previous Code in (functions_steamconnect.php):

Code:

$match = array();
        preg_match_all("/\w*(\".+\": .+,?)\n/", $raw_json, $match);

        if (!isset($match[1]) || !is_array($match[1])) {
                DEVDEBUG("stc_profiling[] = Time: ".(microtime(1)-$time).", ret: http404");
                return false;
        }       

        $steam_info = array();
        // We filter just for the fields we actually need.
        $additional_fields2 = explode("\n",$vbulletin->options['stc_additionalfields']);
        $whitelist = array_unique(array_merge(array('steamid', 'communityvisibilitystate', 'personaname', 'profileurl', 'avatar', 'avatarmedium', 'avatarfull'),$additional_fields,$additional_fields2));
        $values = $match[1];
        foreach ($values AS $val) {
                $match = array();
                preg_match("/\"(.+)\": ([^,]*),?/", $val, $match);
                if (is_array($match) && count($match) == 3) {

                        $name = $match[1];
                        $value = trim($match[2]);
                        if (!in_array($name, $whitelist)) continue; // Not a setting we're looking for. skip..

                        // Strip quotes and slashes
                        if ($value{0} == '"' && $value{strlen($value)-1} == '"')
                                $value = stripslashes(substr($value, 1, -1));

                        $steam_info[$name] = $value;
                }
        }


With either options below

Code:

    $steam_info = array();
    $json_decoded = json_decode($raw_json);

    foreach ($json_decoded->response->players as $player) {

        $steam_info['steamid'] = $player->steamid;
        $steam_info['communityvisibilitystate'] = $player->communityvisibilitystate;
        $steam_info['personaname'] = $player->personaname;
        $steam_info['profileurl'] = $player->profileurl;
        $steam_info['avatar'] = $player->avatar;
        $steam_info['avatarfull'] = $player->avatarfull;
        $steam_info['avatarmedium'] = $player->avatarmedium;

    }


or

Code:

        $steam_info = array();
        $json_decoded = json_decode($raw_json);
        $steam_values = array('steamid', 'communityvisibilitystate', 'personaname', 'profileurl', 'avatar', 'avatarmedium', 'avatarfull');

        foreach ($json_decoded->response->players as $player) {

            foreach ($steam_values as $steam_value) {
                $data = $player->$steam_value;

                if($data != null && $player != null)
                    $steam_info[$steam_value] = $data;
            }

        }

No idea if this causes any further security issues, just a quick fix to showing Avatars & URL's. Haven't come across any other issues yet.

Thank you, it worked for me as well.


All times are GMT. The time now is 06:20 AM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01787 seconds
  • Memory Usage 1,800KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (11)bbcode_code_printable
  • (2)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (2)pagenav_pagelink
  • (2)pagenav_pagelinkrel
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (10)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.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/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete