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.


All times are GMT. The time now is 04:56 PM.

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.01180 seconds
  • Memory Usage 1,758KB
  • 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
  • (7)bbcode_php_printable
  • (5)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (3)pagenav_pagelink
  • (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