',$param_start_pos);
// kompletten block bis exclusiv '>' ausschneiden
// param_block = name der span Klasse
$class = substr($line, $param_start_pos, $param_ende_pos - $param_start_pos);
// ResetActTag($class); // es gibt ja img und img0-9
// Ausnahmen
$act_tag = $class;
$act_htmltag = '<'.$class.'>';
// param_block = name der span Klasse
// Jetzt das Wort suchen
$word_start = $param_ende_pos + 1;
// Ende Wort Suchen, blank, oder neuer Tag und \n beenden das Wort
$i = $word_start;
$len = strlen($line);
while( $i++ < $len )
{
if( $line[$i] == " " ){
break;
}
else if( $line[$i] == "." ){
break;
}
else if( $line[$i] == "," ){
break;
}
else if( $line[$i] == "<" ){
break;
}
else if( $line[$i] == "\n" ){
break;
}
else if( $line[$i] == "§" && $line[$i+1] == ">" ){
break;
}
}
// word ausschneiden
$param_block = substr($line, $word_start, $i - $word_start );
// Html mit span erzeugen
$htmlcode = ''.$param_block.'';
$line = GetNewTag($param_block,$htmlcode,$line);
}
////////////////////////////////////////////////////////////////
// Hier neue Tags einbauen ende
////////////////////////////////////////////////////////////////
//
- ',$line);
$ulist = true;
$old_pre = $pre_tag;
$pre_tag = '';
}
$i = 0;
while ($ulist && (strpos($line,'\\') !== false )){
$line = str_replace('\\
','
- ',$line);
$line = str_replace('\\','
- ',$line);
if ($i++ > 10){
errorlog( "######################################################\n");
errorlog( "######################################################\n");
errorlog( "ACHTUNG TAGFEHLER STELLE ulist Zeile ".$zeile_nr."\n");
errorlog( "Zeilentext:".$line."\n");
errorlog( "######################################################\n");
errorlog( "######################################################\n");
exit; // Notaustieg bei falschem tag
}
}
if ($ulist && (strpos($line,'=ul>') !== false )){
$line = str_replace('=ul>','
',$line);
$ulist = false;
$pre_tag = $old_pre;
}
// <§?= Mehrzeilige Tags erstellen
while (strpos($line,'<§') !== false ){
$tag_basis = strpos($line,'<§');
$tag_basis_ende = strpos(substr($line,$tag_basis),'=');
$tag_param = substr($line,$tag_basis,$tag_basis_ende+1);
$html_text = '';
$tag_c = '';
if (strchr($tag_param,'p') !== false ){ // Paragraph
$tag_c .= '';
$html_text .= '';
}
if (strchr($tag_param,'f') !== false ){ // Fett
$tag_c .= '';
$html_text .= '';
}
if (strchr($tag_param,'u') !== false ){ // Unterstrichen
$tag_c .= '';
$html_text .= '';
$x4 = str_replace('u','',$x4);
}
if (strchr($tag_param,'i') !== false ){ // Kursiv Italic
$tag_c .= '';
$html_text .= '';
}
if (strchr($tag_param,'g') !== false ){ // Grosser Text
$tag_c .= '';
$html_text .= '';
}
if (strchr($tag_param,'k') !== false ){ // Klein
$tag_c .= '';
$html_text .= '';
}
if (strchr($tag_param,'t') !== false ){ // Terminal Text
$tag_c .= '';
$html_text .= '';
}
if (strchr($tag_param,'c') !== false ){ // Center
$tag_c .= '';
$html_text .= '';
}
if (strchr($tag_param,'w') !== false ){ // Word Tags
$tag_w = substr($tag_param,strpos($tag_param,'w'),2);
$tag_c .= '';
$html_text .= '';
}
$line = substr($line,0,$tag_basis).$html_text.substr($line,$tag_basis+$tag_basis_ende+1);
array_push($tag_close,$tag_c);
$e = strpos($line,'<§');
if ($e !== false){
$f = strpos($line,'§>');
if ($f !== false){
if ($e > $f){
$tag_c = array_pop($tag_close);
if ($tag_c == ''){
errorlog( "######################################################\n");
errorlog( "######################################################\n");
errorlog( "ACHTUNG TAGFEHLER STELLE 5 Zeile ".$zeile_nr."\n");
errorlog( "Zeilentext:".$line."\n");
errorlog( "######################################################\n");
errorlog( "######################################################\n");
exit; // Notaustieg bei falschem tag
}
$line = substr($line,0,strpos($line,'§>')).$tag_c.substr($line,strpos($line,'§>')+2);
}
}
}
}
// Zeilenübergreifende Tags beenden
while(strpos($line,'§>') !== false ){
$tag_c = array_pop($tag_close);
if ($tag_c == ''){
errorlog( "######################################################\n");
errorlog( "######################################################\n");
errorlog( "ACHTUNG TAGFEHLER STELLE 4 Zeile ".$zeile_nr."\n");
errorlog( "Zeilentext:".$line."\n");
errorlog( "######################################################\n");
errorlog( "######################################################\n");
exit; // Notaustieg bei falschem tag
}
$line = substr($line,0,strpos($line,'§>')).$tag_c.substr($line,strpos($line,'§>')+2);
}
//
SetActTag('');
while (strpos($line,'';
$line = GetNewTag($param_block,$htmlcode,$line);
}
//
/*
SetActTag('');
while (strpos($line,''
,''
,''
);
$line = GetNewTag($param_block,$htmlcode,$line);
}
*/
// Links
SetActTag('link');
while (strpos($line,$act_htmltag) !== false ) {
$param_block = GetParamBlock($line); // Inhalt des Tags holen
list($param_block_ref,$freierText) = split(',',$param_block);
list($npos,$n_anker) = split('#',$param_block_ref);
$htmlcode = ''.$freierText."";
$line = GetNewTag($param_block,$htmlcode,$line);
}
// include
SetActTag('include');
while (strpos($line,$act_htmltag) !== false ) {
$param_block = GetParamBlock($line); // Inhalt des Tags holen
list($include_Text,$include_Remotefile,$include_offenzu) = split(',',$param_block);
if (strpos($include_Remotefile,'.html') === false ){
$include_Remotefile .= '.html';
}
// Offen
if ($include_offenzu != ''){
$class_span = 'include_offen';
$class_block = 'include_block_offen';
}else{
$class_span = 'include_zu';
$class_block = 'include_block_zu';
}
$htmlcode = ''.$include_Text.'
'.
''.
''.
'
';
$line = GetNewTag($param_block,$htmlcode,$line);
}
// Remotefile einbinden
$i = 0;
$act_max = 999; // Maximale Tags pro Zeile
if ($incl_aktiv){ // aufgelöste includes (remotfiles) einbinden
SetActTag('remotefile');
while (strpos($line,$act_htmltag) !== false ) {
$param_block = GetParamBlock($line); // Inhalt des Tags holen
$inc_file = $verz_incl.$param_block;
if ($fincl = fopen($inc_file,'r')){
$htmlcode = fread($fincl,filesize($inc_file));
fclose($fincl);
}
$line = GetNewTag($param_block,$htmlcode,$line);
if ($i++ > 100){
errorlog( "######################################################\n");
errorlog( "######################################################\n");
errorlog( "ACHTUNG FEHLER Zeile ".$zeile_nr."\n");
errorlog( "Generierte Seite in Remotfile Include loopt \n");
errorlog( "Filename:".$inc_file." \n");
errorlog( "######################################################\n");
errorlog( "######################################################\n");
exit; // Notaustieg bei falschem tag
}
}
$line = str_replace($span_replace ,$span_replace .'-'.$include_nr,$line);
$line = str_replace($include_replace,$include_replace.'-'.$include_nr,$line);
$include_nr++;
}
$act_max = $act_max_default; // Maximale Tags pro Zeile zurück auf delfault
/*ENDE TAGS*/
} // if line = ''
if (strpos($line,'') !== false ){
$pre_tag = '';
}
if (strpos($line,'
') !== false ){
$pre_tag = '
';
}
$lastchar = substr($line,strlen($line)-1,1);
// backslash wird extra am Ende umgesetzt
if ($lastchar == '>' || $lastchar == '\\'){
$pre_tag_insert = '';
}else{
$pre_tag_insert = $pre_tag;
}
$html_output_main .= ''.replace_escape_toHtml($line) . $pre_tag_insert."\n";
if ($ii++ > 999){
errorlog( "######################################################\n");
errorlog( "######################################################\n");
errorlog( "ACHTUNG FEHLER Zeile ".$zeile_nr."\n");
errorlog( "Generierte Seite loopt \n");
errorlog( "######################################################\n");
errorlog( "######################################################\n");
exit; // Notaustieg bei falschem tag
}
}
if ($incl_aktiv){ // aufgelöste includes (remotfiles) einbinden
// alle $include_replace auflösen und Eindeutige id's vergeben
// Immer nur im Paar auflösen
for ($i=0;$i<$include_nr;$i++){
$span_replace_nr = $span_replace.'-'.$i;
$include_replace_nr = $include_replace.'-'.$i;
$j = 0;
while (strpos($html_output_main,$include_replace_nr) !== false ) {
$klappids = 'span-klappid-'.$i.'-'.$j;
$klappid = 'include-klappid-'.$i.'-'.$j;
$j++;
$pos = strpos($html_output_main,$span_replace_nr);
$html_output_main = substr_replace($html_output_main, $klappids, $pos, strlen($span_replace_nr));
$pos = strpos($html_output_main,$span_replace_nr);
$html_output_main = substr_replace($html_output_main, $klappids, $pos, strlen($span_replace_nr));
$pos = strpos($html_output_main,$include_replace_nr);
$html_output_main = substr_replace($html_output_main, $klappid, $pos, strlen($include_replace_nr));
$pos = strpos($html_output_main,$include_replace_nr);
$html_output_main = substr_replace($html_output_main, $klappid, $pos, strlen($include_replace_nr));
}
}
}
//alle Backslash auf return umsetzten
$html_output_main = str_replace('\\','
',$html_output_main);
// Achtung keine Anker im Menue (links) wenn das Tag nicht eingehängt ist !!!!
return ''.str_replace( '',
"\n\n"."\n",
$html_output_main).
$pre_tag."\n";
}
}
?>