Changeset 16


Ignore:
Timestamp:
Dec 25, 2018, 10:14:53 AM (6 years ago)
Author:
chronos
Message:
  • Fixed: Corrections in tanecniskola.cz meet import.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Import/TanecniSkola.php

    r15 r16  
    7070        if (array_key_exists($MeetItem->Height, $HeightRange))
    7171          $MeetItem->Height = $HeightRange[$MeetItem->Height];
    72         $MeetItem->Weight = GetWeightFromText($MeetItem->Message);
    7372        $MeetItem->Email = trim(GetTextBetween($Item, '">', '</a>'));
    7473        $MeetItem->Phone = trim(GetTextBetween($Item, 'tel.:', '<br />'));
     
    7877          else $MeetItem->Gender = Gender::Undefined;
    7978        $MeetItem->Message = trim(GetTextBetween($Item, '<p class="message">', '</p>'));
    80         if ($MenuItem->Age == '')
     79        $MeetItem->Weight = GetWeightFromText($MeetItem->Message);
     80        // Update age only if it is not set already
     81        if ($MeetItem->Age == '')
    8182        {
    8283          $MessageAge = GetAgeFromText($MeetItem->Message);
    8384          if ($MessageAge != '') $MeetItem->Age = $MessageAge;
    8485        }
    85         if ($MenuItem->Height == '')
    86         {
    87           $MessageHeight = GetHeightFromText($MeetItem->Message);
    88           if ($MessageHeight != '') $MeetItem->Height = $MessageHeight;
    89         }
     86        // Update height from message text even if height is already set
     87        // because it can be more precise
     88        $MessageHeight = GetHeightFromText($MeetItem->Message);
     89        if ($MessageHeight != '') $MeetItem->Height = $MessageHeight;
    9090        $MeetItem->Location = 'Praha';
    9191        $MeetItem->Database = $this->Database;
Note: See TracChangeset for help on using the changeset viewer.