\n"; // Set get_image paths based on URI. This is ajax request file. It doesn't return a standard BASEDIR. $prefix_ = ""; if (!fusion_get_settings("site_seo") && isset($_POST['url'])) { $uri = pathinfo($_POST['url']); $count = substr($_POST['url'], -1) == "/" ? substr_count($uri['dirname'], "/") : substr_count($uri['dirname'], "/") - 1; $prefix_ = str_repeat("../", ($count >= 0) ? $count : 0); foreach (cache_smileys() as $smiley) { $smiley_path = fusion_get_settings('siteurl')."images/smiley/".$smiley['smiley_image']; \PHPFusion\ImageRepo::setImage("smiley_".$smiley['smiley_text'], $smiley_path); } } if ($_POST['editor'] == 'html') { $text = htmlspecialchars($text); $text = parsesmileys(nl2br(html_entity_decode(stripslashes($text)))); if (isset($_POST['mode']) && $_POST['mode'] == 'admin') { $images = str_replace('../../../', '', IMAGES); $text = str_replace(IMAGES, $images, $text); if (defined('IMAGES_N')) { $text = str_replace(IMAGES_N, $images, $text); } $text = parse_imageDir($text, $prefix_."images/"); } echo nl2br(html_entity_decode($text, ENT_QUOTES, $locale['charset'])) ?: "
".$locale['nopreview']."
\n"; } else if ($_POST['editor'] == 'bbcode') { $text = htmlspecialchars($text); $text = parseubb(parsesmileys($text)); if (isset($_POST['mode']) && $_POST['mode'] == 'admin') { $images = str_replace('../../../', '', IMAGES); $text = str_replace(IMAGES, $images, $text); if (defined('IMAGES_N')) { $text = str_replace(IMAGES_N, $images, $text); } $text = parse_imageDir($text, $prefix_."images/"); } echo nl2br(html_entity_decode($text, ENT_QUOTES, $locale['charset'])) ?: "".$locale['nopreview']."
\n"; } else { $text = htmlspecialchars($text); $text = parsesmileys($text); if (isset($_POST['mode']) && $_POST['mode'] == 'admin') { $images = str_replace('../../../', '', IMAGES); $text = str_replace(IMAGES, $images, $text); if (defined('IMAGES_N')) { $text = str_replace(IMAGES_N, $images, $text); } } echo parse_imageDir(nl2br(html_entity_decode($text, ENT_QUOTES, $locale['charset']))) ?: "".$locale['nopreview']."
\n"; } echo "\n";