Ignore:
Timestamp:
Apr 19, 2022, 10:25:41 PM (3 years ago)
Author:
chronos
Message:
  • Added: Meet items import from La Tropcial school.
  • Modified: Use explicit types for class fields.
  • Modified: Use utf8mb4 encoding for database.
  • Fixed: Spam items checking was inverted.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Modules/Meet/Import/Seznamka.php

    r63 r65  
    2525      $MeetItem = new MeetItem();
    2626      //$MeetItem->Image = trim(GetTextBetween($Item, '<div', '</div>'));
    27       $MeetItem->Gender = trim(GetTextBetween($Item, "<span class=\"ipoh ", "\""));
    28       if ($MeetItem->Gender == 'zena') $MeetItem->Gender = Gender::Female;
    29         else if ($MeetItem->Gender == 'muz') $MeetItem->Gender = Gender::Male;
    30         else $MeetItem->Gender = Gender::Undefined;
     27      $Gender = trim(GetTextBetween($Item, "<span class=\"ipoh ", "\""));
     28      if ($Gender == 'zena') $MeetItem->Gender = Gender::Female;
     29        else if ($Gender == 'muz') $MeetItem->Gender = Gender::Male;
     30        else $Gender = Gender::Undefined;
    3131      $MeetItem->Name = trim(GetTextBetween($Item, '>', '</span>'));
    3232      $MeetItem->Name = trim(strip_tags($MeetItem->Name));
     
    3535      $MeetItem->Age = trim(str_replace('let', '', $MeetItem->Age));
    3636      $MeetItem->Location = trim(strip_tags(GetTextBetween($Item, '<span class=\'imesto\'>', '</span>')));
    37       $MeetItem->Time = trim(html_entity_decode(str_replace('&nbsp;', '', GetTextBetween($Item, 'TOP</a>', '</span>'))));
    38       if ($MeetItem->Time == 'Včera') $MeetItem->Time = HumanDate(time() - 60*60*24);
    39         else if ($MeetItem->Time == 'Dnes') $MeetItem->Time = HumanDate(time());
    40       $MeetItem->Time = HumanDateToTime($MeetItem->Time);
     37      $Time = trim(html_entity_decode(str_replace('&nbsp;', '', GetTextBetween($Item, 'TOP</a>', '</span>'))));
     38      if ($Time == 'Včera') $Time = HumanDate(time() - 60*60*24);
     39        else if ($Time == 'Dnes') $Time = HumanDate(time());
     40      $MeetItem->Time = HumanDateToTime($Time);
    4141      $MeetItem->Message = trim(strip_tags(GetTextBetween($Item, '<p>', '</p>')));
    4242      $MeetItem->Link = GetTextBetween($Item, "<a href='", "'");
Note: See TracChangeset for help on using the changeset viewer.