Ignore:
Timestamp:
May 27, 2020, 8:04:56 PM (4 years ago)
Author:
chronos
Message:
  • Added: Allow to disable MeetSource in database.
  • Added: Show how many meet items were parsed and how many new added.
File:
1 edited

Legend:

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

    r37 r57  
    2929      if (strpos($MeetItem->Gender, 'partnerku') !== false) $MeetItem->Gender = Gender::Male;
    3030        else if (strpos($MeetItem->Gender, 'partnera') !== false) $MeetItem->Gender = Gender::Female;
    31         else $MeetItem->Gender = Gender::Undefined;     
     31        else $MeetItem->Gender = Gender::Undefined;
    3232      $Small = GetTextBetween($Item, '<small>', '</small>');
    33       if (strpos($Small, '/') != false){
    34         $MeetItem->Location = substr(trim(substr($Small, 0, strpos($Small, '/') - 1)), 1, -1);
    35         $Small = substr($Small, strpos($Small, '/') + 1);
    36       }     
     33      if (strpos($Small, '/') != false)
     34      {
     35        $MeetItem->Location = substr(trim(substr($Small, 0, strpos($Small, '/') - 1)), 1, -1);
     36        $Small = substr($Small, strpos($Small, '/') + 1);
     37      }
    3738      $MeetItem->Time = trim($Small);
    3839      $MeetItem->Time = HumanDateToTime($MeetItem->Time);
    3940      $MeetItem->Message = trim(GetTextBetween($Item, '<p class="lead">', '</p>'));
    40       $MeetItem->Age = GetAgeFromText($MeetItem->Message);     
     41      $MeetItem->Age = GetAgeFromText($MeetItem->Message);
    4142      $MeetItem->Height = GetHeightFromText($MeetItem->Message);
    4243      $MeetItem->Weight = GetWeightFromText($MeetItem->Message);
     
    4950      $MeetItem->Database = $this->Database;
    5051      $MeetItem->Source = $this->Id;
    51       $this->AddedCount += $MeetItem->AddIfNotExist();
     52      $this->MeetItems[] = $MeetItem;
    5253    }
    5354    return $Output;
Note: See TracChangeset for help on using the changeset viewer.