diff options
author | Yaco <franco@reevo.org> | 2019-03-12 12:35:17 -0300 |
---|---|---|
committer | Yaco <franco@reevo.org> | 2019-03-12 12:35:17 -0300 |
commit | 822a862e252103ed599ac4c2eccd764686daef43 (patch) | |
tree | da1f12a90a3868c89b907bd475e93f4f32b6e01e | |
parent | 0deb40159f6992a5c2da9c3adec0c202221045e1 (diff) |
funcion para mostrar banner
-rw-r--r-- | www/wiki/extensions/OpenGraphMeta/OpenGraphMeta.class.php | 6 |
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>"); } } |