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
  #12  
Old 04-20-2010, 01:37 AM
Inflikted Inflikted is offline
 
Join Date: Mar 2002
Posts: 40
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Bouncer222 View Post
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.
Reply With Quote
  #13  
Old 04-25-2010, 10:23 PM
CampinCarl CampinCarl is offline
 
Join Date: Apr 2008
Posts: 97
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Is there a way to get this to work with the forum side bar?
Reply With Quote
  #14  
Old 04-30-2010, 12:34 PM
K4GAP K4GAP is offline
 
Join Date: Mar 2008
Posts: 1,255
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Bouncer222 View Post
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?
Reply With Quote
  #15  
Old 04-30-2010, 07:28 PM
Bouncer222 Bouncer222 is offline
 
Join Date: Oct 2009
Posts: 705
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

We have developers in our community, they created it for us.
Reply With Quote
  #16  
Old 06-11-2010, 10:43 PM
Bouncer222 Bouncer222 is offline
 
Join Date: Oct 2009
Posts: 705
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Hey can anyone get the type of block this clan has?
http://www.ilevelup.net/Forums/content.php
Reply With Quote
  #17  
Old 06-22-2010, 07:13 PM
wobbly wobbly is offline
 
Join Date: Sep 2005
Posts: 110
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Bouncer222 View Post
We have developers in our community, they created it for us.
Any chance of releasing it to the public?
Reply With Quote
  #18  
Old 06-22-2010, 07:29 PM
Bouncer222 Bouncer222 is offline
 
Join Date: Oct 2009
Posts: 705
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by wobbly View Post
Any chance of releasing it to the public?
https://vborg.vbsupport.ru/showthrea...ht=steam+group
Reply With Quote
  #19  
Old 06-23-2010, 06:49 AM
K4GAP K4GAP is offline
 
Join Date: Mar 2008
Posts: 1,255
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Inflikted View Post
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
PHP Code:
<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($domain1);   
    echo 
"&nbsp;&nbsp;&nbsp;&nbsp;<b><font style='color:#417394'>$strip1</font> Members</b>";  
    echo 
"<br>";  

    
$domain1 strstr($pieces[6], '>');  
    
$strip2 substr($domain11);  
    echo 
"&nbsp;&nbsp;&nbsp;&nbsp;<b><font style='color:#417394'>$strip2</font> In-Game</b>";   
    echo 
"<br>";  

    
$domain2 strstr($pieces[9], '>');  
    
$strip3 substr($domain21);   
    echo 
"&nbsp;&nbsp;&nbsp;&nbsp;<b><font style='color:#417394'>$strip3</font> Online</b>"
?> 
</tr>  
</table>   
</body>  
</html>
2. In your actual widget put this code in

PHP Code:
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...
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.
Reply With Quote
  #20  
Old 07-26-2010, 03:29 PM
soulz2003 soulz2003 is offline
 
Join Date: Nov 2009
Posts: 42
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

is it possible to make this compatible with 3.8?
thanks
Reply With Quote
  #21  
Old 08-22-2010, 07:03 AM
paradoxx109 paradoxx109 is offline
 
Join Date: Mar 2007
Posts: 17
Благодарил(а): 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.

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.
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:16 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.05139 seconds
  • Memory Usage 2,391KB
  • 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
  • (2)bbcode_code
  • (4)bbcode_php
  • (6)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
  • (3)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