1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34
| <?php
defined('_JEXEC') or die('Restricted Access');
$mainframe->registerEvent('onPrepareContent', 'plgimagesrose');
function plgimagesrose(&$row, &$params, $page)
{
$JeSuisOff = "{articlenormal}";
if (JString::strpos($text,$JeSuisOff ) !== false) {
$text = JString::str_ireplace($JeSuisOff , '', $text);
return true;
}
// find all image tags in the content
$pattern = '/<img.src="([^"]*)".([^>]*)>/';
preg_match_all($pattern, $row->text, $matches);
// iterate through them and replace with cached version
for($i = 0; $i< count($matches[0]); $i++)
{
$row->text = str_replace($matches[0][$i],"",$row->text);
}
$row->text = '<div id="article">'.$row->text .'</div><div id="photos">';
for($i = 0; $i< count($matches[0]); $i++) {
$row->text .= $matches[0][$i] ;
}
$row->text .= '</div>';
}
?> |
Partager