Changeset 42 for trunk/Modules/Meet/Meet.php
- Timestamp:
- Sep 17, 2019, 10:13:33 PM (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Modules/Meet/Meet.php
r41 r42 169 169 $Text = strtolower($Text); 170 170 $Result = GetNumberAfterText($Text, 'je mi'); 171 if ($Result == '') $Result = GetNumber AfterText($Text, 'jsem');171 if ($Result == '') $Result = GetNumberBeforeText($Text, 'let'); 172 172 if ($Result == '') $Result = GetNumberBeforeText($Text, 'rokov'); 173 173 if ($Result == '') $Result = GetNumberBeforeText($Text, 'letou'); 174 if ($Result == '') $Result = GetNumberBeforeText($Text, 'let');175 174 if ($Result == '') $Result = GetNumberAfterText($Text, 'čerstvých'); 175 if ($Result == '') { 176 $Result = GetNumberAfterText($Text, 'jsem'); 177 if ($Result > 100) $Result = ''; // Age over 100 is probably not age but height 178 } 176 179 if ($Result == '') $Result = GetAgeHeightWeightFromText($Text)[0]; 177 180 if ($Result == '') { … … 179 182 if ($Year != '') $Result = date('Y', time()) - $Year; 180 183 } 184 if ($Result == '') { 185 $Year = GetNumberAfterText($Text, 'narozen roku'); 186 if ($Year != '') $Result = date('Y', time()) - $Year; 187 } 181 188 return $Result; 182 189 } … … 184 191 function GetHeightFromText($Text) 185 192 { 186 $Text = strtolower($Text); 193 $Text = strtolower($Text); 187 194 $Result = GetNumberAfterText($Text, 'měřím'); 188 195 if ($Result == '') $Result = GetNumberAfterText($Text, 'merim'); 189 if ($Result == '') $Result = GetNumberBeforeText($Text, 'cm'); 196 if ($Result == '') $Result = GetNumberAfterText($Text, 'výška'); 197 if ($Result == '') $Result = GetNumberBeforeText($Text, 'cm'); 190 198 if ($Result == '') $Result = GetNumberBeforeText($Text, 'bez podpatků'); 199 if ($Result == '') { 200 $Result = GetNumberAfterText($Text, 'jsem'); 201 if ($Result < 150) $Result = ''; // Height below 150 is probably not height but age 202 } 191 203 if ($Result == '') $Result = GetAgeHeightWeightFromText($Text)[1]; 192 204 return $Result; … … 198 210 $Result = GetNumberBeforeText($Text, 'kg'); 199 211 if ($Result == '') $Result = GetNumberAfterText($Text, 'vážím'); 212 if ($Result == '') $Result = GetNumberAfterText($Text, 'váha'); 200 213 if ($Result == '') $Result = GetAgeHeightWeightFromText($Text)[2]; 201 214 return $Result; … … 264 277 { 265 278 global $Locations; 266 279 267 280 $Text = strtolower($Text); 268 281 … … 357 370 if ($DbResult->num_rows == 0) 358 371 { 359 if ($this->Age == '') $Age = null; 372 if ($this->Age == '') $Age = null; 360 373 else $Age = $this->Age; 361 if ($this->Height == '') $Height = null; 374 if ($this->Height == '') $Height = null; 362 375 else $Height = $this->Height; 363 if ($this->Weight == '') $Weight = null; 376 if ($this->Weight == '') $Weight = null; 364 377 else $Weight = $this->Weight; 365 378 $this->Database->insert('MeetItem', array(
Note:
See TracChangeset
for help on using the changeset viewer.