diff options
| author | Darkelarious <github@333networks.com> | 2025-03-08 15:56:30 +0100 |
|---|---|---|
| committer | Darkelarious <github@333networks.com> | 2025-03-08 15:56:30 +0100 |
| commit | 6bd235f3e62251d8763a552ab0042d59584de842 (patch) | |
| tree | 2ff943b6ddb8aa8980a3ed1fb4a1f869fc787d1c /lib/MasterWebInterface/Util | |
| parent | 318a5a20a930192df788dbac54b1f9c60e1b98b8 (diff) | |
| download | WebInterface-Perl-6bd235f3e62251d8763a552ab0042d59584de842.tar.gz WebInterface-Perl-6bd235f3e62251d8763a552ab0042d59584de842.zip | |
Metadata and update to hotfix 4.
Display thumbnails / snippets in 3rd party apps (like discord) and add map thumbnails + icons for multiple games. Minor fixes/optimisations.
Diffstat (limited to 'lib/MasterWebInterface/Util')
| -rwxr-xr-x | lib/MasterWebInterface/Util/AdvancedFilterBox.pm | 23 | ||||
| -rwxr-xr-x | lib/MasterWebInterface/Util/FilterBox.pm | 2 | ||||
| -rwxr-xr-x | lib/MasterWebInterface/Util/Layout.pm | 11 |
3 files changed, 22 insertions, 14 deletions
diff --git a/lib/MasterWebInterface/Util/AdvancedFilterBox.pm b/lib/MasterWebInterface/Util/AdvancedFilterBox.pm index a496a04..24382a2 100755 --- a/lib/MasterWebInterface/Util/AdvancedFilterBox.pm +++ b/lib/MasterWebInterface/Util/AdvancedFilterBox.pm @@ -19,7 +19,7 @@ use Data::Dumper 'Dumper'; # TODO: allow searching by IP, in combination with expired servers (and sanity check in javascript?) sub htmlAdvancedFilterBox { - my($self, %opt) = @_; + my ($self, %opt) = @_; div class => 'mainbox'; div class => "header"; @@ -31,6 +31,16 @@ sub htmlAdvancedFilterBox txt "."; end; end; + + if (0) + { + div class => "codeblock"; + p "No worries, Darkelarious is debugging an issue right now. Please ignore this code block."; + pre; + txt Dumper \%opt; + end; + end; + } # advanced filter form form action => "/adv", 'accept-charset' => 'UTF-8', method => 'get', class => "advancedfilter"; @@ -182,17 +192,6 @@ sub htmlAdvancedFilterBox end 'fieldset'; end; # form - # debugging box - if ( 0 ) - { - h2 "Debug information"; - div class => "codeblock"; - pre; - txt Dumper \%opt; - end; - end; - } - # return to simple filter/layout div class => "simpleadvanced"; a href => $opt{gamename} ? "/s/$opt{gamename}" : "/s"; diff --git a/lib/MasterWebInterface/Util/FilterBox.pm b/lib/MasterWebInterface/Util/FilterBox.pm index 8db7a60..40218ac 100755 --- a/lib/MasterWebInterface/Util/FilterBox.pm +++ b/lib/MasterWebInterface/Util/FilterBox.pm @@ -22,7 +22,7 @@ sub htmlFilterBox end; # filter box - form action => $opt{gamename} ? "/s/$opt{gamename}" : "/s", 'accept-charset' => 'UTF-8', method => 'get'; + form action => $opt{action}, 'accept-charset' => 'UTF-8', method => 'get'; fieldset class => 'simple'; a href => '/g', $opt{sel} eq 'g' ? (class => 'sel') : (), 'Games'; a href => '/s', $opt{sel} eq 's' ? (class => 'sel') : (), 'Servers'; diff --git a/lib/MasterWebInterface/Util/Layout.pm b/lib/MasterWebInterface/Util/Layout.pm index fe7b5c5..4862f93 100755 --- a/lib/MasterWebInterface/Util/Layout.pm +++ b/lib/MasterWebInterface/Util/Layout.pm @@ -18,9 +18,18 @@ sub htmlHeader title "$o{title} :: $self->{site_name} masterserver"; Link type => 'image/x-icon', rel => 'shortcut icon', href => "/favicon.ico"; Link type => "text/css", rel => 'stylesheet', href => "/style/$self->{style}/style.css", media => "all"; + + # metadata for previews + meta property => "theme-color", content => ($self->{meta_color} // "#111111"); + meta property => "og:type", content => "website"; + meta property => "og:site_name", content => $self->{site_name}; + meta property => "og:title", content => substr($o{title},0,50); + meta property => "og:description", content => ($o{meta_desc} // ""); + meta property => "og:image", content => ($o{meta_img } // "/map/default/333networks.jpg"); + if ( $o{noindex} ) { - meta name => 'robots', content => 'noindex,nofollow,nosnippet,noodp,noarchive,noimageindex';end; + meta name => 'robots', content => 'noindex,nofollow,nosnippet,noodp,noarchive,noimageindex'; } end 'head'; |
