| verzia 1.44, 2006/10/24 10:28:47 |
verzia 1.45, 2006/11/08 14:18:06 |
|
|
| * http://platon.sk/projects/Metafox/ |
* http://platon.sk/projects/Metafox/ |
| */ |
*/ |
| |
|
| /* $Platon: Metafox/functions.inc.php,v 1.43 2006-10-01 14:31:41 nepto Exp $ */ |
/* $Platon: Metafox/functions.inc.php,v 1.44 2006-10-24 10:28:47 nepto Exp $ */ |
| |
|
| function ezin_eval($evalcode) /* {{{ */ |
function ezin_eval($evalcode) /* {{{ */ |
| { |
{ |
| Riadok 77 function ezin_get_special_tags_flags($st |
|
| Riadok 77 function ezin_get_special_tags_flags($st |
|
| $ret = ''; |
$ret = ''; |
| preg_match('|<flash\s[^>]+>|i', $str) && $ret .= 'f'; |
preg_match('|<flash\s[^>]+>|i', $str) && $ret .= 'f'; |
| preg_match('|<image\s[^>]+>|i', $str) && $ret .= 'i'; |
preg_match('|<image\s[^>]+>|i', $str) && $ret .= 'i'; |
| |
preg_match('|<image-link\s[^>]+>|i', $str) && $ret .= 'I'; |
| preg_match('|<link\s[^>]+>|i', $str) && $ret .= 'L'; |
preg_match('|<link\s[^>]+>|i', $str) && $ret .= 'L'; |
| preg_match('|<extern-link\s[^>]+>|i', $str) && $ret .= 'E'; |
preg_match('|<extern-link\s[^>]+>|i', $str) && $ret .= 'E'; |
| preg_match('|<repository-link\s[^>]+>|i', $str) && $ret .= 'R'; |
preg_match('|<repository-link\s[^>]+>|i', $str) && $ret .= 'R'; |
| preg_match('|<image-link\s[^>]+>|i', $str) && $ret .= 'I'; |
|
| preg_match('|<mail-link\s[^>]+>|i', $str) && $ret .= 'M'; |
preg_match('|<mail-link\s[^>]+>|i', $str) && $ret .= 'M'; |
| preg_match('|<author-link\s[^>]+>|i', $str) && $ret .= 'U'; |
preg_match('|<author-link\s[^>]+>|i', $str) && $ret .= 'U'; |
| preg_match('|<section-link\s[^>]+>|i', $str) && $ret .= 'S'; |
preg_match('|<section-link\s[^>]+>|i', $str) && $ret .= 'S'; |
| Riadok 88 function ezin_get_special_tags_flags($st |
|
| Riadok 88 function ezin_get_special_tags_flags($st |
|
| preg_match('|<page-link\s[^>]+>|i', $str) && $ret .= 'A'; // same as articles |
preg_match('|<page-link\s[^>]+>|i', $str) && $ret .= 'A'; // same as articles |
| preg_match('|<article-print-link\s[^>]+>|i', $str) && $ret .= 'P'; |
preg_match('|<article-print-link\s[^>]+>|i', $str) && $ret .= 'P'; |
| preg_match('|<print-link\s[^>]+>|i', $str) && $ret .= 'P'; |
preg_match('|<print-link\s[^>]+>|i', $str) && $ret .= 'P'; |
| preg_match('|<include\s[^>]+>|i', $str) && $ret .= 'I'; |
preg_match('|<include\s[^>]+>|i', $str) && $ret .= 'N'; |
| return $ret; |
return $ret; |
| } /* }}} */ |
} /* }}} */ |
| |
|
| Riadok 139 function ezin_handle_special_tags(&$str, |
|
| Riadok 139 function ezin_handle_special_tags(&$str, |
|
| $replacement[] = '<object type="application/x-shockwave-flash" data="'.$repository_url.'\\1"\\2>'."\n" |
$replacement[] = '<object type="application/x-shockwave-flash" data="'.$repository_url.'\\1"\\2>'."\n" |
| .'<param name="movie" value="'.$repository_url.'\\1"><embed src="'.$repository_url.'\\1"\\2></object>'; |
.'<param name="movie" value="'.$repository_url.'\\1"><embed src="'.$repository_url.'\\1"\\2></object>'; |
| } /* }}} */ |
} /* }}} */ |
| if (strpos($mask, 'i') !== false) { /* {{{ */ |
if (strpos($mask, 'I') !== false) { /* {{{ */ |
| preg_match_all('|<image\s+([^>\s]+)([^>]*width=([^>\s]+)[^>]*)>|i', $str, $matches, PREG_SET_ORDER); |
$pattern[] = '|<image-link\s+([^>\s]+)([^>]*)>((?:(?!<image-link).){0,499}?)</image-link>|si'; |
| |
$pattern[] = '|<image-link\s+([^>\s]+)([^>]*)>|i'; |
| |
$replacement[] = '<a target="_blank" href="'.$repository_url.'\\1"><image \\1\\2>\\3</image></a>'; |
| |
$replacement[] = '<a target="_blank" href="'.$repository_url.'\\1"><image \\1\\2></a>'; |
| |
} /* }}} */ |
| |
if (stripos($mask, 'i') !== false) { /* {{{ */ |
| |
preg_match_all('|<image(-link)?\s+([^>\s]+)([^>]*width=([^>\s]+)[^>]*)>|i', |
| |
$str, $matches, PREG_SET_ORDER); |
| foreach ($matches as $key => $val) { |
foreach ($matches as $key => $val) { |
| $old_file = $val[1]; |
$old_file = $val[2]; |
| $width = $val[3]; |
$width = $val[4]; |
| $new_file = ezin_scale_upload_image($old_file, $width); |
$new_file = ezin_scale_upload_image($old_file, $width); |
| if ($new_file != false && $new_file != $val[1]) { |
if ($new_file != false && $new_file != $val[1]) { |
| $pattern[] = '|<image\s+'.$old_file.'([^>]*)width='.$width.'([^>]*)>|i'; |
$pattern[] = '|<image\s+'.$old_file.'([^>]*)width='.$width.'([^>]*)>|i'; |
| Riadok 199 function ezin_handle_special_tags(&$str, |
|
| Riadok 206 function ezin_handle_special_tags(&$str, |
|
| $replacement[] = '<a target="_blank" href="'.$repository_url.'\\1"\\2>\\3</a>'; |
$replacement[] = '<a target="_blank" href="'.$repository_url.'\\1"\\2>\\3</a>'; |
| $replacement[] = '<a target="_blank" href="'.$repository_url.'\\1"\\2>\\1</a>'; |
$replacement[] = '<a target="_blank" href="'.$repository_url.'\\1"\\2>\\1</a>'; |
| } /* }}} */ |
} /* }}} */ |
| if (strpos($mask, 'I') !== false) { /* {{{ */ |
|
| $pattern[] = '|<image-link\s+([^>\s]+)([^>]*)>((?:(?!<image-link).){0,499}?)</image-link>|si'; |
|
| $pattern[] = '|<image-link\s+([^>\s]+)([^>]*)>|i'; |
|
| $replacement[] = '<a target="_blank" href="'.$repository_url.'\\1"\\2>\\3</a>'; |
|
| $replacement[] = '<a target="_blank" href="'.$repository_url.'\\1"\\2>\\1</a>'; |
|
| } /* }}} */ |
|
| if (strpos($mask, 'M') !== false) { /* {{{ */ |
if (strpos($mask, 'M') !== false) { /* {{{ */ |
| $pattern[] = '|<mail-link\s+([^>\s]+)([^>]*)>((?:(?!<mail-link).){0,499}?)</mail-link>|sie'; |
$pattern[] = '|<mail-link\s+([^>\s]+)([^>]*)>((?:(?!<mail-link).){0,499}?)</mail-link>|sie'; |
| $pattern[] = '|<mail-link\s+([^>\s]+)([^>]*)>|ie'; |
$pattern[] = '|<mail-link\s+([^>\s]+)([^>]*)>|ie'; |