forked from ZwiiCMS-Team/ZwiiCMS
v9.0.0 modification appel meta image
This commit is contained in:
parent
bd5648764d
commit
5fd5285e95
@ -16,6 +16,7 @@ class config extends common {
|
||||
|
||||
public static $actions = [
|
||||
'backup' => self::GROUP_ADMIN,
|
||||
'configMetaImage' => self::GROUP_ADMIN,
|
||||
'index' => self::GROUP_ADMIN
|
||||
];
|
||||
|
||||
@ -169,16 +170,16 @@ class config extends common {
|
||||
}
|
||||
|
||||
/**
|
||||
* Réalise une copie d'écran
|
||||
* Réalise une copie d'écran du site
|
||||
* https://www.codexworld.com/capture-screenshot-website-url-php-google-api/
|
||||
*/
|
||||
public function configmetaimage() {
|
||||
public function configMetaImage() {
|
||||
// fonction désactivée pour un site local
|
||||
if ( strpos(helper::baseUrl(false),'localhost') > 0 OR strpos(helper::baseUrl(false),'127.0.0.1') > 0) {
|
||||
$site = 'https://ZwiiCMS.com'; } else {
|
||||
$site = 'https://zwiicms.com/'; } else {
|
||||
$site = helper::baseUrl(false); }
|
||||
|
||||
$googlePagespeedData = file_get_contents('https://www.googleapis.com/pagespeedonline/v2/runPagespeed?url='. $site .'&screenshot=true&key=AIzaSyA_JOJidlWFgEiyxTlSGi2_fORgYsCZFtA');
|
||||
$googlePagespeedData = file_get_contents('https://www.googleapis.com/pagespeedonline/v2/runPagespeed?url='. $site .'&screenshot=true');
|
||||
$googlePagespeedData = json_decode($googlePagespeedData, true);
|
||||
$screenshot = $googlePagespeedData['screenshot']['data'];
|
||||
$screenshot = str_replace(array('_','-'),array('/','+'),$screenshot);
|
||||
|
@ -1,4 +1,3 @@
|
||||
<?php $this->makeImageTag(); ?>
|
||||
<?php echo template::formOpen('configForm'); ?>
|
||||
<div class="row">
|
||||
<div class="col2">
|
||||
@ -136,7 +135,7 @@
|
||||
'help' => 'Sauvegarde une fois par jour le fichier de données dans le dossier site/backup/. La sauvegarde est conservée 30 jours.'
|
||||
]); ?>
|
||||
<div class="row">
|
||||
<div class="col6">
|
||||
<div class="col6 offset3">
|
||||
<?php echo template::button('configExport', [
|
||||
'href' => helper::baseUrl() . 'config/backup',
|
||||
'value' => 'Exporter les données'
|
||||
@ -146,20 +145,18 @@
|
||||
</div>
|
||||
<div class="block">
|
||||
<h4>Copie d'écran pour OpenGraph :</h4>
|
||||
<div class="col3">
|
||||
<!--
|
||||
Bouton inutile
|
||||
<?php echo template::button('configmetaImage', [
|
||||
'href' => helper::baseUrl() . 'config/metaimage',
|
||||
'value' => 'Rafraîchir la capture <br /> d\'écran du site'
|
||||
]); ?>
|
||||
-->
|
||||
</div>
|
||||
<div class="col6">
|
||||
<p><img src='<?php echo helper::baseUrl(false) . 'site/file/source/screenshot.png';?>' />
|
||||
</div>
|
||||
<div class="col3">
|
||||
<div clas='row'>
|
||||
<div class="col6 offset3">
|
||||
<p><img src='<?php echo helper::baseUrl(false) . 'site/file/source/screenshot.png';?>' />
|
||||
</div>
|
||||
<div class='row'>
|
||||
<div class="col6 offset3">
|
||||
<?php echo template::button('configMetaImage', [
|
||||
'href' => helper::baseUrl() . 'config/configMetaImage',
|
||||
'value' => 'Rafraîchir la capture d\'écran'
|
||||
]); ?>
|
||||
</div>
|
||||
</div>
|
||||
<p>Cette copie d'écran est nécessaire aux partages sur les réseaux sociaux. Elle est régénérée lorsque le fichier screenshot.png est effacé du gestionnaire de fichiers.</p>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -25,7 +25,7 @@ class theme extends common {
|
||||
'reset' => self::GROUP_ADMIN,
|
||||
'site' => self::GROUP_ADMIN,
|
||||
'manage' => self::GROUP_ADMIN,
|
||||
'themeEport' => self::GROUP_ADMIN,
|
||||
'themeExport' => self::GROUP_ADMIN,
|
||||
'themeImport' => self::GROUP_ADMIN
|
||||
];
|
||||
public static $aligns = [
|
||||
|
@ -9,13 +9,13 @@
|
||||
]); ?>
|
||||
</div>
|
||||
<div class="col2">
|
||||
<?php echo template::button('themeManage', [
|
||||
<?php echo template::button('themeImport', [
|
||||
'href' => helper::baseUrl() . 'theme/themeImport',
|
||||
'value' => 'Importer les données du thème'
|
||||
]); ?>
|
||||
</div>
|
||||
<div class="col2">
|
||||
<?php echo template::button('themeManage', [
|
||||
<?php echo template::button('themeExport', [
|
||||
'href' => helper::baseUrl() . 'theme/themeExport',
|
||||
'value' => 'Exporter les données du thème'
|
||||
]); ?>
|
||||
|
Binary file not shown.
Before Width: | Height: | Size: 6.0 KiB After Width: | Height: | Size: 3.8 KiB |
Loading…
Reference in New Issue
Block a user