Esempio n. 1
0
/**
 * Clean the editor text to remove/convert line-returns.
 * 
 * @param string $text The text to convert
 * @return string
 * @access public
 * @date 9/15/04
 */
function cleanEditorText($text, $texttype = NULL)
{
    // If we are using a plain text-field convert any linereturns to <br /> tags
    // Make sure that we have the content formatted correctly.
    include "sniffer.inc.php";
    // If we just have a text box, replace new lines with <br /> tags
    // If the user didn't specify "html" as the texttype.
    if (!$supported && $texttype != 'html') {
        $text = htmlbr($text);
    } else {
        if ($supported) {
            $text = preg_replace("/\$\n/", "", $text);
        }
    }
    return $text;
}
Esempio n. 2
0
$storyObj->owningSiteObj->fetchFromDB();
//$site_owner=slot::getOwner($story->owningSiteObj->name);
$site_owner = $storyObj->owningSiteObj->owner;
//print_r($story->owningSiteObj);
//print $site_owner;
// get the correct shorttext
if ($storyObj->getField("type") == 'story') {
    $smalltext = convertTagsToInteralLinks($siteObj->name, $storyObj->getField("shorttext"));
    $fulltext = convertTagsToInteralLinks($siteObj->name, $storyObj->getField("longertext"));
    $smalltext = stripslashes($smalltext);
    $fulltext = stripslashes($fulltext);
    if ($storyObj->getField("texttype") == 'text') {
        $fulltext = htmlbr($fulltext);
    }
    if ($storyObj->getField("texttype") == 'text') {
        $smalltext = htmlbr($smalltext);
    }
}
if ($storyObj->getField("type") == 'image') {
    $filename = urldecode(db_get_value("media", "media_tag", "media_id='" . addslashes($storyObj->getField("longertext")) . "'"));
    $dir = db_get_value("media INNER JOIN slot ON media.FK_site = slot.FK_site", "slot_name", "media_id='" . addslashes($storyObj->getField("longertext")) . "'");
    $imagepath = "{$uploadurl}/{$dir}/{$filename}";
    $fulltext = "\n<div style='text-align: center'><br /><img src='{$imagepath}' border='0' /></div>";
    /* 	if ($story->getField("title")) $fulltext .= "<tr><td align='center'><b>".spchars($story->getField("title"))."</b></td></tr>"; */
    if ($storyObj->getField("shorttext")) {
        $captiontext = $st = convertTagsToInteralLinks($site, $storyObj->getField("shorttext"));
        $captiontext = "<br />" . stripslashes($captiontext);
    }
    $fulltext .= "";
}
if ($storyObj->getField("type") == 'file') {