OOTP Developments Forums

OOTP Developments Forums (https://forums.ootpdevelopments.com//index.php)
-   OOTP Mods - Database Tools (https://forums.ootpdevelopments.com//forumdisplay.php?f=3633)
-   -   StatsLab13 (https://forums.ootpdevelopments.com//showthread.php?t=226361)

fhomess 11-29-2012 05:56 PM

StatsLab
 
StatsLab 13 v3.0

I've had a lot of inquiries about StatsLab lately, so here is finally an update to the utility.

StatsLab is a set of web pages and utilities for use with online leagues. It requires PHP and MySQL on a webserver. The intention is to enhance the online league experience by covering some gaps in what can be done via OOTP itself. For those of you familiar with the old version of StatsLab, everything has been rewritten to hopefully provide a better experience.

Downloads
Downloads are now accessible at the work in progress StatsLab Wiki.

Versions are available for OOTP21, through OOTP13. See the wiki for which version to use depending on your version of OOTP. PHP 7.2 support was added in the OOTP20 version. Questions about installation and configuring the MySQL load in OOTP can be found via the Installation link on the left.

Be sure to download the appropriate version for your league.

Documentation
The zip files include basic installation instructions, as well as instructions for upgrading from the old version of StatsLab12 and draft utility instructions.

Full documentation is not yet available, but will be written up in the near future.
If in doubt, check out the old StatsLab11 documentation - most of the settings function similarly.

Key Features:
  • League selector - one install can give StatsLab level reports from High School up to the Majors.
  • Season module containing last sim, playoff, milestone reports, and more.
  • Historical module containing detailed league, team, and player reports.
  • Stat of the Day with a year's worth of unique insight into your league.
  • Vote for All-Stars, End-of-season Awards, and Hall of Famers
  • Draft Module
  • Development Tracker
  • Front office module including trade block, team injury reports, payroll projections, and projected FA reports
  • Export Tracker
  • Dynamic widgets that can be used to put stats on your online league's home page

Now the disclaimer... I haven't had as much testing from live leagues as I would have liked. The PEBA has been using the StatsLab12 version for some time now, and while I've shared the util with some OOTP13 leagues, I haven't had a lot of feedback.

I'm sure it's possible that some things have been missed, so questions/bug reports/enhancement suggestions and the like are all welcome. The best way to get a response from me is to PM me on these forums, although there's enough StatsLab experience floating around the OOTP community that posting in this thread may get your question answered by a forum member faster than I will get to it.

Acknowledgements
The original idea for StatsLab came from Catobase and OOTP:OU, as well as Markus' inclusion of a MySQL data dump. Many thanks also to Corsairs, and the rest of the PEBA for putting up with some bugs and botched fixes along the way.

Donate to StatsLab - StatsLab is free to use. Donations are not required, but greatly appreciated given the amount of time that has gone into this.

Bonedwarf 11-30-2012 11:18 PM

Ah, Catobase, I remember that well.

Look forward to trying this.

cody8200 12-09-2012 08:56 AM

I just wanted to post a live version of a StatsLab 13 game for people who may never have seen it in action. This is just my single player league I play. Just the first year in so a lot of the cool history stuff isn't working yet. Amazing work as always Frank!

Box Scores - StatsLab for OOTP13

Cooleyvol 12-09-2012 09:10 AM

Quote:

Originally Posted by cody8200 (Post 3417127)
I just wanted to post a live version of a StatsLab 13 game for people who may never have seen it in action. This is just my single player league I play. Just the first year in so a lot of the cool history stuff isn't working yet. Amazing work as always Frank!

Box Scores - StatsLab for OOTP13

Dead link (actually got a Trojan warning initially from Avast).

cody8200 12-09-2012 09:57 AM

Weird. I just tried it again after logging out and it still works.

Kaaosaste 12-10-2012 10:06 AM

I was able to get this up and running last night for my league. No hitches to report. Thanks for all your work on this!

Halara 12-13-2012 12:09 PM

This is great news! Thanks!

cody8200 12-13-2012 10:38 PM

I'm loving all of the new graphs, positional leaderboards and history. I would love to see the preseason prediction make a comeback though! Awesome stuff Frank!

Buane 12-14-2012 04:08 PM

Really happy to see this back and updated. You do a great job, and I know my league is super appreciative to have something as cool as StatsLab available to it.

Having installed this two nights ago, it's run perfectly. I haven't run into any bugs save for the following small one: the Development tracker is reporting changes in a pitcher's Control as changes in Contact. For example: http://buane.net/risingstar/StatsLab...=all&split=all

dangarion 12-15-2012 01:57 AM

When I run validate I get the following two errors.

Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in /home/pcjbl/pcjbl.com/StatsLab/session_functions.php on line 79

Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in /home/pcjbl/pcjbl.com/StatsLab/nav_functions.php on line 335



Although for the life of me I can't see the issues with those rows after looking through the code.

Also in the manual it says to put the path of the StatsLab install folder in config.txt but I think you meant for it to include the path to the sql folder.... right?

Spindel 12-15-2012 05:40 AM

I seem to have a problem with running win shares. I get a whole bunch of messages like:

Warning: Division by zero in /home/spindel/public_html/unionleague/StatsLab/winshares.php on line 1010

Warning: Division by zero in /home/spindel/public_html/unionleague/StatsLab/winshares.php on line 1077

Warning: Division by zero in /home/spindel/public_html/unionleague/StatsLab/winshares.php on line 1281

Warning: Division by zero in /home/spindel/public_html/unionleague/StatsLab/winshares.php on line 1292


That last two appear a bunch of times.

Any ideas?

fhomess 12-15-2012 07:19 PM

Quote:

Originally Posted by dangarion (Post 3419668)
When I run validate I get the following two errors.

Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in /home/pcjbl/pcjbl.com/StatsLab/session_functions.php on line 79

Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in /home/pcjbl/pcjbl.com/StatsLab/nav_functions.php on line 335

Dan, try this: Ignore these errors for now, do the steps for the admin page config, and come back and see if they reappear. If you're still having issues, please send me a link via PM.

Quote:

Originally Posted by Spindel (Post 3419680)
I seem to have a problem with running win shares. I get a whole bunch of messages like:

Warning: Division by zero in /home/spindel/public_html/unionleague/StatsLab/winshares.php on line 1010

Warning: Division by zero in /home/spindel/public_html/unionleague/StatsLab/winshares.php on line 1077

Warning: Division by zero in /home/spindel/public_html/unionleague/StatsLab/winshares.php on line 1281

Warning: Division by zero in /home/spindel/public_html/unionleague/StatsLab/winshares.php on line 1292


That last two appear a bunch of times.

Any ideas?

My guess is that you've got some leagues that haven't played games yet that are causing these. I believe they're safe to ignore and it looks like some of your leagues do have win shares values getting calculated. I'll have to look into getting taking care of these, but they appear to be benign.

Spindel 12-16-2012 03:36 AM

Yeah, a few leagues seasons are over.

dangarion 12-16-2012 04:08 PM

Quote:

Originally Posted by fhomess (Post 3419919)
Dan, try this: Ignore these errors for now, do the steps for the admin page config, and come back and see if they reappear. If you're still having issues, please send me a link via PM.

Ok I'm ignoring that.

I was getting the ERROR: OOTP SQL Utilities not configured properly (no ootp_sql_admin table)


Interesting, I went ahead and clicked on "Admin" from the validator and it said the db wasn't loaded and to click on a link to load it. I did that and it actually was able to load the whole db... with no timeouts (remember how the old version used to do that???). And it looks like I can login now.

Wow... Statslab has really progressed from the last time I was able to use it with our old league... Amazing.

dangarion 12-16-2012 05:12 PM

Just figured I would ask the genius behind Statslab, is there some type of automated way/process to get the MySql uploaded to the server without having to upload things twice (the league file, and then the MySql)? I'm not the commish but I'm the website cocommish guy for our league (just as I've always been for any league I've been in).

I'm just wondering how other leagues do it all because that's quite a bit of waiting around for things to process and uploading to do...

dangarion 12-16-2012 11:31 PM

Code:

<?php
include("/home/pcjbl/pcjbl.com/StatsLab/widget.php?show=standings&division=1&sub_league=1");
?>

That's the type of coding I should use for the widgets right? For the life of me it's not working in my sidebars and I've been at it for awhile trying a number of different PHP Text widgets in Wordpress...

Getting this error.

Warning: include(/home/pcjbl/pcjbl.com/StatsLab/widget.php?show=standings&division=1&sub_league=1) [function.include]: failed to open stream: No such file or directory in /home/pcjbl/pcjbl.com/wp-content/plugins/enhanced-text-widget/enhanced-text-widget.php(53) : eval()'d code on line 2

Warning: include() [function.include]: Failed opening '/home/pcjbl/pcjbl.com/StatsLab/widget.php?show=standings&division=1&sub_league=1' for inclusion (include_path='.:/usr/local/lib/php:/usr/local/php5/lib/pear') in /home/pcjbl/pcjbl.com/wp-content/plugins/enhanced-text-widget/enhanced-text-widget.php(53) : eval()'d code on line 2


I tried to switch it a bit with this...

Code:

<?php
include $_SERVER['document_root'].’/StatsLab/widget.php?show=leaders’;
?>

Parse error: syntax error, unexpected '=' in /home/pcjbl/pcjbl.com/test.php on line 2

Right now I'm just trying to call the code to a php file to see if I can get it to work. I can get the links themselves to work perfectly fine, but once I put the parameter everything seems to break down... The sad part is I know it's just a simple fix, I'm just not thinking straight.

It appears you can't sent parameters via include with local php files, the only way to do that is with external links (which is a big security no no).

I can get the include to work with if I just include widget.php I get the same output on my Wordpress install as I do when I go to the direct link, but that doesn't provide anything useful.

cody8200 12-17-2012 01:12 AM

Hi Frank, a few things:

I noticed the option to include the Sim Preview screen was included in admin settings but the actual simPreview.php is missing. Was this on purpose or a mistake?

The StatsLab player cards link to the development report is currently broken.

And while Markus finally distinguished between round 1, pick 1 players and round 1 pick 1 supplemental draft, statslab still doesn't (that may just be a export issue).

Thanks.

fhomess 12-17-2012 07:32 PM

Quote:

Originally Posted by dangarion (Post 3420280)
Just figured I would ask the genius behind Statslab, is there some type of automated way/process to get the MySql uploaded to the server without having to upload things twice (the league file, and then the MySql)? I'm not the commish but I'm the website cocommish guy for our league (just as I've always been for any league I've been in).

No, OOTP doesn't provide a way to do them together.

Quote:

Originally Posted by dangarion (Post 3420479)
Code:

<?php
include("/home/pcjbl/pcjbl.com/StatsLab/widget.php?show=standings&division=1&sub_league=1");
?>


I always test it first by pulling it up in a browser window by itself, first replacing the first part of the URL with "http://". From that, I can see that the code you entered works just fine. I don't use Wordpress myself, and have had no trouble getting it to work with Joomla by creating a menu item that linked to the specific widget URL. I suspect the problem you're having is related to Wordpress or the PHP plugin you're using with it. Are you able to get other, non-StatsLab php scripts to be included? Do they take parameters? There may be something that's not interacting well with the StatsLab widget.

Quote:

Originally Posted by cody8200 (Post 3420509)
I noticed the option to include the Sim Preview screen was included in admin settings but the actual simPreview.php is missing. Was this on purpose or a mistake?

simPreview.php is not ready yet, but coming.

Quote:

Originally Posted by cody8200 (Post 3420509)
The StatsLab player cards link to the development report is currently broken.

Will be fixed in 3.0.1.

Quote:

Originally Posted by cody8200 (Post 3420509)
And while Markus finally distinguished between round 1, pick 1 players and round 1 pick 1 supplemental draft, statslab still doesn't (that may just be a export issue).

Will be fixed in 3.0.1.

dangarion 12-18-2012 01:08 AM

Quote:

Originally Posted by fhomess (Post 3420827)

I always test it first by pulling it up in a browser window by itself, first replacing the first part of the URL with "http://". From that, I can see that the code you entered works just fine. I don't use Wordpress myself, and have had no trouble getting it to work with Joomla by creating a menu item that linked to the specific widget URL. I suspect the problem you're having is related to Wordpress or the PHP plugin you're using with it. Are you able to get other, non-StatsLab php scripts to be included? Do they take parameters? There may be something that's not interacting well with the StatsLab widget.

Well yeah I got the whole http:// part to work. These are supposed to be inserted as php includes right? It's not like RSS or XML or something?

fhomess 12-18-2012 02:21 PM

Quote:

Originally Posted by dangarion (Post 3420934)
Well yeah I got the whole http:// part to work. These are supposed to be inserted as php includes right? It's not like RSS or XML or something?

Ok, I installed WordPress on my site. It seems the PHP widgets won't work for this, but if you use the ****** Widget plugin, then it will work.

EDIT... apparently "eye-Frame" is a bad word here? Replace the asterisks with eye-Frame, but change "eye" to "I".


All times are GMT -4. The time now is 03:43 PM.

Powered by vBulletin® Version 3.8.10
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Copyright © 2020 Out of the Park Developments