Recent Changes - Search:

Home Pages Pidgin   Azarennya (S|N) Mac Textanium Reference ToDo Food Local Edit

Local: Hide

Language: Hide

Fantasy: Hide

SciFi: Hide

Film: Hide

Music: Hide

REALbasic: Hide

ResourcesGarageUniversityWebRingForums:REALElfDataPlugins and Code:BKeeneyDeclareSubEinhugurJoeRestrepoTempelmannZAZ

Coding: Hide

Forums:PowWebPHPWebmasterCodingWalkersPerlIntroMonksPHPJavaScriptToolboxUnobtrusiveJavaScriptJavaScriptCompressorRegularExpressions (test)JSLintSQLCocoaCocoaBuilderCocoaDevCocoaLabAppleScriptBBSUserlandFaqintoshFileMakerFileMakerTipsFileMakerWorldFileMakerPlugins

Science: Hide

History: Hide

1421

News/Politics: Hide

Cults/Crime: Hide

ClambakeInfidels

Miscellaneous: Hide

InspirationCitiWikiWakka

<?php

if (!function_exists("wakka2callback"))
{
   function wakka2callback($things)
   {
      $thing = $things[1];
      $result = "";

      static $oldIndentLevel = 0;
      static $indentClosers = array();
      static $br = 1;
      static $tabcolor;
      static $tabrow = 2;
      global $citiwiki;

      //statische variablen für die toc action
      static $hr1, $hr2, $hr3, $hr4, $hr5;
      static $hr1tmp, $hr2tmp, $hr3tmp, $hr4tmp, $hr5tmp;
      static $headercount = 0;

      //tabellen nichzt parsen
      static $citiwikimenu = 0;

// convert HTML thingies
      if ($thing == "<")
         return "&lt;";
      else if ($thing == ">")
         return "&gt;";

      else if ($thing == "ä")
         return "&auml;";

      else if ($thing == "ö")
         return "&ouml;";

      else if ($thing == "ü")
         return "&uuml;";

      else if ($thing == "&")
         return "&amp;";

// escaped text
      else if (preg_match("/^\"\"(.*)\"\"$/s", $thing, $matches))
      {
         return str_replace("\n","<br />",htmlspecialchars($matches[1]));
      }

//comamenu (dont format some things)
      else if (preg_match("/\~\~\~menu\~\~\~/", $thing))
      {
         $br = 0;
         return "";
      }

//smileys
      if ($citiwikimenu == 0)
      {
         $base = $citiwiki->config['root_url'];

      if ($thing == ":-)")
         return "<img align=\"middle\" src=\"".$base."images/happy.gif\" height=\"15px\" width=\"15px\" alt=\" \"></img>";
      else if ($thing == "8-)")
         return "<img align=\"middle\" src=\"".$base."images/cool.gif\" height=\"15px\" width=\"15px\" alt=\" \"></img>";
      else if ($thing == ":-(")
         return "<img align=\"middle\" src=\"".$base."images/frown.gif\" height=\"15px\" width=\"15px\" alt=\" \"></img>";
      else if ($thing == ":-o")
         return "<img align=\"middle\" src=\"".$base."images/bla.gif\" height=\"15px\" width=\"15px\" alt=\" \"></img>";
      else if ($thing == ":-D")
         return "<img align=\"middle\" src=\"".$base."images/biggrin.gif\" height=\"15px\" width=\"15px\" alt=\" \"></img>";
      else if ($thing == ";-)")
         return "<img align=\"middle\" src=\"".$base."images/zwinker.gif\" height=\"15px\" width=\"15px\" alt=\" \"></img>";
      else if ($thing == ":-p")
         return "<img align=\"middle\" src=\"".$base."images/zunge.gif\" height=\"15px\" width=\"15px\" alt=\" \"></img>";
      else if ($thing == ":rollen:")
         return "<img align=\"middle\" src=\"".$base."images/rollen.gif\" height=\"15px\" width=\"15px\" alt=\" \"></img>";
      else if ($thing == ":boese:")
         return "<img align=\"middle\" src=\"".$base."images/evil.gif\" height=\"15px\" width=\"15px\" alt=\" \"></img>";
      else if ($thing == ":schock:")
         return "<img align=\"middle\" src=\"".$base."images/eek.gif\" height=\"15px\" width=\"15px\" alt=\" \"></img>";
      else if ($thing == ":weinen:")
         return "<img align=\"middle\" src=\"".$base."images/crying.gif\" height=\"15px\" width=\"15px\" alt=\" \"></img>";
      else if ($thing == ":schaem:")
         return "<img align=\"middle\" src=\"".$base."images/schaem.gif\" height=\"15px\" width=\"15px\" alt=\" \"></img>";
      else if ($thing == ":top:")
         return "<img align=\"middle\" src=\"".$base."images/top.gif\" height=\"15px\" width=\"15px\" alt=\" \"></img>";
      else if ($thing == ":flop:")
         return "<img align=\"middle\" src=\"".$base."images/flop.gif\" height=\"15px\" width=\"15px\" alt=\" \"></img>";
      else if ($thing == ":aua:")
         return "<img align=\"middle\" src=\"".$base."images/aua.gif\" height=\"15px\" width=\"15px\" alt=\" \"></img>";
      else if ($thing == ":bla:")
         return "<img align=\"middle\" src=\"".$base."images/bla.gif\" height=\"15px\" width=\"15px\" alt=\" \"></img>";
      else if ($thing == ":idee:")
         return "<img align=\"middle\" src=\"".$base."images/idee.gif\" height=\"15px\" width=\"15px\" alt=\" \"></img>";
      else if ($thing == ":rechts:")
         return "<img align=\"middle\" src=\"".$base."images/rechts.gif\" height=\"15px\" width=\"15px\" alt=\" \"></img>";
      else if ($thing == ":links:")
         return "<img align=\"middle\" src=\"".$base."images/links.gif\" height=\"15px\" width=\"15px\" alt=\" \"></img>";
      else if ($thing == ":notiz:")
         return "<img align=\"middle\" src=\"".$base."images/notiz.gif\" height=\"15px\" width=\"15px\" alt=\" \"></img>";
      else if ($thing == ":achtung:")
         return "<img align=\"middle\" src=\"".$base."images/achtung.gif\" height=\"15px\" width=\"15px\" alt=\" \"></img>";
      }

//flaggen der welt
      if (preg_match("/^:([A-Za-z]{2}):$/s", $thing, $matches) && $citiwikimenu == 0)
         return "<img align=\"middle\" src=\"".$base."images/flags/".$matches[1].".png\" width=\"18px\" height=\"12px\" alt=\" \"></img>";

// highlight
      else if ($thing == "++")
      {
         static $highlight = 0;
         return (++$highlight % 2 ? "<span class=\"highlight\">" : "</span>");
      }

//memo
		else if ($thing == "''")
		{
			static $notes = 0;
			return (++$notes % 2 ? "<span class=\"notes\">" : "</span>");
		}

//bold
      else if ($thing == "**")
      {
         static $bold = 0;
         return (++$bold % 2 ? "<b>" : "</b>");
      }

//url's
      else if (preg_match("/^([a-z]+:\/\/\S+?)([^[:alnum:]^\/])?$/", $thing, $matches) && $citiwikimenu == 0)
      {
         $url = $matches[1];

//include images
         $imgurl = substr($url,strlen($url)-3,3);
         if (($imgurl == 'gif') || ($imgurl == 'jpg') || ($imgurl == 'png'))
            return "<img src=\"$url\" alt=\"\" />".$matches[2];
         else if ($imgurl == 'wmv')
            return "<embed src=\"$url\" />".$matches[2];

//external link
            $url = "<a href=\"".str_replace("&", "&amp;", $url)."\" >".str_replace("&", "&amp;", $url)."</a>";

         return $url;
      }

// italic
      else if ($thing == "//")
      {
         static $italic = 0;
         return (++$italic % 2 ? "<i>" : "</i>");
      }
// underline
      else if ($thing == "__")
      {
         static $underline = 0;
         return (++$underline % 2 ? "<u>" : "</u>");
      }
// monospace
      else if ($thing == "##")
      {
         static $monospace = 0;
         return (++$monospace % 2 ? "<tt>" : "</tt>");
      }

// strike
      else if ($thing == "@@")
      {
  	 static $center = 0;
	 return (++$center % 2 ? "<div style=\"width:100%;text-align:center\">" : "</div>");
      }


// headers

      else if (preg_match("/^======(.*)======$/s", $thing, $matches))
      {
         if ($_SESSION['tocnr'] == "yep")
         {
            (!$hr5 || $hr4tmp == 1) ? $hr5 = 1 : ($hr5tmp = 1 && $hr5 = ($hr5 + 1));
            if ($hr4tmp == 1) $hr4tmp = "";
            $toccount = (($hr1) ? $hr1."." : "" ).(($hr2) ? $hr2."." : "" ).(($hr3) ? $hr3."." : "" ).(($hr4) ? $hr4."." : "" ).(($hr5) ? $hr5.". " : "" );
         }
         $headercount++;
         $_SESSION['toc'] .= "<a style=\"padding-left:10px\" href=\"#titelanker".$headercount."\">".$toccount.trim($matches[1])."</a><br />";
         $br = 0;
         return "<a name=\"titelanker".$headercount."\"></a><h1>".$toccount.trim($matches[1])."</h1>";
      }
      else if (preg_match("/^=====(.*)=====$/s", $thing, $matches))
      {
         if ($_SESSION['tocnr'] == "yep")
         {
            (!$hr4 || $hr3tmp == 1) ? $hr4 = 1 : ($hr4tmp = 1 && $hr4 = ($hr4 + 1));
            if ($hr3tmp == 1) $hr3tmp = "";
            $toccount = (($hr1) ? $hr1."." : "" ).(($hr2) ? $hr2."." : "" ).(($hr3) ? $hr3."." : "" ).(($hr4) ? $hr4.". " : "" );
         }
         $headercount++;
         $_SESSION['toc'] .= "<a style=\"padding-left:25px\" href=\"#titelanker".$headercount."\">".$toccount.trim($matches[1])."</a><br />";
         $br = 0;
         return "<a name=\"titelanker".$headercount."\"></a><h2>".$toccount.trim($matches[1])."</h2>";
      }
      else if (preg_match("/^====(.*)====$/s", $thing, $matches))
      {
         if ($_SESSION['tocnr'] == "yep")
         {
            (!$hr3 || $hr2tmp == 1) ? $hr3 = 1 : ($hr3tmp = 1 && $hr3 = ($hr3 + 1));
            if ($hr2tmp == 1) $hr2tmp = "";
            $toccount = (($hr1) ? $hr1."." : "" ).(($hr2) ? $hr2."." : "" ).(($hr3) ? $hr3.". " : "" );
         }
         $headercount++;
         $_SESSION['toc'] .= "<a style=\"padding-left:40px\" href=\"#titelanker".$headercount."\">".$toccount.trim($matches[1])."</a><br />";
         $br = 0;
         return "<a name=\"titelanker".$headercount."\"></a><h3>".$toccount.trim($matches[1])."</h3>";
      }
      else if (preg_match("/^===(.*)===$/s", $thing, $matches))
      {
         if ($_SESSION['tocnr'] == "yep")
         {
            (!$hr2 || $hr1tmp == 1) ? $hr2 = 1 : ($hr2tmp = 1 && $hr2 = ($hr2 + 1));
            if ($hr1tmp == 1) $hr1tmp = "";
            $toccount = (($hr1) ? $hr1."." : "" ).(($hr2) ? $hr2.". " : "" );
         }
         $headercount++;
         $_SESSION['toc'] .= "<a style=\"padding-left:55px\" href=\"#titelanker".$headercount."\">".$toccount.trim($matches[1])."</a><br />";
         $br = 0;
         return "<a name=\"titelanker".$headercount."\"></a><h4>".$toccount.trim($matches[1])."</h4>";
      }
      else if (preg_match("/^==(.*)==$/s", $thing, $matches))
      {
         if ($_SESSION['tocnr'] == "yep")
         {
            (!$hr1) ? $hr1 = 1 : ($hr1tmp = 1 && $hr1 = ($hr1 + 1));
            $toccount = (($hr1) ? $hr1.". " : "" );
         }
         $headercount++;
         $_SESSION['toc'] .= "<a style=\"padding-left:70px\" href=\"#titelanker".$headercount."\">".$toccount.trim($matches[1])."</a><br />";
         $br = 0;
         return "<a name=\"titelanker".$headercount."\"></a><h5>".$toccount.trim($matches[1])."</h5>";
      }


// headers
                          /*
	else if (preg_match("/^======(.*)======$/s", $thing, $matches))
		{
			$br = 0;
			return "<h1>".str_replace("\n","<br />",htmlspecialchars($matches[1]))."</h1>";
		}
		else if (preg_match("/^=====(.*)=====$/s", $thing, $matches))
		{
			$br = 0;
			return "<h2>".str_replace("\n","<br />",htmlspecialchars($matches[1]))."</h2>";
		}
		else if (preg_match("/^====(.*)====$/s", $thing, $matches))
		{
			$br = 0;
			return "<h3>".str_replace("\n","<br />",htmlspecialchars($matches[1]))."</h3>";
		}
		else if (preg_match("/^===(.*)===$/s", $thing, $matches))
		{
			$br = 0;
			return "<h4>".str_replace("\n","<br />",htmlspecialchars($matches[1]))."</h4>";
		}
		else if (preg_match("/^==(.*)==$/s", $thing, $matches))
		{
			$br = 0;
			return "<h5>".str_replace("\n","<br />",htmlspecialchars($matches[1]))."</h5>";
		}

	*/
// forced line breaks
      else if ($thing == "---")
      {
         return "<br />";
      }

// separators
      else if ($thing == "- - -")
      {
         $br = 0;
         return "<div style=\"height:3px;border-bottom:1px dashed #777;\" ><hr style=\"display:none;\" /></div>";
      }

      else if ($thing == "----")
      {
         $br = 0;
         return "<hr size=\"1\" noshade=\"noshade\"/>";
      }
      /*
         else if (preg_match("/-{4,}/", $thing, $matches))
      {
         $br = 0;
         return "<hr size=\"1\" noshade=\"noshade\"/>";
      }
      */



		// code text
		else if (preg_match("/^\%\%(.*)\%\%$/s", $thing, $matches))
		{
			// check if a language has been specified
			$code = $matches[1];
			if (preg_match("/^\((.+?)\)(.*)$/s", $code, $matches))
			{
				list(, $language, $code) = $matches;
			}
			switch ($language)
			{
			case "php":
				$formatter = "php";
				break;
			case "c++":
				$formatter = "php";
				$code = "<?php ".$code."?>";
				break;
			default:
				$formatter = "code";
			}

			$output = "<div class=\"code\">";

                        if ($language=="c++")
                        {
                            $temp = $citiwiki->Format(trim($code), $formatter);
                            $temp = str_replace("<?php","",$temp);
                            $temp = str_replace("?>","",$temp);
                            $output .= $temp;
                        }
                        else
                            $output .= $citiwiki->Format(trim($code), $formatter);

			$output .= "</div>";

			return $output;
		}

//farben neue version
      else if ($thing == ":blank:")
         { return ("&nbsp"); }
      else if ($thing == ":hide:")
         { static $hide = 0; return (++$hide % 2 ? "<span style=\"display:none\">" : "</span>"); }
      else if ($thing == ":black:")
         { static $black = 0; return (++$black % 2 ? "<span style=\"color:black\">" : "</span>"); }
      else if ($thing == ":white:")
         { static $white = 0; return (++$white % 2 ? "<span style=\"color:white\">" : "</span>"); }
      else if ($thing == ":red:")
         { static $rot = 0; return (++$rot % 2 ? "<span style=\"color:red\">" : "</span>"); }
      else if ($thing == ":green:")
         { static $lime = 0; return (++$lime % 2 ? "<span style=\"color:green\">" : "</span>"); }
      else if ($thing == ":lightgreen:")
         { static $hgruen = 0; return (++$hgruen % 2 ? "<span style=\"color:lightgreen\">" : "</span>"); }
      else if ($thing == ":violet:")
         { static $lila = 0; return (++$lila % 2 ? "<span style=\"color:violet\">" : "</span>"); }
      else if ($thing == ":purple:")
         { static $lila = 0; return (++$lila % 2 ? "<span style=\"color:purple\">" : "</span>"); }
      else if ($thing == ":orange:")
         { static $orange = 0; return (++$orange % 2 ? "<span style=\"color:orange\">" : "</span>"); }
      else if ($thing == ":blue:")
         { static $blau = 0; return (++$blau % 2 ? "<span style=\"color:blue\">" : "</span>"); }
      else if ($thing == ":lightblue:")
         { static $hblau = 0; return (++$hblau % 2 ? "<span style=\"color:lightblue\">" : "</span>"); }
      else if ($thing == ":pink:")
         { static $pink = 0; return (++$pink % 2 ? "<span style=\"color:pink\">" : "</span>"); }
      else if ($thing == ":brown:")
         { static $braun = 0; return (++$braun % 2 ? "<span style=\"color:brown\">" : "</span>"); }
      else if ($thing == ":grey:")
         { static $grau = 0; return (++$grau % 2 ? "<span style=\"color:grey\">" : "</span>"); }
      else if ($thing == ":yellow:")
         { static $gelb = 0; return (++$gelb % 2 ? "<span style=\"color:yellow\">" : "</span>"); }

//additions und deletions in der diffansicht
      else if ($thing == ":add:")
         { static $add = 0; return (++$add % 2 ? "<span class=\"additions\">" : "</span>"); }
      else if ($thing == ":del:")
         { static $del = 0; return (++$del % 2 ? "<span class=\"deletions\">" : "</span>"); }

//schriftgrösse neue version
      else if ($thing == ":1:")
         { static $s5 = 0; return (++$s5 % 2 ? "<span style=\"font-size:9px;\">" : "</span>"); }
      else if ($thing == ":2:")
         { static $s8 = 0; return (++$s8 % 2 ? "<span style=\"font-size:12px;\">" : "</span>"); }
      else if ($thing == ":3:")
         { static $s16 = 0; return (++$s16 % 2 ? "<span style=\"font-size:16px;\">" : "</span>"); }
      else if ($thing == ":4:")
         { static $s20 = 0; return (++$s20 % 2 ? "<span style=\"font-size:20px;\">" : "</span>"); }
      else if ($thing == ":5:")
         { static $s24 = 0; return (++$s24 % 2 ? "<span style=\"font-size:24px;\">" : "</span>"); }
      else if ($thing == ":6:")
         { static $s28 = 0; return (++$s28 % 2 ? "<span style=\"font-size:28px;\">" : "</span>"); }
      else if ($thing == ":7:")
         { static $s32 = 0; return (++$s32 % 2 ? "<span style=\"font-size:32px;\">" : "</span>"); }

// forced links
      else if (preg_match("/^\[\[(\S*)(\s+(.+))?\]\]$/", $thing, $matches) && $citiwikimenu == 0)
      {
         list (, $url, , $text) = $matches;

         if ($url)
         {
            if (!$text) $text = $url;
            {
               return $citiwiki->Link($url, "", $text);
            }
         }
         else
         {
            return "";
         }
      }

// indented text
      else if (preg_match("/\n([>\t]+)(-|([0-9a-zA-Z]+)\))?(\n|$)/s", $thing, $matches))
      {
         // new line
         $result .= ($br ? "<br />\n" : "\n");

         // we definitely want no line break in this one.
         $br = 0;

         // find out which indent type we want
         $newIndentType = $matches[2];
         if (!$newIndentType) { $opener = "<div class=\"indent\">"; $closer = "</div>"; $br = 1; }
         elseif ($newIndentType == "-") { $opener = "<ul><li>"; $closer = "</li></ul>"; $li = 1; }
         else { $opener = "<ol type=\"". substr($newIndentType, 0, 1)."\"><li>"; $closer = "</li></ol>"; $li = 1; }

         // get new indent level
         $newIndentLevel = strlen($matches[1]);
         if ($newIndentLevel > $oldIndentLevel)
         {
            for ($i = 0; $i < $newIndentLevel - $oldIndentLevel; $i++)
            {
               $result .= $opener;
               array_push($indentClosers, $closer);
            }
         }
         elseif ($newIndentLevel < $oldIndentLevel)
         {
            for ($i = 0; $i < $oldIndentLevel - $newIndentLevel; $i++)
            {
               $result .= array_pop($indentClosers);
            }
         }

         $oldIndentLevel = $newIndentLevel;

         if ($li && !preg_match("/".str_replace(")", "\)", $opener)."$/", $result))
         {
            $result .= "</li><li>";
         }

         return $result;
      }

// new lines
      else if ($thing == "\n")
      {
         // if we got here, there was no tab in the next line; this means that we can close all open indents.
         $c = count($indentClosers);
         for ($i = 0; $i < $c; $i++)
         {
            $result .= array_pop($indentClosers);
            $br = 0;
         }
         $oldIndentLevel = 0;

         $result .= ($br ? "<br />\n" : "\n");
         $br = 1;
         return $result;
      }

// events
      else if (preg_match("/^\{\{(.*?)\}\}$/s", $thing, $matches))
      {
         $br = 0;
         if ($matches[1])
            return $citiwiki->Action($matches[1]);
         else
            return "{{}}";
      }

// leerzeichen
      else if (preg_match("/\ \ /", $thing, $matches))
            return "&nbsp;&nbsp;";

// interwiki links!
      else if (preg_match("/^[A-Z][A-Za-z]+[:]([A-Za-z0-9,\+]*)$/s", $thing) && $citiwikimenu == 0)
      {
         return $citiwiki->Link($thing);
      }

//tabellen

   //tabellenbegin ohne rahmen und mit farben
      else if (preg_match("#^\|\|\|(0[cC]|[cC]0)#", $thing) && $citiwikimenu == 0)
      {
         $tabcolor = true;
         return "<table border=\"0\" cellspacing=\"0\">\n<tr align=\"center\" valign=\"top\" class=\"tab_title\"><td style=\"padding-left:3px;padding-right:3px\">";
      }

   //tabellenbeginn ohne rahmen
      else if (preg_match("#^\|\|\|0#", $thing) && $citiwikimenu == 0)
      {
         $tabcolor = false;
         return "<table border=\"0\" cellspacing=\"0\">\n<tr valign=\"top\"><td style=\"padding-left:3px;padding-right:3px\">";
      }

   //tabellenende
      else if (preg_match("#\|\|\|[$\n| ]#", $thing) && $citiwikimenu == 0)
      {
         return "</td></tr>\n</table>";
      }

   //tabellenbegin mit rahmen und farben
      else if (preg_match("#^\|\|\|[cC]#", $thing) && $citiwikimenu == 0)
      {
         $tabcolor = true;
         return "<table border=\"1\" cellspacing=\"0\">\n<tr align=\"center\" valign=\"top\" class=\"tab_title\"><td style=\"padding-left:3px;padding-right:3px\">";
      }

   //tabellenbegin mit rahmen
      else if (preg_match("#^\|\|\|#", $thing) && $citiwikimenu == 0)
      {
         $tabcolor = false;
         return "<table border=\"1\" cellspacing=\"0\">\n<tr valign=\"top\"><td style=\"padding-left:3px;padding-right:3px\">";
      }

   //tabelle ende zeile und neue zeile
      else if (preg_match("#\|\|\s*\n\s*\|\|#", $thing) && $citiwikimenu == 0)
      {
         if ( is_integer($tabrow/2) )
            $tabclass = "tab_row_uneven";
         else
            $tabclass = "tab_row_even";
         $tabrow = $tabrow + 1 ;

         return "</td></tr>\n<tr ".(($tabcolor) ? "class=\"".$tabclass."\"" : "")."><td style=\"padding-left:3px;padding-right:3px\">";
      }

   //tabelle ende kollonne anfang kollonne
      else if (preg_match("#\|\|#", $thing) && $citiwikimenu == 0)
      {
         $br = 0;
         return "</td><td style=\"padding-left:3px;padding-right:3px\">";
      }

// CoMa links!
      else if (preg_match("/^[A-Z][a-z]+[A-Z0-9][A-Za-z0-9]*$/s", $thing) && $citiwikimenu == 0)
      {
         return $citiwiki->Link($thing);
      }

//eurozeichen
      else if (preg_match("/( |^)[Ee][uU][Rr][oO]?( |$)/", $thing, $matches))
         return $matches[1]."&euro;".$matches[2];

      // if we reach this point, it must have been an accident.
      return $thing;

   }
}

