Mit dieser Funktion sollte es mit ' und " funktionieren:
Code
function imgpop_the_content($content)
{
global $doing_rss;
if (!$doing_rss) {
global $pluginurl;
preg_match_all("/<a\s[^>]*href=\'[^\']+\.(jpg|jpeg|gif|png)\'[^>]*>/Ui", $content, $temp1, PREG_PATTERN_ORDER);
for($v=0; $v<=sizeof($temp1[0])-1; $v++) {
$link[$v]['original'] = $temp1[0][$v];
preg_match("/\shref=\'([^\']+\.(jpg|jpeg|gif|png))\'/Ui", $link[$v]['original'], $temp2);
$link[$v]['href'] = $temp2[1];
preg_match("/\stitle=\'([^\']*)\'/Ui", $link[$v]['original'], $temp2);
$link[$v]['rest'] = chop(str_replace(">", "", $link[$v]['original']));
$link[$v]['neu'] = $link[$v]['rest'] . " onclick=\"return enlarge('".$pluginurl."','".$link[$v]['href']."','".$link[$v]['title']."',event,300,75)\">";
$content = str_replace($link[$v]['original'], $link[$v]['neu'], $content);
}
preg_match_all("/<a\s[^>]*href=\"[^\"]+\.(jpg|jpeg|gif|png)\"[^>]*>/Ui", $content, $temp1, PREG_PATTERN_ORDER);
for($v=0; $v<=sizeof($temp1[0])-1; $v++) {
$link[$v]['original'] = $temp1[0][$v];
preg_match("/\shref=\"([^\"]+\.(jpg|jpeg|gif|png))\"/Ui", $link[$v]['original'], $temp2);
$link[$v]['href'] = $temp2[1];
preg_match("/\stitle=\"([^\"]*)\"/Ui", $link[$v]['original'], $temp2);
$link[$v]['title'] = str_replace("'", "\'", $temp2[1]);
$link[$v]['rest'] = chop(str_replace(">", "", $link[$v]['original']));
$link[$v]['neu'] = $link[$v]['rest'] . " onclick=\"return enlarge('".$pluginurl."','".$link[$v]['href']."','".$link[$v]['title']."',event,300,75)\">";
$content = str_replace($link[$v]['original'], $link[$v]['neu'], $content);
}
}
return $content;
}
Alles anzeigen