diff options
author | polo <ordipolo@gmx.fr> | 2022-07-22 23:41:56 +0200 |
---|---|---|
committer | polo <ordipolo@gmx.fr> | 2022-07-22 23:41:56 +0200 |
commit | 7f4faa78cfb9cc687e6171527bbe9e3f74d6e9bc (patch) | |
tree | f88dfae1e70172ad1b6e9a09c522d5f11e35c406 | |
parent | 6cb7d134384f94b78ed995d8744f88eb7d66b6f9 (diff) | |
download | melaine-7f4faa78cfb9cc687e6171527bbe9e3f74d6e9bc.zip |
debug !
-rw-r--r-- | controller/installation.php | 2 | ||||
-rw-r--r-- | model/Article.php | 9 |
2 files changed, 7 insertions, 4 deletions
diff --git a/controller/installation.php b/controller/installation.php index 6ae35e7..e99a06e 100644 --- a/controller/installation.php +++ b/controller/installation.php | |||
@@ -55,7 +55,7 @@ function installation() | |||
55 | createIndexPHP('data/index.php', $droitsFichiers); | 55 | createIndexPHP('data/index.php', $droitsFichiers); |
56 | } | 56 | } |
57 | 57 | ||
58 | $listePages = array('menu', 'melaine', 'musique', 'discographie', 'presse', 'jaime', 'peinture', 'archives', 'legal'); | 58 | $listePages = array('menu', 'melaine', 'musique', 'discographie', 'presse', 'livres', 'jaime', 'peinture', 'archives', 'legal'); |
59 | $sousDossiers = array('html', 'html-maxi-images', 'images', 'images-mini'); | 59 | $sousDossiers = array('html', 'html-maxi-images', 'images', 'images-mini'); |
60 | foreach ($listePages as $page) | 60 | foreach ($listePages as $page) |
61 | { | 61 | { |
diff --git a/model/Article.php b/model/Article.php index 39fbbe4..6086b3e 100644 --- a/model/Article.php +++ b/model/Article.php | |||
@@ -51,10 +51,13 @@ class Article | |||
51 | 51 | ||
52 | private function makeHtmlMiniImages($content) | 52 | private function makeHtmlMiniImages($content) |
53 | { | 53 | { |
54 | while(preg_match('#<img src=.*/images/.*>#', $content)) | 54 | // on match tant qu'on trouve "/images/" |
55 | while(preg_match('#<img src=.+/images/.+>#', $content)) | ||
55 | { | 56 | { |
56 | $pattern = '#(<img src=.*/)(images)(/.*>)#'; | 57 | // ? => mode paresseux, on fait matcher le moins d'occurences possibles |
57 | $content = preg_replace($pattern, '$1$2-mini$3', $content); | 58 | $pattern = '#(<img src=.+/)(images)(/.+?)(\.jpg.+>)#'; |
59 | // insérer -mini au nom du dossier et au fichier | ||
60 | $content = preg_replace($pattern, '$1$2-mini$3-mini$4', $content); | ||
58 | } | 61 | } |
59 | 62 | ||
60 | return $content; | 63 | return $content; |