30 lines
1.6 KiB
PHP
Executable File
30 lines
1.6 KiB
PHP
Executable File
<?php
|
|
$nomFicAppelant = basename(__FILE__);
|
|
// -----------------------------------------------------
|
|
// Ecriture du fichier js
|
|
// -----------------------------------------------------
|
|
$line="";
|
|
$retour='';
|
|
//
|
|
include ("gID.reqSelect.php");
|
|
For ($g=0; $g<count($gIDTab); $g++) {
|
|
if ($g>0) $line .= "\n";
|
|
if ($gScriptTab[$g]!='') $line .=$gScriptTab[$g];
|
|
// echo '<br>line=' .$line;
|
|
}
|
|
// echo '<br> line finale = ' .$line;
|
|
$retour=file_put_contents($includePathPublication. '/googleA/googleAnalytic.js',$line);
|
|
if (isset($debug[2]) && $debug[2] == '1') { $debugMsg .= monDebug(2, ['écriture du fichier' => $includePathPublication, 'retour' => $retour], '');}
|
|
|
|
// -----------------------------------------------------
|
|
// Si pas de js faire le script noJS
|
|
// C'est en dur, mais ce serait un peu compliqué de le faire en testant si un script existe
|
|
// car le script noJs n'est pas appelé au meme endroit, il est dans le body. Donc faudrait faire 2 scripts / 2 mouilnettes
|
|
$fileName=$includePathPublication. "/googleA/cGoogle.txt";
|
|
if (file_exists($fileName)) {
|
|
$cGoogle=file_get_contents($fileName);
|
|
$script= '<!-- Google Tag Manager (noscript) --><noscript><iframe src="https://www.googletagmanager.com/ns.html?id=' .$cGoogle. '" height="0" width="0" style="display:none;visibility:hidden"></iframe></noscript><!-- End Google Tag Manager (noscript) -->';
|
|
$retour=file_put_contents($includePathPublication. '/googleA/googleA_noJS.js',$script);
|
|
if (isset($debug[2]) && $debug[2] == '1') { $debugMsg .= monDebug(2, ['écriture du fichier' => $includePathPublication, 'retour' => $retour], '');}
|
|
}
|
|
?>
|