Go Back   vb.org Archive > vBulletin Modifications > vBulletin 4.x Modifications > vBulletin 4.x Add-ons
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools
[WIDGET] Steam Group Stats Details »»
[WIDGET] Steam Group Stats
Version: 1.00, by Inflikted Inflikted is offline
Developer Last Online: Aug 2012 Show Printable Version Email this Page

Category: vBulletin CMS Widgets - Version: 4.0.3 Rating:
Released: 04-18-2010 Last Update: Never Installs: 36
Re-useable Code Translations  
No support by the author.

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:
PHP Code:
<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 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($domain1); 
    echo 
"<span class=resultsb>$strip1 Members</span>";
    echo 
"<br>";
$domain1 strstr($pieces[6], '>');
$strip2 substr($domain11);
    echo 
"<span class=membersInGame><font color=#8bc53f>$strip2 In-Game</font></span>"
    echo 
"<br>";
$domain2 strstr($pieces[9], '>');
$strip3 substr($domain21); 
    echo 
"<span class=membersOnline><font color=#62a7e3>$strip3 Online</font></span>";
echo 
"</table>";
echo 
"</div>";
$fp fopen($cachefile'w');
fwrite($fpob_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
PHP Code:
<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($domain1); 
    echo 
"<span class=resultsb>$strip1 Members</span>";
    echo 
"<br>";
$domain1 strstr($pieces[6], '>');
$strip2 substr($domain11);
    echo 
"<span class=membersInGame><font color=#8bc53f>$strip2 In-Game</font></span>"
    echo 
"<br>";
$domain2 strstr($pieces[9], '>');
$strip3 substr($domain21); 
    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/

Screenshots

File Type: jpg steamstats.jpg (12.9 KB, 0 views)

Show Your Support

  • This modification may not be copied, reproduced or published elsewhere without author's permission.

Comments
  #22  
Old 08-26-2010, 09:02 PM
NeXtCentury NeXtCentury is offline
 
Join Date: Mar 2010
Location: Netherlands
Posts: 6
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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.
Reply With Quote
  #23  
Old 08-29-2010, 05:17 PM
Bouncer222 Bouncer222 is offline
 
Join Date: Oct 2009
Posts: 705
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

how did you do this?
"653 new members in last 24 hours"

or is this included in the code?
Reply With Quote
  #24  
Old 09-11-2010, 08:26 PM
Bouncer222 Bouncer222 is offline
 
Join Date: Oct 2009
Posts: 705
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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?
Reply With Quote
  #25  
Old 09-26-2010, 10:01 PM
NeXtCentury NeXtCentury is offline
 
Join Date: Mar 2010
Location: Netherlands
Posts: 6
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by GaryT View Post
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...
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 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
Reply With Quote
  #26  
Old 10-11-2010, 04:08 AM
mavrick4283 mavrick4283 is offline
 
Join Date: Jul 2009
Posts: 11
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I have tried both versions but they are not showing up in my CMS page.
Reply With Quote
  #27  
Old 11-13-2010, 03:49 PM
jaffaman jaffaman is offline
 
Join Date: Nov 2004
Posts: 153
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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.
Reply With Quote
  #28  
Old 11-23-2010, 07:35 PM
DJ29Joesph DJ29Joesph is offline
 
Join Date: Jan 2009
Posts: 70
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Bouncer222 View Post
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
Reply With Quote
  #29  
Old 03-29-2011, 09:00 AM
Popa Andrei's Avatar
Popa Andrei Popa Andrei is offline
 
Join Date: May 2008
Location: Romania/Petrosani
Posts: 367
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

GaryT worked for 4.1.2
The original didnt, so thanks GaryT
Reply With Quote
  #30  
Old 04-12-2011, 09:25 PM
MadMakz MadMakz is offline
 
Join Date: Apr 2011
Posts: 26
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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.

PHP Code:
$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($domain1); 
    
$return .= "<span class=resultsb>$strip1 Members</span>";
    
$return .= "<br>";
    
$domain1 strstr($pieces[6], '>');
    
$strip2 substr($domain11);
    
$return .= "<span class=membersInGame><font color=#8bc53f>$strip2 In-Game</font></span>"
    
$return .= "<br>";
    
$domain2 strstr($pieces[9], '>');
    
$strip3 substr($domain21); 
    
$return .= "<span class=membersOnline><font color=#62a7e3>$strip3 Online</font></span>";
    
$return .= "</table>";
    
$return .= "</div>";

return 
$return
demo: http://community.cgx24.com/forum.php
Reply With Quote
  #31  
Old 05-17-2011, 09:03 PM
MissSavitri MissSavitri is offline
 
Join Date: May 2011
Posts: 15
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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?
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 11:53 PM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.11357 seconds
  • Memory Usage 2,386KB
  • Queries Executed 26 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (1)bbcode_code
  • (3)bbcode_php
  • (2)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)modsystem_post
  • (1)navbar
  • (4)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (4)pagenav_pagelink
  • (11)post_thanks_box
  • (11)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (11)post_thanks_postbit_info
  • (10)postbit
  • (1)postbit_attachment
  • (11)postbit_onlinestatus
  • (11)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.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/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.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
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_attachment
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete