summaryrefslogtreecommitdiff
path: root/www/wiki
diff options
context:
space:
mode:
authorYaco <franco@reevo.org>2019-03-12 12:35:17 -0300
committerYaco <franco@reevo.org>2019-03-12 12:35:17 -0300
commit822a862e252103ed599ac4c2eccd764686daef43 (patch)
treeda1f12a90a3868c89b907bd475e93f4f32b6e01e /www/wiki
parent0deb40159f6992a5c2da9c3adec0c202221045e1 (diff)
funcion para mostrar banner
Diffstat (limited to 'www/wiki')
-rw-r--r--www/wiki/extensions/OpenGraphMeta/OpenGraphMeta.class.php6
1 files changed, 4 insertions, 2 deletions
diff --git a/www/wiki/extensions/OpenGraphMeta/OpenGraphMeta.class.php b/www/wiki/extensions/OpenGraphMeta/OpenGraphMeta.class.php
index 5ff064f0..d6f96dc4 100644
--- a/www/wiki/extensions/OpenGraphMeta/OpenGraphMeta.class.php
+++ b/www/wiki/extensions/OpenGraphMeta/OpenGraphMeta.class.php
@@ -60,8 +60,7 @@ class OpenGraphMeta {
* @param ParserOutput $parserOutput
*/
public static function onOutputPageParserOutput( OutputPage &$out, ParserOutput $parserOutput ) {
- global $wgLogo, $wgSitename, $wgXhtmlNamespaces, $egFacebookAppId, $egFacebookAdmins;
-
+ global $wgLogo, $wgSitename, $wgXhtmlNamespaces, $egFacebookAppId, $egFacebookAdmins, $bannerImage;
$setMainImage = $parserOutput->getExtensionData( 'setmainimage' );
$setMainTitle = $parserOutput->getExtensionData( 'setmaintitle' );
@@ -108,6 +107,8 @@ class OpenGraphMeta {
// @see https://developers.facebook.com/docs/sharing/best-practices/
// @see https://phabricator.wikimedia.org/T193986
$meta['og:image'] = wfExpandUrl( $mainImage->createThumb( 1200, 630 ) );
+ $bannerImage = wfExpandUrl( $mainImage->createThumb( 1200, 630 ) );
+
} else {
// In some edge-cases we won't have defined an object but rather a full URL.
$meta['og:image'] = $mainImage;
@@ -138,6 +139,7 @@ class OpenGraphMeta {
);
}
}
+ $out->addScript("<style>.bannerimage {background-image:url('{$bannerImage}');}</style>");
}
}