Ejemplo n.º 1
0
        if (($tmpline = $matches[1]) != '') {
            $html .= SetHTMLOutputMode('p', ZERO_LEVEL, 0);
        }
    } else {
        // it's ordinary output if nothing else
        $html .= SetHTMLOutputMode('p', ZERO_LEVEL, 0);
    }
    // These are still problems as far as generating correct HTML is
    // concerned.  Paragraph (<p>) elements are not allowed to contain
    // other block-level elements (like <form>s).
    if (strstr($tmpline, '%%Search%%')) {
        $tmpline = str_replace('%%Search%%', RenderQuickSearch(), $tmpline);
    }
    if (strstr($tmpline, '%%Fullsearch%%')) {
        $tmpline = str_replace('%%Fullsearch%%', RenderFullSearch(), $tmpline);
    }
    if (strstr($tmpline, '%%Mostpopular%%')) {
        $tmpline = str_replace('%%Mostpopular%%', RenderMostPopular(), $tmpline);
    }
    if (defined('WIKI_ADMIN') && strstr($tmpline, '%%ADMIN-')) {
        $tmpline = ParseAdminTokens($tmpline);
    }
    ///////////////////////////////////////////////////////
    // Replace tokens
    for ($i = 0; $i < $ntokens; $i++) {
        $tmpline = str_replace($FieldSeparator . $FieldSeparator . $i . $FieldSeparator, $replacements[$i], $tmpline);
    }
    $html .= $tmpline . "\n";
}
$html .= SetHTMLOutputMode('', ZERO_LEVEL, 0);
Ejemplo n.º 2
0
        $tmpline = '<dt>' . $matches[2];
      $tmpline .= '<dd>' . $matches[3];
  //} elseif (preg_match("/^\s+/", $tmpline)) {
     // this is preformatted text, i.e. <pre>
     //$html .= SetHTMLOutputMode('pre', "0", 0);
  } elseif (preg_match("/^(!{1,3})[^!]/", $tmpline, $whichheading)) {
    if($whichheading[1] == '!') $heading = 'h3';
    elseif($whichheading[1] == '!!') $heading = 'h2';
    elseif($whichheading[1] == '!!!') $heading = 'h1';
    $tmpline = preg_replace("/^!+/", '', $tmpline);
    $html .= SetHTMLOutputMode($heading, "0", 0);
  } elseif (preg_match('/^-{4,}\s*(.*?)\s*$/', $tmpline, $matches)) {
    $html .= SetHTMLOutputMode('', "0", 0) . "<hr />\n";
    if ( ($tmpline = $matches[1]) != '' ) {
      $html .= SetHTMLOutputMode('p', "0", 0);
    }
  //} elseif (preg_match('/^%{3,}\s*(.*?)\s*$/', $tmpline, $matches)) {
  //    $html .= SetHTMLOutputMode('', "0", 0) . "<br />\n";
  } else {
	//$html .= SetHTMLOutputMode('p', "0", 0);
	//correction Régis, enlever p pour ne plus injecter les balises <p>
	$html = preg_replace("|(<u>)(.*?)(</u>)|", "<ins>\\2</ins>", $html);
	$html .= SetHTMLOutputMode('', "0", 0);
  }
  for ($indice = 0; $indice < $ntokens; $indice++)
     $tmpline = str_replace($FieldSeparator.$FieldSeparator.$indice.$FieldSeparator, $replacements[$indice], $tmpline);
  $html .= $tmpline . "\n";
}
$html .= SetHTMLOutputMode('', "0", 0);

?>