Changeset 63 for trunk/Modules/Meet
- Timestamp:
- Aug 3, 2021, 11:20:41 AM (3 years ago)
- Location:
- trunk
- Files:
-
- 14 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk
- Property svn:ignore
-
old new 1 nbproject2 Config.php3 1 .settings 4 2 .project 5 3 .buildpath 4 .htaccess
-
- Property svn:ignore
-
trunk/Modules/Meet/Import/Amblar.php
r57 r63 26 26 class MeetSourceAmblar extends MeetSource 27 27 { 28 function Import() 28 function Import(): string 29 29 { 30 30 $Output = parent::Import(); … … 79 79 } 80 80 81 function ImportItem( &$MeetItem)81 function ImportItem(MeetItem &$MeetItem): string 82 82 { 83 83 global $HeightTags, $AgeTags, $LevelTags; … … 92 92 { 93 93 $Output .= 'Main block not isolated.</br>'; 94 return ;94 return $Output; 95 95 } 96 96 -
trunk/Modules/Meet/Import/AstraPraha.php
r57 r63 3 3 class MeetSourceAstraPraha extends MeetSource 4 4 { 5 function Import() 5 function Import(): string 6 6 { 7 7 $Output = parent::Import(); -
trunk/Modules/Meet/Import/Csts.php
r57 r63 3 3 class MeetSourceCsts extends MeetSource 4 4 { 5 function Import() 5 function Import(): string 6 6 { 7 7 $Output = parent::Import(); -
trunk/Modules/Meet/Import/Ella.php
r57 r63 3 3 class MeetSourceElla extends MeetSource 4 4 { 5 function Import() 5 function Import(): string 6 6 { 7 7 $Output = parent::Import(); -
trunk/Modules/Meet/Import/Eso.php
r57 r63 3 3 class MeetSourceEso extends MeetSource 4 4 { 5 function Import() 5 function Import(): string 6 6 { 7 7 $Output = parent::Import(); -
trunk/Modules/Meet/Import/Facebook.php
r57 r63 3 3 class MeetSourceFacebook extends MeetSource 4 4 { 5 function Import() 5 function Import(): string 6 6 { 7 return ;7 return ''; 8 8 $Output = parent::Import(); 9 9 $Content = file_get_contents($this->URL); -
trunk/Modules/Meet/Import/MajkluvSvet.php
r57 r63 3 3 class MeetSourceMajkluvSvet extends MeetSource 4 4 { 5 function Import() 5 function Import(): string 6 6 { 7 7 $Output = parent::Import(); -
trunk/Modules/Meet/Import/SalsaDance.php
r57 r63 3 3 class MeetSourceSalsaDance extends MeetSource 4 4 { 5 function Import() 5 function Import(): string 6 6 { 7 7 $Output = parent::Import(); -
trunk/Modules/Meet/Import/Seznamka.php
r58 r63 3 3 class MeetSourceSeznamka extends MeetSource 4 4 { 5 function Import() 5 function Import(): string 6 6 { 7 7 $Output = parent::Import(); -
trunk/Modules/Meet/Import/TanecniSkola.php
r60 r63 3 3 class MeetSourceTanecniSkola extends MeetSource 4 4 { 5 function Import() 5 function Import(): string 6 6 { 7 7 $Output = parent::Import(); -
trunk/Modules/Meet/Import/Vavruska.php
r57 r63 3 3 class MeetSourceVavruska extends MeetSource 4 4 { 5 function Import() 5 function Import(): string 6 6 { 7 7 $Output = parent::Import(); -
trunk/Modules/Meet/Meet.php
r61 r63 20 20 } 21 21 22 function GetTextBetween( &$Text, $Start, $End)22 function GetTextBetween(string &$Text, string $Start, string $End): string 23 23 { 24 24 $Result = ''; … … 32 32 } 33 33 34 function HumanDateTimeToTime( $DateTime)34 function HumanDateTimeToTime(string $DateTime): ?int 35 35 { 36 36 if ($DateTime == '') return NULL; … … 47 47 } 48 48 49 function HumanDateToTime( $Date)49 function HumanDateToTime(string $Date): ?int 50 50 { 51 51 if ($Date == '') return NULL; … … 53 53 } 54 54 55 function DecodeHtmlEnt( $str)55 function DecodeHtmlEnt(string $str): string 56 56 { 57 57 $prefix = '&#'; … … 90 90 } 91 91 92 function RemoveHtmlComments( $Content)92 function RemoveHtmlComments(string $Content): string 93 93 { 94 94 $Result = ''; … … 103 103 } 104 104 105 function is_alpha( $Char)105 function is_alpha(string $Char): bool 106 106 { 107 107 return (($Char >= 'a') and ($Char <= 'z')) or (($Char >= 'A') and ($Char <= 'Z')); 108 108 } 109 109 110 function is_white_space( $Char)110 function is_white_space(string $Char): bool 111 111 { 112 112 return ($Char == ' ') or ($Char == "\t"); 113 113 } 114 114 115 function GetDefaultMeetFilter( $Table = '')115 function GetDefaultMeetFilter(string $Table = ''): string 116 116 { 117 117 global $Config; … … 119 119 if ($Table != '') $Table = $Table.'.'; 120 120 121 return '('.$Table.'Hidden=0) AND ('.$Table.'Time > "'.TimeToMysqlDateTime(time() - $Config['MeetInterval']).'")';122 } 123 124 function GetNumberBeforeText( $Text, $Needle)121 return '('.$Table.'Hidden=0) AND ('.$Table.'Time > "'.TimeToMysqlDateTime(time() - (int)$Config['MeetInterval']).'")'; 122 } 123 124 function GetNumberBeforeText(string $Text, string $Needle): string 125 125 { 126 126 $Result = ''; … … 148 148 } 149 149 150 function GetNumberAfterText( $Text, $Needle)150 function GetNumberAfterText(string $Text, string $Needle): string 151 151 { 152 152 $Result = ''; … … 175 175 } 176 176 177 function GetAgeFromText( $Text)177 function GetAgeFromText(string $Text): string 178 178 { 179 179 $Text = strtolower($Text); … … 212 212 } 213 213 214 function GetHeightFromText( $Text)214 function GetHeightFromText(string $Text): string 215 215 { 216 216 $Text = strtolower($Text); … … 228 228 } 229 229 230 function GetWeightFromText( $Text)230 function GetWeightFromText(string $Text): string 231 231 { 232 232 $Text = strtolower($Text); … … 238 238 } 239 239 240 function GetAgeHeightWeightFromText( $Text)240 function GetAgeHeightWeightFromText(string $Text): array 241 241 { 242 242 $Result = array('', '', ''); … … 261 261 } 262 262 263 function GetEmailFromText( $Text)263 function GetEmailFromText(string $Text): string 264 264 { 265 265 $Result = ''; … … 302 302 ); 303 303 304 function GetLocationFromText( $Text)304 function GetLocationFromText(string $Text): string 305 305 { 306 306 global $Locations; … … 315 315 } 316 316 317 function GetGenderFromName( $Text)317 function GetGenderFromName(string $Text): string 318 318 { 319 319 $Gender = Gender::Male; … … 334 334 public $Database; 335 335 336 function Parse( $Id = null)336 function Parse(?int $Id = null): string 337 337 { 338 338 $Output = ''; … … 392 392 } 393 393 394 function Import() 394 function Import(): string 395 395 { 396 396 return ''; 397 397 } 398 398 399 function DoImport() 399 function DoImport(): string 400 400 { 401 401 $this->MeetItems = array(); … … 406 406 foreach ($this->MeetItems as $MeetItem) 407 407 { 408 if ($MeetItem->IsSpam()) continue; 408 409 $this->AddedCount += $MeetItem->AddIfNotExist($this->AddTimeInterval, $this->AddCompareTime, $this->AddCompareRemoteId); 409 410 } … … 434 435 var $RemoteId = ''; 435 436 436 function AddIfNotExist( $TimeInterval = 0, $CompareTime = true, $CompareRemoteId = false)437 function AddIfNotExist(int $TimeInterval = 0, bool $CompareTime = true, bool $CompareRemoteId = false): int 437 438 { 438 439 $Where = '(`Message` = "'.$this->Database->real_escape_string($this->Message).'") AND '. … … 473 474 return $Result; 474 475 } 475 } 476 477 function IsSpam(): bool 478 { 479 $Keywords = array('půjčk', 'úvěr'); 480 foreach ($Keywords as $Keyword) 481 { 482 if (strpos($this->Message, $Keyword) !== false) 483 { 484 return false; 485 } 486 } 487 return true; 488 } 489 } -
trunk/Modules/Meet/MeetPage.php
r62 r63 1 1 <?php 2 2 3 class ModuleMeet extends AppModule3 class ModuleMeet extends Module 4 4 { 5 5 function __construct($System) … … 15 15 } 16 16 17 function Start() 18 { 19 $this->System->RegisterPage( 'seznamka', 'PageMeetList');20 $this->System->RegisterPage( array('seznamka', 'inzerat'), 'PageMeetItem');21 $this->System->RegisterPage( array('seznamka', 'aktualizace'), 'PageMeetUpdate');22 $this->System->RegisterPage( array('seznamka', 'rss'), 'PageMeetRss');23 $this->System->RegisterMenuItem('/seznamka', 'Seznamka');17 function Start(): void 18 { 19 $this->System->RegisterPage(['seznamka'], 'PageMeetList'); 20 $this->System->RegisterPage(['seznamka', 'inzerat'], 'PageMeetItem'); 21 $this->System->RegisterPage(['seznamka', 'aktualizace'], 'PageMeetUpdate'); 22 $this->System->RegisterPage(['seznamka', 'rss'], 'PageMeetRss'); 23 Core::Cast($this->System)->RegisterMenuItem('/seznamka', 'Seznamka'); 24 24 } 25 25 } … … 30 30 { 31 31 parent::__construct($System); 32 $this-> FullTitle = 'Taneční seznamka';33 $this-> ShortTitle = 'Seznamka';34 } 35 36 function Show() 32 $this->Title = 'Seznamka'; 33 $this->Description = 'Taneční seznamka'; 34 } 35 36 function Show(): string 37 37 { 38 38 global $Config; … … 52 52 53 53 $Output = ''; 54 $this->Title = 'Seznamka - '.$this->Title;55 54 if (array_key_exists('lvm', $_GET) and ($_GET['lvm'] == 'seznam')) 56 55 $this->RawPage = true; … … 121 120 { 122 121 parent::__construct($System); 123 $this-> FullTitle = 'Aktualizace tanečníseznamky';124 $this-> ShortTitle = 'Aktualizaceseznamky';125 } 126 127 function Show() 122 $this->Title = 'Aktualizace seznamky'; 123 $this->Description = 'Aktualizace taneční seznamky'; 124 } 125 126 function Show(): string 128 127 { 129 128 $MeetSources = new MeetSources(); … … 140 139 { 141 140 parent::__construct($System); 142 $this->FullTitle = 'Inzerát taneční seznamky'; 143 $this->ShortTitle = 'Inzerát seznamky'; 144 } 145 146 function Show() 147 { 148 $this->Title = 'Inzerát - Seznamka - '.$this->Title; 141 $this->Title = 'Inzerát'; 142 $this->Description = 'Inzerát taneční seznamky'; 143 } 144 145 function Show(): string 146 { 149 147 $Output = ''; 150 148 if (count($this->System->PathItems) > 2) … … 152 150 $id = $this->System->PathItems[2] * 1; 153 151 } else return 'Položka nenalezena'; 154 if ( $this->System->IsAdmin())152 if (Core::Cast($this->System)->IsAdmin()) 155 153 { 156 154 if (array_key_exists('hide', $_GET)) $this->Database->update('MeetItem', 'Id='.$id, array('Hidden' => 1)); … … 165 163 { 166 164 $MeetItem = $DbResult->fetch_assoc(); 167 if (($MeetItem['Filter'] == '0') and ! $this->System->IsAdmin())165 if (($MeetItem['Filter'] == '0') and !Core::Cast($this->System)->IsAdmin()) 168 166 return 'Položka nenalezena'; 169 167 if ($MeetItem['Link'] != '') $Link = '<a href="'.$MeetItem['Link'].'">Odkaz</a>'; … … 183 181 '<tr><th>Zdroj importu</th><td><a href="'.$MeetItem['SourceURL'].'">'.$MeetItem['SourceName'].'</a></td></tr>'; 184 182 $Output .= '</table>'; 185 if ( $this->System->IsAdmin()) {183 if (Core::Cast($this->System)->IsAdmin()) { 186 184 if ($MeetItem['Hidden'] == '1') 187 185 $Output .= '<div>Skrytá položka <a href="?unhide">Zviditelnit</a></div>'; … … 198 196 { 199 197 parent::__construct($System); 200 $this-> FullTitle = 'RSS kanál tanečníseznamky';201 $this-> ShortTitle = 'RSS inzerátyseznamky';202 } 203 204 function Show() 198 $this->Title = 'RSS inzeráty seznamky'; 199 $this->Description = 'RSS kanál taneční seznamky'; 200 } 201 202 function Show(): string 205 203 { 206 204 global $Config;
Note:
See TracChangeset
for help on using the changeset viewer.