| version 1.66, 2007/07/19 18:54:33 |
version 1.67, 2007/07/27 20:47:37 |
|
|
| * http://platon.sk/projects/Metafox/ |
* http://platon.sk/projects/Metafox/ |
| */ |
*/ |
| |
|
| /* $Platon: Metafox/functions.inc.php,v 1.65 2007-07-19 18:30:50 nepto Exp $ */ |
/* $Platon: Metafox/functions.inc.php,v 1.66 2007-07-19 18:54:33 nepto Exp $ */ |
| |
|
| function ezin_eval($evalcode) /* {{{ */ |
function ezin_eval($evalcode) /* {{{ */ |
| { |
{ |
| Line 131 function ezin_handle_special_tags(&$str, |
|
| Line 131 function ezin_handle_special_tags(&$str, |
|
| $pattern = array(); |
$pattern = array(); |
| $replacement = array(); |
$replacement = array(); |
| if (strpos($mask, 'f') !== false) { /* {{{ */ |
if (strpos($mask, 'f') !== false) { /* {{{ */ |
| $pattern[] = '|<flash\s+(\w{3,6}://[^>\s]+)([^>]*)>((?:(?!<flash).){0,499}?)</flash>|si'; |
$pattern[] = '|<flash\s+(\w{3,6}://[^>\s]+)([^>]*)>\s*((?:(?!<flash).){0,499}?)\s*</flash>|si'; |
| $pattern[] = '|<flash\s+([^>\s]+)([^>]*)>((?:(?!<flash).){0,499}?)</flash>|si'; |
$pattern[] = '|<flash\s+([^>\s]+)([^>]*)>\s*((?:(?!<flash).){0,499}?)\s*</flash>|si'; |
| $pattern[] = '|<flash\s+(\w{3,6}://[^>\s]+)([^>]*)>|i'; |
$pattern[] = '|<flash\s+(\w{3,6}://[^>\s]+)([^>]*)>|i'; |
| $pattern[] = '|<flash\s+([^>\s]+)([^>]*)>|i'; |
$pattern[] = '|<flash\s+([^>\s]+)([^>]*)>|i'; |
| $replacement[] = '<object type="application/x-shockwave-flash" data="\\1"\\2>'."\n" |
$replacement[] = '<object type="application/x-shockwave-flash" data="\\1"\\2>'."\n" |
| Line 145 function ezin_handle_special_tags(&$str, |
|
| Line 145 function ezin_handle_special_tags(&$str, |
|
| .'<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) { /* {{{ */ |
| $pattern[] = '|<image-link\s+([^>\s]+)([^>]*)>((?:(?!<image-link).){0,499}?)</image-link>|si'; |
$pattern[] = '|<image-link\s+([^>\s]+)([^>]*)>\s*((?:(?!<image-link).){0,499}?)\s*</image-link>|si'; |
| $pattern[] = '|<image-link\s+([^>\s]+)([^>]*)>|i'; |
$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>\\3</image></a>'; |
| $replacement[] = '<a target="_blank" href="'.$repository_url.'\\1"><image \\1\\2></a>'; |
$replacement[] = '<a target="_blank" href="'.$repository_url.'\\1"><image \\1\\2></a>'; |
| Line 164 function ezin_handle_special_tags(&$str, |
|
| Line 164 function ezin_handle_special_tags(&$str, |
|
| //echo "FILE: $val[1], WIDTH: $val[3], RET: $ret<br>"; |
//echo "FILE: $val[1], WIDTH: $val[3], RET: $ret<br>"; |
| } |
} |
| |
|
| $pattern[] = '|<image\s+(\w{3,6}://[^>\s]+)([^>]*)>((?:(?!<image).){0,499}?)</image>|si'; |
$pattern[] = '|<image\s+(\w{3,6}://[^>\s]+)([^>]*)>\s*((?:(?!<image).){0,499}?)\s*</image>|si'; |
| $pattern[] = '|<image\s+/([^>\s]+)([^>]*)>((?:(?!<image).){0,499}?)</image>|si'; |
$pattern[] = '|<image\s+/([^>\s]+)([^>]*)>\s*((?:(?!<image).){0,499}?)\s*</image>|si'; |
| $pattern[] = '|<image\s+([^>\s]+)([^>]*)>((?:(?!<image).){0,499}?)</image>|si'; |
$pattern[] = '|<image\s+([^>\s]+)([^>]*)>\s*((?:(?!<image).){0,499}?)\s*</image>|si'; |
| $pattern[] = '|<image\s+(\w{3,6}://[^>\s]+)([^>]*)>|i'; |
$pattern[] = '|<image\s+(\w{3,6}://[^>\s]+)([^>]*)>|i'; |
| $pattern[] = '|<image\s+/([^>\s]+)([^>]*)>|i'; |
$pattern[] = '|<image\s+/([^>\s]+)([^>]*)>|i'; |
| $pattern[] = '|<image\s+([^>\s]+)([^>]*)>|i'; |
$pattern[] = '|<image\s+([^>\s]+)([^>]*)>|i'; |
| Line 178 function ezin_handle_special_tags(&$str, |
|
| Line 178 function ezin_handle_special_tags(&$str, |
|
| $replacement[] = '<img alt="" border="0" src="'.$repository_url.'\\1"\\2>'; |
$replacement[] = '<img alt="" border="0" src="'.$repository_url.'\\1"\\2>'; |
| } /* }}} */ |
} /* }}} */ |
| if (strpos($mask, 'L') !== false) { /* {{{ */ |
if (strpos($mask, 'L') !== false) { /* {{{ */ |
| $pattern[] = '|<link\s+(\w{3,6}://[^>\s]+)([^>]*)>((?:(?!<link).){0,499}?)</link>|si'; |
$pattern[] = '|<link\s+(\w{3,6}://[^>\s]+)([^>]*)>\s*((?:(?!<link).){0,499}?)\s*</link>|si'; |
| $pattern[] = '|<link\s+/([^>\s]*)([^>]*)>((?:(?!<link).){0,499}?)</link>|si'; |
$pattern[] = '|<link\s+/([^>\s]*)([^>]*)>\s*((?:(?!<link).){0,499}?)\s*</link>|si'; |
| $pattern[] = '|<link\s+([^>\s]+)([^>]*)>((?:(?!<link).){0,499}?)</link>|si'; |
$pattern[] = '|<link\s+([^>\s]+)([^>]*)>\s*((?:(?!<link).){0,499}?)\s*</link>|si'; |
| $pattern[] = '|<link\s+(\w{3,6}://[^>\s]+)([^>]*)>|i'; |
$pattern[] = '|<link\s+(\w{3,6}://[^>\s]+)([^>]*)>|i'; |
| $pattern[] = '|<link\s+/([^>\s]*)([^>]*)>|i'; |
$pattern[] = '|<link\s+/([^>\s]*)([^>]*)>|i'; |
| $pattern[] = '|<link\s+([^>\s]+)([^>]*)>|i'; |
$pattern[] = '|<link\s+([^>\s]+)([^>]*)>|i'; |
| Line 192 function ezin_handle_special_tags(&$str, |
|
| Line 192 function ezin_handle_special_tags(&$str, |
|
| $replacement[] = '<a href="'.$repository_url.'\\1"\\2>\\1</a>'; |
$replacement[] = '<a href="'.$repository_url.'\\1"\\2>\\1</a>'; |
| } /* }}} */ |
} /* }}} */ |
| if (strpos($mask, 'E') !== false) { /* {{{ */ |
if (strpos($mask, 'E') !== false) { /* {{{ */ |
| $pattern[] = '|<extern-link\s+(\w{3,6}://[^>\s]+)([^>]*)>((?:(?!<extern-link).){0,499}?)</extern-link>|si'; |
$pattern[] = '|<extern-link\s+(\w{3,6}://[^>\s]+)([^>]*)>\s*((?:(?!<extern-link).){0,499}?)\s*</extern-link>|si'; |
| $pattern[] = '|<extern-link\s+/([^>\s]*)([^>]*)>((?:(?!<extern-link).){0,499}?)</extern-link>|si'; |
$pattern[] = '|<extern-link\s+/([^>\s]*)([^>]*)>\s*((?:(?!<extern-link).){0,499}?)\s*</extern-link>|si'; |
| $pattern[] = '|<extern-link\s+([^>\s]+)([^>]*)>((?:(?!<extern-link).){0,499}?)</extern-link>|si'; |
$pattern[] = '|<extern-link\s+([^>\s]+)([^>]*)>\s*((?:(?!<extern-link).){0,499}?)\s*</extern-link>|si'; |
| $pattern[] = '|<extern-link\s+(\w{3,6}://[^>\s]+)([^>]*)>|i'; |
$pattern[] = '|<extern-link\s+(\w{3,6}://[^>\s]+)([^>]*)>|i'; |
| $pattern[] = '|<extern-link\s+/([^>\s]*)([^>]*)>|i'; |
$pattern[] = '|<extern-link\s+/([^>\s]*)([^>]*)>|i'; |
| $pattern[] = '|<extern-link\s+([^>\s]+)([^>]*)>|i'; |
$pattern[] = '|<extern-link\s+([^>\s]+)([^>]*)>|i'; |
| Line 206 function ezin_handle_special_tags(&$str, |
|
| Line 206 function ezin_handle_special_tags(&$str, |
|
| $replacement[] = '<a target="_blank" href="http://\\1"\\2>\\1</a>'; |
$replacement[] = '<a target="_blank" href="http://\\1"\\2>\\1</a>'; |
| } /* }}} */ |
} /* }}} */ |
| if (strpos($mask, 'R') !== false) { /* {{{ */ |
if (strpos($mask, 'R') !== false) { /* {{{ */ |
| $pattern[] = '|<repository-link\s+([^>\s]+)([^>]*)>((?:(?!<repository-link).){0,499}?)</repository-link>|si'; |
$pattern[] = '|<repository-link\s+([^>\s]+)([^>]*)>\s*((?:(?!<repository-link).){0,499}?)\s*</repository-link>|si'; |
| $pattern[] = '|<repository-link\s+([^>\s]+)([^>]*)>|i'; |
$pattern[] = '|<repository-link\s+([^>\s]+)([^>]*)>|i'; |
| $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, 'M') !== false) { /* {{{ */ |
if (strpos($mask, 'M') !== false) { /* {{{ */ |
| $pattern[] = '|<mail-link\s+([^>\s]+)([^>]*)>((?:(?!<mail-link).){0,499}?)</mail-link>|sie'; |
$pattern[] = '|<mail-link\s+([^>\s]+)([^>]*)>\s*((?:(?!<mail-link).){0,499}?)\s*</mail-link>|sie'; |
| $pattern[] = '|<mail-link\s+([^>\s]+)([^>]*)>|ie'; |
$pattern[] = '|<mail-link\s+([^>\s]+)([^>]*)>|ie'; |
| //$replacement[] = '<a href="mailto:\\1"\\2>\\3</a>'; |
|
| //$replacement[] = '<a href="mailto:\\1"\\2>\\1</a>'; |
|
| $replacement[] = '\'<a href="\'.Platon::escape_email(\'\\1\', \'mailto\').\'"\\2>\\3</a>\''; |
$replacement[] = '\'<a href="\'.Platon::escape_email(\'\\1\', \'mailto\').\'"\\2>\\3</a>\''; |
| $replacement[] = 'Platon::escape_email(\'\\1\', \'hypertext_link\', \'\\2\')'; |
$replacement[] = 'Platon::escape_email(\'\\1\', \'hypertext_link\', \'\\2\')'; |
| } /* }}} */ |
} /* }}} */ |
| if (strpos($mask, 'S') !== false) { /* {{{ */ |
if (strpos($mask, 'S') !== false) { /* {{{ */ |
| $sub_url = $link_file_type ? 'section.php?' : '?ezin_section_id='; |
$sub_url = $link_file_type ? 'section.php?' : '?ezin_section_id='; |
| $pattern[] = '|<section-link\s+([^>\s]+)([^>]*)>((?:(?!<section-link).){0,499}?)</section-link>|si'; |
$pattern[] = '|<section-link\s+([^>\s]+)([^>]*)>\s*((?:(?!<section-link).){0,499}?)\s*</section-link>|si'; |
| $pattern[] = '|<section-link\s+([^>\s]+)([^>]*)>|i'; |
$pattern[] = '|<section-link\s+([^>\s]+)([^>]*)>|i'; |
| $replacement[] = '<a href="'.$ezin_url.$sub_url.'\\1"\\2>\\3</a>'; |
$replacement[] = '<a href="'.$ezin_url.$sub_url.'\\1"\\2>\\3</a>'; |
| $replacement[] = '<a href="'.$ezin_url.$sub_url.'\\1"\\2>\\1</a>'; |
$replacement[] = '<a href="'.$ezin_url.$sub_url.'\\1"\\2>\\1</a>'; |
| } /* }}} */ |
} /* }}} */ |
| if (strpos($mask, 'A') !== false) { /* {{{ */ |
if (strpos($mask, 'A') !== false) { /* {{{ */ |
| $sub_url = $link_file_type ? 'article.php?' : '?ezin_article_id='; |
$sub_url = $link_file_type ? 'article.php?' : '?ezin_article_id='; |
| $pattern[] = '|<article-link\s+([^>\s]+)([^>]*)>((?:(?!<article-link).){0,499}?)</article-link>|si'; |
$pattern[] = '|<article-link\s+([^>\s]+)([^>]*)>\s*((?:(?!<article-link).){0,499}?)\s*</article-link>|si'; |
| $pattern[] = '|<article-link\s+([^>\s]+)([^>]*)>|i'; |
$pattern[] = '|<article-link\s+([^>\s]+)([^>]*)>|i'; |
| $replacement[] = '<a href="'.$ezin_url.$sub_url.'\\1"\\2>\\3</a>'; |
$replacement[] = '<a href="'.$ezin_url.$sub_url.'\\1"\\2>\\3</a>'; |
| $replacement[] = '<a href="'.$ezin_url.$sub_url.'\\1"\\2>\\1</a>'; |
$replacement[] = '<a href="'.$ezin_url.$sub_url.'\\1"\\2>\\1</a>'; |
| $pattern[] = '|<page-link\s+([^>\s]+)([^>]*)>((?:(?!<page-link).){0,499}?)</page-link>|si'; |
$pattern[] = '|<page-link\s+([^>\s]+)([^>]*)>\s*((?:(?!<page-link).){0,499}?)\s*</page-link>|si'; |
| $pattern[] = '|<page-link\s+([^>\s]+)([^>]*)>|i'; |
$pattern[] = '|<page-link\s+([^>\s]+)([^>]*)>|i'; |
| $replacement[] = '<a href="'.$ezin_url.$sub_url.'\\1"\\2>\\3</a>'; |
$replacement[] = '<a href="'.$ezin_url.$sub_url.'\\1"\\2>\\3</a>'; |
| $replacement[] = '<a href="'.$ezin_url.$sub_url.'\\1"\\2>\\1</a>'; |
$replacement[] = '<a href="'.$ezin_url.$sub_url.'\\1"\\2>\\1</a>'; |
| } /* }}} */ |
} /* }}} */ |
| if (strpos($mask, 'P') !== false) { /* {{{ */ |
if (strpos($mask, 'P') !== false) { /* {{{ */ |
| $sub_url = $link_file_type ? 'print.php?' : '?ezin_print=1&ezin_article_id='; |
$sub_url = $link_file_type ? 'print.php?' : '?ezin_print=1&ezin_article_id='; |
| $pattern[] = '|<article-print-link\s+([^>\s]+)([^>]*)>((?:(?!<article-print-link).){0,499}?)' |
$pattern[] = '|<article-print-link\s+([^>\s]+)([^>]*)>\s*((?:(?!<article-print-link).){0,499}?)' |
| .'</article-print-link>|si'; |
.'\s*</article-print-link>|si'; |
| $pattern[] = '|<article-print-link\s+([^>\s]+)([^>]*)>|i'; |
$pattern[] = '|<article-print-link\s+([^>\s]+)([^>]*)>|i'; |
| $replacement[] = '<a href="'.$ezin_url.$sub_url.'\\1"\\2>\\3</a>'; |
$replacement[] = '<a href="'.$ezin_url.$sub_url.'\\1"\\2>\\3</a>'; |
| $replacement[] = '<a href="'.$ezin_url.$sub_url.'\\1"\\2>\\1</a>'; |
$replacement[] = '<a href="'.$ezin_url.$sub_url.'\\1"\\2>\\1</a>'; |
| $pattern[] = '|<print-link\s+([^>\s]+)([^>]*)>((?:(?!<print-link).){0,499}?)</print-link>|si'; |
$pattern[] = '|<print-link\s+([^>\s]+)([^>]*)>\s*((?:(?!<print-link).){0,499}?)\s*</print-link>|si'; |
| $pattern[] = '|<print-link\s+([^>\s]+)([^>]*)>|i'; |
$pattern[] = '|<print-link\s+([^>\s]+)([^>]*)>|i'; |
| $replacement[] = '<a href="'.$ezin_url.$sub_url.'\\1"\\2>\\3</a>'; |
$replacement[] = '<a href="'.$ezin_url.$sub_url.'\\1"\\2>\\3</a>'; |
| $replacement[] = '<a href="'.$ezin_url.$sub_url.'\\1"\\2>\\1</a>'; |
$replacement[] = '<a href="'.$ezin_url.$sub_url.'\\1"\\2>\\1</a>'; |
| } /* }}} */ |
} /* }}} */ |
| if (strpos($mask, 'U') !== false) { /* {{{ */ |
if (strpos($mask, 'U') !== false) { /* {{{ */ |
| $sub_url = $link_file_type ? 'author.php?' : '?ezin_author_id='; |
$sub_url = $link_file_type ? 'author.php?' : '?ezin_author_id='; |
| $pattern[] = '|<author-link\s+([^>\s]+)([^>]*)>((?:(?!<author-link).){0,499}?)</author-link>|si'; |
$pattern[] = '|<author-link\s+([^>\s]+)([^>]*)>\s*((?:(?!<author-link).){0,499}?)\s*</author-link>|si'; |
| $pattern[] = '|<author-link\s+([^>\s]+)([^>]*)>|i'; |
$pattern[] = '|<author-link\s+([^>\s]+)([^>]*)>|i'; |
| $replacement[] = '<a href="'.$ezin_url.$sub_url.'\\1"\\2>\\3</a>'; |
$replacement[] = '<a href="'.$ezin_url.$sub_url.'\\1"\\2>\\3</a>'; |
| $replacement[] = '<a href="'.$ezin_url.$sub_url.'\\1"\\2>\\1</a>'; |
$replacement[] = '<a href="'.$ezin_url.$sub_url.'\\1"\\2>\\1</a>'; |