Download Latest Version golfstatsphp_3.0.zip (461.4 kB)
Email in envelope

Get an email when there's a new version of GolfstatsPHP

Home / OldFiles
Name Modified Size InfoDownloads / Week
Parent folder
golfstatsphp_2.0.3.tar.gz 2007-03-10 34.8 kB
golfstatsphp_2.0.2a.tar.gz 2007-03-07 33.4 kB
golfstatsphp_2.0.2.tar.gz 2007-03-07 16.6 kB
golfstatsv2.1.tar.gz 2005-01-26 48.8 kB
changesv2.1.txt 2005-01-26 4.0 kB
README.txt 2005-01-05 14.3 kB
golfstatsV20.tar.gz 2005-01-03 305.9 kB
sqlchangesv2.txt 2004-12-30 3.7 kB
golfstatsphp_without_data.sql 2004-12-29 29.6 kB
menu.php 2004-08-13 14.6 kB
README 2004-07-30 2.1 kB
mainsql2.sql 2004-07-20 27.2 kB
mainsql.sql 2004-07-20 27.2 kB
golfstatsphp.tar.gz 2004-07-20 262.7 kB
structuregolf.sql 2004-05-14 24.3 kB
Totals: 15 Items   849.3 kB 0
GOLFSTATSPHP v2.0
==================

1) WHAT'S NEW
=============

* Cosmetics changes and navigation changes
* Player statistics doesn't take into account players with stats 0, i.e best putts per round must be > 0.
* Additional information on front page for news, quotes etc
* Money Leaders and Ranking from personalized tournaments
* "Random Ramble" option, where player's quotes of the day are randomly selected
* Message Board option to delete own messages
* Delete function for own scores
* Picture for stats comparison
* Adjustments in counting GIR and fairway hits. Only holes putted will be taken into account for GIR calculation and fairway hits can be selected/de-selected for calculation
* WMD (Weapons of Mass Destruction) option, where players can add their own golf equipments
* Management module created for updating hole ranks, deleting players, deleting courses, recalculating stats, creating tournament and types, processing tournaments according to prize money
* Tournament statistics and leaderboard according to scores.


2) CHANGES
==========

There were some coding changes done, and some additional database changes. The sql changes can be found in sqlchangesv2.txt.
Tables added to accomodate more features


3) INSTALLATION
===============

*Unpack the archive files into the root directory of your webserver and name the directory whatever you want. To get started, there are a few things to check:
*Ensure that the tables 'stableford' and 'clubs' are populated.
*ensure that the env.php is set, i.e tourleaderid is the variable for the leader of our local group, this is just to identify the front page articles for him and can be commented out if not needed. rootid is more important as it's the id that can access the management console of the application. Guestid would be the guest login where the user has limited access and cannot add/edit scorecards or courses.
*dbasecon.inc.php is important. Set up your database connectivity stuff here.
*login.php is your front file, you can (and should) enter your introduction here
*auth.inc.php and sesion.inc.php deals with the cookies and sessions. Please ensure that your broswer accepts cookies for the app to work.
*menu.php is your front logged in page and again, you can do whatever you want here and even change the structure.
*the pictures and stuff are really up to you, if you feel you don't need them, you can just remove the img src statements in the files. Perhaps I'll work on a way to check if file exist, if so, put up picture else, leave empty.
*Also, please ensure that register_globals = On for variables to be able to pass properly. If you prefer to be more secure, then I'm afraid there would be a lot of coding changes in terms of variable calling. I just run golf statistics, not really classified national security information :)
*For this app to work, PLEASE ENABLE COOKIES. For I.E. users: Tools --> Internet Options --> Privacy Tab --> Low
For Firefox, Tools --> Options --> Privacy --> Cookies -->Allow sites to set cookies
*My PHP is compiled with:

'./configure' '--with-apxs=/usr/local/apache/bin/apxs' '--with-xml' '--enable-bcmath' '--enable-calendar' '--enable-ftp' '--with-gd' '--with-jpeg-dir=/usr/local' '--with-png-dir=/usr' '--with-xpm-dir=/usr/X11R6' '--with-gettext' '--with-imap' '--with-imap-ssl' '--with-kerberos' '--with-mcrypt' '--enable-magic-quotes' '--with-mysql=/usr' '--enable-discard-path' '--with-pear' '--enable-sockets' '--enable-track-vars' '--enable-versioning' '--with-zlib'

