- Introduced meta.php to handle meta tags dynamically based on the presence of values in the $ometa array. - Set default values for meta tags using predefined variables if $ometa values are not set. - Included essential meta tags for SEO and social media sharing, including Open Graph and Twitter cards. - Ensured compatibility with various devices by adding viewport and charset meta tags.
152 lines
4.8 KiB
PHP
152 lines
4.8 KiB
PHP
<?php
|
|
|
|
$Ometa = array();
|
|
$meta = array();
|
|
|
|
include_once $URLcorrection . "meta/config.php";
|
|
|
|
if (isset($ometa['title'])) {
|
|
$meta['title'] = $ometa['title'];
|
|
} else {
|
|
$meta['title'] = $metatitle;
|
|
}
|
|
if (isset($ometa['description'])) {
|
|
$meta['description'] = $ometa['description'];
|
|
} else {
|
|
$meta['description'] = $metadescription;
|
|
}
|
|
if (isset($ometa['keywords'])) {
|
|
$meta['keywords'] = $ometa['keywords'];
|
|
} else {
|
|
$meta['keywords'] = $metakeywords;
|
|
}
|
|
if (isset($ometa['robots'])) {
|
|
$meta['robots'] = $ometa['robots'];
|
|
} else {
|
|
$meta['robots'] = $metarobots;
|
|
}
|
|
if (isset($ometa['language'])) {
|
|
$meta['language'] = $ometa['language'];
|
|
} else {
|
|
$meta['language'] = $metalanguage;
|
|
}
|
|
if (isset($ometa['revisit-after'])) {
|
|
$meta['revisit-after'] = $ometa['revisit-after'];
|
|
} else {
|
|
$meta['revisit-after'] = $metarevisit;
|
|
}
|
|
if (isset($ometa['author'])) {
|
|
$meta['author'] = $ometa['author'];
|
|
} else {
|
|
$meta['author'] = $metaauthor;
|
|
}
|
|
if (isset($ometa['apple-touch-icon'])) {
|
|
$meta['apple-touch-icon'] = $ometa['apple-touch-icon'];
|
|
} else {
|
|
$meta['apple-touch-icon'] = $metaappleicon;
|
|
}
|
|
if (isset($ometa['icon32'])) {
|
|
$meta['icon32'] = $ometa['icon32'];
|
|
} else {
|
|
$meta['icon32'] = $metaicon32;
|
|
}
|
|
if (isset($ometa['icon16'])) {
|
|
$meta['icon16'] = $ometa['icon16'];
|
|
} else {
|
|
$meta['icon16'] = $metaicon16;
|
|
}
|
|
if (isset($ometa['site.webmanifest'])) {
|
|
$meta['site.webmanifest'] = $ometa['site.webmanifest'];
|
|
} else {
|
|
$meta['site.webmanifest'] = $metamanifest;
|
|
}
|
|
if (isset($ometa['ogtype'])) {
|
|
$meta['ogtype'] = $ometa['ogtype'];
|
|
} else {
|
|
$meta['ogtype'] = $metaogtype;
|
|
}
|
|
if (isset($ometa['ogurl'])) {
|
|
$meta['ogurl'] = $ometa['ogurl'];
|
|
} else {
|
|
$meta['ogurl'] = $metaogurl;
|
|
}
|
|
if (isset($ometa['ogtitle'])) {
|
|
$meta['ogtitle'] = $ometa['ogtitle'];
|
|
} else {
|
|
$meta['ogtitle'] = $metaogtitle;
|
|
}
|
|
if (isset($ometa['ogdescription'])) {
|
|
$meta['ogdescription'] = $ometa['ogdescription'];
|
|
} else {
|
|
$meta['ogdescription'] = $metaogdescription;
|
|
}
|
|
if (isset($ometa['ogimage'])) {
|
|
$meta['ogimage'] = $ometa['ogimage'];
|
|
} else {
|
|
$meta['ogimage'] = $metaogimage;
|
|
}
|
|
if (isset($ometa['twittercard'])) {
|
|
$meta['twittercard'] = $ometa['twittercard'];
|
|
} else {
|
|
$meta['twittercard'] = $metatwittercard;
|
|
}
|
|
if (isset($ometa['twitterurl'])) {
|
|
$meta['twitterurl'] = $ometa['twitterurl'];
|
|
} else {
|
|
$meta['twitterurl'] = $metatwitterurl;
|
|
}
|
|
if (isset($ometa['twittertitle'])) {
|
|
$meta['twittertitle'] = $ometa['twittertitle'];
|
|
} else {
|
|
$meta['twittertitle'] = $metatwittertitle;
|
|
}
|
|
if (isset($ometa['twitterdescription'])) {
|
|
$meta['twitterdescription'] = $ometa['twitterdescription'];
|
|
} else {
|
|
$meta['twitterdescription'] = $metatwitterdescription;
|
|
}
|
|
if (isset($ometa['twitterimage'])) {
|
|
$meta['twitterimage'] = $ometa['twitterimage'];
|
|
} else {
|
|
$meta['twitterimage'] = $metatwitterimage;
|
|
}
|
|
|
|
?>
|
|
|
|
<meta charset="UTF-8">
|
|
<meta name="viewport" content="width=device-width, initial-scale=1">
|
|
<title><?=$meta['title']?></title>
|
|
|
|
<meta name="title" content="<?=$meta['title']?>">
|
|
<meta name="description" content="<?=$meta['description']?>">
|
|
<meta name="keywords" content="<?=$meta['keywords']?>">
|
|
<meta name="robots" content="<?=$meta['robots']?>">
|
|
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
|
|
<meta name="language" content="<?=$meta['language']?>">
|
|
<meta name="revisit-after" content="<?=$meta['revisit-after']?>">
|
|
<meta name="author" content="<?=$meta['author']?>">
|
|
<link rel="apple-touch-icon" sizes="180x180" href="<?=$meta['apple-touch-icon']?>">
|
|
<link rel="icon" type="image/png" sizes="32x32" href="<?=$meta['icon32']?>">
|
|
<link rel="icon" type="image/png" sizes="16x16" href="<?=$meta['icon16']?>">
|
|
<!--<link rel="manifest" href="--><?php //=$meta['manifest']?><!--">-->
|
|
<link rel="mask-icon" href="/meta/favicons/safari-pinned-tab.svg" color="#5bbad5">
|
|
<link rel="shortcut icon" href="/meta/favicons/favicon.ico">
|
|
<meta name="msapplication-TileColor" content="#da532c">
|
|
<meta name="msapplication-config" content="/meta/favicons/browserconfig.xml">
|
|
<meta name="theme-color" content="#ffffff">
|
|
|
|
<!-- Open Graph / Facebook -->
|
|
<meta property="og:type" content="<?=$meta['ogtype']?>" />
|
|
<meta property="og:url" content="<?=$meta['ogurl']?>" />
|
|
<meta property="og:title" content="<?=$meta['ogtitle']?>" />
|
|
<meta property="og:description" content="<?=$meta['ogdescription']?>"/>
|
|
<meta property="og:image" content="<?=$meta['ogimage']?>" />
|
|
|
|
<!-- Twitter -->
|
|
<meta property="twitter:card" content="<?=$meta['twittercard'] ?>" />
|
|
<meta property="twitter:url" content="<?=$meta['twitterurl'] ?>" />
|
|
<meta property="twitter:title" content="<?=$meta['twittertitle'] ?>" />
|
|
<meta property="twitter:description" content="<?=$meta['twitterdescription'] ?>" />
|
|
<meta property="twitter:image" content="<?=$meta['twitterimage'] ?>" />
|
|
|