Browse Source

Support theme-color meta tag

This allows for some browsers like chrome mobile to change the color of
the address bar to smoothly match the theme of the page
undefined
spaghetti 7 years ago
committed by Tomochin
parent
commit
61009c0f23
2 changed files with 12 additions and 3 deletions
  1. +11
    -3
      design/privateheader.php
  2. +1
    -0
      design/publicheader.php

+ 11
- 3
design/privateheader.php View File

@@ -59,9 +59,17 @@ if (isset(G::$LoggedUser['Notify'])) {
<link rel="stylesheet" href="<?=STATIC_SERVER?>styles/tooltipster/style.css?v=<?=filemtime(SERVER_ROOT.STATIC_SERVER.'styles/tooltipster/style.css')?>" type="text/css" media="screen" />
<?
if (empty(G::$LoggedUser['StyleURL'])) {
?>
<link rel="stylesheet" type="text/css" title="<?=G::$LoggedUser['StyleName']?>" media="screen"
href="<?=STATIC_SERVER?>styles/<?=G::$LoggedUser['StyleName']?>/style.css?v=<?=filemtime(SERVER_ROOT.STATIC_SERVER.'styles/'.G::$LoggedUser['StyleName'].'/style.css')?>" />
if (($StyleColors = G::$Cache->get_value('stylesheet_colors')) === false) {
G::$DB->query('SELECT LOWER(REPLACE(Name, " ", "_")) AS Name, Color FROM stylesheets WHERE COLOR IS NOT NULL');
while (list($StyleName, $StyleColor) = G::$DB->next_record()) {
$StyleColors[$StyleName] = $StyleColor;
}
G::$Cache->cache_value('stylesheet_colors', $StyleColors, 0);
}
if (isset($StyleColors[G::$LoggedUser['StyleName']])) { ?>
<meta name="theme-color" content="<?=$StyleColors[G::$LoggedUser['StyleName']]?>">
<? } ?>
<link rel="stylesheet" type="text/css" title="<?=G::$LoggedUser['StyleName']?>" media="screen" href="<?=STATIC_SERVER?>styles/<?=G::$LoggedUser['StyleName']?>/style.css?v=<?=filemtime(SERVER_ROOT.STATIC_SERVER.'styles/'.G::$LoggedUser['StyleName'].'/style.css')?>" />
<?
} else {
$StyleURLInfo = parse_url(G::$LoggedUser['StyleURL']);


+ 1
- 0
design/publicheader.php View File

@@ -7,6 +7,7 @@ define('FOOTER_FILE',SERVER_ROOT.'/design/publicfooter.php');
<head>
<title><?=display_str($PageTitle)?></title>
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="theme-color" content="#461640">
<link rel="shortcut icon" href="favicon.ico?v=<?=md5_file('favicon.ico');?>" />
<link href="<?=STATIC_SERVER ?>styles/public/style.css?v=<?=filemtime(SERVER_ROOT.'/static/styles/public/style.css')?>" rel="stylesheet" type="text/css" />
<?


Loading…
Cancel
Save