just make sure --with-gd; --enable-bcmath is there, along with png,zlib,jpeg support this is used for graph drawing and calculation of stats.

4) INSTRUCTIONS
===============

Starting Pages
==============
The front page login.php can be manually changed and the link to allow user to register can be taken out or disallowed, up to your discretion. How I set up would be to have a guest user (you can set this in the env.php file) and disallow this user access to add scorecards and courses so that he/she won't screw up the statistics by adding in ridiculous scores. Basically, for pages you want to restrict, just add a 

if ($login_id<>$guestid) { 

do stuff

} else {

restriction message
}

The initial pages without any data looks a little sad, I haven't really caught all exceptions yet, my coding is so messed up; but create your root id first (set at env.php), either by directly accessing the database or using signup.php.

You can modify menu.php easily (take out the random ramble option, the game organiser, the money leader board ) and create your own ways to display information. We'll look later into the tables in the database that you may create your own queries and stuff.


The ramblings of the tourleader (we have our private tour organiser), is a section quite manually set up dedicated to out tour organiser's rambling. You don't need it but if you ever want to have some sort of thing like this, this is how I did it. Basically it starts off with:

$mugshot="mug_"."$tourleaderid".".jpg"; //this is defined in the env.php file

The articles are numbered like so

leadramble.php?article=009

where 009 pertains to leadramble009.txt in the files directory


The money leaders section is also optional. This only pertains to tournaments. 

Mugshots all start with mug_<userid>.jpg. Again, you can change this to what suits you best




ScoreCard
=========
Select date, venue and the handicap you are using (I opted to have a variable handicap because we often play a system 36 format here, where our handicaps are adjusted according to our scores so it varies), and whether this is a 'tournament'. This is really up to you, basically it just sets up the field in games table to be 0 or 1.

There has been some changes in the scorecard. Again, take into account 4 inputs. Your gross score, which is easy. There's an option now for you to disregard this game's fairway hit. I.e A lot of people don't keep track of this in some of their games. If they played 3 rounds and only track one round's fairway hit, it would be unfair to say he only hit, say 5 of 54 holes (par 3s are not counted, but for the sake of the example), as opposed to 5 of 18 holes that he counted his fairway hits. By default, it's set to NOT COUNT, so remember to check the checkbox beside the fairway hit!

Now, GIR is not counted for holes you did not putt, i.e putts that are 'na'.

Drive distance for par 3s not counted.

Drive distance with driver only accounted for, so teeing off with a 4 iron/3 wood does not account for your distance.

TeeOff club is the something even I don't use. I just set it to driver all the way, unless I hit a 150m submarine with my 3 wood, then I'd either not take the drive into account ('na') or set it to 150m and 3 wood. I created the teeoff club option in the future event that people wanted to dig into how far they often hit a shot with a club or what sort of clubs are usually used for a particular hole.

Once all is entered, click Calculate. Then confirm. If you forget to confirm, then your scores won't be entered. Once confirmed, the app will calculate your stats accordingly.



Scores
======

Finally, I managed to add a delete scores option. Once the score is deleted, the stats are recalculated for that user. Course holes should be calculated as well, I didn't automate this, so you have to go Management-->Update Hole Ranks manually


Stats
=====

Here we can go head to head comparison between players. Scrambling stats has changed to take into account only for holes putted. 


Tournament
==========
The tournament module is very much a work in progress. The first page basically summarises the tourneys played, the type (so far, we only calculate using stableford, stroke play to gross or net), Location, champion and score, and tournament purse. 

Tournament2.php brings out the details. There are 3 ways to access this file. 
1) Pass the tourneyid through the URL
2) When you click on submit for 'Tournament Report'
3) When you click 'Delete' for tournament report

Any other way to access this file would result in it barfing.

Tourney statistics are counted in the management module.


In tournament2.php, tournamet gallery takes in images/<gameid>[a-z].jpg. You can name this to whatever suits best. Also tournament correspondence is just my way to chuck all the emails at the bottom. This simply takes the file <gameid>a.txt and prints it out at the bottom. 



Courses
=======

I didn't really work much on these files, although future version would tweak the Top 5 stats on the holes and disregard holes with 0% statistics.

Also, remember that the naming convention should be optimally 4 letters and 1 number. It shouldn't matter, but I'll set up a regex check in the next version to set it at abcd[1-9].


Players
=======

