本文整理汇总了PHP中Idno\Entities\File::getByURL方法的典型用法代码示例。如果您正苦于以下问题:PHP File::getByURL方法的具体用法?PHP File::getByURL怎么用?PHP File::getByURL使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Idno\Entities\File
的用法示例。
在下文中一共展示了File::getByURL方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: array
<?php
$opengraph = array('og:type' => 'website', 'og:title' => htmlspecialchars(strip_tags($vars['title'])), 'og:site_name' => htmlspecialchars(strip_tags(\Idno\Core\Idno::site()->config()->title)), 'og:image' => Idno\Core\site()->currentPage()->getIcon());
if (\Idno\Core\Idno::site()->currentPage() && \Idno\Core\Idno::site()->currentPage()->isPermalink()) {
$opengraph['og:url'] = \Idno\Core\Idno::site()->currentPage()->currentUrl();
if (!empty($vars['object'])) {
$owner = $vars['object']->getOwner();
$object = $vars['object'];
$opengraph['og:title'] = htmlspecialchars(strip_tags($vars['object']->getTitle()));
$opengraph['og:description'] = htmlspecialchars($vars['object']->getShortDescription());
$opengraph['og:type'] = 'article';
//htmlspecialchars($vars['object']->getActivityStreamsObjectType());
$opengraph['og:image'] = $vars['object']->getIcon();
//$owner->getIcon(); //Icon, for now set to being the author profile pic
if ($icon = $vars['object']->getIcon()) {
if ($icon_file = \Idno\Entities\File::getByURL($icon)) {
if (!empty($icon_file->metadata['width'])) {
$opengraph['og:image:width'] = $icon_file->metadata['width'];
}
if (!empty($icon_file->metadata['height'])) {
$opengraph['og:image:height'] = $icon_file->metadata['height'];
}
}
}
if ($url = $vars['object']->getDisplayURL()) {
$opengraph['og:url'] = $vars['object']->getDisplayURL();
}
}
}
foreach ($opengraph as $key => $value) {
echo "<meta property=\"{$key}\" content=\"{$value}\" />\n";