Changeset 893 for trunk/Modules/Redirection
- Timestamp:
- Mar 6, 2023, 1:48:45 AM (22 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Modules/Redirection/Redirection.php
r888 r893 3 3 class ModuleRedirection extends Module 4 4 { 5 public array $Excludes; 6 5 7 function __construct(System $System) 6 8 { … … 12 14 $this->Description = 'Redirects erlier obsolete addresses to new ones.'; 13 15 $this->Dependencies = array(); 16 14 17 $this->Excludes = array(); 15 18 } … … 17 20 function DoStart(): void 18 21 { 19 $this->System->OnPageNotFound = array($this, 'ShowRedirect');22 Core::Cast($this->System)->OnPageNotFound = array($this, 'ShowRedirect'); 20 23 } 21 24 … … 30 33 { 31 34 $Output = ''; 32 if (count( $this->System->PathItems) > 0)35 if (count(Core::Cast($this->System)->PathItems) > 0) 33 36 { 34 if ( $this->System->PathItems[0] == 'user.php') $Output = $this->Redirect($this->System->Link('/user/'));35 if ( $this->System->PathItems[0] == 'team.php') $Output = $this->Redirect($this->System->Link('/team/'));36 if ( $this->System->PathItems[0] == 'version.php') $Output = $this->Redirect($this->System->Link('/client-version/'));37 if ( $this->System->PathItems[0] == 'phpBB3') $Output = $this->Redirect($this->System->Link('/forum/'));38 if ( $this->System->PathItems[0] == 'phpbb3') $Output = $this->Redirect($this->System->Link('/forum/'));39 if ( $this->System->PathItems[0] == 'statistic.php') $Output = $this->Redirect($this->System->Link('/progress/'));40 if ( $this->System->PathItems[0] == 'register.php') $Output = $this->Redirect($this->System->Link('/registration/'));41 if ( $this->System->PathItems[0] == 'registrace.php') $Output = $this->Redirect($this->System->Link('/registration/'));42 if ( $this->System->PathItems[0] == 'dictionary.php') $Output = $this->Redirect($this->System->Link('/dictionary/'));43 if ( $this->System->PathItems[0] == 'download-addon.php') $Output = $this->Redirect($this->System->Link('/download/'));44 if ( $this->System->PathItems[0] == 'banners.php') $Output = $this->Redirect($this->System->Link('/referrer/'));45 if ( $this->System->PathItems[0] == 'download.php') $Output = $this->Redirect($this->System->Link('/download/'));46 if ( $this->System->PathItems[0] == 'serverlist.php') $Output = $this->Redirect($this->System->Link('/server/'));47 if ( $this->System->PathItems[0] == 'info.php') $Output = $this->Redirect($this->System->Link('/info/'));48 if ( $this->System->PathItems[0] == 'userlist.php') $Output = $this->Redirect($this->System->Link('/users/'));49 if ( $this->System->PathItems[0] == 'promotion.php') $Output = $this->Redirect($this->System->Link('/promotion/'));50 if ( $this->System->PathItems[0] == 'log.php') $Output = $this->Redirect($this->System->Link('/log/'));51 if (count( $this->System->PathItems) > 1)37 if (Core::Cast($this->System)->PathItems[0] == 'user.php') $Output = $this->Redirect($this->System->Link('/user/')); 38 if (Core::Cast($this->System)->PathItems[0] == 'team.php') $Output = $this->Redirect($this->System->Link('/team/')); 39 if (Core::Cast($this->System)->PathItems[0] == 'version.php') $Output = $this->Redirect($this->System->Link('/client-version/')); 40 if (Core::Cast($this->System)->PathItems[0] == 'phpBB3') $Output = $this->Redirect($this->System->Link('/forum/')); 41 if (Core::Cast($this->System)->PathItems[0] == 'phpbb3') $Output = $this->Redirect($this->System->Link('/forum/')); 42 if (Core::Cast($this->System)->PathItems[0] == 'statistic.php') $Output = $this->Redirect($this->System->Link('/progress/')); 43 if (Core::Cast($this->System)->PathItems[0] == 'register.php') $Output = $this->Redirect($this->System->Link('/registration/')); 44 if (Core::Cast($this->System)->PathItems[0] == 'registrace.php') $Output = $this->Redirect($this->System->Link('/registration/')); 45 if (Core::Cast($this->System)->PathItems[0] == 'dictionary.php') $Output = $this->Redirect($this->System->Link('/dictionary/')); 46 if (Core::Cast($this->System)->PathItems[0] == 'download-addon.php') $Output = $this->Redirect($this->System->Link('/download/')); 47 if (Core::Cast($this->System)->PathItems[0] == 'banners.php') $Output = $this->Redirect($this->System->Link('/referrer/')); 48 if (Core::Cast($this->System)->PathItems[0] == 'download.php') $Output = $this->Redirect($this->System->Link('/download/')); 49 if (Core::Cast($this->System)->PathItems[0] == 'serverlist.php') $Output = $this->Redirect($this->System->Link('/server/')); 50 if (Core::Cast($this->System)->PathItems[0] == 'info.php') $Output = $this->Redirect($this->System->Link('/info/')); 51 if (Core::Cast($this->System)->PathItems[0] == 'userlist.php') $Output = $this->Redirect($this->System->Link('/users/')); 52 if (Core::Cast($this->System)->PathItems[0] == 'promotion.php') $Output = $this->Redirect($this->System->Link('/promotion/')); 53 if (Core::Cast($this->System)->PathItems[0] == 'log.php') $Output = $this->Redirect($this->System->Link('/log/')); 54 if (count(Core::Cast($this->System)->PathItems) > 1) 52 55 { 53 if (( $this->System->PathItems[0] == 'team') and ($this->System->PathItems[1] == 'userlist.php'))56 if ((Core::Cast($this->System)->PathItems[0] == 'team') and (Core::Cast($this->System)->PathItems[1] == 'userlist.php')) 54 57 $Output = $this->Redirect($this->System->Link('/userlist/')); 55 if (( $this->System->PathItems[0] == 'dictionary') and ($this->System->PathItems[1] == 'user.php'))58 if ((Core::Cast($this->System)->PathItems[0] == 'dictionary') and (Core::Cast($this->System)->PathItems[1] == 'user.php')) 56 59 $Output = $this->Redirect($this->System->Link('/user/')); 57 if (( $this->System->PathItems[0] == 'forum') and ($this->System->PathItems[1] == 'index.php'))60 if ((Core::Cast($this->System)->PathItems[0] == 'forum') and (Core::Cast($this->System)->PathItems[1] == 'index.php')) 58 61 $Output = $this->Redirect($this->System->Link('/forum/')); 59 if (( $this->System->PathItems[0] == 'phpbb3') and ($this->System->PathItems[1] == 'index.php'))62 if ((Core::Cast($this->System)->PathItems[0] == 'phpbb3') and (Core::Cast($this->System)->PathItems[1] == 'index.php')) 60 63 $Output = $this->Redirect($this->System->Link('/forum/')); 61 if (( $this->System->PathItems[0] == 'phpBB3') and ($this->System->PathItems[1] == 'index.php'))64 if ((Core::Cast($this->System)->PathItems[0] == 'phpBB3') and (Core::Cast($this->System)->PathItems[1] == 'index.php')) 62 65 $Output = $this->Redirect($this->System->Link('/forum/')); 63 if (( $this->System->PathItems[0] == 'download') and ($this->System->PathItems[1] == 'ceske_fonty_do_wow.zip'))66 if ((Core::Cast($this->System)->PathItems[0] == 'download') and (Core::Cast($this->System)->PathItems[1] == 'ceske_fonty_do_wow.zip')) 64 67 $Output = $this->Redirect($this->System->Link('/files/ceske_fonty_do_wow.zip')); 65 68 }
Note:
See TracChangeset
for help on using the changeset viewer.