forked from WWBN/AVideo
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathfunctionogSite.php
82 lines (77 loc) · 3.07 KB
/
functionogSite.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
<?php
global $videos_id;
echo PHP_EOL."<!-- OpenGraph for the Site -->".PHP_EOL;
if ($users_id = isChannel()) {
echo PHP_EOL."<!-- OpenGraph channel -->".PHP_EOL;
$imgw = 200;
$imgh = 200;
$img = User::getOGImage($users_id);
$title = User::getNameIdentificationById($users_id);
$url = User::getChannelLink($users_id); ?>
<meta property="og:type" content="profile" />
<meta property="profile:username" content="<?php echo $title; ?>" />
<?php
} elseif (!empty($_GET['catName'])) {
$imgw = 200;
$imgh = 200;
$category = Category::getCategoryByName($_GET['catName']);
$img = Category::getOGImage($category['id']);
$title = html2plainText($category['name']);
$url = Category::getCategoryLinkFromName($_GET['catName']);
echo PHP_EOL."<!-- OpenGraph not video -->".PHP_EOL; ?>
<meta property="og:type" content="website" />
<meta property="og:site_name" content="<?php echo $title; ?>">
<?php
} elseif (!isVideo() && empty($videos_id)) {
$imgw = 200;
$imgh = 200;
$img = Configuration::getOGImage();
$title = html2plainText($config->getWebSiteTitle());
$url = $global['webSiteRootURL'];
echo PHP_EOL."<!-- OpenGraph not video -->".PHP_EOL; ?>
<meta property="og:type" content="website" />
<meta property="og:site_name" content="<?php echo $title; ?>">
<?php
} else {
return false;
}
if (empty($customizePluginDescription)) {
if (AVideoPlugin::isEnabledByName('Customize')) {
$ec = new ExtraConfig();
$customizePluginDescription = $ec->getDescription();
}
}
$description = $title;
if (!empty($customizePluginDescription)) {
$description = $customizePluginDescription;
} elseif (!empty($metaDescription)) {
$description = $metaDescription;
}
?>
<link rel="image_src" href="<?php echo $img; ?>" />
<meta property="og:image" content="<?php echo $img; ?>" />
<meta property="og:image:url" content="<?php echo $img; ?>" />
<meta property="og:image:secure_url" content="<?php echo $img; ?>" />
<meta property="og:image:type" content="image/jpeg" />
<meta property="og:image:width" content="<?php echo $imgw; ?>" />
<meta property="og:image:height" content="<?php echo $imgh; ?>" />
<meta property="fb:app_id" content="774958212660408" />
<meta property="og:title" content="<?php echo $title; ?>" />
<meta property="og:description" content="<?php echo $description; ?>" />
<meta property="og:url" content="<?php echo $url; ?>" />
<link rel="canonical" href="<?php echo $url; ?>" />
<?php
if (!empty($advancedCustom->twitter_summary_large_image)) {
?>
<meta name="twitter:card" content="summary_large_image" />
<?php
} else {
?>
<meta name="twitter:card" content="summary" />
<?php
}
?>
<meta name="twitter:url" content="<?php echo $global['webSiteRootURL']; ?>"/>
<meta name="twitter:title" content="<?php echo $title; ?>"/>
<meta name="twitter:description" content="<?php echo $title; ?>"/>
<meta name="twitter:image" content="<?php echo $img; ?>"/>