Changeset 12


Ignore:
Timestamp:
Dec 21, 2018, 8:51:54 PM (6 years ago)
Author:
chronos
Message:
  • Modified: Use absolute links for RSS channels.
Location:
trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/RSS.php

    r10 r12  
    1818  function Generate()
    1919  {
     20    Header('Content-Type: text/xml; charset=utf-8');
    2021    $Result = '<?xml version="1.0" encoding="'.$this->Charset.'" ?>'."\n". //<?
    21   '<rss version="2.0">'."\n".
    22   "  <channel>\n".
    23   "    <title>".$this->Title."</title>\n".
    24   "    <link>".$this->Link."</link>\n".
    25   "    <description>".$this->Description."</description>\n".
    26   "    <language>cs</language>\n".
    27   "    <webMaster>".$this->WebmasterEmail."</webMaster>\n".
    28   "    <pubDate>".date('r')."</pubDate>\n".
    29   "    <ttl>20</ttl>\n";
     22      '<rss version="2.0">'."\n".
     23      "  <channel>\n".
     24      "    <title>".$this->Title."</title>\n".
     25      "    <link>".$this->Link."</link>\n".
     26      "    <description>".$this->Description."</description>\n".
     27      "    <language>cs</language>\n".
     28      "    <webMaster>".$this->WebmasterEmail."</webMaster>\n".
     29      "    <pubDate>".date('r')."</pubDate>\n".
     30      "    <ttl>20</ttl>\n";
    3031    foreach($this->Items as $Item)
    3132    {
     
    3334        '      <title>'.htmlspecialchars($Item['Title'])."</title>\n".
    3435        '      <description>'.htmlspecialchars($Item['Description'])."</description>\n".
    35   '      <pubDate>'.date('r',$Item['Time'])."</pubDate>\n".
    36   '      <link>'.$Item['Link']."</link>\n".
     36        '      <pubDate>'.date('r',$Item['Time'])."</pubDate>\n".
     37        '      <link>'.$Item['Link']."</link>\n".
    3738        "    </item>\n";
    3839    }
  • trunk/index.php

    r11 r12  
    1616  {
    1717    return($this->Config['BaseURL'].$URL);
     18  }
     19
     20  function AbsoluteLink($URL)
     21  {
     22    return($this->Config['HostName'].$this->Config['BaseURL'].$URL);
    1823  }
    1924
     
    9499    $Output = '<h4 style="text-align: center;">Taneční školy:</h4>';
    95100    $Output .= '<table class="WideTable">';
    96     $Output .= '<tr><th>Název</th><th>Adresa</th>';
     101    $Output .= '<tr><th>Název</th><th>Webové stránky</th><th>Adresa</th>';
    97102    $Output .= '</tr>';
    98103    $DbResult = $this->Database->select('School', '*', '1 ORDER BY `Name`');
    99104    while($School = $DbResult->fetch_assoc())
    100105    {
    101       $Output .= '<tr><td><a href="'.$this->Link($School['URL']).'">'.$School['Name'].'</a></th><td>'.$School['Address'].'</td>';
     106      $Output .= '<tr><td>'.$School['Name'].'</td><td><a href="'.$this->Link($School['URL']).'">'.$School['URL'].'</a></th><td>'.$School['Address'].'</td>';
    102107      $Output .= '</tr>';
    103108    }
     
    281286    $RSS->Title = 'Taneční seznamka';
    282287    $RSS->Description = '';
    283     $RSS->Link = $this->Link('/seznamka/');
     288    $RSS->Link = $this->AbsoluteLink('/seznamka/');
    284289
    285290    $DbResult = $this->Database->select('MeetItem', '*, (SELECT MeetSource.Name FROM MeetSource WHERE MeetSource.Id = MeetItem.Source) AS SourceName, '.
     
    297302      if ($MeetItem['Height'] != '') $Description .= '<br/>Výška: '.$MeetItem['Height'].' cm';
    298303      if ($MeetItem['Weight'] != '') $Description .= '<br/>Váha: '.$MeetItem['Weight'].' kg';
    299       $Description .= '<br/>Škola: <a href="'.$this->Link($MeetItem['SourceURL']).'">'.$MeetItem['SourceName'].'</a>';
     304      $Description .= '<br/>Škola: <a href="'.$this->AbsoluteLink($MeetItem['SourceURL']).'">'.$MeetItem['SourceName'].'</a>';
    300305      $RSS->Items[] = array(
    301306        'Title' => $Title,
    302307        'Description' => $Description,
    303308        'Time' => $MeetItem['UnixTime'],
    304         'Link' => $this->Link('/seznamka/'),
     309        'Link' => $this->AbsoluteLink('/seznamka/'),
    305310      );
    306311      $Output .= '</tr>';
Note: See TracChangeset for help on using the changeset viewer.