View Full Version : vBulletin CMS Widgets - [WIDGET] Steam Group Stats
Inflikted
04-18-2010, 10:00 PM
For those who have a steam group, you can easily display your steamgroup stats on your frontpage. I included 2 versions a cached version (which I recommend to use but takes a tiny bit more effort to run) and a non-cached version which runs out of the box (might slow down your site a bit more).
Instructions Cached Version:
1.Navigate to AdminCP -> CMS -> Widgets.
2. Create a PHP Type Widget and paste the code from below:
cached version:
<html>
<style type="text/css">
span.membersInGame {
font-size: 11px;
color: #8bc53f;
font-family:arial, Helvetica, tahoma, sans-serif;
text-decoration:none;
}
span.membersOnline {
font-size: 11px;
color: #62a7e3;
font-family:arial, Helvetica, tahoma, sans-serif;
text-decoration:none;
}
</style>
</html>
<?php
$group = freefragnet;
$cachefile = 'cache/grpcache.html';
$cachetime = 5 * 60; // 5 minutes
if (file_exists($cachefile) && (time() - $cachetime < filemtime($cachefile))) {
include($cachefile);
echo "<!-- Cached ".date('jS F Y H:i', filemtime($cachefile))." -->";
} else {
ob_start();
$url = file_get_contents('http://steamcommunity.com/groups/'.$group);
ini_set('default_socket_timeout', 0);
preg_match('#<h1>(.+)</h1>#sU', $url, $aMatches);
echo "<div class=blockrow>";
echo "<table>";
echo "<a class='clanname' href='http://steamcommunity.com/groups/$group' target='_blank'>$aMatches[1]</a>";
echo "<br>";
preg_match('#<div class="groupMemberRow">(.+)</div>#sU', $url, $aMatches);
$aMatches = str_replace('class="linkStandard"', 'class="linkStandard" target="_blank"', $aMatches[1]);
$pieces = explode(" ", $aMatches);
$domain = strstr($pieces[3], '>');
$strip1 = substr($domain, 1);
echo "<span class=resultsb>$strip1 Members</span>";
echo "<br>";
$domain1 = strstr($pieces[6], '>');
$strip2 = substr($domain1, 1);
echo "<span class=membersInGame><font color=#8bc53f>$strip2 In-Game</font></span>";
echo "<br>";
$domain2 = strstr($pieces[9], '>');
$strip3 = substr($domain2, 1);
echo "<span class=membersOnline><font color=#62a7e3>$strip3 Online</font></span>";
echo "</table>";
echo "</div>";
$fp = fopen($cachefile, 'w');
fwrite($fp, ob_get_contents());
fclose($fp);
ob_end_flush();
ob_end_clean();
}
?>
3. Edit $group = freefragnet; to your group. This is in the url base for your steam group Example: http://steamcommunity.com/groups/freefragnet
4. In your ftp, in the same base folder vbulletin is hosted, create a folder named 'cache' and CHMOD to 777.
5. Your set :)
Demo: http://www.freefrag.com/
Instructions Non-Cached Version:
1.Navigate to AdminCP -> CMS -> Widgets.
2. Create a PHP Type Widget and paste the code from below:
non-cache
<html>
<style type="text/css">
span.membersInGame {
font-size: 11px;
color: #8bc53f;
font-family:arial, Helvetica, tahoma, sans-serif;
text-decoration:none;
}
span.membersOnline {
font-size: 11px;
color: #62a7e3;
font-family:arial, Helvetica, tahoma, sans-serif;
text-decoration:none;
}
</style>
</html>
<?php
$group = freefragnet;
$url = file_get_contents('http://steamcommunity.com/groups/'.$group);
ini_set('default_socket_timeout', 0);
preg_match('#<h1>(.+)</h1>#sU', $url, $aMatches);
echo "<div class=blockrow>";
echo "<table>";
echo "<a class='clanname' href='http://steamcommunity.com/groups/$group' target='_blank'>$aMatches[1]</a>";
echo "<br>";
preg_match('#<div class="groupMemberRow">(.+)</div>#sU', $url, $aMatches);
$aMatches = str_replace('class="linkStandard"', 'class="linkStandard" target="_blank"', $aMatches[1]);
$pieces = explode(" ", $aMatches);
$domain = strstr($pieces[3], '>');
$strip1 = substr($domain, 1);
echo "<span class=resultsb>$strip1 Members</span>";
echo "<br>";
$domain1 = strstr($pieces[6], '>');
$strip2 = substr($domain1, 1);
echo "<span class=membersInGame><font color=#8bc53f>$strip2 In-Game</font></span>";
echo "<br>";
$domain2 = strstr($pieces[9], '>');
$strip3 = substr($domain2, 1);
echo "<span class=membersOnline><font color=#62a7e3>$strip3 Online</font></span>";
echo "</table>";
echo "</div>";
?>
3. Edit $group = freefragnet; to your group. This is in the url base for your steam group Example: http://steamcommunity.com/groups/freefragnet
4. Your set :)
Demo: http://www.freefrag.com/
joshtrav
04-19-2010, 04:26 AM
Very nice widget.
Currently it only displays today's date for me however. I added it via php direct execution and set it on the layout manager.
Side note:
Is there a release for that server status widget as well?
Inflikted
04-19-2010, 04:28 AM
i suppose i can.. but i need to clean the code up alot, its a bit messy and confusing lol.
joshtrav
04-19-2010, 04:43 AM
I had done an edit to my first post with the error I receive at the top of the page, however you had already replied.
I am interested in your status widget mainly only for CS:S, but I am sure it would be ideal for others to include what else you display there, as its very stylish at the moment.
Inflikted
04-19-2010, 04:54 AM
if you are getting today's date that means the script portion is blank. you may have made the mistake and copy/pasted the coding into the widget description rather than the widget code area.
avigate to AdminCP -> CMS -> Widgets and click on Configure next to the steam group widget, make sure the coding is over there.
well the backend coding is based off gameQ for my server status script, jquery for the popups. i just need some time to clean it up.. because right now there isnt really an easy way to add in servers, without editing the php file in 3 different location for each server you want to add. not a big deal for people with a bit of experience in php i suppose. but for those who are new it can be a bit troublesome if you have alot of servers to add. ontop of that the style i put in is custom, I was stupid at the time and should have built the style off the forum style lol.
joshtrav
04-19-2010, 05:23 AM
Done as you said, whoops at a silly mistake there.
Now I have this at the top of my install. Again, sorry but php is not my high point. Python/Java are much easier for me, heh.
Parse error: syntax error, unexpected '<' in /home/joshtrav/vb.joinwcs.com/packages/vbcms/widget/execphp.php(177) : eval()'d code on line 1
Edit:
Seems to work now without the style info at the top, and the html.
There is a decent amount of specific style tags missing as well. Such as span assignments for clanname, etc.
I am getting it to work but I am having a hard time getting it to go into the widget block, instead it shows on the very top right corner of the page.
strudinox
04-19-2010, 03:58 PM
joshtrav, how did you get it to work? I'm getting the same error.
Inflikted
04-19-2010, 05:39 PM
joshtrav, how did you get it to work? I'm getting the same error.
here is the version josh edited. frontpage is always kind of funky how it accepts your modules, depending on what else you have loading in. he was able to alleviate it by setting up a php include file..
1. make a php file and name it w_steamgroup.php put it into your includes folder
<html>
<body style="font-family:Verdana, Arial, Helvetica, sans-serif; font-size:10px;">
<table style="font-size:9px;" width="100%">
<tr align="center" valign="top">
<?php
$url = file_get_contents('http://steamcommunity.com/groups/joinwcs');
ini_set('default_socket_timeout', 0);
preg_match('#<h1>(.+)</h1>#sU', $url, $aMatches);
echo "<h3 class='article_preview'><a href='steam://url/GroupSteamIDPage/103582791429921702'>$aMatches[1]</a></h3>";
preg_match('#<div class="groupMemberRow">(.+)</div>#sU', $url, $aMatches);
$aMatches = str_replace('class="linkStandard"', 'class="linkStandard" target="_blank"', $aMatches[1]);
$pieces = explode(" ", $aMatches);
$domain = strstr($pieces[3], '>');
$strip1 = substr($domain, 1);
echo " <b><font style='color:#417394'>$strip1</font> Members</b>";
echo "<br>";
$domain1 = strstr($pieces[6], '>');
$strip2 = substr($domain1, 1);
echo " <b><font style='color:#417394'>$strip2</font> In-Game</b>";
echo "<br>";
$domain2 = strstr($pieces[9], '>');
$strip3 = substr($domain2, 1);
echo " <b><font style='color:#417394'>$strip3</font> Online</b>";
?>
</tr>
</table>
</body>
</html>
2. In your actual widget put this code in
ob_start();
require_once './includes/w_steamgroup.php';
$output=ob_get_contents();
ob_end_clean();
I haven't tested this out, but this is what joshtrav did to fix his issue.
joshtrav
04-19-2010, 06:27 PM
Yes, this worked for me.
The one thing to note is the need to replace the joinwcs groupname and the a href link to your appropriate group.
Other than that, it works well.
I am using vB for the first time, so you can see the example of it at vb.joinwcs.com, bottom left corner.
Bear with me as its a fresh install so its very bland, but for the purposes here in it works fine.
Bouncer222
04-19-2010, 11:09 PM
Hey great mod....but I already have a pretty good steam looking stats module on my site at www.brotherhoodofgamers.com its on the top right.
I was just wondering, could you write some instructions on how to ONLY add " x members joined past 24hrs" like you have in the image?
Thanks.
Inflikted
04-20-2010, 01:37 AM
Hey great mod....but I already have a pretty good steam looking stats module on my site at www.brotherhoodofgamers.com its on the top right.
I was just wondering, could you write some instructions on how to ONLY add " x members joined past 24hrs" like you have in the image?
Thanks.
well my vbulletin coding is sketchy at best lol. but i know how to do it outside of vbulletin and at least display the info add me up on steam http://steamcommunity.com/id/Inflikted or shoot me a pm on my forums http://www.freefrag.com/members/inflik.html I can guide you through it by chat if you have some php/sql experience.
CampinCarl
04-25-2010, 10:23 PM
Is there a way to get this to work with the forum side bar?
K4GAP
04-30-2010, 12:34 PM
Hey great mod....but I already have a pretty good steam looking stats module on my site at www.brotherhoodofgamers.com its on the top right.
I was just wondering, could you write some instructions on how to ONLY add " x members joined past 24hrs" like you have in the image?
Thanks.
Hey man I love your Steam block on your site. May I ask where you got it?
Bouncer222
04-30-2010, 07:28 PM
We have developers in our community, they created it for us.
Bouncer222
06-11-2010, 10:43 PM
Hey can anyone get the type of block this clan has?
http://www.ilevelup.net/Forums/content.php
wobbly
06-22-2010, 07:13 PM
We have developers in our community, they created it for us.
Any chance of releasing it to the public?
Bouncer222
06-22-2010, 07:29 PM
Any chance of releasing it to the public?
https://vborg.vbsupport.ru/showthread.php?t=244629&highlight=steam+group
K4GAP
06-23-2010, 06:49 AM
here is the version josh edited. frontpage is always kind of funky how it accepts your modules, depending on what else you have loading in. he was able to alleviate it by setting up a php include file..
1. make a php file and name it w_steamgroup.php put it into your includes folder
<html>
<body style="font-family:Verdana, Arial, Helvetica, sans-serif; font-size:10px;">
<table style="font-size:9px;" width="100%">
<tr align="center" valign="top">
<?php
$url = file_get_contents('http://steamcommunity.com/groups/joinwcs');
ini_set('default_socket_timeout', 0);
preg_match('#<h1>(.+)</h1>#sU', $url, $aMatches);
echo "<h3 class='article_preview'><a href='steam://url/GroupSteamIDPage/103582791429921702'>$aMatches[1]</a></h3>";
preg_match('#<div class="groupMemberRow">(.+)</div>#sU', $url, $aMatches);
$aMatches = str_replace('class="linkStandard"', 'class="linkStandard" target="_blank"', $aMatches[1]);
$pieces = explode(" ", $aMatches);
$domain = strstr($pieces[3], '>');
$strip1 = substr($domain, 1);
echo " <b><font style='color:#417394'>$strip1</font> Members</b>";
echo "<br>";
$domain1 = strstr($pieces[6], '>');
$strip2 = substr($domain1, 1);
echo " <b><font style='color:#417394'>$strip2</font> In-Game</b>";
echo "<br>";
$domain2 = strstr($pieces[9], '>');
$strip3 = substr($domain2, 1);
echo " <b><font style='color:#417394'>$strip3</font> Online</b>";
?>
</tr>
</table>
</body>
</html>
2. In your actual widget put this code in
ob_start();
require_once './includes/w_steamgroup.php';
$output=ob_get_contents();
ob_end_clean();
I haven't tested this out, but this is what joshtrav did to fix his issue.
This works for me except I'm being taken to his community page. I placed my community name "puwa" in the proper place but I think it has something to do with this line of code... <h3 class='article_preview'><a href='steam://url/GroupSteamIDPage/103582791429921702'>$aMatches[1]</a></h3>
Is this the community address? If so, where do I find that info on my community? This is my Steam Group's page (http://steamcommunity.com/groups/puwa) but when logged in or otherwise I don't see anything resembling the above id.
soulz2003
07-26-2010, 03:29 PM
is it possible to make this compatible with 3.8?
thanks
paradoxx109
08-22-2010, 07:03 AM
This works for me except I'm being taken to his community page. I placed my community name "puwa" in the proper place but I think it has something to do with this line of code... <h3 class='article_preview'><a href='steam://url/GroupSteamIDPage/103582791429921702'>$aMatches[1]</a></h3>
Is this the community address? If so, where do I find that info on my community? This is my Steam Group's page (http://steamcommunity.com/groups/puwa) but when logged in or otherwise I don't see anything resembling the above id.
You actually have to change the value on the php file you uploaded and then re-edit the widget code without modifying it and hit save just to make a refresh. At least that worked for me.
Marked as installed! Thanks.
NeXtCentury
08-26-2010, 09:02 PM
Tried it.. but stays empty on my site.. both the cached and non-cached version
Add PHP widget used configure to copy and past the code and changed the $groups to
$group = NeXt-Century;
according to our page at steam :
http://steamcommunity.com/groups/NeXt-Century
Looks very straight forward but seems to forget something or doing something wrong.
BTW do i have to delete the default code that is present if you create the PHP widget and configure it ? Cause default there is already some code present..
*Update*
Used inflikted version with the PHP file and that works.. only still ugly as hell...
still thanks to him :)
Thanks.
Bouncer222
08-29-2010, 05:17 PM
how did you do this?
"653 new members in last 24 hours"
or is this included in the code?
Bouncer222
09-11-2010, 08:26 PM
Funny.... the cached version timed out my site, i checked my cpu usage, and it went from 2/25 to like 14/25, timing out my site. I had to disable it.
whats the issue?
NeXtCentury
09-26-2010, 10:01 PM
This works for me except I'm being taken to his community page. I placed my community name "puwa" in the proper place but I think it has something to do with this line of code... <h3 class='article_preview'><a href='steam://url/GroupSteamIDPage/103582791429921702'>$aMatches[1]</a></h3>
Is this the community address? If so, where do I find that info on my community? This is my Steam Group's page (http://steamcommunity.com/groups/puwa) but when logged in or otherwise I don't see anything resembling the above id.
I had the same problem when i checked this link it creates behind the name of the group. It also redirects to the WCS group and not to mine..
I had some troubles finding any info about retrieving the steamgroupID for my group.
What i did was to read the source behind the page on my group page. Connected to Steam (with steamclient) and right click on my groupspage.. > "view source" If you see the code you can easily identify the ID for your group.
For example the lines :
<div class="actionItemIcon"><a href="steam://friends/joinchat/103582791430303639">
or
<span class="hiliteTextBlue"><a class="steamLink" href="steam://friends/joinchat/103582791430303639"
if you a bit into PHP code you can find this in a flash ( or already did) I'm not into this website shizzle and managed :)
Dutch
mavrick4283
10-11-2010, 04:08 AM
I have tried both versions but they are not showing up in my CMS page.
jaffaman
11-13-2010, 03:49 PM
Ok i know this old post but i got it to work doing it the same way as GaryT (post 18) except it looks strange in IE8 you have to turn compatibility mode on ? but works in firefox,google chrome,Safari anyone know how to fix this ????
Also for some reason it would not work with our steamgroup name csa-squad but once we renamed it to csasquad without the - it works fine so that might be the problem for other people.
Also i would like to know how you got the new members in last 24 hours part.
DJ29Joesph
11-23-2010, 07:35 PM
Hey can anyone get the type of block this clan has?
http://www.ilevelup.net/Forums/content.php
You could have just asked us.. LOL
Popa Andrei
03-29-2011, 09:00 AM
GaryT worked for 4.1.2
The original didnt, so thanks GaryT :D
MadMakz
04-12-2011, 09:25 PM
Thanks! Marked as installed, though, i haven't actually installed this code since i'm not running the Suite.
I've stripped and modded the code a little and use it in the forums sidebar and felt to just share it here.
$group = "cMyGroup";
$url = file_get_contents('http://steamcommunity.com/groups/'.$group);
ini_set('default_socket_timeout', 0);
preg_match('#<h1>(.+)</h1>#sU', $url, $aMatches);
$return = "<div class=blockrow>";
$return .= "<table>";
$return .= "<a class='clanname' href='http://steamcommunity.com/groups/$group' target='_blank'>$aMatches[1]</a>";
$return .= "<br>";
preg_match('#<div class="groupMemberRow">(.+)</div>#sU', $url, $aMatches);
$aMatches = str_replace('class="linkStandard"', 'class="linkStandard" target="_blank"', $aMatches[1]);
$pieces = explode(" ", $aMatches);
$domain = strstr($pieces[3], '>');
$strip1 = substr($domain, 1);
$return .= "<span class=resultsb>$strip1 Members</span>";
$return .= "<br>";
$domain1 = strstr($pieces[6], '>');
$strip2 = substr($domain1, 1);
$return .= "<span class=membersInGame><font color=#8bc53f>$strip2 In-Game</font></span>";
$return .= "<br>";
$domain2 = strstr($pieces[9], '>');
$strip3 = substr($domain2, 1);
$return .= "<span class=membersOnline><font color=#62a7e3>$strip3 Online</font></span>";
$return .= "</table>";
$return .= "</div>";
return $return;
demo: http://community.cgx24.com/forum.php
MissSavitri
05-17-2011, 09:03 PM
I'm getting the following error in 4.1.3:
Parse error: syntax error, unexpected '<' in /homepages/17/d366822374/htdocs/forums/packages/vbcms/widget/execphp.php(191) : eval()'d code on line 1
Is there any chance of an update?
j0k4w1ld
05-20-2011, 09:41 PM
im using advanced cmps
how can i accomplish to install properly this module mates?
Kapeket
05-31-2011, 04:28 AM
I'm getting the following error in 4.1.3:
Parse error: syntax error, unexpected '<' in /homepages/17/d366822374/htdocs/forums/packages/vbcms/widget/execphp.php(191) : eval()'d code on line 1
Is there any chance of an update?
Same here.
Thanks for the efforts and want to run this one on our site for sure.
matt.b
08-29-2011, 11:59 PM
When I go to create a widget there's only a php direct extension choice.
Mine only shows the date and a small php icon at the top left.
Kapeket
09-08-2011, 12:49 AM
When I go to create a widget there's only a php direct extension choice.
Mine only shows the date and a small php icon at the top left.
Remove that coding and place what is provided here.
I am having a little bit of a different issue with a forum block.
Here is the image of that situation:
https://vborg.vbsupport.ru/attachment.php?attachmentid=132764&stc=1&d=1315446658
thecore762
09-08-2011, 03:50 AM
Will this work with vBadvanced?
AcesGaming
11-03-2011, 08:28 PM
Cannot get this to work on my site no matter what I do. The default way displays:
Parse error: syntax error, unexpected '<' in /homepages/46/d281957229/htdocs/aces/packages/vbcms/widget/execphp.php(191) : eval()'d code on line 1
And if I try and use the php call trick, it doesn't work because file-access is disabled on my server for security purposes.
Am I shit out of luck? How do other people have this working and I can't... really bugging my head.
MadMakz
11-18-2011, 12:17 AM
Thanks! Marked as installed, though, i haven't actually installed this code since i'm not running the Suite.
I've stripped and modded the code a little and use it in the forums sidebar and felt to just share it here.
demo: http://community.cgx24.com/forum.php
small and simple error handling for if steamcommunity's webservers are out of order:
add
if($http_response_header[0] != "HTTP/1.1 200 OK"){ return "<div class=\"blockrow\">Steamcommunity appears to be down.</div>"; }
before
preg_match('#<h1>(.+)</h1>#sU', $url, $aMatches);
btw: it might be good idea to redo the whole mod using steamcommunities webapi. it's way more lightweight an easier to handle.
fookaa
12-22-2011, 01:51 PM
Wooo i finally got it working...
I used the 2nd code and it does not work if your steam group name has - in it. I changed my group name from Kool-Killers to TheKoolKillers and then put it in a php file in root then made a new block on vBadvanced and set it in the block as an iframe...
Anyone ever work out the last 24 hours thing ?
Replicators
12-23-2011, 02:44 PM
I am starting to hate the vbulletin cms, i am thinking of switching back to vbadvanced. Clicking configure next to widget ain;t doing anything at all.
fookaa
09-05-2012, 03:37 PM
Ah maaaaaaaaaaan ...
Steam just updated some stuff and its busted ...
Any way to get this working again ?
MadMakz
09-08-2012, 11:40 PM
I've updated my custom (https://vborg.vbsupport.ru/showpost.php?p=2183981&postcount=29)-code and simplyfied it. Working with 2012/Greenlight update.
https://tracker.madmakz.com/redmine/projects/misc-tools/repository/entry/PHP/Steam/SteamGroupStatus/sgs.php
to have it working on vBulletin sidebar, change
echo stgrp_status($gruppe);
to
return stgrp_status($gruppe);
fookaa
09-23-2012, 02:40 PM
Thanks
CoZmicShReddeR
09-25-2012, 10:04 AM
I've updated my custom (https://vborg.vbsupport.ru/showpost.php?p=2183981&postcount=29)-code and simplyfied it. Working with 2012/Greenlight update.
http://rcs.madmakz.com/misc-tools/src/0dcb66ac66f4/PHP/Steam/SteamGroupStatus/sgs.php
to have it working on vBulletin sidebar, change
echo stgrp_status($gruppe);
to
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
function file_get_contents_curl($url, $agent = "My Agent"){
$ch = curl_init();
curl_setopt($ch, CURLOPT_HEADER, 0);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); //Set curl to return the data instead of printing it to the browser.
curl_setopt($ch, CURLOPT_USERAGENT, $agent);
curl_setopt($ch, CURLOPT_URL, $url);
$data = curl_exec($ch);
curl_close($ch);
return $data;
}
and replace
file_get_contents('http://steamcommunity.com/groups/'.$group)
with
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/projects/misc-tools/repository/entry/PHP/Steam/SteamGroupStatus/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
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/src/8648d5fc0d96/PHP/Steam/SteamGroupStatus/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
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/src/8648d5fc0d96/PHP/Steam/SteamGroupStatus/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
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-condenser-php/blob/master/tests/steam/community/SteamGroupTest.php
Crotan
10-05-2012, 06:02 AM
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/projects/misc-tools/repository/entry/PHP/Steam/SteamGroupStatus/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 (https://tracker.madmakz.com/redmine/projects/misc-tools/boards) (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
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.
$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($json, TRUE);
$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;
vBulletin® v3.8.12 by vBS, Copyright ©2000-2024, vBulletin Solutions Inc.