Jump to content

Template talk:NBA game log end

Page contents not supported in other languages.
From Wikipedia, the free encyclopedia
WikiProject iconNational Basketball Association Template‑class
WikiProject iconThis template is within the scope of WikiProject National Basketball Association, a collaborative effort to improve the coverage of the NBA on Wikipedia. If you would like to participate, please visit the project page, where you can join the discussion and see a list of open tasks.
TemplateThis template does not require a rating on Wikipedia's content assessment scale.

Update[edit]

This template is in desperate need of an update; it uses the old espn nba link format. However, as I cannot figure out how to do it, I will need someone to help me carry out the update.

The new espn links are in this format: http://espn.go.com/nba/team/schedule/_/name/X/year/Y/seasontype/Z/, where X is the three-letter team abbreviation, Y is the year that the season ended, and Z is a number from 1 to 3. 1 gives the preseason game log, 2 gives the regular season game log, and 3 gives the playoffs game log.

I was thinking some code along the lines of this:

  • Pre-season: {{NBA game log end|three-letter abbreviation|preseason=yes|end_year=2009}}
  • Regular season: {{NBA game log end|three-letter abbreviation|regseason=yes|end_year=2009}}
  • Playoffs: {{NBA game log end|three-letter abbreviation|playoffs=yes|end_year=2009}}

There would also be different text shown for each type of game log:

  • Pre-season: 2008–09 pre-season schedule
  • Regular season: 2008–09 regular season schedule
  • Playoffs: 2008–09 playoffs schedule

Can someone please help me out here?


Possible Fix[edit]

The following should correctly load the pre, regular, and post season for all teams: [{{{schedule|http://espn.go.com/nba/team/schedule/_/name/{{{1}}}/year/{{{end_year|2013}}}/seasontype/{{#ifeq:{{{playoffs}}}|yes|3|{{#ifeq:{{{preseason}}}|yes|1|2}}}}/}}} {{#ifeq:{{{playoffs}}}|yes|{{{end_year|2013}}}|{{#expr:{{{end_year|2013}}}-1}}–{{padleft:{{#expr:{{{end_year|2013}}} mod 100}}|2|0}}}} {{#if: {{{playoffs|}}}|playoff|{{#if: {{{preseason|}}}|preseason|season}}}} schedule]

However, there are a couple of teams that espn uses a different abbreviation for:

  • Golden State - gs
  • New Orleans - no
  • New York - ny
  • San Antonio - sa
  • Utah - utah
  • Washington - wsh

I'd make the change, but I'm pretty new to this and I'm not completely sure what I've done it what is wanted. It seemed to work just fine in the sandbox, but it could be I just didn't test it right to find the broken parts. Trooperomulo (talk) 21:30, 28 November 2012 (UTC)[reply]