Showing 1 changed files with 19 additions and 5 deletions
+19 -5
sources/news-huffingtonpost.fr.php
... ...
@@ -87,11 +87,13 @@ foreach ($articles as $article ) {
87 87
     '',
88 88
     ' width="100%" frameborder="0" ');
89 89
   $article_only  = str_replace($orgStrings, $newStrings, $article_only);
90
-
91
-  $SEARCH_SUB1='<p><strong>À voir également sur <em>Le HuffPost</em>:</strong></p>';
90
+  
91
+  $SEARCH_SUB1='<p><strong>Lire aussi :</strong></p>';
92 92
   $pos_stop = strpos($article_only, $SEARCH_SUB1);
93
-  $temp = substr($article_only, 0, $pos_stop);
94
-  $article_only = $temp;
93
+  if($pos_stop) {
94
+    $temp = substr($article_only, 0, $pos_stop);
95
+    $article_only = $temp."</blockquote>";
96
+  }
95 97
 
96 98
   $re = '/alt="(.+?)" width="(.+?)" height="(.+?)"/';
97 99
   $temp = preg_replace($re, 'width="100%"', $article_only);
... ...
@@ -112,7 +114,7 @@ foreach ($articles as $article ) {
112 114
   $temp = preg_replace($re, '<img ', $article_only);
113 115
   $article_only = $temp;
114 116
   $re = '/<iframe (.+?) height="(.+?)" (.+?) width="(.+?)">/';
115
-  $temp = preg_replace($re, '<iframe \\1 \\3 width="100%"', $article_only);
117
+  $temp = preg_replace($re, '<iframe \\1 \\3 width="100%">', $article_only);
116 118
   $article_only = $temp;
117 119
   $re = '/<img class="image__src"/';
118 120
   $temp = preg_replace($re, '<img class="image__src" width="100%"', $article_only);
... ...
@@ -122,6 +124,18 @@ foreach ($articles as $article ) {
122 124
   $article_only = $temp;
123 125
   $temp = preg_replace('/\s\s+/', ' ', $article_only);
124 126
   $article_only = $temp;
127
+  $orgStrings = array( 
128
+    '<div id="entry_paragraph_1" class="entry-body--paragraph-ad"> <div class="ad_spot "> </div> </div>',
129
+    '<div id="entry_paragraph_2" class="entry-body--paragraph-ad"> <div class="ad_spot "> </div> </div>',
130
+    '<div id="entry_paragraph_3" class="entry-body--paragraph-ad"> <div class="ad_spot "> </div> </div>',
131
+    '<div id="entry_paragraph_4" class="entry-body--paragraph-ad"> <div class="ad_spot "> </div> </div>');
132
+  $newStrings = array( 
133
+    '',
134
+    '',
135
+    '',
136
+    '');
137
+  $article_only  = str_replace($orgStrings, $newStrings, $article_only);
138
+  
125 139
   echo '<div id="nav-up" style="display:inline;"><a href="#top"><i class="fa fa-home fa-2x"></i></a></div>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;';
126 140
   echo '<div id="nav-source" style="display:inline;"><a href="'.$article['link'].'" target="new-'.$cpt.'"><i class="fa fa-link fa-2x"></i></a></div>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;';
127 141
   echo '<div id="nav-prev" onclick="onArticle('.$cpt_prev.')" style="display:inline;"><i class="fa fa-chevron-left fa-2x"></i></div>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;';