Changeset 6 for trunk


Ignore:
Timestamp:
Aug 5, 2018, 8:38:46 PM (6 years ago)
Author:
chronos
Message:
  • Fixed: Relative links to BaseURL.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/index.php

    r4 r6  
    1212{
    1313  var $NoFullPage = false;
    14  
     14
    1515  function Link($URL)
    1616  {
    17     if(substr($URL, 0, 1) == '/') return($this->Config['BaseURL'].substr($URL, 1));
    18       else return($URL);
     17    return($this->Config['BaseURL'].$URL);
    1918  }
    2019
     
    6867      $Output .= '<th>'.$ResourceGroup['Name'].'</th>';
    6968    }
    70     $Output .= '</tr>';     
     69    $Output .= '</tr>';
    7170    $DbResult = $this->Database->select('Dance', '*, (SELECT Name FROM DanceGroup WHERE DanceGroup.Id=Dance.Group) AS GroupName', '1 ORDER BY `Name`');
    7271    while($Dance = $DbResult->fetch_assoc())
     
    114113    $MeetSources->ParseAll();
    115114  }
    116  
     115
    117116  function ShowMeetList()
    118117  {
     
    130129      if (array_key_exists('pohlavi', $_GET) ) {
    131130        if ($_GET['pohlavi'] > 0) $_SESSION['pohlavi'] = $_GET['pohlavi'];
    132           else unset($_SESSION['pohlavi']); 
     131          else unset($_SESSION['pohlavi']);
    133132      }
    134133    } else {
     
    136135      ' var load_timer = 100;
    137136   var ltimer = null;
    138    
     137
    139138   function checkOut(kc,obj){
    140       if(kc==13) $(obj).blur(); 
     139      if(kc==13) $(obj).blur();
    141140   }
    142141   function initLTimer(tm){
     
    148147      ltimer = null;
    149148   }
    150            
     149
    151150   var cf = {};
    152151
     
    169168      if(lonreload) initLTimer(1000); else initLTimer(100);
    170169   }
    171    
     170
    172171   function freloader(){
    173172      ltimer = null;
     
    214213      '</div>';
    215214    }
    216    
    217     $Where = '';   
     215
     216    $Where = '';
    218217    if (array_key_exists('vekod', $_SESSION) and ($_SESSION['vekod'] != '')) $Where .= ' AND (Age >= '.$_SESSION['vekod'].')';
    219218    if (array_key_exists('vekdo', $_SESSION) and ($_SESSION['vekdo'] != '')) $Where .= ' AND (Age <= '.$_SESSION['vekdo'].')';
     
    224223    if (array_key_exists('pohlavi', $_SESSION) and ($_SESSION['pohlavi'] != '')) $Where .= ' AND (Gender = '.$_SESSION['pohlavi'].')';
    225224    if (substr($Where, 0, 4) == ' AND') $Where = substr($Where, 4);
    226     if ($Where == '') $Where = '1';   
    227    
     225    if ($Where == '') $Where = '1';
     226
    228227    $DbResult = $this->Database->query('SELECT COUNT(*) FROM `MeetItem` WHERE '.$Where);
    229228    $DbRow = $DbResult->fetch_row();
    230229    $PageList = GetPageList($DbRow[0]);
    231    
     230
    232231    $Gender = array('', 'Muž', 'Žena');
    233232    $Output .= '<div id="list_content">';
     
    260259        '<td>'.$Gender[$MeetItem['Gender']].'</td>'.
    261260        '<td>'.$MeetItem['Message'].'</td>'.
    262         '<td><a href="'.$this->Link($MeetItem['SourceURL']).'">'.$MeetItem['SourceName'].'</a></td>';     
     261        '<td><a href="'.$this->Link($MeetItem['SourceURL']).'">'.$MeetItem['SourceName'].'</a></td>';
    263262      $Output .= '</tr>';
    264263    }
     
    269268    return($Output);
    270269  }
    271  
     270
    272271  function ShowMeetListRss()
    273272  {
    274273    global $Config;
    275    
     274
    276275    $this->NoFullPage = true;
    277276    $RSS = new RSS();
    278277    $RSS->Title = 'Taneční seznamka';
    279278    $RSS->Description = '';
    280     $RSS->Link = $Config['BaseURL'].'seznamka';
    281    
     279    $RSS->Link = $this->Link('/seznamka/');
     280
    282281    $DbResult = $this->Database->select('MeetItem', '*, (SELECT MeetSource.Name FROM MeetSource WHERE MeetSource.Id = MeetItem.Source) AS SourceName, '.
    283282      '(SELECT MeetSource.URL FROM MeetSource WHERE MeetSource.Id = MeetItem.Source) AS SourceURL', '1 ORDER BY `Date` DESC LIMIT 30');
     
    291290      if ($MeetItem['Phone'] != '') $Description .= '<br/>Telefon: '.$MeetItem['Phone'];
    292291      $Description .= '<br/>Škola: <a href="'.$this->Link($MeetItem['SourceURL']).'">'.$MeetItem['SourceName'].'</a>';
    293       $RSS->Items[] = array(         
    294         'Title' => $Title, 
    295         'Description' => $Description, 
     292      $RSS->Items[] = array(
     293        'Title' => $Title,
     294        'Description' => $Description,
    296295        'Time' => MysqlDateTimeToTime($MeetItem['Date']),
    297         'Link' => $Config['BaseURL'].'seznamka',
     296        'Link' => $this->Link('/seznamka/'),
    298297      );
    299298      $Output .= '<tr>'.
     
    322321      '<link rel="stylesheet" href="'.$this->Link('/style.css').'" type="text/css" media="all" />'.
    323322      '<meta http-equiv="content-type" content="application/xhtml+xml; charset='.$this->Config['Encoding'].'" />'.
    324       '<script src="jquery.js"></script>';
     323      '<script src="'.$this->Link('/jquery.js').'"></script>';
    325324    $Output .= '<link rel="alternate" title="Taneční seznamka" href="'.
    326       $this->Config['BaseURL'].'seznamka-rss" type="application/rss+xml" />';
     325      $this->Link('/seznamka-rss/').'" type="application/rss+xml" />';
    327326    $Output .= '<title>Tance</title>'.
    328327      '</head><body>';
     
    344343    $this->PathItems = $this->ProcessURL();
    345344
    346     $Output = '';   
    347 
    348     if(count($this->PathItems) > 0) {
     345    $Output = '';
     346
     347    if(count($this->PathItems) > 0)
     348    {
    349349      if($this->PathItems[0] == 'skoly') $Output .= $this->ShowSchoolList();
    350350      else if($this->PathItems[0] == 'tance') $Output .= $this->ShowDanceList();
     
    354354      else $Output .= $this->ShowDanceList();
    355355    } else $Output .= $this->ShowDanceList();
    356     if (!$this->NoFullPage) {
     356    if (!$this->NoFullPage)
     357    {
    357358      $Output = $this->ShowMenu().$Output;
    358359      echo($this->ShowPage($Output));
Note: See TracChangeset for help on using the changeset viewer.