Changeset 31 for trunk/Import/Amblar.php


Ignore:
Timestamp:
Dec 30, 2018, 7:37:55 PM (6 years ago)
Author:
chronos
Message:
  • Modified: Store date of meet items including time. For items without specified time, just use current time (time of import).
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Import/Amblar.php

    r20 r31  
    5555      $Type = trim(GetTextBetween($Item, ' ', ' '));
    5656      if ($Type == 'odpovězeno') continue;
    57       $MeetItem->Date = trim(GetTextBetween($Item, '<span class="dwqa-date">', '</span>'));
    58       if (mb_substr($MeetItem->Date, 0, 4) == 'před')
     57      $MeetItem->Time = trim(GetTextBetween($Item, '<span class="dwqa-date">', '</span>'));
     58      if (mb_substr($MeetItem->Time, 0, 4) == 'před')
    5959      {           
    60         $Parts = explode(' ', $MeetItem->Date);
    61         if ($Parts[2] == 'hours') $MeetItem->Date = strtotime("-".$Parts[1]." hours");
    62         else if ($Parts[2] == 'dní') $MeetItem->Date = strtotime("-".$Parts[1]." days");
    63         else if ($Parts[2] == 'dny') $MeetItem->Date = strtotime("-".$Parts[1]." days");
    64       } else $MeetItem->Date = HumanDateToTime($MeetItem->Date);
     60        $Parts = explode(' ', $MeetItem->Time);
     61        if ($Parts[2] == 'hours') $MeetItem->Time = strtotime("-".$Parts[1]." hours");
     62        else if ($Parts[2] == 'dní') $MeetItem->Time = strtotime("-".$Parts[1]." days");
     63        else if ($Parts[2] == 'dny') $MeetItem->Time = strtotime("-".$Parts[1]." days");
     64      } else $MeetItem->Time = HumanDateTimeToTime($MeetItem->Time.' '.HumanTime(time()));
    6565      $MeetItem->Email = '';
    6666      $MeetItem->Message = '';
Note: See TracChangeset for help on using the changeset viewer.