Only change is to take into account clubs in bag for each player, the ball used and bags used. Again, the file players2.php is pretty easy to edit and to modify.


Account
=======

This also remains pretty much the same except that we can add our clubs


5) MANAGEMENT MODULE
====================

This is the biggest change made and still very much a work in progress.

Only the rootid user can access this module.


Update Hole Ranks
=================

This updates all the courses holes and recalculates the statistics. Basically, if you have added in a scorecard, the holes doesn't get update until someone (a rootid) selects this option. I toyed with the idea of allowing anyone to just update it, or even update it automatically after each scorecard submission, but didn't really get down to doing it. I suppose it should be pretty straight forward and might do this next version.


Create Tournament
=================
The drop down for tournament game would be the gameid for any game created with the Tournament Checkbox selected. 


Process Tournament
==================

Key in the top 5 prize (or just leave it) and just select the tournament games to process. If the tournament is not there, then click another menu and reenter back into management again (don't F5, since it would resubmit the previous form info again). Once process, the tournament will be added into the database.

So in summary, to start a tournament:
*Create a scorecard with the tournament checked. It could be one or more.
*In management, create a tournament with the gameid created above.
*Process the tournament and the prize money


Delete Tournament
=================

This just deletes the tournament and set all tournament games to non-tournament. There is no recalculation of normal statistics.


Delete Course
=============
This deletes the course from the database. This will delete ALL games of ALL players. If there is a tournament, please delete the tourney first.


Delete Player
=============
This deletes the players from the database. This will delete ALL games of the selected player. If there is a tournament that the player is in, note that the scorecard for that player will no longer be available.


Add Ramble
==========
This is just a front end to add the random quotes we see on the main page. We can ignore this if you like.


6) DATABASE
===========

While I won't go through in every single detail, the overview of the database should provide you with enough to start modifying if you think appropriate.

Games
=====

Additional four fields for tournament (1,0), tourney placing, money won and points won (points are not calculated yet, maybe useful for future). Also, field types have changed in fairway hit, gir to accomodate 'na'. Remember, if this is changed to char type, we have to CAST to numeric during the sql query to find top record!

Hole
====

Changes only to the type, again to char and again, remember to CAST during query!


Holerank
========

This is the table that gets updated to reflect hole statistics


Msgboard
========

The ramble (quote) and normal messages piggy back on this table. Quotes would have a rambleid > 1. Normal messages (appearing in the yellow box at the front page) has rambleid=0. One thing to note about the random ramble is that it takes a sequential formula according to the rambleid. I.e if you have ramble 1-10, there's no problem. But say you deleted ramble 3, now you have a break, 1-2, 4-10. The formula still takes into account the formula for 1-10, so  it might generate a random 3, in which in this case, its empty, hence, a random empty quote pops up. Might work on this in next version.


Ranking
=======

This is where all the player ranks are kept and calculated.


Stableford
==========

Probably in the next version, I'll come up with a simple interface to edit this table. As of now, you'll have to manually change the stableford point system.


Substats
========

These are actually the stats used to count the ranking stats.


Tourney_Board
=============

Here is where the tournament report is kept


Tourney_stat
============

And here's where all the tourney stats dumped by 'Processing Tournament' in management module are kept.


users_clubs
===========

New table to store club information for players

users_tour
==========

This is the new user database, entirely up to you, but make sure you change the queries in all files to query the new field name as opposed to users_tour.



7) DIRECTORIES AND FILES
========================

chart
=====

This is where we installed jpgraph for drawing

files
=====

Rambling files from leadramble as well as tournament correspondence. You can actually put anything in here.

images
======

Mug shots, tourney shots, swing analysis shot etc

tempcharts
==========

This is where charts created by jpgraph will be stored.


8) KNOWN BUGS
=============

* In scoreview.php, deleting the last game would result in calls to empty arrays due to the inclusion of mainstats and substats calculation.
*The error occurs "Warning: Cannot modify header information - headers already sent" during login. Apaprently, the dbasconn script might have spaces at the bottom causing this to occur. Thanks Dave, for pointing this out.


9) NEXT VERSION
===============
* Option to convert to yardage
* Sand saves


10) MORE ENQUIRIES
==============

If there are more enquiries, email me at stevie@core.com.my. I'll try my best to help. Also, if there are more features, questions, I'll try to compile an FAQ list on golfstatsphp.

Have fun!
Source: README.txt, updated 2005-01-05