Changeset 11 for trunk/Meet.php
- Timestamp:
- Aug 26, 2018, 8:53:55 PM (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Meet.php
r10 r11 145 145 146 146 $Result = trim(substr($Result, 0, $End + 1)); 147 break;147 if (is_numeric($Result)) break; 148 148 } else break; 149 149 } … … 153 153 function GetAgeFromText($Text) 154 154 { 155 $Text = strtolower($Text); 155 156 $Result = GetNumberBeforeText($Text, 'let'); 156 if ($Result == '') $Result = GetNumberAfterText($Text, 'Je mi'); 157 if ($Result == '') $Result = GetNumberAfterText($Text, 'je mi'); 158 if ($Result == '') $Result = GetNumberAfterText($Text, 'jsem'); 157 159 if ($Result == '') $Result = GetNumberAfterText($Text, 'čerstvých'); 158 160 if ($Result == '') $Result = GetAgeHeightWeightFromText($Text)[0]; … … 162 164 function GetHeightFromText($Text) 163 165 { 166 $Text = strtolower($Text); 164 167 $Result = GetNumberBeforeText($Text, 'cm'); 165 168 if ($Result == '') $Result = GetNumberAfterText($Text, 'měřím'); 169 if ($Result == '') $Result = GetNumberAfterText($Text, 'merim'); 166 170 if ($Result == '') $Result = GetNumberBeforeText($Text, 'bez podpatků'); 167 171 if ($Result == '') $Result = GetAgeHeightWeightFromText($Text)[1]; … … 171 175 function GetWeightFromText($Text) 172 176 { 177 $Text = strtolower($Text); 173 178 $Result = GetNumberBeforeText($Text, 'kg'); 174 179 if ($Result == '') $Result = GetAgeHeightWeightFromText($Text)[2]; … … 233 238 public $Database; 234 239 235 function ParseAll() 236 { 237 $DbResult = $this->Database->select('MeetSource', '*'); 240 function Parse($Id = null) 241 { 242 if (($Id != null) and is_numeric($Id)) $Where = 'Id='.$Id; 243 else $Where = '1'; 244 $DbResult = $this->Database->select('MeetSource', '*', $Where); 238 245 while ($DbRow = $DbResult->fetch_assoc()) 239 246 { … … 267 274 public $Id; 268 275 public $Database; 276 277 function Import() 278 { 279 $this->AddedCount = 0; 280 echo('Parsing '.$this->Name.' ('.$this->Id.')...</br>'); 281 } 269 282 } 270 283 … … 310 323 'Link' => $this->Link, 311 324 )); 312 } 313 } 314 } 325 $Result = 1; 326 } else $Result = 0; 327 return($Result); 328 } 329 }
Note:
See TracChangeset
for help on using the changeset viewer.