Changeset 32 for trunk/index.php


Ignore:
Timestamp:
Dec 30, 2018, 8:14:55 PM (6 years ago)
Author:
chronos
Message:
  • Added: Meet item TimeImport time to see when was item imported to the database. Use TimeImport in RSS export for items with only date specified.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/index.php

    r31 r32  
    272272      array('Name' => 'Age', 'Title' => 'Věk'),
    273273      array('Name' => 'Weight', 'Title' => 'Váha'),
    274       array('Name' => 'Location', 'Title' => 'Úmístění'),
     274      array('Name' => 'Location', 'Title' => 'Umístění'),
    275275      array('Name' => 'Gender', 'Title' => 'Pohlaví'),
    276276      array('Name' => 'Message', 'Title' => 'Zpráva'),
     
    360360
    361361    $DbResult = $this->Database->select('MeetItem', '*, (SELECT MeetSource.Name FROM MeetSource WHERE MeetSource.Id = MeetItem.Source) AS SourceName, '.
    362       '(SELECT MeetSource.URL FROM MeetSource WHERE MeetSource.Id = MeetItem.Source) AS SourceURL, UNIX_TIMESTAMP(`Time`) AS `UnixTime`', '1 ORDER BY `Time` DESC LIMIT 30');
     362      '(SELECT MeetSource.URL FROM MeetSource WHERE MeetSource.Id = MeetItem.Source) AS SourceURL', '1 ORDER BY `Time` DESC LIMIT 30');
    363363    while($MeetItem = $DbResult->fetch_assoc())
    364364    {
     
    373373      if ($MeetItem['Height'] != '') $Description .= '<br/>Výška: '.$MeetItem['Height'].' cm';
    374374      if ($MeetItem['Weight'] != '') $Description .= '<br/>Váha: '.$MeetItem['Weight'].' kg';     
    375       $Description .= '<br/>Zdroj importu: <a href="'.$MeetItem['SourceURL'].'">'.$MeetItem['SourceName'].'</a>';
     375      $Description .= '<br/>Zdroj importu: <a href="'.$MeetItem['SourceURL'].'">'.$MeetItem['SourceName'].'</a>';     
     376      $Time = MysqlDateTimeToTime($MeetItem['Time']);
     377      $TimeImport = MysqlDateTimeToTime($MeetItem['TimeImport']);     
     378      // Append time part of TimeImport time to item time so new items will appear in correct time order even if item doesn't have time part specified
     379      if (TimeToMysqlTime($Time) == '00:00:00')
     380      {
     381        $Time = MysqlDateTimeToTime(TimeToMysqlDate($Time).' '.TimeToMysqlTime($TimeImport));
     382      }
    376383      $RSS->Items[] = array(
    377384        'Title' => $Title,
    378385        'Description' => $Description,
    379         'Time' => $MeetItem['UnixTime'],
     386        'Time' => $Time,
    380387        'Link' => $this->AbsoluteLink('/seznamka/inzerat/'.$MeetItem['Id'].'/'),
    381388      );
Note: See TracChangeset for help on using the changeset viewer.