Changeset 44
- Timestamp:
- Nov 9, 2019, 11:14:27 PM (5 years ago)
- Location:
- trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Modules/Meet/Meet.php
r43 r44 11 11 include_once(dirname(__FILE__).'/Import/Facebook.php'); 12 12 include_once(dirname(__FILE__).'/Import/Eso.php'); 13 include_once(dirname(__FILE__).'/Import/Ella.php'); 13 14 14 15 abstract class Gender … … 287 288 } 288 289 290 function GetGenderFromName($Text) 291 { 292 $Gender = Gender::Male; 293 $Ending = substr($Text, -2); 294 if (($Ending == 'na') or ($Ending == 'ta') or ($Ending == 'va') or 295 ($Ending == 'ka') or ($Ending == 'ga') or ($Ending == 'ie') or 296 ($Ending == 'la') or ($Ending == 'za') or ($Ending == 'še') or 297 ($Ending == 'ra') or ($Ending == 'da') or ($Ending == 'sa') or 298 ($Ending == 'ce') or ($Ending == 'id') or ($Ending == 'ša') or 299 ($Ending == 'ma') or ($Ending == 'ja') or ($Ending == 'ia') or 300 ($Ending == 'ha') or ($Ending == 'is')) 301 return $Gender = Gender::Female; 302 return $Gender; 303 } 304 289 305 class MeetSources 290 306 { … … 310 326 else if ($Method == 'facebook') $Source = new MeetSourceFacebook(); 311 327 else if ($Method == 'eso') $Source = new MeetSourceEso(); 328 else if ($Method == 'ella') $Source = new MeetSourceElla(); 312 329 else { 313 330 $Output .= 'Unsupported parse method: '.$Method.'<br/>'; … … 360 377 var $Title = ''; 361 378 var $Level = ''; 362 363 function AddIfNotExist($TimeInterval = 0) 364 {365 $DbResult = $this->Database->select('MeetItem', '*',366 379 var $RemoteId = ''; 380 381 function AddIfNotExist($TimeInterval = 0, $CompareTime = true, $CompareRemoteId = false) 382 { 383 $Where = '(`Message` = "'.$this->Database->real_escape_string($this->Message).'") AND '. 367 384 '(`Email` = "'.$this->Database->real_escape_string($this->Email).'") AND '. 368 '(`Time` >= "'.$this->Database->real_escape_string(TimeToMysqlDateTime($this->Time - $TimeInterval)).'") AND '. 369 '(`Time` <= "'.$this->Database->real_escape_string(TimeToMysqlDateTime($this->Time + $TimeInterval)).'") AND '. 370 '(`Source` = '.$this->Source.')'); 385 '(`Source` = '.$this->Source.')'; 386 if ($CompareTime) 387 $Where .= ' AND (`Time` >= "'.$this->Database->real_escape_string(TimeToMysqlDateTime($this->Time - $TimeInterval)).'") AND '. 388 '(`Time` <= "'.$this->Database->real_escape_string(TimeToMysqlDateTime($this->Time + $TimeInterval)).'")'; 389 if ($CompareRemoteId) 390 $Where .= ' AND (`RemoteId` = "'.$this->Database->real_escape_string($this->RemoteId).'")'; 391 $DbResult = $this->Database->select('MeetItem', '*', $Where); 371 392 if ($DbResult->num_rows == 0) 372 393 { … … 390 411 'Source' => $this->Source, 391 412 'Link' => $this->Link, 413 'RemoteId' => $this->RemoteId, 392 414 'TimeImport' => 'NOW()', 393 415 )); -
trunk/SQL/Update.php
r40 r44 49 49 ALTER TABLE `DanceFigure` 50 50 ADD CONSTRAINT `DanceFigure_ibfk_1` FOREIGN KEY (`Dance`) REFERENCES `Dance` (`Id`); 51 52 ALTER TABLE `MeetItem` 53 ADD COLUMN `RemoteId` VARCHAR(255) NULL DEFAULT NULL AFTER `TimeImport`;
Note:
See TracChangeset
for help on using the changeset viewer.