Compare commits

..

No commits in common. "598d28551d071774007172782541e1d140b8a3c1" and "2a154a6eea510e08b2608fd55f6729056c363b25" have entirely different histories.

3 changed files with 1 additions and 59 deletions

View File

@ -1,8 +0,0 @@
<div id="hosted-on" class="widget widget_text">
<h5>Auto-hébergé sur mon NAS</h5>
<div class="textwidget">
<div style="text-align: center">
Ce blog est hébergé à la maison avec de l'Internet fournit par <a href="https://www.franciliens.net">Franciliens.net</a>
</div>
</div>
</div>

View File

@ -1,4 +0,0 @@
<div style="background-color: orange;border-radius: 6px;font-weight: bold;margin-bottom: 10px;" class="container">
Ceci est la version legacy de mon blog si vous voulez voir les nouveaux articles et et savoir pourquoi c'est par
<a href="/new">ICI</a>
</div>

View File

@ -111,24 +111,6 @@ const ARCHIVARIX_INCLUDE_CUSTOM = array(
'REGEX' => 0,
'POSITION' => -1,
],
// remove twitter widget in the right column on all the pages
[
'OPERATION' => 'REMOVE',
'XPATH' => '//*[@id="twitter-2"]',
],
[
'OPERATION' => 'REPLACE',
'XPATH' => '//*[@id="text-6"]',
'FILE' => 'hosted_by_franciliens.html',
],
[
'OPERATION' => 'APPEND',
'XPATH' => '//nav[contains(@class, "navbar")]',
'FILE' => 'warning_new_blog.php',
],
);
/**
@ -386,7 +368,7 @@ function prepareContent( $file, $sourcePath )
$content = file_get_contents( $file );
foreach ( $LOADER['ARCHIVARIX_INCLUDE_CUSTOM'] as $includeCustom ) {
if ( $includeCustom['FILE'] && $includeCustom['KEYPHRASE'] ) {
if ( $includeCustom['FILE'] ) {
global $includeRule;
$includeRule = $includeCustom;
ob_start();
@ -409,36 +391,8 @@ function prepareContent( $file, $sourcePath )
}
$content = preg_replace( '~' . $includeCustom['KEYPHRASE'] . '~is', $includedContent, $content, $includeCustom['LIMIT'] );
} else if ( $includeCustom['OPERATION'] && $includeCustom['XPATH'] ) {
$doc = new DOMDocument();
$doc->loadHTML($content);
$xpath = new DOMXpath($doc);
$elementsToChange = $xpath->query($includeCustom['XPATH']);
foreach ( $elementsToChange as $elementToChange ) {
switch ( $includeCustom['OPERATION'] ) {
case 'APPEND':
case 'REPLACE' :
$fragment = $doc->createDocumentFragment();
ob_start();
require($sourcePath . DIRECTORY_SEPARATOR . 'includes' . DIRECTORY_SEPARATOR . $includeCustom['FILE']);
$fragment->appendXML(ob_get_clean());
if ($includeCustom['OPERATION'] === 'APPEND') {
$elementToChange->append($fragment->firstChild);
} else {
$elementToChange->replaceWith($fragment->firstChild);
}
break;
case 'REMOVE' :
$elementToChange->remove();
break;
}
}
$content = $doc->saveHTML();
}
}
if ( function_exists( 'mb_strlen' ) ) {
header( 'Content-Length: ' . mb_strlen( $content, '8bit' ), true );
}