Arrow

Changing Code | Peter's Sports League Standings | Forum

Back to the sports standings script page

Please consider registering
guest

Log In

Lost password?
Advanced Search

— Forum Scope —

  

— Match —

   

— Forum Options —

   

Minimum search word length is 4 characters - maximum search word length is 84 characters

Topic RSS
Changing Code
June 29, 2008
4:40 pm
Martyn
Guest

Hi Peter,

Just checked out you script and it is looking great so far a youth soccer site that I am involved in.

Just a few questions if you have the time :-)

1) Can you point me in the right direction to change the runs for and runs against on the display so it reads as goals for and goals against (GF / GA instead of RF and RA)

2) I can easily change some of the coding so it blends into my site, however, I was just wondering if you have any docs that indicated which code can be changed and which should be left alone.

3) How can I remove the PCT column on the standings page. I dont want it to show.

Thanks in advance

regards

Martyn

June 30, 2008
1:44 am
Peter
Admin
Forum Posts: 841
Offline

Sure:

1) If you only need to change this in the front-end display, it is quite simple. Just open standings.php (or whatever you renamed it to) and search for:

<strong>RF</strong>

and:

<strong>RA</strong>

Then replace the labels as necessary.

2) I don't have specific docs on this, but if you look at the code in standings.php, all of the database retrieval stuff should be left as-is. All display stuff can be changed as much as you want.

The original intent of standings.php was for it to be a framework and thus there's no reason why the different implementations of the script cannot look unique. One day, in the very far future, I hope to make it more of a template system that properly separates content from design.

3) See this topic about making the default sorting method something other than winning percentage. After doing that, if you want to remove that field completely, you can first remove the heading for it:

<td><?php if ($standings_sort != 0) print '<a href="' . $_SERVER['PHP_SELF'] . "?conf=$confid&sort=0\\">"; ?><strong>PCT</strong><?php if ($standings_sort != 0) print '</a>'; ?></td>

Then remove the two entries for it:

<td><?php print $winningpct; ?></td>

To top it off, you can change the default sort order:

default: // Sort by winning percentage
$standings_sort = 0; $sort_order = "winningpct DESC, teamorder DESC";