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)
-   -   vBulletin CMS Widgets - [WIDGET] Steam Group Stats (https://vborg.vbsupport.ru/showthread.php?t=240773)

MadMakz 09-08-2012 11:40 PM

I've updated my custom-code and simplyfied it. Working with 2012/Greenlight update.
https://tracker.madmakz.com/redmine/...Status/sgs.php

to have it working on vBulletin sidebar, change
PHP Code:

echo stgrp_status($gruppe); 

to
PHP Code:

return stgrp_status($gruppe); 


fookaa 09-23-2012 02:40 PM

Thanks

CoZmicShReddeR 09-25-2012 10:04 AM

Quote:

Originally Posted by MadMakz (Post 2363860)
I've updated my custom-code and simplyfied it. Working with 2012/Greenlight update.
http://rcs.madmakz.com/misc-tools/sr...Status/sgs.php

to have it working on vBulletin sidebar, change
PHP Code:

echo stgrp_status($gruppe); 

to
PHP Code:

return stgrp_status($gruppe); 


I am trying to use your code as a widget on front page and all I keep getting is
"Steamcommunity appears to be down."

Any ideas?

MadMakz 09-26-2012 09:47 AM

Either you've tested when steam had its massive maintenaince downtime yesterday or file_get_contents() might not be allowed on your server (allow_fopen_url must be enabled).

if you have php-curl installed you could workaround this by adding the following function
PHP Code:

function file_get_contents_curl($url$agent "My Agent"){
    
$ch curl_init();
    
    
curl_setopt($chCURLOPT_HEADER0);
    
curl_setopt($chCURLOPT_RETURNTRANSFER1); //Set curl to return the data instead of printing it to the browser.
    
curl_setopt($chCURLOPT_USERAGENT$agent);
    
curl_setopt($chCURLOPT_URL$url);
     
    
$data curl_exec($ch);
    
curl_close($ch);
     
    return 
$data;


and replace
PHP Code:

file_get_contents('http://steamcommunity.com/groups/'.$group

with
PHP Code:

file_get_contents_curl('http://steamcommunity.com/groups/'.$group

.
i have not tested this but it should work.

other problem could be that your host can't resolve the steamcommunity domain properly.

MadMakz 09-26-2012 12:33 PM

addition: simply changeing file_get_contents won't do it so here's a cURL version of the whole script:
https://tracker.madmakz.com/redmine/...s/sgs_curl.php

fookaa 09-26-2012 02:05 PM

I never did the edit you said "echo to return" and mine works :D

Did you enter your steam group name in the file ?

Crotan 09-26-2012 02:33 PM

Quote:

Originally Posted by MadMakz (Post 2368696)
addition: simply changeing file_get_contents won't do it so here's a cURL version of the whole script:
http://rcs.madmakz.com/misc-tools/sr...s/sgs_curl.php

Since this is reusable code, might you want to make a separate mod for tracking and discussion purposes?

Maybe [WIDGET] Steam Group Stats cURL

Also is this what you use on your site?

CoZmicShReddeR 09-26-2012 06:51 PM

Quote:

Originally Posted by MadMakz (Post 2368696)
addition: simply changeing file_get_contents won't do it so here's a cURL version of the whole script:
http://rcs.madmakz.com/misc-tools/sr...s/sgs_curl.php


Ok new code works now!

Now I was wondering how can we dress this up a little bit like with a banner above the out put and maybe some RSS info below like some of the latest Announcements?

I just need an example of the image code because every time I try to add something it is at the top of the page...

Thanks!:)

Crotan 09-29-2012 12:21 AM

Quote:

Originally Posted by CoZmicShReddeR (Post 2368792)
Ok new code works now!

Now I was wondering how can we dress this up a little bit like with a banner above the out put and maybe some RSS info below like some of the latest Announcements?

I just need an example of the image code because every time I try to add something it is at the top of the page...

Thanks!:)

What would be awesome to see, or atleast what i see in my dreams is if someone could create a widget that displays the usernames of a specified steam group that are In-Game, and then of those players what game they are in.

Some php coders that want to be loved forever should check out github and the new steam web api.

https://github.com/koraktor/steam-co...mGroupTest.php

Crotan 10-05-2012 06:02 AM

Quote:

Originally Posted by MadMakz (Post 2269069)
btw: it might be good idea to redo the whole mod using steamcommunities webapi. it's way more lightweight an easier to handle.

I actually just did this using the steam webapi, group information doesn't need an API key and is all xml based. I'm just not sure how to put it into a vBulletin php widget. Doing it in a html iframe calling the php works, but not really the route that I would think is best.

I'm sure using the xml page is faster than loading the real page like all these previous ones are.

MissSavitri 10-07-2012 06:21 PM

Has anyone found a solution for the parse errors?

What I'm getting is:

Parse error: syntax error, unexpected '<' in /homepages/17/d366822374/htdocs/forums/packages/vbcms/widget/execphp.php(191) : eval()'d code on line 1

And the widget is empty.

MadMakz 10-14-2012 01:20 PM

Here's a third version. Using Steam's XML API.

https://tracker.madmakz.com/redmine/...us/sgs_xml.php

As always replace
echo stgrp_status($gruppe);
by
return stgrp_status($gruppe);

if used in sidebar to keep compatibility to vB workflow.

This is probably my last post regarding this code here. Already took it over enough.
I'm not going to make a Modpost for it since the code itself ist not targetet only for vB an represents just a snippet.

If you have any issues you can use my local tracker-board here (doesn't require registration).

edit: updated download link to point to always latest version.

Hitman235234532 01-30-2013 04:57 PM

Hello, I have a small problem. I have my widget setup, but all I see is:
Members
In-Game
Online

I don't see any numbers.

Help please.

fred86 06-01-2015 12:51 PM

Quote:

Originally Posted by Hitman235234532 (Post 2400556)
Hello, I have a small problem. I have my widget setup, but all I see is:
Members
In-Game
Online

I don't see any numbers.

Help please.

Did anyone ever figure out the solution to this? I have exactly the same problem. :confused:

ukhostz 07-04-2015 06:37 PM

I have the exact same issue and it seems tracker.madmakz is no longer online. Has anyone got the file sgs_xml.php? Any help would be appreciated :)

Replicators 10-25-2015 01:33 AM

Someone should really update this or send to the graveyard, it doesn't work anymore!

LM SpinX 11-06-2015 09:27 PM

Any updates for it?

armpit 01-19-2016 03:29 AM

In case anyone is still interested in this, it is pretty easy. Just add it as a foum block. (Replace 'HeadShotCommunity' with your own group)

I knocked this up in about 2 minutes, would be easy to expand on.

PHP Code:

$gUrl 'http://steamcommunity.com/groups/HeadShotCommunity/memberslistxml/?xml=1';
$r '';

$xmlstring file_get_contents($gUrl);
ini_set('default_socket_timeout'0);

$xml  simplexml_load_string($xmlstring);
$json json_encode($xml);
$ar   json_decode($jsonTRUE);
$gd   $ar['groupDetails'];

$r .= "<div>Members: ".$gd['memberCount']."</div>";
$r .= "<div><font style='color: #8bc53f;'>In Game:</font> ".$gd['membersInGame']."</div>";
$r .= "<div><font style='color: #62a7e3'>Online:</font> ".$gd['membersOnline']."</div>";

return 
$r



All times are GMT. The time now is 11:25 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.01175 seconds
  • Memory Usage 1,784KB
  • 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
  • (8)bbcode_php_printable
  • (6)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (1)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (18)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