$text = str_replace("\r", "", $text);
$text = trim($text)."\n";
if (preg_match('/^[>\t]/', $text))
   $text = "\n".$text;

//pseudotocaction durch phantasiewort ersetzen, um es nachher wieder mit dem tocinhalt zu ersetzen
if (strpos($text, "{toc nr}}"))
   $_SESSION['tocnr'] = "yep";

$text = preg_replace("/{{toc}}/", "tocactionplaceboding", $text);
$text = preg_replace("/{{toc nr}}/", "tocactionplaceboding", $text);



//$text = preg_replace_callback("/(\"\".*?\"\"|\-\-\>|\<\-\-|\%\%.*?\%\%|\[\[.*?\]\]|\§\§|\*\*|\'\'|\<|\>|\ä|\ö|\ü|&|\#\#|__|\ \ |".
$text = preg_replace_callback("/(\"\".*?\"\"|\%\%.*?\%\%|\[\[.*?\]\]|\*\*|\'\'|\<|\>|\#\#|__|\ \ |".
   "\:red\:|\:green\:|\:purple\:|\:violet\:|\:hide\:|\:orange\:|\:pink\:|\:blue\:|\:lightgreen\:|\:brown\:|\:grey\:|\:yellow\:|\:lightblue\:|\:add\:|\:del\:|".
   "\:1\:|\:2\:|\:3\:|\:4\:|\:5\:|\:6\:|\:7\:|".
   "\b[a-z]+:\/\/\S+|".
   "^\|{3}(0[cC]|[cC]0)|^\|{3}0|^\|{3}[cC]|^\|{3}|\|{3}[\n| ]|\|{2}\s*\n\s*\|{2}|\|{2}|".
   "\:-\)|\:-\(|\:-o|\;-\)|\:-D|\:-p|8-\)|\:blank\:|\:black\:|\:white\:|\:aua\:|\:schaem\:|\:bla\:|\:idee\:|\:rechts\:|\:links\:|\:notiz\:|\:achtung\:|\:rollen\:|\:weinen\:|\:flop\:|\:blind\:|\:boese\:|\:schock\:|\:top\:|".
   "\:[A-Za-z]{2}\:|\/\/|\@\@|======.*?======|=====.*?=====|====.*?====|===.*?===|==.*?==|----|---|- - -|".
   "\n[>\t]+(-|[0-9a-zA-Z]+\))?|".
   "\~\~\~menu\~\~\~.*?\~\~\~menu\~\~\~|".
   "\{\{.*?\}\}|\:img\:.*?\:img\:|".
   "\b[A-Z][A-Za-z]+[:]([A-Za-z0-9,\+]*)\b|".
   "\b([A-Z][a-z]+[A-Z0-9][A-Za-z0-9]*)\b|( |^)[Ee][uU][Rr][oO]?( |$)|".
   "\n)/ms", "wakka2callback", $text);

$text = preg_replace("/tocactionplaceboding/", "<fieldset><legend class=\"toclegend\">&nbsp;Table of content&nbsp;</legend><div class=\"tocbody\">".$_SESSION['toc']."</div></fieldset>", $text);

// we're cutting the last <br>
$text = preg_replace("/<br \/>$/", "", trim($text));

//tocinhalt löschen
$_SESSION['toc'] = "";
$_SESSION['tocnr'] = "nope";

print($text);
?>
Edit - History - Print - Recent Changes - Search
Page last modified on February 04, 2008, at 02:02 PM