Description
This project is based on the bf3stats.com API. I figured it would be neat to have an easy way to display a list of players on clan websites to allow easy comparision between statistics and also use it as a way to “show off” what your clan is able to pull off in BF3.
The source is available soon. Setup is simple and takes no longer than 5 minutes. It supports developing your own themes based on the Smarty Template engine. It comes with a simple sample theme.
You can find an example at http://bf3stats.grewe.ca/
Showcases
| Unit | Platform | URL |
|---|---|---|
| ALT+F4 Platoon | PC | http://hang-over.org/bf3stats/ |
| Mad World Entertainment | XBox 360 | http://www.mweclan.com/clan-stats |
Download
Download Latest Release 0.0.8 : bf3stats Source Code (126)
Features
- Configurable list of players to display on stats list
- Memcache and Disk Cache support for statistics
- JS popups to display more information on a statistic
- Compare players side by side
- Tracked Statistics by bf3stats.com: Scores, Kills, Deaths, K/D Ratio, Vehicle Usage, Games, MVP and many more
- Optional Cronjob to automatically update players at bf3stats.com
- Sort list by each statistic
Requirements
- Either enable disk cache or use Memcache if available (recommended)
- Write access to templates/compile and templates/cache (if disk cache is enabled)
- BF3stats.com API Keys if you wish to run the player update cronjob
- PHP CURL Library
Installation
- Upload the bf3stats source code folder to your Website
- Ensure templates/compile and templates/cache are writable by the server
- Configure your players in include/config/global.inc.php
- Enable (if available) or Disable the Memcache inĀ include/config/global.inc.php
Screenshots
- bf3stats – Player List
- bf3stats – Score Popup
- bf3stats – Compare Players
- bf3stats – Compare Vehicle Stats
Changelog
Version 0.0.8
- bugfix for memcache config call during update
- additional config variable used in update process outside cronjob
- moved forced update to its own page
- cronjob updated to use proper configuration variables
- cronjob updated to store a list of already updated players in the past 60 minutes to conserve update slots
- removed darkpro template and files to avoid confusion
- made bf3stats the default template
- renamed config for memcache to cache to avoid confusion
Version 0.0.7
- disable memcache by default
- only enable smarty cache when memcache is disabled
- disable smarty cache by default if memcache is not used
- split up the statistics on their own templates, including them on the default template for home
- added accuracy popup to show top 10 accuarcy for weapons
- moved best ribbon and medal count to best ribbon name line
Version 0.0.6
- removed debug output from updatePlayers.php cronjob
- only update players that were not updated > 2hrs
- moved Kits from Score to Kit popup
- removed Main Kit name from Kit popup and only show the icon instead
- re-aligned Kills popup
- merged MVP tables together into one table
- removed unique medal and ribbon counts from popup and renamed Progress to Unique Progress
Version 0.0.5
- Bugfix: Wrong player list due to configuration changes on compare page
- Bugfix: % of Total score was not displayed for ground and air vehicles
Version 0.0.4
- Added custom cache index
- Added per player configuration for bought date
- Added playtime per 50 Euro spent
- Added playtime since release date
- Added playtime since bought [Optional]
- Added Main Kit used
- Added best weapon and vehicle under kills popup
Version 0.0.2
- fixed errors for devision by zero on round() calls
- fixed error when debugging disabled
- updated update_players method
- Adjusted vehicle SPM location in list
- Adjusted popup windows
- Replaced Vehicles scores with Vehicles SPM
Version 0.0.1
- Initial Release




Pingback: bf3stats Version 0.0.1 Released | BlogSpot
Pingback: bf3stats Version 0.0.5 Released | BlogSpot
Not sure why but for some reason it will not show more than one player? Is this the right code method to display additional players?
),
‘players’ => array(
‘xIce-x-Manx’ => array(
‘bought’ => “2011-12-12″,
),
‘xIce-x-Manx’,
‘jadedways’,
‘kevin1141′,
),
Yes but you only need to define a player once even if you add some configuration for them. Also ensure they are added on the bf3stats.com page first by searching for them and adding them via their update call. Currently cross-platform is also unsupported – you need to chose one in the config first.
The “most ribbons note” is wrong, it shows xx/45 for completing the next medal instead if xx/50 or xx/30.
Thanks for the heads up! Will make sure to get that fixed.
There might be a misunderstanding what the progress displays. It shows your unique ribbon and medal process, not the progress towards the next unique or common ribbon.
There are 50 unique medals in the game and 45 unique ribbons. Progress shows how many unique rewards you have to go to finish them all.
I will remove the Unique counter and combine it into a “Unique Progress” instead. It holds the unique value already anyway.
Love this code!! Beauty job!!
I’m setup and running, got a few players & my API keys loaded.
Just wondering how to kickoff the cronjob? (Haven’t used them before)
Does it check the cache or is it set on a timer? Also where does the logfile save to?
Looking into the code but haven’t figured it out yet.
Still no luck..
But did I mention this is some awesome code!!
I’ve modified the graphics a bit to fit in my site.
http://www.mweclan.com/clan-stats
And moved your link to the bottom of the main site, rather than only on the stats page
Thanks for compliments! I did try my best
As for the cronjob: This is a script that should be run periodically by the server itself. In Linux this is fairly easy to setup but often web providers do not offer client cronjobs. Another option would be taking the code and running the update on another machine. As long as the configuration is the same it won’t matter where the job is started.
It is currently not writing any log file. I didn’t think it would be needed since the information you get out of an update is minimal.
I does not check the cache, it actually flushes it and grabs most recent data once the update completes, then caches the new results.
Usually you are fine to run without the cronjob. Most users will update their stats often anyway and if someone you wish to compare against hasn’t updated in a while you can also do that for them by clicking their name.
Great work on your clan page. I like how you embedded the default template into your website. If you put some effort into it you can change the CSS and templates to fit your site even better.
Added you to the list of users
Hello again. I’ve decided to try an pursue the cronjob, as lots of my guys are too lazy to update
Once I get it running I’ll go back to more css customizing.
So far I’ve setup my API keys, and given my playerupdate.php a 755, however I am getting an error : Status: 500 Internal Server Error. I’ve got my host to confirm that it’s a coding issue, and one even start to debug it a little, but of course left it up to me. Could this be related to my server API running CGI/FastCGI, is this the same as yours?
I’ve confirmed my process is sound. I got another cron update script running for bf3stats. However I now have to maintain 2 lists of users. So if you have any tips on how I can tweak yours, let me know.
Hit me up with the error message thrown by the server. FastCGI might be an issue but I doubt it.
Internal Server errors are a nightmare. I recommend deleting the files in your /templates/compile folder first. Once you have done that, if it is not fixed toss up another message and Sebastian or myself will address the issue as best we can.
I know my first place to start when dealing with a 500 Internal Server error is to get rid of my cached files. There are other steps if that doesn’t work, but for me, at least 75% of 500 Internal Server errors are resolved with a flush of cached files.
Hope this helps!
Pingback: bf3stats Version 0.0.8 Released | BlogSpot