Changeset 44 for trunk/index.php


Ignore:
Timestamp:
Sep 17, 2020, 10:12:29 AM (4 years ago)
Author:
chronos
Message:
  • Added: Allow to show runners in more narrower groups as all, men, women and kids.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/index.php

    r43 r44  
    713713  }
    714714
    715   function ShowRunners()
     715  function ShowRunnersAll()
     716  {
     717    return $this->ShowRunners();
     718  }
     719
     720  function ShowRunnersMen()
     721  {
     722    return $this->ShowRunners('(Gender=1)');
     723  }
     724
     725  function ShowRunnersWomen()
     726  {
     727    return $this->ShowRunners('(Gender=2)');
     728  }
     729
     730  function ShowRunnersKids()
     731  {
     732    return $this->ShowRunners('(Gender=3)');
     733  }
     734
     735  function ShowRunners($Where = '1')
    716736  {
    717737    $this->Title = T('Runners').' - '.$this->Title;
    718738    $Output = '<div class="page-title">'.T('Runners').'</div>';
     739    $Output .= '<div class="section-title">'.
     740      '<a href="'.$this->Link('/runners/').'">'.T('All').'</a> '.
     741      '<a href="'.$this->Link('/men/').'">'.T('Men').'</a> '.
     742      '<a href="'.$this->Link('/women/').'">'.T('Women').'</a> '.
     743      '<a href="'.$this->Link('/kids/').'">'.T('Kids').'</a>'.
     744      '</div>';
    719745    $Year = $this->GetYear();
    720746
    721747    $Output .= '<div class="section-title">'.$this->YearList('/runners/', $Year, 'Runner').' '.T('Name').': '.$this->ShowSearch().'</div>';
    722     $Where = '(Year='.$Year.')';
     748    $Where .= ' AND (Year='.$Year.')';
    723749    if (array_key_exists('query', $_GET) and ($_GET['query'] != ''))
    724750    {
     
    11141140      //else if ($this->PathItems[0] == 'empty') $Output .= $this->ShowEmpty();
    11151141      else if ($Item == 'runner') $Output .= $this->ShowRunner();
    1116       else if ($Item == 'runners') $Output .= $this->ShowRunners();
     1142      else if ($Item == 'runners') $Output .= $this->ShowRunnersAll();
     1143      else if ($Item == 'men') $Output .= $this->ShowRunnersMen();
     1144      else if ($Item == 'women') $Output .= $this->ShowRunnersWomen();
     1145      else if ($Item == 'kids') $Output .= $this->ShowRunnersKids();
    11171146      else if ($Item == 'team') $Output .= $this->ShowTeam();
    11181147      else if ($Item == 'teams') $Output .= $this->ShowTeams();
Note: See TracChangeset for help on using the changeset viewer.