コード例 #1
0
 // funktions bereich fuer erweiterungen
 // ***
 ### put your code here ###
 // +++
 // funktions bereich fuer erweiterungen
 // datensatz holen
 $sql = "SELECT *\n                  FROM " . $cfg["db"]["info"]["entries"] . "\n                 WHERE " . $cfg["db"]["info"]["key"] . "='" . $environment["parameter"][1] . "'";
 if ($debugging["sql_enable"]) {
     $debugging["ausgabe"] .= "sql: " . $sql . $debugging["char"];
 }
 $result = $db->query($sql);
 $form_values = $db->fetch_array($result, 1);
 // form elemente erweitern
 $ausgaben["titel"] = $form_values[$cfg["db"]["info"]["titel"]];
 $ausgaben["lead"] = $form_values[$cfg["db"]["info"]["teaser"]];
 $ausgaben["text"] = tagreplace(nlreplace($form_values[$cfg["db"]["info"]["text"]]));
 $ausgaben["breite"] = "";
 if ($form_values[$cfg["db"]["info"]["bilder"]]) {
     $arrPics = explode(",", $form_values[$cfg["db"]["info"]["bilder"]]);
     if ($cfg["gal_len"] == 0) {
         $gal_len = count($arrPics);
     } else {
         $gal_len = $cfg["gal_len"];
     }
     foreach (array_slice($arrPics, 0, $cfg["gal_len"]) as $value) {
         $sql = "SELECT * FROM " . $cfg["db"]["file"]["entries"] . " WHERE " . $cfg["db"]["file"]["key"] . "=" . $value;
         $result = $db->query($sql);
         $data = $db->fetch_array($result, 1);
         $dataloop["pics"][] = array("id" => $data[$cfg["db"]["file"]["key"]], "view" => "details," . $environment["parameter"][1] . "/view,o," . $data[$cfg["db"]["file"]["key"]] . ".html", "desc" => $data[$cfg["db"]["file"]["name"]]);
     }
     if (count($arrPics) > 0 && $cfg["gal_len"] > 0) {
コード例 #2
0
function show_blog($url, $tags, $right = "", $limit = "", $kategorie = "", $future = "")
{
    global $db, $pathvars, $ausgaben, $mapping, $hidedata, $environment, $cfg, $specialvars;
    // parameter-erklaerung
    // 1: vorgesehen fuer inhalt_selector
    // 2: aufruf eines einzigen contents
    // 3: anzeige als faq
    // unzugaengliche #(marken) sichtbar machen
    if (isset($HTTP_GET_VARS["edit"])) {
        $ausgaben["inaccessible"] = "inaccessible values:<br />";
        $ausgaben["inaccessible"] .= "# (error1) #(error1)<br />";
    } else {
        $ausgaben["inaccessible"] = "";
    }
    // label bearbeitung aktivieren
    if (isset($_GET["edit"])) {
        $specialvars["editlock"] = 0;
    } else {
        $specialvars["editlock"] = -1;
    }
    // aus der url eine id machen
    $id = make_id($url);
    $new = $id["mid"];
    $where = "";
    // manipulation verhindern
    if ($environment["parameter"][2] != "" && !preg_match("/^[0-9]*\$/", $environment["parameter"][2])) {
        header('Location: /index.html');
        exit;
    }
    $sort_len = strlen($cfg["bloged"]["blogs"][$url]["sort"][0]) + 2;
    // hier erfolgt der rechte-check
    $check_url = $url;
    if ($kategorie != "") {
        $check_url = $kategorie;
    }
    $status = "status=1";
    $order = "";
    $wizard_right = "";
    // falls der der content bei dem der blog eingebunden ist, zur Freigabe angefordert ist, darf hier nichts mehr passieren
    if ($kategorie == tname2path($environment["parameter"][2]) && !priv_check($check_url, "publish")) {
        $sql = "SELECT status from site_text WHERE tname='" . $environment["parameter"][2] . "' AND label='" . $environment["parameter"][3] . "' ORDER by version DESC";
        $result = $db->query($sql);
        $data = $db->fetch_array($result, 1);
        if ($data["status"] == -2) {
            $wizard_right = "NO";
        }
    }
    if ($right == "" || priv_check($check_url, $right) && $wizard_right == "") {
        $hidedata["new"]["link"] = $url;
        $hidedata["new"]["kategorie"] = $kategorie;
        if ($environment["ebene"] == "/wizard") {
            $status = "(status=1 OR status = -1)";
            $order = " DESC ,changed";
        }
    }
    // erster test einer suchanfrage per kalender
    //
    if ($environment["parameter"][4] && $environment["kategorie"] != "delete") {
        $parameter = ",,," . $environment["parameter"][4] . "," . $environment["parameter"][5] . "," . $environment["parameter"][6];
        if ($cfg["bloged"]["blogs"][$url]["sort"][1] != -1) {
            $heute = getdate(mktime(0, 0, 0, $environment["parameter"][5] + 1, 0, $environment["parameter"][4]));
            if ($environment["parameter"][5] == "") {
                $month2 = "1";
                $month1 = "12";
            } else {
                $month1 = $environment["parameter"][5];
                $month2 = $environment["parameter"][5];
            }
            if (!$environment["parameter"][6]) {
                $day1 = $heute["mday"];
                $day2 = "1";
            } else {
                $day1 = $environment["parameter"][6];
                $day2 = $environment["parameter"][6];
            }
            // parameter - check
            $preg_error = "";
            if (!preg_match("/^[0-9]{4}\$/", $environment["parameter"][4])) {
                $preg_error = -1;
            }
            if ($environment["parameter"][5] != "" && !preg_match("/^[0-9]{1,2}\$/", $environment["parameter"][5])) {
                $preg_error = -1;
            }
            if ($environment["parameter"][6] != "" && !preg_match("/^[0-9]{1,2}\$/", $environment["parameter"][6])) {
                $preg_error = -1;
            }
            if ($preg_error == -1) {
                header('Location: /index.html');
                exit;
            }
            $environment["parameter"][4] = min($environment["parameter"][4], '2035');
            $environment["parameter"][4] = max($environment["parameter"][4], '1970');
            if ($cfg["bloged"]["blogs"][$url]["ext_sort"] == "") {
                $where .= " AND Cast(SUBSTRING(content,POSITION('[" . $cfg["bloged"]["blogs"][$url]["sort"][0] . "]' IN content)+" . $sort_len . ",POSITION('[/" . $cfg["bloged"]["blogs"][$url]["sort"][0] . "]' IN content)-POSITION('[" . $cfg["bloged"]["blogs"][$url]["sort"][0] . "]' IN content)-" . $sort_len . ") as DATETIME) < '" . $environment["parameter"][4] . "-" . $month1 . "-" . $day1 . " 23:59:59' AND Cast(SUBSTRING(content,POSITION('[" . $cfg["bloged"]["blogs"][$url]["sort"][0] . "]' IN content)+" . $sort_len . ",POSITION('[/" . $cfg["bloged"]["blogs"][$url]["sort"][0] . "]' IN content)-POSITION('[" . $cfg["bloged"]["blogs"][$url]["sort"][0] . "]' IN content)-" . $sort_len . ") as DATETIME) > '" . $environment["parameter"][4] . "-" . $month2 . "-" . $day2 . " 00:00:00'";
            } else {
                $where .= " AND (( Cast(SUBSTRING(content,POSITION('[" . $cfg["bloged"]["blogs"][$url]["sort"][0] . "]' IN content)+" . $sort_len . ",POSITION('[/" . $cfg["bloged"]["blogs"][$url]["sort"][0] . "]' IN content)-POSITION('[" . $cfg["bloged"]["blogs"][$url]["sort"][0] . "]' IN content)-" . $sort_len . ") as DATETIME) < '" . $environment["parameter"][4] . "-" . $month1 . "-" . $day1 . " 23:59:59' AND Cast(SUBSTRING(content,POSITION('[" . $cfg["bloged"]["blogs"][$url]["sort"][0] . "]' IN content)+" . $sort_len . ",POSITION('[/" . $cfg["bloged"]["blogs"][$url]["sort"][0] . "]' IN content)-POSITION('[" . $cfg["bloged"]["blogs"][$url]["sort"][0] . "]' IN content)-" . $sort_len . ") as DATETIME) >= '" . $environment["parameter"][4] . "-" . $month2 . "-" . $day2 . " 00:00:00')";
                $sort_len2 = strlen($cfg["bloged"]["blogs"][$url]["ext_sort"]) + 2;
                $where .= " OR ( Cast(SUBSTRING(content,POSITION('[" . $cfg["bloged"]["blogs"][$url]["sort"][0] . "]' IN content)+" . $sort_len . ",POSITION('[/" . $cfg["bloged"]["blogs"][$url]["sort"][0] . "]' IN content)-POSITION('[" . $cfg["bloged"]["blogs"][$url]["sort"][0] . "]' IN content)-" . $sort_len . ") as DATETIME) <= '" . $environment["parameter"][4] . "-" . $month1 . "-" . $day2 . " 00:00:00' AND  Cast(SUBSTRING(content,POSITION('[" . $cfg["bloged"]["blogs"][$url]["ext_sort"] . "]' IN content)+" . $sort_len2 . ",POSITION('[/" . $cfg["bloged"]["blogs"][$url]["ext_sort"] . "]' IN content)-POSITION('[" . $cfg["bloged"]["blogs"][$url]["ext_sort"] . "]' IN content)-" . $sort_len2 . ") as DATETIME) >= '" . $environment["parameter"][4] . "-" . $month2 . "-" . $day2 . " 00:00:00'))";
            }
        }
    }
    //
    // erster test einer suchanfrage per kalender
    // falls kategorie , werden nur diese angezeigt
    if ($kategorie != "") {
        $cat_len = strlen($cfg["bloged"]["blogs"][$url]["category"]) + 2;
        $where .= "  AND SUBSTRING(content,POSITION('[" . $cfg["bloged"]["blogs"][$url]["category"] . "]' IN content),POSITION('[/" . $cfg["bloged"]["blogs"][$url]["category"] . "]' IN content)-POSITION('[" . $cfg["bloged"]["blogs"][$url]["category"] . "]' IN content)) ='[" . $cfg["bloged"]["blogs"][$url]["category"] . "]" . $kategorie . "'";
    }
    if ($future == -1) {
        $where .= " AND Cast(SUBSTRING(content,POSITION('[" . $cfg["bloged"]["blogs"][$url]["sort"][0] . "]' IN content)+" . $sort_len . ",POSITION('[/" . $cfg["bloged"]["blogs"][$url]["sort"][0] . "]' IN content)-POSITION('[" . $cfg["bloged"]["blogs"][$url]["sort"][0] . "]' IN content)-" . $sort_len . ") as DATETIME) < '" . date('Y-m-d') . " 23:59:59'";
    }
    $tname = eCRC($url) . ".%";
    // falls parameter 2 gesetzt, wird nur dieser content geholt
    if ($environment["parameter"][2] != "" && $environment["ebene"] != "/wizard") {
        $tname = eCRC($url) . "." . $environment["parameter"][2];
    }
    // falls sort auf -1 wird anstatt ein datum ein integer als sortiermerkmal gesetzt um ein manuelles sortieren zu ermoeglichen
    if ($cfg["bloged"]["blogs"][$url]["sort"][1] == "-1") {
        $art = "SIGNED";
    } else {
        $art = "DATETIME";
    }
    // hier der endgueltige sql !!
    $sql = "SELECT Cast(SUBSTRING(content,POSITION('[" . $cfg["bloged"]["blogs"][$url]["sort"][0] . "]' IN content)+" . $sort_len . ",POSITION('[/" . $cfg["bloged"]["blogs"][$url]["sort"][0] . "]' IN content)-POSITION('[" . $cfg["bloged"]["blogs"][$url]["sort"][0] . "]' IN content)-" . $sort_len . ") AS " . $art . ") AS date,status,content,tname from site_text WHERE " . $status . " AND tname like '" . $tname . "'" . $where . " order by date" . $order . " DESC";
    // damit kann man beliebig viele blogs manuell holen
    $ausgaben["inhalt_selector"] = "";
    if (strpos($limit, ",")) {
        $sql = $sql . " LIMIT " . $limit;
    } else {
        if ($limit != "") {
            $hidedata["inhalt_selector"]["on"] = "on";
            $p = $environment["parameter"][1] + 0;
            // seiten umschalter
            $inhalt_selector = inhalt_selector($sql, $p, $limit, $parameter, 1, 10, $getvalues);
            $ausgaben["inhalt_selector"] = $inhalt_selector[0] . "<br />";
            $sql = $inhalt_selector[1];
            $ausgaben["anzahl"] = $inhalt_selector[2];
            $ausgaben["sel_hit"] = $inhalt_selector[3];
        }
    }
    $counter = 0;
    $result = $db->query($sql);
    $preg1 = "\\.([0-9]*)\$";
    // evtl wizard einbinden
    if ($cfg["bloged"]["blogs"][$url]["wizard"] != "") {
        $editlink = "/wizard/show,";
    } else {
        $editlink = "/admin/contented/edit,";
    }
    while ($data = $db->fetch_array($result, 1)) {
        $tag_parameter = "";
        $counter++;
        // im wizard wird der content aus der SESSION-Variablen genommen
        if ($_SESSION["wizard_content"][DATABASE . "," . $data["tname"] . ",inhalt"] && $environment["ebene"] == "/wizard") {
            $test = preg_replace("|\r\n|", "\\r\\n", $_SESSION["wizard_content"][DATABASE . "," . $data["tname"] . ",inhalt"]);
        } else {
            $test = preg_replace("|\r\n|", "\\r\\n", $data["content"]);
        }
        foreach ($tags as $key => $value) {
            // finden der parameter sowie begin und endtag
            $invisible = "";
            if (is_array($value)) {
                $tag_parameter = $value["parameter"];
                $invisible = $value["invisible"];
                $show = $value["show"];
                $value = $value["tag"];
            }
            if (strpos($value, "=")) {
                $endtag = substr($value, 0, strpos($value, "="));
                if ($value == "IMG=") {
                    $value .= ".*";
                } else {
                    $value = $value . $tag_parameter;
                }
            } else {
                $endtag = $value;
            }
            // preg nach den tags in der config
            $preg = "(\\[" . addcslashes($value, "/") . "\\])(.*)\\[\\/" . $endtag . "\\]";
            if (preg_match("/{$preg}/Us", $test, $regs)) {
                $rep_tag = str_replace('\\r\\n', "<br />", $regs[0]);
                $org_tag = str_replace('\\r\\n', "<br />", $regs[2]);
            } else {
                $rep_tag = "";
                $org_tag = "";
            }
            // gefundene werte in array schreiben
            if ($invisible != -1) {
                $array[$counter][$key . "_wizard_edit_link"] = $pathvars["virtual"] . "/wizard/editor," . DATABASE . "," . $data["tname"] . ",inhalt," . $value . ":0,,,.html";
                $array[$counter][$key . "_org"] = str_replace("\"", "'", $org_tag);
                $array[$counter][$key . "_org_tag"] = $value;
                $array[$counter][$key] = tagreplace($rep_tag);
                if ($org_tag == "") {
                    $array[$counter][$key] = "";
                }
                if (preg_match("/^\\[IMG/", $rep_tag, $regs_img)) {
                    $image_para = explode("/", $rep_tag);
                    $array[$counter][$key . "_img_art"] = $image_para[2];
                    $array[$counter][$key . "_img_id"] = $image_para[3];
                    $array[$counter][$key . "_img_size"] = $image_para[4];
                    $sql_img = "SELECT * FROM site_file WHERE fid='" . $image_para[3] . "'";
                    $result_img = $db->query($sql_img);
                    $data_img = $db->fetch_array($result_img, 1);
                    $array[$counter][$key . "_img_desc"] = $data_img["fdesc"];
                    $array[$counter][$key . "_img_under"] = $data_img["funder"];
                    $array[$counter][$key . "_img_fname"] = $data_img["ffname"];
                    if ($show != "") {
                        $rep_tag = str_replace("/" . $image_para[4] . "/", "/" . $show . "/", $rep_tag);
                    }
                }
            } else {
                if (preg_match("/^\\[IMG/", $rep_tag, $reg_img)) {
                    $image_para = explode("/", $rep_tag);
                    $invisible_array[$counter][$key . "_img_art"] = $image_para[2];
                    $invisible_array[$counter][$key . "_img_id"] = $image_para[3];
                    $invisible_array[$counter][$key . "_img_size"] = $image_para[4];
                    if ($show != "") {
                        $rep_tag = str_replace("/" . $image_para[4] . "/", "/" . $show . "/", $rep_tag);
                    }
                }
                $invisible_array[$counter][$key . "_org"] = str_replace("\"", "'", $org_tag);
                $invisible_array[$counter][$key] = tagreplace($rep_tag);
                $array[$counter][$key . "_org"] = "";
                $array[$counter][$key] = "";
            }
        }
        preg_match("/{$preg1}/", $data["tname"], $regs);
        if ($environment["parameter"][2] != "" && $environment["ebene"] != "/wizard") {
            $array[$counter]["all"] = tagreplace($data["content"]);
            $array[$counter]["id"] = $regs[1];
        } else {
            $array[$counter]["datum"] = substr($data["date"], 8, 2) . "." . substr($data["date"], 5, 2) . "." . substr($data["date"], 0, 4);
            $array[$counter]["detaillink"] = $pathvars["virtual"] . $url . "/" . $regs[1] . ".html";
            if ($environment["ebene"] == "") {
                $faq_url = "/" . $environment["kategorie"];
            } else {
                $faq_url = $environment["ebene"] . "/" . $environment["kategorie"];
            }
            $array[$counter]["faqlink"] = $pathvars["virtual"] . $faq_url . ",,," . $regs[1] . ".html#faq_" . $regs[1];
            $array[$counter]["faqanker"] = "faq_" . $regs[1];
            $array[$counter]["allink"] = $pathvars["virtual"] . $faq_url . ",," . $regs[1] . ".html";
            $array[$counter]["id"] = $regs[1];
            $array[$counter]["status"] = $data["status"];
            // Sortierung ausgeben
            // ausgabe der aktions-buttons
            if ($right == "" || priv_check($check_url, $right) && $wizard_right == "") {
                if ($cfg["bloged"]["blogs"][$url]["sort"][1] == "-1") {
                    $sort_kat = "";
                    if ($kategorie != "") {
                        $id = make_id($kategorie);
                        $sort_kat = $id["mid"];
                    }
                    $array[$counter]["sort_up"] = $pathvars["virtual"] . "/admin/bloged/sort,up," . $regs[1] . "," . $sort_kat . "," . $new . ".html";
                    $array[$counter]["sort_down"] = $pathvars["virtual"] . "/admin/bloged/sort,down," . $regs[1] . "," . $sort_kat . "," . $new . ".html";
                } else {
                    $array[$counter]["sort_up"] = "";
                    $array[$counter]["sort_down"] = "";
                }
                $array[$counter]["wizard_delete_link"] = $pathvars["virtual"] . "/wizard/delete," . DATABASE . "," . $data["tname"] . ",inhalt.html\"";
                $array[$counter]["deletelink"] = "<a href=\"" . $pathvars["virtual"] . "/admin/bloged/delete,," . $regs[1] . "," . $sort_kat . "," . $new . ".html\">g(blog_delete)</a>";
                $array[$counter]["editlink"] = "<a href=\"" . $pathvars["virtual"] . $editlink . DATABASE . "," . $data["tname"] . ",inhalt.html\">g(blog_edit)</a>";
                $array[$counter]["tname"] = eCrc($url);
            } else {
                $array[$counter]["editlink"] = "";
                $array[$counter]["deletelink"] = "";
                $array[$counter]["sort"] = "";
            }
        }
        if ($environment["parameter"][3] == $regs[1]) {
            if (is_array($invisible_array)) {
                foreach ($invisible_array[$counter] as $key => $value) {
                    $array[$counter][$key] = $value;
                }
            }
        }
    }
    // was anzeigen
    if ($environment["ebene"] == "") {
        $templ = $environment["kategorie"];
    } else {
        $templ = eCRC($environment["ebene"]) . "." . $environment["kategorie"];
    }
    if (file_exists($pathvars["templates"] . $templ . ".tem.html")) {
        $mapping["main"] = $templ;
    } elseif ($cfg["bloged"]["blogs"][$url]["own_list_template"] != "") {
        $mapping["main"] = "-2051315182." . $cfg["bloged"]["blogs"][$url]["own_list_template"];
    } elseif ($cfg["bloged"]["blogs"][$url]["sort"][1] != "") {
        $mapping["main"] = "-2051315182.faq";
    } else {
        $mapping["main"] = "-2051315182.list";
    }
    return $array;
}
コード例 #3
0
function content($line, $tname)
{
    global $db, $debugging, $pathvars, $specialvars, $environment, $ausgaben, $rechte;
    if ($specialvars["crc32"] == -1) {
        if ($environment["ebene"] != "" && $tname == $environment["kategorie"]) {
            $dbtname = crc32($environment["ebene"]) . "." . $tname;
            if ($debugging["html_enable"]) {
                $debugging["ausgabe"] .= "crc32 tname \"" . $dbtname . "\" forced!!!" . $debugging["char"];
            }
        } else {
            $dbtname = $tname;
        }
    } else {
        // ist das eine sub kategorie ?
        if ($environment["subkatid"] != "" && $tname == $environment["katid"]) {
            $dbtname = $tname . "." . $environment["subkatid"];
            if ($debugging["html_enable"]) {
                $debugging["ausgabe"] .= "sub tname \"" . $dbtname . "\" forced!!!" . $debugging["char"];
            }
            #$dbtname = $tname;
        } else {
            $dbtname = $tname;
        }
    }
    while (strstr($line, "#(")) {
        // wo beginnt die marke
        $labelbeg = strpos($line, "#(");
        // wo endet die marke (wichtig der offset!)
        $labelend = strpos($line, ")", $labelbeg);
        // wie lang ist die marke
        $labellen = $labelend - $labelbeg;
        // token name extrahieren
        $label = substr($line, $labelbeg + 2, $labellen - 2);
        $sql = "SELECT html, content FROM " . SITETEXT . " WHERE tname='" . $dbtname . "' AND lang='" . $environment["language"] . "' AND label='{$label}'";
        #if ( $debugging["html_enable"] ) $debugging["ausgabe"] .= "sql: ".$sql.$debugging["char"];
        $result = $db->query($sql);
        $row = $db->fetch_row($result);
        if (!is_array($row)) {
            // wenn "aktuelle sprache" = "default sprache" ueberfluessige fehlermeldung nicht anzeigen!
            if ($environment["language"] != $specialvars["default_language"]) {
                if ($debugging["html_enable"]) {
                    $debugging["ausgabe"] .= "Language: \"" . $environment["language"] . "\" for #(" . $label . ") in template \"" . $dbtname . "\" not found using default: \"" . $specialvars["default_language"] . "\"" . $debugging["char"];
                }
            }
            $sql = "SELECT html, content FROM " . SITETEXT . " WHERE tname='{$dbtname}' AND lang='" . $specialvars["default_language"] . "' AND label='{$label}'";
            $result = $db->query($sql);
            $row = $db->fetch_row($result);
        }
        if ($row[1] == "") {
            if ($debugging["html_enable"]) {
                $debugging["ausgabe"] .= "Language: Uuuuups no default language \"" . $specialvars["default_language"] . "\" for #(" . $label . ") in template \"" . $dbtname . "\" found. Giving up!" . $debugging["char"];
            }
        }
        // erlaubnis bei intrabvv speziell setzen
        global $HTTP_SESSION_VARS;
        $database = $db->getDb();
        if (is_array($HTTP_SESSION_VARS["katzugriff"])) {
            if (in_array("-1:" . $database . ":" . $dbtname, $HTTP_SESSION_VARS["katzugriff"])) {
                $erlaubnis = -1;
            }
        }
        if (is_array($HTTP_SESSION_VARS["dbzugriff"])) {
            if (in_array($database, $HTTP_SESSION_VARS["dbzugriff"])) {
                $erlaubnis = -1;
            }
        }
        $replace = $row[1];
        // cms edit link einblenden
        if ($rechte["cms_edit"] == -1 || $rechte["administration"] == -1 && $erlaubnis == -1) {
            // konvertieren ?
            if ($specialvars["wysiwyg"] == "" && $row[0] == -1) {
                $convert = ",,tag";
                $signal = "c";
            } elseif ($specialvars["wysiwyg"] != "" && $row[0] != -1) {
                $convert = ",,html";
                $signal = "c";
            } else {
                $convert = "";
                $signal = "e";
            }
            $editurl = $pathvars["virtual"] . "/cms/edit," . $db->getDb() . "," . $dbtname . "," . $label;
            // wenn es kein button ist
            if (!strstr($line, "value=\"")) {
                $replace .= " <a target=\"_top\" href=\"" . $editurl . $convert . ".html\"><img src=\"" . $pathvars["images"] . "cms-tag-" . $signal . ".png\" width=\"4\" height=\"4\" border=\"0\" alt=\"Bearbeiten\"></a>";
            } else {
                $line = $line . " <a target=\"_top\" href=\"" . $editurl . ".html\"><img src=\"" . $pathvars["images"] . "cms-tag-" . $signal . ".png\" width=\"4\" height=\"4\" border=\"0\" alt=\"Bearbeiten\"></a>";
            }
        }
        // wenn content nicht in html ist
        if ($row[0] != -1) {
            // intelligenten link tag bearbeiten
            $replace = intelilink($replace);
            // neues generelles tagreplace
            $replace = tagreplace($replace);
            // newlines nach br wandeln (muss zuletzt gemacht werden)
            $replace = nlreplace($replace);
        }
        // marke ersetzen
        if (strstr($line, "#(")) {
            $line = str_replace("#(" . $label . ")", $replace, $line);
        }
    }
    return $line;
}
コード例 #4
0
function tagreplace($replace)
{
    global $db, $debugging, $cfg, $pathvars, $environment, $ausgaben, $defaults, $specialvars, $dataloop, $hidedata, $mapping;
    // cariage return + linefeed fix
    if ($specialvars["newbrmode"] != True) {
        $sear = array("\r\n[TA", "\r\n[RO", "\r\n[CO", "/H1]\r\n", "/H2]\r\n", "/H3]\r\n", "/H4]\r\n", "/H5]\r\n", "/H6]\r\n[", "/HR]\r\n", "AB]\r\n", "OW]\r\n", "OL]\r\n", "IV]\r\n");
        $repl = array("[TA", "[RO", "[CO", "/H1]", "/H2]", "/H3]", "/H4]", "/H5]", "/H6]", "/HR]", "AB]", "OW]", "OL]", "IV]");
        $replace = str_replace($sear, $repl, $replace);
    }
    $preg = "|\\[\\/[!A-Z0-9]{1,6}\\]|";
    $selection_counter = 0;
    $img_counter = 0;
    $imgb_counter = 0;
    while (preg_match($preg, $replace, $match)) {
        $closetag = $match[0];
        if (strstr($replace, $closetag)) {
            // wo beginnt der closetag
            $closetagbeg = strpos($replace, $closetag);
            // wie sieht der opentag aus
            $opentag = str_replace(array("/", "]"), array("", ""), $closetag);
            // wie lang ist der opentag
            $opentaglen = strlen($opentag);
            // nur hier kann der opentag sein
            $haystack = substr($replace, 0, $closetagbeg);
            // fehlenden open tag abfangen
            if (strpos($haystack, $opentag . "]") === false && strpos($haystack, $opentag . "=") === false) {
                if ($defaults["tag"]["error"] == "") {
                    $error = " <font color=\"#FF0000\">" . $opentag . "]?</font> ";
                } else {
                    $error = $defaults["tag"]["error"] . $opentag . "]" . $defaults["tag"]["/error"];
                }
                $replace = $haystack . $error . substr($replace, $closetagbeg + $opentaglen + 2);
                continue;
            }
            // wie lautet der tagwert
            $tagwertbeg = strlen($haystack) - (strpos(strrev($haystack), strrev($opentag)) + strlen($opentag)) + $opentaglen + 1;
            $tagoriginal = substr($replace, $tagwertbeg, $closetagbeg - $tagwertbeg);
            $tagwert = $tagoriginal;
            // parameter?
            $sign = substr($replace, $tagwertbeg - 1, 1);
            // opentag komplettieren
            $opentag = $opentag . $sign;
            // kompletten tag mit tagwert ersetzen
            switch ($closetag) {
                //
                // Block Elemente
                // H1-6 | P | PRE | DIV | LIST | HR | TAB, ROW, COL | CENTER
                //
                case "[/H1]":
                    if ($specialvars["newbrmode"] == True) {
                        $tagwert = nlreplace($tagwert);
                    }
                    if ($defaults["tag"]["h1"] == "") {
                        $defaults["tag"]["h1"] = "<h1>";
                        $defaults["tag"]["/h1"] = "</h1>";
                    }
                    $replace = str_replace($opentag . $tagoriginal . $closetag, $defaults["tag"]["h1"] . $tagwert . $defaults["tag"]["/h1"], $replace);
                    break;
                case "[/H2]":
                    if ($specialvars["newbrmode"] == True) {
                        $tagwert = nlreplace($tagwert);
                    }
                    if ($defaults["tag"]["h2"] == "") {
                        $defaults["tag"]["h2"] = "<h2>";
                        $defaults["tag"]["/h2"] = "</h2>";
                    }
                    $replace = str_replace($opentag . $tagoriginal . $closetag, $defaults["tag"]["h2"] . $tagwert . $defaults["tag"]["/h2"], $replace);
                    break;
                case "[/H3]":
                    if ($specialvars["newbrmode"] == True) {
                        $tagwert = nlreplace($tagwert);
                    }
                    if ($defaults["tag"]["h3"] == "") {
                        $defaults["tag"]["h3"] = "<h3>";
                        $defaults["tag"]["/h3"] = "</h3>";
                    }
                    $replace = str_replace($opentag . $tagoriginal . $closetag, $defaults["tag"]["h3"] . $tagwert . $defaults["tag"]["/h3"], $replace);
                    break;
                case "[/H4]":
                    if ($specialvars["newbrmode"] == True) {
                        $tagwert = nlreplace($tagwert);
                    }
                    if ($defaults["tag"]["h4"] == "") {
                        $defaults["tag"]["h4"] = "<h4>";
                        $defaults["tag"]["/h4"] = "</h4>";
                    }
                    $replace = str_replace($opentag . $tagoriginal . $closetag, $defaults["tag"]["h4"] . $tagwert . $defaults["tag"]["/h4"], $replace);
                    break;
                case "[/H5]":
                    if ($specialvars["newbrmode"] == True) {
                        $tagwert = nlreplace($tagwert);
                    }
                    if ($defaults["tag"]["h5"] == "") {
                        $defaults["tag"]["h5"] = "<h5>";
                        $defaults["tag"]["/h5"] = "</h5>";
                    }
                    $replace = str_replace($opentag . $tagoriginal . $closetag, $defaults["tag"]["h5"] . $tagwert . $defaults["tag"]["/h5"], $replace);
                    break;
                case "[/H6]":
                    if ($specialvars["newbrmode"] == True) {
                        $tagwert = nlreplace($tagwert);
                    }
                    if ($defaults["tag"]["h6"] == "") {
                        $defaults["tag"]["h6"] = "<h6>";
                        $defaults["tag"]["/h6"] = "</h6>";
                    }
                    $replace = str_replace($opentag . $tagoriginal . $closetag, $defaults["tag"]["h6"] . $tagwert . $defaults["tag"]["/h6"], $replace);
                    break;
                case "[/P]":
                    if ($specialvars["newbrmode"] == True) {
                        $tagwert = nlreplace($tagwert);
                    }
                    if ($sign == "]") {
                        $ausgabewert = "<p>" . $tagwert . "</p>";
                        $replace = str_replace($opentag . $tagoriginal . $closetag, $ausgabewert, $replace);
                    } else {
                        $tagwerte = explode("]", $tagwert, 2);
                        $pwerte = explode(";", $tagwerte[0]);
                        $extrawerte = explode(":", $pwerte[0]);
                        if ($extrawerte[1] != "") {
                            $pwerte[0] = $extrawerte[1];
                        }
                        if ($extrawerte[0] == "id") {
                            $art = "id";
                        } else {
                            $art = "class";
                        }
                        $attrib = "";
                        if ($pwerte[0] != "") {
                            $attrib = " " . $art . "=\"" . $pwerte[0] . "\"";
                        }
                        $replace = str_replace($opentag . $tagoriginal . $closetag, "<p" . $attrib . ">" . $tagwerte[1] . "</p>", $replace);
                    }
                    break;
                case "[/PRE]":
                    $replace = str_replace($opentag . $tagoriginal . $closetag, "<pre>" . $tagwert . "</pre>", $replace);
                    break;
                case "[/DIV]":
                    if ($specialvars["newbrmode"] == True && strpos($specialvars["newbrblock"], "DIV") === false) {
                        $tagwert = nlreplace($tagwert);
                    }
                    if ($sign == "]") {
                        $ausgabewert = "<div>" . $tagwert . "</div>";
                        $replace = str_replace($opentag . $tagoriginal . $closetag, $ausgabewert, $replace);
                    } else {
                        $tagwerte = explode("]", $tagwert, 2);
                        $divwerte = explode(";", $tagwerte[0]);
                        $extrawerte = explode(":", $divwerte[0]);
                        if ($extrawerte[1] != "") {
                            $divwerte[0] = $extrawerte[1];
                        }
                        if ($extrawerte[0] == "id") {
                            $art = "id";
                        } else {
                            $art = "class";
                        }
                        $attrib = "";
                        if ($divwerte[0] != "") {
                            $attrib = " " . $art . "=\"" . $divwerte[0] . "\"";
                        }
                        $replace = str_replace($opentag . $tagoriginal . $closetag, "<div" . $attrib . ">" . $tagwerte[1] . "</div>", $replace);
                    }
                    break;
                case "[/LIST]":
                    if ($sign == "]") {
                        $tagwerte = explode("[*]", $tagwert);
                        $ausgabewert = "<ul>";
                        while (list($key, $punkt) = each($tagwerte)) {
                            if ($specialvars["newbrmode"] == True) {
                                $punkt = nlreplace($punkt);
                            }
                            $ausgabewert .= "<li><span>" . $punkt . "</span></li>";
                        }
                        $ausgabewert .= "</ul>";
                        $replace = str_replace($opentag . $tagoriginal . $closetag, $ausgabewert, $replace);
                    } else {
                        $tagrestbeg = strpos($tagwert, "]");
                        $listart = substr($tagwert, 0, $tagrestbeg);
                        $tagrest = substr($tagwert, $tagrestbeg + 1);
                        $tagwerte = explode("[*]", $tagrest);
                        if ($listart == 1) {
                            $ausgabewert = "<ol>";
                            while (list($key, $punkt) = each($tagwerte)) {
                                if ($specialvars["newbrmode"] == True) {
                                    $punkt = nlreplace($punkt);
                                }
                                $ausgabewert .= "<li><span>" . $punkt . "</span></li>";
                            }
                            $ausgabewert .= "</ol>";
                        } elseif ($listart == "DEF") {
                            $ausgabewert = "<dl>";
                            while (list($key, $punkt) = each($tagwerte)) {
                                if ($specialvars["newbrmode"] == True) {
                                    $punkt = nlreplace($punkt);
                                }
                                if ($key % 2 != 0) {
                                    $ausgabewert .= "<dd>" . $punkt . "</dd>";
                                } else {
                                    $ausgabewert .= "<dt>" . $punkt . "</dt>";
                                }
                            }
                            $ausgabewert .= "</dl>";
                        } else {
                            if (strlen($listart) > 1) {
                                $ausgabewert = "<ul type=\"" . $listart . "\">";
                            } else {
                                $ausgabewert = "<ol type=\"" . $listart . "\">";
                            }
                            while (list($key, $punkt) = each($tagwerte)) {
                                if ($specialvars["newbrmode"] == True) {
                                    $punkt = nlreplace($punkt);
                                }
                                $ausgabewert .= "<li><span>" . $punkt . "</span></li>";
                            }
                            if (strlen($listart) > 1) {
                                $ausgabewert .= "</ul>";
                            } else {
                                $ausgabewert .= "</ol>";
                            }
                        }
                        $replace = str_replace($opentag . $tagoriginal . $closetag, $ausgabewert, $replace);
                    }
                    break;
                case "[/HR]":
                    if ($defaults["tag"]["hr"] == "") {
                        $defaults["tag"]["hr"] = "<hr />";
                        $defaults["tag"]["/hr"] = "";
                    }
                    $replace = str_replace($opentag . $tagoriginal . $closetag, $defaults["tag"]["hr"] . $tagwert . $defaults["tag"]["/hr"], $replace);
                    break;
                case "[/TAB]":
                    if ($specialvars["newbrmode"] == True) {
                        $tagwert = str_replace("\r\n", "", $tagwert);
                    }
                    if ($sign == "]") {
                        $replace = str_replace($opentag . $tagoriginal . $closetag, "<table cellspacing=\"0\" cellpadding=\"1\">" . $tagwert . "</table>", $replace);
                    } else {
                        $tagwerte = explode("]", $tagwert, 2);
                        $tabwerte = explode(";", $tagwerte[0]);
                        if ($tabwerte[0] == "l") {
                            $align = " align=\"left\"";
                        } elseif ($tabwerte[0] == "m") {
                            $align = " align=\"center\"";
                        } elseif ($tabwerte[0] == "r") {
                            $align = " align=\"right\"";
                        } else {
                            $align = "";
                        }
                        if ($tabwerte[1] != "") {
                            $width = " width=\"" . $tabwerte[1] . "\"";
                        }
                        if ($tabwerte[2] != "") {
                            $border = " border=\"" . $tabwerte[2] . "\"";
                        }
                        if ($tabwerte[3] != "") {
                            $cellspacing = " cellspacing=\"" . $tabwerte[3] . "\"";
                        } else {
                            $cellspacing = " cellspacing=\"0\"";
                        }
                        if ($tabwerte[4] != "") {
                            $cellpadding = " cellpadding=\"" . $tabwerte[4] . "\"";
                        } else {
                            $cellpadding = " cellpadding=\"1\"";
                        }
                        $replace = str_replace($opentag . $tagoriginal . $closetag, "<table" . $cellspacing . $cellpadding . $width . $align . $border . ">" . $tagwerte[1] . "</table>", $replace);
                        $replace = tagreplace($replace);
                    }
                    break;
                case "[/TABCSV]":
                    if ($sign != "]") {
                        $tagwerte = explode("]", $tagwert, 2);
                        $tabwerte = explode(";", $tagwerte[0]);
                        // csv-datei
                        if ($specialvars["subdir"] != "") {
                            $pfad = str_replace($specialvars["subdir"] . "/", "", $tabwerte[0]);
                        } else {
                            $pfad = $tabwerte[0];
                        }
                        $file_path = explode("/", $pfad);
                        $extension = $cfg["file"]["filetyp"][$file_path[2]];
                        $directory = $cfg["file"]["fileopt"][$extension]["path"];
                        $file_name = $extension . "_" . $file_path[3] . "." . $file_path[2];
                        if (file_exists($directory . $file_name)) {
                            $table = "";
                            $handle = fopen($directory . $file_name, "r");
                            // enthaelt die erste zeile spaltenueberschriften
                            if ($tabwerte[3] != "") {
                                $cell_tag1 = "<th scope=\"col\">";
                                $cell_tag2 = "</th>\n";
                                $row_tag1 = "<thead>\n<tr>";
                                $row_tag2 = "</tr>\n</thead>";
                            } else {
                                $cell_tag1 = "<td>";
                                $cell_tag2 = "</td>\n";
                                $row_tag1 = "<tr>";
                                $row_tag2 = "</tr>\n";
                            }
                            $thead = "";
                            while (($data = fgetcsv($handle, 1000, ";")) !== FALSE) {
                                $row = "";
                                foreach ($data as $value) {
                                    $row .= $cell_tag1 . $value . $cell_tag2;
                                }
                                if ($row != "") {
                                    $table .= $row_tag1 . $row . $row_tag2;
                                }
                                if (strstr($cell_tag1, "<th")) {
                                    $thead = $table;
                                    $table = "";
                                    $cell_tag1 = "<td>";
                                    $cell_tag2 = "</td>\n";
                                    $row_tag1 = "<tr>";
                                    $row_tag2 = "</tr>\n";
                                }
                            }
                            // summary
                            if ($tagwerte[1] != "") {
                                $summary = " summary=\"" . $tagwerte[1] . "\"";
                            } else {
                                $summary = "";
                            }
                            // breite
                            if ($tabwerte[1] != "") {
                                $width = " width=\"" . $tabwerte[1] . "%\"";
                            } else {
                                $width = "";
                            }
                            // border
                            if ($tabwerte[2] != "") {
                                $border = " border=\"" . $tabwerte[2] . "\"";
                            } else {
                                $border = "";
                            }
                            if ($table != "") {
                                $table = "<table" . $border . $width . $summary . ">\n" . $thead . "<tbody>\n" . $table . "</tbody>\n</table>\n";
                            }
                        } else {
                            $table = "";
                        }
                        $replace = str_replace($opentag . $tagoriginal . $closetag, $table, $replace);
                    } else {
                        $replace = str_replace($opentag . $tagoriginal . $closetag, "", $replace);
                    }
                    break;
                case "[/ROW]":
                    if ($specialvars["newbrmode"] == True) {
                        $tagwert = str_replace("\r\n", "", $tagwert);
                    }
                    $replace = str_replace($opentag . $tagoriginal . $closetag, "<tr>" . $tagwert . "</tr>", $replace);
                    break;
                case "[/TH]":
                    if ($specialvars["newbrmode"] == True) {
                        $tagwert = nlreplace($tagwert);
                    }
                    $replace = str_replace($opentag . $tagoriginal . $closetag, "<th valign=\"top\">" . $tagwert . "</th>", $replace);
                    break;
                case "[/COL]":
                    if ($specialvars["newbrmode"] == True) {
                        $tagwert = nlreplace($tagwert);
                    }
                    if ($sign == "]") {
                        $replace = str_replace($opentag . $tagoriginal . $closetag, "<td valign=\"top\">" . $tagwert . "</td>", $replace);
                    } else {
                        $tagwerte = explode("]", $tagwert, 2);
                        $colwerte = explode(";", $tagwerte[0]);
                        if ($colwerte[0] == "l") {
                            $align = " align=\"left\"";
                        } elseif ($colwerte[0] == "m") {
                            $align = " align=\"center\"";
                        } elseif ($colwerte[0] == "r") {
                            $align = " align=\"right\"";
                        } else {
                            $align = "";
                        }
                        if ($colwerte[1] != "") {
                            $width = " width=\"" . $colwerte[1] . "\"";
                        }
                        if ($colwerte[2] == "o") {
                            $valign = " valign=\"top\"";
                        } elseif ($colwerte[2] == "m") {
                            $valign = " valign=\"middle\"";
                        } elseif ($colwerte[2] == "u") {
                            $valign = " valign=\"bottom\"";
                        } elseif ($colwerte[2] == "g") {
                            $valign = " valign=\"baseline\"";
                        } else {
                            $valign = " valign=\"top\"";
                        }
                        $replace = str_replace($opentag . $tagoriginal . $closetag, "<td" . $align . $width . $valign . ">" . $tagwerte[1] . "</td>", $replace);
                    }
                    break;
                case "[/CENTER]":
                    $replace = str_replace($opentag . $tagoriginal . $closetag, "<center>" . $tagwert . "</center>", $replace);
                    break;
                    //
                    // Inline Elemente
                    // BR | IMG | LINK | -span-
                    //
                //
                // Inline Elemente
                // BR | IMG | LINK | -span-
                //
                case "[/BR]":
                    if ($sign == "]") {
                        $replace = str_replace($opentag . $tagoriginal . $closetag, "<br />", $replace);
                    } else {
                        $tagwerte = explode("]", $tagwert, 2);
                        $brwerte = explode(";", $tagwerte[0]);
                        if ($brwerte[0] == "a") {
                            $clear = "clear=\"all\"";
                            $style_clear = "style=\"clear:both;\"";
                        } elseif ($brwerte[0] == "l") {
                            $clear = "clear=\"left\"";
                            $style_clear = "style=\"clear:left;\"";
                        } elseif ($brwerte[0] == "r") {
                            $clear = "clear=\"right\"";
                            $style_clear = "style=\"clear:right;\"";
                        } else {
                            $clear = "";
                            $style_clear = "";
                        }
                        if ($specialvars["w3c"] == "strict") {
                            $replace = str_replace($opentag . $tagoriginal . $closetag, "<br " . $style_clear . "/>", $replace);
                        } else {
                            $replace = str_replace($opentag . $tagoriginal . $closetag, "<br " . $clear . "/>", $replace);
                        }
                    }
                    break;
                case "[/IMG]":
                    $img_counter++;
                    $imgsize = "";
                    $imgurl = "";
                    if ($sign == "]") {
                        if (!strstr($tagwert, "/")) {
                            $imgfile = $pathvars["fileroot"] . "images/" . $environment["design"] . "/" . $tagwert;
                            if (file_exists($imgfile)) {
                                $imgsize = getimagesize($imgfile);
                                $imgsize = " " . $imgsize[3];
                                $imgurl = $pathvars["images"] . $tagwert;
                            }
                        } else {
                            $imgurl = $tagwert;
                            if (!strstr($tagwert, "http")) {
                                if (strpos($tagwert, $cfg["file"]["base"]["pic"]["root"]) === false) {
                                    $opt = explode("/", $tagwert);
                                    $imgfile = $cfg["file"]["base"]["maindir"] . $cfg["file"]["base"]["pic"]["root"] . $cfg["file"]["base"]["pic"][$opt[4]] . "img_" . $opt[3] . "." . $opt[2];
                                } elseif (strstr($tagwert, $cfg["file"]["base"]["webdir"])) {
                                    $imgfile = str_replace($cfg["file"]["base"]["webdir"], "", $tagwert);
                                    $imgfile = $cfg["file"]["base"]["maindir"] . $imgfile;
                                } else {
                                    $imgfile = $pathvars["fileroot"] . $tagwert;
                                }
                                if (file_exists($imgfile)) {
                                    $imgsize = getimagesize($imgfile);
                                    $imgsize = " " . $imgsize[3];
                                } else {
                                    $imgsize = "";
                                }
                            }
                        }
                        $ausgabewert = "<img src=\"" . $imgurl . "\" title=\"" . $tagwert . "\" alt=\"" . $tagwert . "\"" . $imgsize . " />";
                        $replace = str_replace($opentag . $tagoriginal . $closetag, $ausgabewert, $replace);
                    } else {
                        if ($defaults["tag"]["img_w3c"] == "") {
                            $defaults["tag"]["img_w3c"] = "<img src=\"##imgurl##\" title=\"##beschriftung##\" alt=\"##beschriftung##\"##imgsize## style=\"##style_align####style_border####style_hspace####style_vspace##\"##attrib## />";
                        }
                        if ($defaults["tag"]["img"] == "") {
                            $defaults["tag"]["img"] = "<img src=\"##imgurl##\"##attrib####vspace####hspace## title=\"##beschriftung##\" alt=\"##beschriftung##\"##align####border####imgsize## />";
                        }
                        if ($defaults["tag"]["img_link"] == "") {
                            $defaults["tag"]["img_link"] = "<a href=\"##imglnk##\" title=\"##beschriftung##\">";
                        }
                        if ($defaults["tag"]["img_link_lb"] == "") {
                            $defaults["tag"]["img_link_lb"] = "<a href=\"##imglnk##\" title=\"##beschriftung##\" ##lightbox## >";
                        }
                        if ($defaults["tag"]["/img_link"] == "") {
                            $defaults["tag"]["/img_link"] = "</a>";
                        }
                        $repl = array("imgurl", "beschriftung", "funder", "fdesc", "imgsize", "attrib", "vspace", "hspace", "align", "border", "style_align", "style_border", "style_hspace", "style_vspace", "imglnk", "lightbox");
                        $tagwerte = explode("]", $tagwert, 2);
                        $imgwerte = explode(";", $tagwerte[0]);
                        $extrawerte = explode(":", $imgwerte[1]);
                        if ($extrawerte[1] != "") {
                            $imgwerte[1] = $extrawerte[1];
                        }
                        if ($extrawerte[0] == "id") {
                            $art = " id";
                        } else {
                            $art = " class";
                        }
                        $align = "";
                        $attrib = "";
                        $style_align = "";
                        if ($imgwerte[1] == "r") {
                            $align = " align=\"right\"";
                            $style_align = "float:right;";
                        } elseif ($imgwerte[1] == "l") {
                            $align = " align=\"left\"";
                            $style_align = "float:left;";
                        } elseif ($imgwerte[1] != "") {
                            $attrib = " " . $art . "=\"" . $imgwerte[1] . "\"";
                        }
                        if ($imgwerte[2] == "0") {
                            $border = " border=\"0\"";
                            $style_border = "border-width:0;";
                        } elseif ($imgwerte[2] > 0) {
                            $border = " border=\"" . $imgwerte[2] . "\"";
                            $style_border = "border-width:" . $imgwerte[2] . "px;";
                        } else {
                            $border = "";
                            $style_border = "";
                        }
                        if ($imgwerte[3] == "l") {
                            $lightbox = "rel=\"lightbox[" . $img_counter . "]\"";
                        }
                        if ($imgwerte[4] == "") {
                            $vspace = "";
                            $style_vspace = "";
                        } else {
                            $vspace = " vspace=\"" . $imgwerte[4] . "\"";
                            $style_vspace = "margin-top:" . $imgwerte[4] . "px;margin-bottom:" . $imgwerte[4] . "px;";
                        }
                        if ($imgwerte[6] == "") {
                            $hspace = "";
                            $style_hspace = "";
                        } else {
                            $hspace = " hspace=\"" . $imgwerte[6] . "\"";
                            if ($imgwerte[1] == "r") {
                                $style_hspace = "margin-left:" . $imgwerte[6] . "px;margin-right:0px;";
                            } elseif ($imgwerte[1] == "l") {
                                $style_hspace = "margin-left:0px;margin-right:" . $imgwerte[6] . "px;";
                            } else {
                                $style_hspace = "margin-left:" . $imgwerte[6] . "px;margin-right:" . $imgwerte[6] . "px;";
                            }
                        }
                        if ($tagwerte[1] == "") {
                            $beschriftung = $imgwerte[0];
                        } else {
                            $beschriftung = $tagwerte[1];
                        }
                        // weitere informationen aus datenbank holen
                        if (preg_match("/^\\//", $tagwerte[0])) {
                            $img_path = explode("/", str_replace($cfg["file"]["base"]["maindir"], "", $tagwerte[0]));
                            if (is_numeric($img_path[3])) {
                                $fid = $img_path[3];
                                //subdir quickfix
                            } elseif (is_numeric($img_path[4])) {
                                $fid = $img_path[4];
                            } else {
                                $fid = substr($tagwerte[0], 0, strpos($tagwerte[0], ";"));
                                $fid = strrchr($fid, "_");
                                $fid = substr($fid, 1, strpos($fid, ".") - 1);
                            }
                            $sql = "SELECT *\n                                            FROM site_file\n                                            WHERE fid=" . $fid;
                            $result = $db->query($sql);
                            $data = $db->fetch_array($result, 1);
                            $funder = $data["funder"];
                            $fdesc = $data["fdesc"];
                        } else {
                            $funder = $beschriftung;
                            $fdesc = $beschriftung;
                        }
                        $linka = "";
                        $linkb = "";
                        if (!strstr($imgwerte[0], "/")) {
                            $imgfile = $pathvars["fileroot"] . "images/" . $environment["design"] . "/" . $imgwerte[0];
                            if (file_exists($imgfile)) {
                                $imgsize = getimagesize($imgfile);
                                $imgsize = " " . $imgsize[3];
                                $imgurl = $pathvars["images"] . $imgwerte[0];
                            } else {
                                $imgsize = "";
                            }
                        } else {
                            $imgurl = $imgwerte[0];
                            if (!strstr($imgwerte[0], "http")) {
                                if (strpos($imgwerte[0], $cfg["file"]["base"]["pic"]["root"]) === false) {
                                    $opt = explode("/", str_replace($pathvars["subdir"], "", $imgwerte[0]));
                                    $imgfile = $cfg["file"]["base"]["maindir"] . $cfg["file"]["base"]["pic"]["root"] . $cfg["file"]["base"]["pic"][$opt[4]] . "img_" . $opt[3] . "." . $opt[2];
                                } elseif (strstr($imgwerte[0], $cfg["file"]["base"]["webdir"])) {
                                    $imgfile = str_replace($cfg["file"]["base"]["webdir"], "", $imgwerte[0]);
                                    $imgfile = $cfg["file"]["base"]["maindir"] . $imgfile;
                                } else {
                                    $imgfile = $pathvars["fileroot"] . $imgwerte[0];
                                }
                                if (file_exists($imgfile)) {
                                    $imgsize = getimagesize($imgfile);
                                    $imgsize = " " . $imgsize[3];
                                }
                                if ($imgwerte[3] != "") {
                                    $bilderstrecke = "," . $imgwerte[7];
                                } else {
                                    $bilderstrecke = "";
                                }
                                if ($imgwerte[3] != "") {
                                    if (strpos($imgurl, $cfg["file"]["base"]["pic"]["root"]) === false) {
                                        $opt = explode("/", str_replace($pathvars["subdir"], "", $imgurl));
                                        $imgid = $opt[3];
                                    } else {
                                        $opt = split("[_.]", $imgurl);
                                        $imgid = $opt[1];
                                    }
                                    $path = dirname($pathvars["requested"]);
                                    if (substr($path, -1) != '/') {
                                        $path = $path . "/";
                                    }
                                    $imglnk = $path . basename($pathvars["requested"], ".html") . "/view," . $imgwerte[3] . "," . $imgid . $bilderstrecke . ".html";
                                    if ($imgwerte[3] == "l") {
                                        $imglnk = preg_replace("/\\/(tn|s|m|b)\\//", "/o/", $imgurl);
                                        $linka = $defaults["tag"]["img_link_lb"];
                                    } else {
                                        $linka = $defaults["tag"]["img_link"];
                                    }
                                    $linkb = $defaults["tag"]["/img_link"];
                                }
                            } else {
                                $imgsize = "";
                            }
                        }
                        if ($specialvars["w3c"] == "strict") {
                            $ausgabewert = $linka . $defaults["tag"]["img_w3c"] . $linkb;
                        } else {
                            $ausgabewert = $linka . $defaults["tag"]["img"] . $linkb;
                        }
                        foreach ($repl as $value) {
                            $ausgabewert = str_replace("##" . $value . "##", ${$value}, $ausgabewert);
                            ${$value} = "";
                        }
                        $replace = str_replace($opentag . $tagoriginal . $closetag, $ausgabewert, $replace);
                    }
                    break;
                case "[/LINK]":
                    if ($sign == "]") {
                        $ausgabewert = "<a href=\"" . $tagwert . "\" title=\"" . $tagwert . "\">" . $tagwert . "</a>";
                        $replace = str_replace($opentag . $tagoriginal . $closetag, $ausgabewert, $replace);
                    } else {
                        $tagwerte = explode("]", $tagwert, 2);
                        $linkwerte = explode(";", $tagwerte[0]);
                        $href = $linkwerte[0];
                        if ($tagwerte[1] == "") {
                            $beschriftung = $href;
                        } else {
                            $beschriftung = $tagwerte[1];
                        }
                        // ziel
                        if ($linkwerte[1] != "") {
                            $target = " target=\"" . $linkwerte[1] . "\"";
                        } else {
                            $target = "";
                        }
                        // title-tag
                        if ($linkwerte[2] != "") {
                            $title = $linkwerte[2];
                        } else {
                            if ($linkwerte[1] == "_blank") {
                                $title = "Link in neuem Fenster: " . str_replace("http://", "", $href);
                            } elseif (!strstr($beschriftung, "<")) {
                                $title = $beschriftung;
                            } else {
                                $title = "";
                            }
                        }
                        // css-klasse, je nachdem, welche art link vorliegt
                        $class = "";
                        if (preg_match("/^http/", $href)) {
                            $class = "link_extern";
                        } elseif (preg_match("/^" . str_replace("/", "\\/", $cfg["file"]["base"]["webdir"]) . ".*\\.([a-zA-Z]+)/", $href, $match)) {
                            if ($cfg["file"]["filetyp"][$match[1]] != "") {
                                $class = "link_" . $cfg["file"]["filetyp"][$match[1]];
                            }
                        }
                        // klasse manuell hinzufuegen
                        if ($linkwerte[3] != "") {
                            $class .= " " . $linkwerte[3];
                        }
                        // id
                        if ($linkwerte[4] != "") {
                            $id = " id=\"" . $linkwerte[4] . "\"";
                        } else {
                            $id = "";
                        }
                        $ausgabewert = $pic . "<a href=\"" . $href . "\"" . $id . $target . " title=\"" . $title . "\" class=\"" . $class . "\">" . $beschriftung . "</a>";
                        $replace = str_replace($opentag . $tagoriginal . $closetag, $ausgabewert, $replace);
                    }
                    break;
                    //
                    // Inline Elemente - Logische Auszeichnungen
                    // AKR | EM | STRONG | CODE | CITE | -q-
                    //
                //
                // Inline Elemente - Logische Auszeichnungen
                // AKR | EM | STRONG | CODE | CITE | -q-
                //
                case "[/ACR]":
                    if ($sign == "]") {
                        $ausgabewert = "<acronym>" . $tagwert . "</acronym>";
                        $replace = str_replace($opentag . $tagoriginal . $closetag, $ausgabewert, $replace);
                    } else {
                        $tagwerte = explode("]", $tagwert, 2);
                        $acrwerte = explode(";", $tagwerte[0]);
                        $attrib = "";
                        if ($acrwerte[0] != "") {
                            $attrib = " title=\"" . $acrwerte[0] . "\"";
                        }
                        $replace = str_replace($opentag . $tagoriginal . $closetag, "<acronym" . $attrib . ">" . $tagwerte[1] . "</acronym>", $replace);
                    }
                    break;
                case "[/EM]":
                    $replace = str_replace($opentag . $tagoriginal . $closetag, "<em>" . $tagwert . "</em>", $replace);
                    break;
                case "[/STRONG]":
                    $replace = str_replace($opentag . $tagoriginal . $closetag, "<strong>" . $tagwert . "</strong>", $replace);
                    break;
                case "[/CODE]":
                    $replace = str_replace($opentag . $tagoriginal . $closetag, "<code>" . $tagwert . "</code>", $replace);
                    break;
                case "[/CITE]":
                    $replace = str_replace($opentag . $tagoriginal . $closetag, "<blockquote>" . $tagwert . "</blockquote>", $replace);
                    break;
                    //
                    // Inline Elemente - Physische Auszeichnungen
                    // B | I | TT | U | S, ST | BIG | SMALL | SUB | SUP
                    //
                //
                // Inline Elemente - Physische Auszeichnungen
                // B | I | TT | U | S, ST | BIG | SMALL | SUB | SUP
                //
                case "[/B]":
                    $replace = str_replace($opentag . $tagoriginal . $closetag, "<b>" . $tagwert . "</b>", $replace);
                    break;
                case "[/I]":
                    $replace = str_replace($opentag . $tagoriginal . $closetag, "<i>" . $tagwert . "</i>", $replace);
                    break;
                case "[/TT]":
                    $replace = str_replace($opentag . $tagoriginal . $closetag, "<tt>" . $tagwert . "</tt>", $replace);
                    break;
                case "[/U]":
                    $replace = str_replace($opentag . $tagoriginal . $closetag, "<u>" . $tagwert . "</u>", $replace);
                    break;
                case "[/S]":
                    $replace = str_replace($opentag . $tagoriginal . $closetag, "<s>" . $tagwert . "</s>", $replace);
                    break;
                case "[/ST]":
                    $replace = str_replace($opentag . $tagoriginal . $closetag, "<strike>" . $tagwert . "</strike>", $replace);
                    break;
                case "[/BIG]":
                    $replace = str_replace($opentag . $tagoriginal . $closetag, "<big>" . $tagwert . "</big>", $replace);
                    break;
                case "[/SMALL]":
                    $replace = str_replace($opentag . $tagoriginal . $closetag, "<small>" . $tagwert . "</small>", $replace);
                    break;
                case "[/SUB]":
                    $replace = str_replace($opentag . $tagoriginal . $closetag, "<sub>" . $tagwert . "</sub>", $replace);
                    break;
                case "[/SUP]":
                    $replace = str_replace($opentag . $tagoriginal . $closetag, "<sup>" . $tagwert . "</sup>", $replace);
                    break;
                    //
                    // eWeBuKi Spezial
                    // E | ! | ANK | EMAIL | HS |HL | IMGB | IN | M0 | M1 | M2 | QUOTE | SP | UP | PREV | NEXT
                    //
                //
                // eWeBuKi Spezial
                // E | ! | ANK | EMAIL | HS |HL | IMGB | IN | M0 | M1 | M2 | QUOTE | SP | UP | PREV | NEXT
                //
                case "[/E]":
                    $replace = str_replace($opentag . $tagoriginal . $closetag, "<pre>" . $tagwert . "</pre>", $replace);
                    break;
                case "[/!]":
                    $replace = str_replace($opentag . $tagoriginal . $closetag, "<!--" . $tagwert . "-->", $replace);
                    break;
                case "[/ANK]":
                    if ($sign == "]") {
                        $ausgabewert = "<a name=\"" . $tagwert . "\"></a>";
                        $replace = str_replace($opentag . $tagoriginal . $closetag, $ausgabewert, $replace);
                    } else {
                        $tagwerte = explode("]", $tagwert, 2);
                        $ausgabewert = "<a name=\"" . $tagwerte[0] . "\">" . $tagwerte[1] . "</a>";
                        $replace = str_replace($opentag . $tagoriginal . $closetag, $ausgabewert, $replace);
                    }
                    break;
                case "[/EMAIL]":
                    if ($sign == "]") {
                        $ausgabewert = "<a href=\"mailto:" . $tagwert . "\">" . $tagwert . "</a>";
                        $replace = str_replace($opentag . $tagoriginal . $closetag, $ausgabewert, $replace);
                    } else {
                        $tagwerte = explode("]", $tagwert, 2);
                        if ($tagwerte[1] == "") {
                            $beschriftung = $tagwerte[0];
                        } else {
                            $beschriftung = $tagwerte[1];
                        }
                        $ausgabewert = "<a href=\"mailto:" . $tagwerte[0] . "\">" . $beschriftung . "</a>";
                        $replace = str_replace($opentag . $tagoriginal . $closetag, $ausgabewert, $replace);
                    }
                    break;
                case "[/HS]":
                    $replace = str_replace($opentag . $tagoriginal . $closetag, $tagwert, $replace);
                    break;
                case "[/HL]":
                    if ($defaults["tag"]["hl"] == "") {
                        $defaults["tag"]["hl"] = "<hr />";
                        $defaults["tag"]["/hl"] = "";
                    }
                    $replace = str_replace($opentag . $tagoriginal . $closetag, $defaults["tag"]["hl"] . $tagwert . $defaults["tag"]["/hl"], $replace);
                    break;
                case "[/IMGB]":
                    $imgb_counter++;
                    if ($defaults["tag"]["img_link"] == "") {
                        $defaults["tag"]["img_link"] = "<a href=\"##imglnk##\">";
                    }
                    if ($defaults["tag"]["img_link_lb"] == "") {
                        $defaults["tag"]["img_link_lb"] = "<a href=\"##imglnk##\" title=\"##beschriftung##\" ##lightbox## >";
                    }
                    if ($defaults["tag"]["/img_link"] == "") {
                        $defaults["tag"]["/img_link"] = "</a>";
                    }
                    $repl = array("imgurl", "imglnk", "beschriftung", "funder", "fdesc", "lightbox");
                    $tagwerte = explode("]", $tagwert, 2);
                    $imgwerte = explode(";", $tagwerte[0]);
                    $extrawerte = explode(":", $imgwerte[1]);
                    if ($extrawerte[1] != "") {
                        $imgwerte[1] = $extrawerte[1];
                    }
                    $ausgaben["align"] = "";
                    $lspace = "";
                    $rspace = "";
                    $ausgaben["imgstyle"] = "";
                    $ausgaben["float"] = "";
                    // "id" or "class" wird im template gesetzt (!#ausgaben_imgstyle)
                    if ($imgwerte[1] == "r") {
                        $ausgaben["align"] = "right";
                        $ausgaben["float"] = "float:right;";
                        if ($imgwerte[6] == "") {
                            $lspace = "10";
                        } else {
                            $lspace = $imgwerte[6];
                        }
                        $rspace = "0";
                    } elseif ($imgwerte[1] == "l") {
                        $ausgaben["align"] = "left";
                        $ausgaben["float"] = "float:left;";
                        $lspace = "0";
                        if ($imgwerte[6] == "") {
                            $rspace = "10";
                        } else {
                            $rspace = $imgwerte[6];
                        }
                    } elseif ($imgwerte[1] != "") {
                        $ausgaben["imgstyle"] = $imgwerte[1];
                    }
                    if ($imgwerte[2] == "0") {
                        $ausgaben["border"] = "border-width:0;";
                    } elseif ($imgwerte[2] > 0) {
                        $ausgaben["border"] = "border-width:" . $imgwerte[2] . ";";
                    } else {
                        $ausgaben["border"] = "";
                    }
                    if ($imgwerte[3] == "l") {
                        $lightbox = "rel=\"lightbox[b" . $imgb_counter . "]\"";
                    }
                    if ($imgwerte[4] == "") {
                        $tspace = "0";
                    } else {
                        $tspace = $imgwerte[4];
                    }
                    if ($imgwerte[5] == "") {
                        $bspace = "0";
                    } else {
                        $bspace = $imgwerte[5];
                    }
                    if ($tagwerte[1] == "") {
                        $beschriftung = $imgwerte[0];
                    } else {
                        $beschriftung = $tagwerte[1];
                    }
                    // weitere informationen aus datenbank holen
                    if (preg_match("/^\\//", $tagwerte[0])) {
                        $img_path = explode("/", str_replace($cfg["file"]["base"]["maindir"], "", $tagwerte[0]));
                        if (is_numeric($img_path[3])) {
                            $fid = $img_path[3];
                        } else {
                            $fid = substr($tagwerte[0], 0, strpos($tagwerte[0], ";"));
                            $fid = strrchr($fid, "_");
                            $fid = substr($fid, 1, strpos($fid, ".") - 1);
                        }
                        $sql = "SELECT *\n                                        FROM site_file\n                                        WHERE fid=" . $fid;
                        $result = $db->query($sql);
                        $data = $db->fetch_array($result, 1);
                        $funder = $data["funder"];
                        $fdesc = $data["fdesc"];
                    } else {
                        $funder = $beschriftung;
                        $fdesc = $beschriftung;
                    }
                    $ausgaben["linka"] = "";
                    $ausgaben["linkb"] = "";
                    if (strpos($imgwerte[0], "/") === false) {
                        $imgfile = $pathvars["fileroot"] . "images/" . $environment["design"] . "/" . $imgwerte[0];
                        if (file_exists($imgfile)) {
                            $imgsize = getimagesize($imgfile);
                            $ausgaben["imgsize"] = " " . $imgsize[3];
                            $ausgaben["imgurl"] = $pathvars["images"] . $imgwerte[0];
                        }
                    } else {
                        $imgurl = $imgwerte[0];
                        if (strpos($imgurl, "http") === false) {
                            if (strpos($imgwerte[0], $cfg["file"]["base"]["pic"]["root"]) === false) {
                                $opt = explode("/", str_replace($pathvars["subdir"], "", $imgurl));
                                $imgfile = $cfg["file"]["base"]["maindir"] . $cfg["file"]["base"]["pic"]["root"] . $cfg["file"]["base"]["pic"][$opt[4]] . "img_" . $opt[3] . "." . $opt[2];
                            } elseif (strpos($imgurl, $cfg["file"]["base"]["webdir"]) !== false) {
                                $imgfile = $cfg["file"]["base"]["maindir"] . str_replace($cfg["file"]["base"]["webdir"], "", $imgurl);
                            } else {
                                $imgfile = $pathvars["fileroot"] . $imgwerte[0];
                            }
                            if (file_exists($imgfile)) {
                                $imgsize = getimagesize($imgfile);
                                $ausgaben["tabwidth"] = $imgsize[0];
                                $ausgaben["imgsize"] = " " . $imgsize[3];
                            } else {
                                $ausgaben["tabwidth"] = "";
                                $ausgaben["imgsize"] = "";
                            }
                            if ($imgwerte[7] != "") {
                                $bilderstrecke = "," . $imgwerte[7];
                            } else {
                                $bilderstrecke = "";
                            }
                            if ($imgwerte[3] != "") {
                                if (strpos($imgurl, $cfg["file"]["base"]["pic"]["root"]) === false) {
                                    $opt = explode("/", str_replace($pathvars["subdir"], "", $imgurl));
                                    $imgid = $opt[3];
                                } else {
                                    $opt = split("[_.]", $imgurl);
                                    $imgid = $opt[1];
                                }
                                if (substr($pathvars["requested"], 0, 1) == '/') {
                                    $path = substr($pathvars["requested"], 1);
                                }
                                $path = dirname($pathvars["requested"]);
                                if (substr($path, -1) != '/') {
                                    $path = $path . "/";
                                }
                                $imglnk = $path . basename($pathvars["requested"], ".html") . "/view," . $imgwerte[3] . "," . $imgid . $bilderstrecke . ".html";
                                if ($imgwerte[3] == "l") {
                                    $imglnk = preg_replace("/\\/(tn|s|m)\\//", "/b/", $imgurl);
                                    $ausgaben["linka"] = $defaults["tag"]["img_link_lb"];
                                } else {
                                    $ausgaben["linka"] = $defaults["tag"]["img_link"];
                                }
                                foreach ($repl as $value) {
                                    $ausgaben["linka"] = str_replace("##" . $value . "##", ${$value}, $ausgaben["linka"]);
                                }
                                $ausgaben["linkb"] = $defaults["tag"]["/img_link"];
                            } else {
                                $ausgaben["linka"] = "";
                                $ausgaben["linkb"] = "";
                            }
                        }
                        $ausgaben["imgurl"] = $imgurl;
                    }
                    $ausgaben["alt"] = $beschriftung;
                    $ausgaben["beschriftung"] = $beschriftung;
                    $ausgaben["funder"] = $funder;
                    $ausgaben["fdesc"] = $fdesc;
                    $ausgaben["tspace"] = $tspace;
                    $ausgaben["lspace"] = $lspace;
                    $ausgaben["rspace"] = $rspace;
                    $ausgaben["bspace"] = $bspace;
                    $ausgabewert = str_replace(chr(13) . chr(10), "", parser("imgb", ""));
                    $replace = str_replace($opentag . $tagoriginal . $closetag, $ausgabewert, $replace);
                    break;
                case "[/SEL]":
                    $selection_counter++;
                    $tag_value = explode("]", $tagwert, 2);
                    $tag_param = explode(";", $tag_value[0]);
                    $tag_extra = explode(":", $tag_param[3]);
                    $tag_special = explode(":", $tag_param[0]);
                    if (!preg_match("/[0-9]+/", $tag_param[0])) {
                        $sel = "selection not ready";
                        $replace = str_replace($opentag . $tagoriginal . $closetag, $sel, $replace);
                    } else {
                        $path = dirname($pathvars["requested"]);
                        if (substr($path, -1) != '/') {
                            $path = $path . "/";
                        }
                        $link = $path . basename($pathvars["requested"], ".html") . "/view," . $tag_param[1] . ",#," . $tag_param[0] . "," . $tag_param[2] . ".html";
                        #/view,groesse,bild,selektion,thumbs
                        if ($defaults["tag"]["sel"] == "") {
                            $defaults["tag"]["sel"] = "<div style=\"position:relative\" class=\"selection_teaser\">##no_image####youtube_div##\n<b>##title## ##youtube_link##</b>\n##no_image_end##<div>\n<ul>\n";
                        }
                        if ($defaults["tag"]["*sel"] == "") {
                            $defaults["tag"]["*sel"] = "<li class=\"thumbs\"##style##>\n<a href=\"##link##\" ##lb##class=\"pic\" title=\"##fdesc##\"><img src=\"##tn##\" alt=\"##funder##\" title=\"##funder##\"/></a>\n</li>\n";
                        }
                        if ($defaults["tag"]["/sel"] == "") {
                            $defaults["tag"]["/sel"] = "</ul>\n</div>\n<span##display##>g(compilation_info)(##count## g(compilation_pics))</span>\n</div>";
                        }
                        if (strstr($tag_param[0], ":")) {
                            $sel_pics = "";
                            foreach ($tag_special as $pics) {
                                if ($pics == "") {
                                    continue;
                                }
                                $sel_pics != "" ? $trenner = " ," : ($trenner = "");
                                $sel_pics .= $trenner . $pics;
                            }
                            if ($sel_pics == "") {
                                $sel_pics = 0;
                            }
                            $sql = "SELECT * FROM site_file WHERE fid in (" . $sel_pics . ")";
                            $sel_pics1 = explode(":", $tag_param[0]);
                            $i = 0;
                            foreach ($sel_pics1 as $key => $value) {
                                $i++;
                                $tmp_sort[$value] = $i;
                            }
                            $result = $db->query($sql);
                            $files = array();
                            $sortarray = array();
                            while ($data = $db->fetch_array($result, 1)) {
                                $sortarray[] = $tmp_sort[$data["fid"]];
                                $files[] = array("fid" => $data["fid"], "sort" => $counter, "ffart" => $data["ffart"], "ffname" => $data["ffname"], "funder" => $data["funder"], "fdesc" => $data["fdesc"]);
                            }
                            if (count($files) > 0) {
                                array_multisort($sortarray, $files);
                            }
                        } else {
                            $sql = "SELECT *\n                                          FROM site_file\n                                         WHERE fhit LIKE '%#p" . $tag_param[0] . "%'";
                            $result = $db->query($sql);
                            $files = array();
                            while ($data = $db->fetch_array($result, 1)) {
                                preg_match("/#p" . $tag_param[0] . "[,]*([0-9]*)#/i", $data["fhit"], $match);
                                $files[$match[1]] = array("fid" => $data["fid"], "sort" => $match[1], "ffart" => $data["ffart"], "ffname" => $data["ffname"], "funder" => $data["funder"], "fdesc" => $data["fdesc"]);
                            }
                            ksort($files);
                            $sort = array();
                            foreach ($files as $key => $row) {
                                $sort[$key] = $row['sort'];
                            }
                            array_multisort($sort, $files);
                        }
                        $sel = str_replace("##title##", $tag_value[1], $defaults["tag"]["sel"]);
                        // wenn video-parameter vorhanden dann marken ersetzen
                        if ($tag_param[5] != "") {
                            $sel = str_replace("##youtube_div##", "<div class=\"new_box new_space_inside\" style=\"background: #EEF3FB;height:212px;width:250px;display:none\" id=\"" . $tag_param[0] . "_video\">\n                                [OBJECT=http://www.youtube.com/v/" . $tag_param[5] . "&hl=de_DE&fs=1&;250;192;application/x-shockwave-flash]\n                                [PARAM=movie]http://www.youtube.com/v/" . $tag_param[5] . "&hl=de_DE&fs=1&[/PARAM]\n                                [PARAM=wmode]transparent[/PARAM]\n                                [/OBJECT]\n                                <span style=\"float:right\"><b><a onclick=\"Element.setStyle('" . $tag_param[0] . "_video', 'display:none');\">Schließen</a></b></span></div>", $sel);
                            $sel = str_replace("##youtube_link##", "<a onclick=\"Element.setStyle('" . $tag_param[0] . "_video', 'display:block;position:absolute;left:-1px;top:-228px');\">Video</a>", $sel);
                        } else {
                            $sel = str_replace("##youtube_div##", "", $sel);
                            $sel = str_replace("##youtube_link##", "", $sel);
                        }
                        $lb_helper = "";
                        $file_counter = 0;
                        foreach ($files as $row) {
                            $file_counter++;
                            if ($cfg["file"]["base"]["realname"] == True) {
                                $img = $cfg["file"]["base"]["webdir"] . $row["ffart"] . "/" . $row["fid"] . "/" . $tag_param[1] . "/" . $row["ffname"];
                                $tn = $cfg["file"]["base"]["webdir"] . $row["ffart"] . "/" . $row["fid"] . "/" . "tn/" . $row["ffname"];
                            } else {
                                $img = $cfg["file"]["base"]["webdir"] . $cfg["file"]["base"]["pic"]["root"] . $cfg["file"]["base"]["pic"][$tag_param[1]] . "img_" . $row["fid"] . "." . $row["ffart"];
                                $tn = $cfg["file"]["base"]["webdir"] . $cfg["file"]["base"]["pic"]["root"] . $cfg["file"]["base"]["pic"]["tn"] . "tn_" . $row["fid"] . "." . $row["ffart"];
                            }
                            $style = "";
                            if (!in_array($row["fid"], $tag_extra) && $tag_param[3] != "a") {
                                if ($tag_param[4] == "l") {
                                    $style = " style=\"display:none;\"";
                                } else {
                                    continue;
                                }
                            }
                            if ($tag_param[4] == "l") {
                                $changed = $img;
                                $lb = "rel=\"lightbox[group_" . $selection_counter . "]\" ";
                            } else {
                                $changed = str_replace("#", $row["fid"], $link);
                                $lb = "";
                            }
                            if ($tag_param[3] == "" && $tag_param[4] == "l" && $file_counter == 1) {
                                $tn1 = $img;
                                continue;
                            }
                            $s = array("##link##", "##lb##", "##tn##", "##funder##", "##fdesc##", "##style##");
                            $r = array($changed, $lb, $tn, $row["funder"], $row["fdesc"], $style);
                            $sel .= str_replace($s, $r, $defaults["tag"]["*sel"]);
                        }
                        if ($tag_param[3] == "" && $tag_param[4] == "l") {
                            $ArrayReplace = array(count($files), " style=\"display:none\"");
                        } else {
                            $ArrayReplace = array(count($files), "");
                        }
                        $sel .= str_replace(array("##count##", "##display##"), $ArrayReplace, $defaults["tag"]["/sel"]);
                        if ($tag_param[3] == "") {
                            if ($tag_param[4] == "l") {
                                $sel = str_replace("##no_image##", "<a href=\"" . $tn1 . "\" " . $lb . ">", $sel);
                                $sel = str_replace("##no_image_end##", "</a>", $sel);
                            } else {
                                $changed = str_replace("#", $files[0]["fid"], $link);
                                $sel = "<a href=\"" . $changed . "\">" . $tag_value[1] . "</a>";
                            }
                        } else {
                            $sel = str_replace("##no_image##", "", $sel);
                            $sel = str_replace("##no_image_end##", "", $sel);
                        }
                        $replace = str_replace($opentag . $tagoriginal . $closetag, $sel, $replace);
                    }
                case "[/IN]":
                    if ($defaults["tag"]["in"] == "") {
                        $defaults["tag"]["in"] = "<em>";
                        $defaults["tag"]["/in"] = "</em>";
                    }
                    $replace = str_replace($opentag . $tagoriginal . $closetag, $defaults["tag"]["in"] . $tagwert . $defaults["tag"]["/in"], $replace);
                case "[/M0]":
                    if ($sign == "]") {
                        $m0 = $ausgaben["M0"];
                        $replace = str_replace($opentag . $tagoriginal . $closetag, $m0, $replace);
                    } else {
                        $tagwerte = explode("]", $tagwert, 2);
                        $m0werte = explode(";", $tagwerte[0]);
                        if ($m0werte[0] == "l") {
                            $m0 = $ausgaben["L0"];
                        } else {
                            $m0 = $ausgaben["M0"];
                        }
                        $replace = str_replace($opentag . $tagoriginal . $closetag, $m0, $replace);
                    }
                    break;
                case "[/M1]":
                    if ($sign == "]") {
                        if ($tagwert == "") {
                            $label = " .. ";
                        } else {
                            $label = $tagwert;
                        }
                        if ($ausgaben["M1"] != "") {
                            $trenner = $defaults["split"]["m1"];
                        } else {
                            $trenner = "";
                        }
                        $m1 = "<a class=\"menu_punkte\" href=\"" . $ausgaben["UP"] . "\">" . $label . "</a>" . $trenner . $ausgaben["M1"];
                        $replace = str_replace($opentag . $tagoriginal . $closetag, $m1, $replace);
                    } else {
                        $tagwerte = explode("]", $tagwert, 2);
                        $m1werte = explode(";", $tagwerte[0]);
                        if ($tagwerte[1] == "") {
                            $label = " .. ";
                        } else {
                            $label = $tagwerte[1];
                        }
                        if ($m1werte[0] == "l") {
                            $m1 = "";
                            if ($m1werte[1] == "b") {
                                $m1 = $defaults["split"]["l1"] . "<a class=\"menu_punkte\" href=\"" . $ausgaben["UP"] . "\">" . $label . "</a><br />";
                            }
                            $m1 .= $ausgaben["L1"];
                        } else {
                            $m1 = "";
                            if ($m1werte[1] == "b") {
                                if ($ausgaben["M1"] != "") {
                                    $trenner = $defaults["split"]["m1"];
                                } else {
                                    $trenner = "";
                                }
                                $m1 = "<a class=\"menu_punkte\" href=\"" . $ausgaben["UP"] . "\">" . $label . "</a>" . $trenner;
                            }
                            $m1 .= $ausgaben["M1"];
                        }
                        $replace = str_replace($opentag . $tagoriginal . $closetag, $m1, $replace);
                    }
                    break;
                case "[/M2]":
                    if ($sign == "]") {
                        if ($tagwert == "") {
                            $label = " .. ";
                        } else {
                            $label = $tagwert;
                        }
                        if ($ausgaben["M2"] != "") {
                            $trenner = $defaults["split"]["m2"];
                        } else {
                            $trenner = "";
                        }
                        $m2 = "<a class=\"menu_punkte\" href=\"" . $ausgaben["UP"] . "\">" . $label . "</a>" . $trenner . $ausgaben["M2"];
                        $replace = str_replace($opentag . $tagoriginal . $closetag, $m2, $replace);
                    } else {
                        $tagwerte = explode("]", $tagwert, 2);
                        $m2werte = explode(";", $tagwerte[0]);
                        if ($tagwerte[1] == "") {
                            $label = " .. ";
                        } else {
                            $label = $tagwerte[1];
                        }
                        if ($m2werte[0] == "l") {
                            $m2 = "";
                            if ($m2werte[1] == "b") {
                                $m2 = $defaults["split"]["l2"] . "<a class=\"menu_punkte\" href=\"" . $ausgaben["UP"] . "\">" . $label . "</a><br />";
                            }
                            $m2 .= $ausgaben["L2"];
                        } else {
                            $m2 = "";
                            if ($m2werte[1] == "b") {
                                if ($ausgaben["M2"] != "") {
                                    $trenner = $defaults["split"]["m2"];
                                } else {
                                    $trenner = "";
                                }
                                $m2 = "<a class=\"menu_punkte\" href=\"" . $ausgaben["UP"] . "\">" . $label . "</a>" . $trenner;
                            }
                            $m2 .= $ausgaben["M2"];
                        }
                        $replace = str_replace($opentag . $tagoriginal . $closetag, $m2, $replace);
                    }
                    break;
                case "[/M3]":
                    $replace = str_replace($opentag . $tagoriginal . $closetag, $ausgaben["M3"], $replace);
                    break;
                case "[/UP]":
                    if ($tagwert == "") {
                        $label = " .. ";
                    } else {
                        $label = $tagwert;
                    }
                    $up = "<a class=\"menu_punkte\" href=\"" . $ausgaben["UP"] . "\">" . $label . "</a>";
                    $replace = str_replace($opentag . $tagoriginal . $closetag, $up, $replace);
                    break;
                case "[/PREV]":
                    $replace = str_replace($opentag . $tagoriginal . $closetag, $ausgaben["prev"], $replace);
                    break;
                case "[/NEXT]":
                    $replace = str_replace($opentag . $tagoriginal . $closetag, $ausgaben["next"], $replace);
                    break;
                case "[/QUOTE]":
                    $replace = str_replace($opentag . $tagoriginal . $closetag, "&quot;" . $tagwert . "&quot;", $replace);
                    break;
                case "[/SP]":
                    $replace = str_replace($opentag . $tagoriginal . $closetag, "&nbsp;", $replace);
                    break;
                case "[/BLOG]":
                    if ($environment["ebene"] == "/wizard" && $environment["kategorie"] == "show") {
                        $kat = tname2path($environment["parameter"][2]);
                    } else {
                        if ($environment["ebene"] == "") {
                            $kat = "/" . $environment["kategorie"];
                        } else {
                            $kat = $environment["ebene"] . "/" . $environment["kategorie"];
                        }
                    }
                    $tagwerte = explode("]", $tagwert, 2);
                    $url = $tagwerte[0];
                    // erstellen der tags die angezeigt werden
                    if (is_array($cfg["bloged"]["blogs"][$url]["tags"])) {
                        foreach ($cfg["bloged"]["blogs"][$url]["tags"] as $key => $value) {
                            $tags[$key] = $value;
                        }
                    }
                    require_once $pathvars["moduleroot"] . "libraries/function_menu_convert.inc.php";
                    require_once $pathvars["moduleroot"] . "libraries/function_show_blog.inc.php";
                    if ($environment["parameter"][2] == "" || $environment["ebene"] == "/wizard") {
                        $dataloop["list"] = show_blog($url, $tags, $cfg["auth"]["ghost"]["contented"], $cfg["bloged"]["blogs"][$url]["rows"], $kat);
                    } else {
                        $all = show_blog($url, $tags, $cfg["auth"]["ghost"]["contented"], $cfg["bloged"]["blogs"][$url]["rows"], $kat);
                        unset($hidedata["new"]);
                        $hidedata["all"]["inhalt"] = $all[1]["all"];
                    }
                    if ($cfg["bloged"]["blogs"][$url]["category"] != "") {
                        $replace = str_replace($opentag . $tagoriginal . $closetag, parser($mapping["main"], ""), $replace);
                    } else {
                        $replace = str_replace($opentag . $tagoriginal . $closetag, "not allowed", $replace);
                    }
                    break;
                case "[/OBJECT]":
                    $tagwerte = explode("]", $tagwert, 2);
                    $objectwerte = explode(";", $tagwerte[0]);
                    $replace = str_replace($opentag . $tagoriginal . $closetag, "<object type=\"" . $objectwerte[3] . "\" data=\"" . $objectwerte[0] . "\" width=\"" . $objectwerte[1] . "\" height=\"" . $objectwerte[2] . "\">" . $tagwerte[1] . "</object>", $replace);
                    break;
                case "[/PARAM]":
                    $tagwerte = explode("]", $tagwert, 2);
                    $replace = str_replace($opentag . $tagoriginal . $closetag, "<param name=\"" . $tagwerte[0] . "\" value=\"" . $tagwerte[1] . "\"></param>", $replace);
                    break;
                case "[/YT]":
                    $tagwerte = explode("]", $tagwert, 2);
                    $ytwerte = explode(";", $tagwerte[0]);
                    $yt = "<object width=\"" . $ytwerte[0] . "\" height=\"" . $ytwerte[1] . "\">\n                                <param name=\"movie\" value=\"http://www.youtube.com/v/" . $tagwerte[1] . "&hl=de_DE&fs=1&\"></param>\n                                <param name=\"allowFullScreen\" value=\"true\"></param>\n                                <param name=\"allowscriptaccess\" value=\"always\"></param>\n                                <embed src=\"http://www.youtube.com/v/" . $tagwerte[1] . "&hl=de_DE&fs=1&\" type=\"application/x-shockwave-flash\" allowscriptaccess=\"always\" allowfullscreen=\"true\" width=\"" . $ytwerte[0] . "\" height=\"" . $ytwerte[1] . "\"></embed>\n                                </object>";
                    $replace = str_replace($opentag . $tagoriginal . $closetag, $yt, $replace);
                    break;
                default:
                    $extra_tag = str_replace(array("/", "]", "["), array("", "", ""), $closetag);
                    if ($defaults["extra_tags"][$extra_tag] != "") {
                        if (file_exists($pathvars["moduleroot"] . $defaults["extra_tags"][$extra_tag])) {
                            include $pathvars["moduleroot"] . $defaults["extra_tags"][$extra_tag];
                            break;
                        }
                    }
                    // unbekannte tags verstecken
                    $replace = str_replace($closetag, "[##" . substr($closetag, 1), $replace);
            }
        }
    }
    // unbekannte tags wiederherstellen
    $replace = str_replace("[##/", "[/", $replace);
    return $replace;
}
コード例 #5
0
 if ($debugging["html_enable"]) {
     $debugging["ausgabe"] .= "kategorie: " . $HTTP_SESSION_VARS["kategorie"] . $debugging["char"];
 }
 $ausgaben["ce_tem_db"] = "DB: " . $environment["parameter"][1];
 $ausgaben["ce_tem_name"] = "Template: " . $environment["parameter"][2];
 $ausgaben["ce_tem_label"] = "Label: " . $environment["parameter"][3];
 $ausgaben["ce_tem_convert"] = "Convert: " . $environment["parameter"][5];
 $ausgaben["ce_tem_lang"] = "Sprache: " . $environment["language"];
 $sql = "SELECT tid, html, content FROM " . SITETEXT . " WHERE tname='" . $environment["parameter"][2] . "' AND lang='" . $environment["language"] . "' AND label='" . $environment["parameter"][3] . "'";
 $result = $db->query($sql);
 $data = $db->fetch_array($result, $nop);
 // convert tag 2 html
 switch ($environment["parameter"][5]) {
     case "html":
         // content nach html wandeln
         $data["content"] = tagreplace($data["content"]);
         // intelligenten link tag bearbeiten
         $data["content"] = intelilink($data["content"]);
         // newlines nach br wandeln
         $data["content"] = nlreplace($data["content"]);
         // html db value aendern
         $data["html"] = -1;
         break;
     case "tag":
         // content nach cmstag wandeln
         ###
         // html db value aendern
         $data["html"] = 0;
         break;
 }
 if ($data["html"] == "-1") {
コード例 #6
0
function content($line, $tname)
{
    global $db, $debugging, $pathvars, $specialvars, $environment, $defaults, $ausgaben, $rechte;
    if ($specialvars["crc32"] == -1) {
        if ($environment["ebene"] != "" && $tname == $environment["kategorie"]) {
            $tname = crc32($environment["ebene"]) . "." . $tname;
            if ($debugging["html_enable"]) {
                $debugging["ausgabe"] .= "crc32 tname \"" . $tname . "\" forced!!!" . $debugging["char"];
            }
        }
    } else {
        // ist das eine sub kategorie ?
        if ($environment["subkatid"] != "" && $tname == $environment["katid"]) {
            $tname = $tname . "." . $environment["subkatid"];
            if ($debugging["html_enable"]) {
                $debugging["ausgabe"] .= "sub tname \"" . $tname . "\" forced!!!" . $debugging["char"];
            }
            #$dbtname = $tname;
        }
    }
    while (strpos($line, "#(") !== false || strpos($line, "g(") !== false) {
        // wo beginnt die marke
        $labelbeg = strpos($line, "#(");
        $art = "#(";
        $bez = "# (";
        $dbtname = $tname;
        if ($labelbeg === false) {
            $labelbeg = strpos($line, "g(");
            $art = "g(";
            $bez = "g (";
            $dbtname = "global";
        }
        // wo endet die marke (wichtig der offset!)
        $labelend = strpos($line, ")", $labelbeg);
        // wie lang ist die marke
        $labellen = $labelend - $labelbeg;
        // token name extrahieren
        $label = substr($line, $labelbeg + 2, $labellen - 2);
        if (strpos($label, ",") !== false) {
            break;
        }
        // javascript fix
        $sql = "SELECT html, content FROM " . SITETEXT . " WHERE tname='" . $dbtname . "' AND lang='" . $environment["language"] . "' AND label='{$label}'";
        #if ( $debugging["html_enable"] ) $debugging["ausgabe"] .= "sql: ".$sql.$debugging["char"];
        $result = $db->query($sql);
        $row = $db->fetch_row($result);
        if (!is_array($row)) {
            // wenn "aktuelle sprache" = "default sprache" ueberfluessige fehlermeldung nicht anzeigen!
            if ($environment["language"] != $specialvars["default_language"]) {
                if ($debugging["html_enable"]) {
                    $debugging["ausgabe"] .= "Language: \"" . $environment["language"] . "\" for #(" . $label . ") in template \"" . $dbtname . "\" not found using default: \"" . $specialvars["default_language"] . "\"" . $debugging["char"];
                }
            }
            $sql = "SELECT html, content FROM " . SITETEXT . " WHERE tname='{$dbtname}' AND lang='" . $specialvars["default_language"] . "' AND label='{$label}'";
            $result = $db->query($sql);
            $row = $db->fetch_row($result);
        }
        if ($row[1] == "") {
            if ($debugging["html_enable"]) {
                $debugging["ausgabe"] .= "Language: Uuuuups no default language \"" . $specialvars["default_language"] . "\" for #(" . $label . ") in template \"" . $dbtname . "\" found. Giving up!" . $debugging["char"];
            }
        }
        $database = $db->getDb();
        if (is_array($_SESSION["dbzugriff"])) {
            // admin darf alles in seiner db !!
            if (in_array($database, $_SESSION["dbzugriff"]) && $rechte[$specialvars["security"]["overwrite"]] == -1) {
                $dbzugriff = -1;
                $katzugriff = -1;
                // sperre fuer bestimmte templates
            } elseif (in_array($tname, (array) $specialvars["security"]["nochk"])) {
                $katzugriff = FALSE;
                $dbzugriff = FALSE;
                // hier erfolgt der check wenn man kein admin ist und bei nicht gesperrten templates
            } else {
                if (right_check("-1", $environment["ebene"], $environment["kategorie"], $database) != "") {
                    $dbzugriff = -1;
                    $katzugriff = -1;
                } else {
                    $katzugriff = FALSE;
                    $dbzugriff = FALSE;
                }
            }
        } else {
            $dbzugriff = -1;
            // admin darf alles
            if ($rechte[$specialvars["security"]["overwrite"]] == -1) {
                $katzugriff = -1;
                // sperre fuer bestimmte templates
            } elseif (in_array($tname, (array) $specialvars["security"]["nochk"])) {
                $katzugriff = FALSE;
                // hier erfolgt der check wenn man kein admin ist und bei nicht gesperrten templates
            } else {
                if (right_check("-1", $environment["ebene"], $environment["kategorie"], $database) != "") {
                    $katzugriff = -1;
                } else {
                    $katzugriff = FALSE;
                }
            }
        }
        $replace = $row[1];
        // wenn content nicht in html ist und deaktiviert wurde
        if ($row[0] != -1 && $specialvars["denyhtml"] == -1) {
            // html killer :)
            $pattern = "<[\\!\\/a-zA-Z].{0,}>";
            while (preg_match("/" . $pattern . "/", $replace, $tag)) {
                $replace = str_replace($tag[0], " - html gel&ouml;scht! -", $replace);
            }
        }
        // cms edit link einblenden
        if ($specialvars["editlock"] == False) {
            // erlaubt wenn content_right nicht gesetzt und cms_edit = -1
            if ($rechte["cms_edit"] == -1 && $specialvars["security"]["enable"] != -1 || $specialvars["security"]["enable"] == -1 && $katzugriff == -1 && $dbzugriff == -1) {
                // konvertieren ?
                if ($specialvars["wysiwyg"] == "" && $row[0] == -1) {
                    $convert = ",,tag";
                    $signal = "c";
                } elseif ($specialvars["wysiwyg"] != "" && $row[0] != -1) {
                    $convert = ",,html";
                    $signal = "c";
                } else {
                    $convert = "";
                    $signal = "e";
                }
                $editurl = $pathvars["virtual"] . "/cms/edit," . $db->getDb() . "," . $dbtname . "," . $label;
                if ($defaults["cms-tag"]["signal"] == "") {
                    $defaults["cms-tag"]["signal"] = "<img src=\"/images/default/cms-tag-";
                    $defaults["cms-tag"]["/signal"] = ".png\" width=\"4\" height=\"4\" border=\"0\" alt=\"Bearbeiten\" />";
                }
                // wenn es kein value, alt, title und status in der zeile gibt
                $vorher = substr($line, $labelbeg - 20, 20);
                if (!strpos($vorher, "value=\"") && !strpos($vorher, "alt=\"") && !strpos($vorher, "title=\"") && !strpos($vorher, "status='")) {
                    $replace .= " <a target=\"_top\" href=\"" . $editurl . $convert . ".html\">" . $defaults["cms-tag"]["signal"] . $signal . $defaults["cms-tag"]["/signal"] . "</a>";
                } else {
                    #$line = $line."# (".$label.")&nbsp;<a target=\"_top\" href=\"".$editurl.$convert.".html\">".$defaults["cms-tag"]["signal"].$signal.$defaults["cms-tag"]["/signal"]."</a><br />\n";
                    #$ausgaben["inaccessible"] .= "# (".$label.")&nbsp;#(".$label.")<a target=\"_top\" href=\"".$editurl.$convert.".html\">".$defaults["cms-tag"]["signal"].$signal.$defaults["cms-tag"]["/signal"]."</a><br />\n";
                    $ausgaben["inaccessible"] .= $bez . $label . ")&nbsp;" . $art . $label . ")<br />\n";
                }
            }
        }
        // wenn content nicht in html ist
        if ($row[0] != -1) {
            // intelligenten link tag bearbeiten
            $replace = intelilink($replace);
            // neues generelles tagreplace
            $replace = tagreplace($replace);
            // newlines nach br wandeln (muss zuletzt gemacht werden)
            $replace = nlreplace($replace);
        }
        // marke ersetzen
        if (strpos($line, $art) !== false) {
            $line = str_replace($art . $label . ")", $replace, $line);
        }
    }
    return $line;
}
コード例 #7
0
function content($line, $tname)
{
    global $db, $debugging, $pathvars, $specialvars, $environment, $defaults, $ausgaben, $rechte, $eWeBuKi, $RightConcept;
    if ($specialvars["crc32"] == -1) {
        if ($environment["ebene"] != "" && $tname == $environment["kategorie"]) {
            $tname = eCRC($environment["ebene"]) . "." . $tname;
            if ($debugging["html_enable"]) {
                $debugging["ausgabe"] .= "crc32 tname \"" . $tname . "\" forced!!!" . $debugging["char"];
            }
        }
    } else {
        // ist das eine sub kategorie ?
        if ($environment["subkatid"] != "" && $tname == $environment["katid"]) {
            $tname = $tname . "." . $environment["subkatid"];
            if ($debugging["html_enable"]) {
                $debugging["ausgabe"] .= "sub tname \"" . $tname . "\" forced!!!" . $debugging["char"];
            }
            #$dbtname = $tname;
        }
    }
    while (strpos($line, "#(") !== false || strpos($line, "g(") !== false) {
        // wo beginnt die marke
        $labelbeg = strpos($line, "#(");
        $art = "#(";
        $bez = "# (";
        $dbtname = $tname;
        if ($labelbeg === false) {
            $labelbeg = strpos($line, "g(");
            $art = "g(";
            $bez = "g (";
            $dbtname = "global";
        }
        // wo endet die marke (wichtig der offset!)
        $labelend = strpos($line, ")", $labelbeg);
        // wie lang ist die marke
        $labellen = $labelend - $labelbeg;
        // token name extrahieren
        $label = substr($line, $labelbeg + 2, $labellen - 2);
        if (strpos($label, ",") !== false) {
            break;
        }
        // javascript fix
        if (preg_match("/^v[0-9]*\$/", $environment["parameter"][1], $regs) && ($rechte["view"] || $rechte["cms_edit"] == -1)) {
            $version_sql = "AND version=" . substr($environment["parameter"][1], 1);
            $version = substr($environment["parameter"][1], 1);
        } else {
            $version = "";
            $version_sql = "";
        }
        if ($specialvars["content_release"] == -1 && $version == "") {
            $content_release = "AND status>0";
        } else {
            $content_release = "";
        }
        $sql = "SELECT html, content\n                      FROM " . SITETEXT . "\n                     WHERE tname='" . $dbtname . "'\n                       AND lang='" . $environment["language"] . "'\n                       AND label='" . $label . "'\n                        " . $version_sql . "\n                        " . $content_release . "\n                  ORDER BY version DESC\n                     LIMIT 0,1";
        #if ( $debugging["html_enable"] ) $debugging["ausgabe"] .= "sql: ".$sql.$debugging["char"];
        $result = $db->query($sql);
        $row = $db->fetch_row($result);
        if (!is_array($row)) {
            // wenn "aktuelle sprache" = "default sprache" ueberfluessige fehlermeldung nicht anzeigen!
            if ($environment["language"] != $specialvars["default_language"]) {
                if ($debugging["html_enable"]) {
                    $debugging["ausgabe"] .= "Language: \"" . $environment["language"] . "\" for #(" . $label . ") in template \"" . $dbtname . "\" not found using default: \"" . $specialvars["default_language"] . "\"" . $debugging["char"];
                }
            }
            $sql = "SELECT html, content\n                          FROM " . SITETEXT . "\n                         WHERE tname='{$dbtname}'\n                           AND lang='" . $specialvars["default_language"] . "'\n                           AND label='{$label}'\n                            " . $version_sql . "\n                            " . $content_release . "\n                      ORDER BY version DESC\n                         LIMIT 0,1";
            $result = $db->query($sql);
            $row = $db->fetch_row($result);
        }
        if ($row[1] == "") {
            if ($debugging["html_enable"]) {
                $debugging["ausgabe"] .= "Language: Uuuuups no default language \"" . $specialvars["default_language"] . "\" for #(" . $label . ") in template \"" . $dbtname . "\" found. Giving up!" . $debugging["char"];
            }
        }
        $database = $db->getDb();
        $replace = $row[1];
        // wenn content nicht in html ist und deaktiviert wurde
        if ($row[0] != -1 && $specialvars["denyhtml"] == -1) {
            // html killer :)
            $pattern = "<[\\!\\/a-zA-Z].{0,}>";
            while (preg_match("/" . $pattern . "/", $replace, $tag)) {
                $replace = str_replace($tag[0], " - html gel&ouml;scht! -", $replace);
            }
        }
        // eWeBuKi tag schutz part 1 (siehe part 2 (weiter unten), part 3 (cms.in.php), part 4 (function_rparser.inc.php))
        if (strpos($replace, "[/E]") !== false) {
            $preg = "|\\[E\\](.*)\\[/E\\]|Us";
            preg_match_all($preg, $replace, $match, PREG_PATTERN_ORDER);
            $mark_l = array("[/", "[");
            $hide_l = array("++", "**");
            $mark_o = array("#(", "g(", "#{", "!#");
            $hide_o = array("::1::", "::2::", "::3::", "::4::");
            foreach ($match[0] as $key => $value) {
                $escape = str_replace($mark_l, $hide_l, $match[1][$key]);
                $escape = str_replace($mark_o, $hide_o, $escape);
                $replace = str_replace($value, "[E]" . $escape . "[/E]", $replace);
            }
        }
        // cms edit link einblenden
        $check = "";
        if ($specialvars["editlock"] == False && $tname != "auth") {
            if ($specialvars["security"]["new"] == -1) {
                $check = priv_check('', $specialvars["security"]["content"], $specialvars["dyndb"]);
            } else {
                if ($rechte["cms_edit"] == -1) {
                    $check = True;
                }
            }
            if ($check == True) {
                if ($defaults["section"]["label"] == "") {
                    $defaults["section"]["label"] = "inhalt";
                }
                if ($defaults["section"]["tag"] == "") {
                    $defaults["section"]["tag"] = "[H";
                }
                if ($specialvars["nosections"] != True && $label == $defaults["section"]["label"]) {
                    if (is_array($defaults["section"]["tag"])) {
                        // neue section-edit-marken
                        $preg_search = str_replace(array("[", "]", "/"), array("\\[", "\\]", "\\/"), implode("|", $defaults["section"]["tag"]));
                        $allcontent = preg_split("/(" . $preg_search . ")/", $replace, -1, PREG_SPLIT_DELIM_CAPTURE);
                        $i = 0;
                        foreach ($allcontent as $key => $value) {
                            if (in_array($value, $defaults["section"]["tag"])) {
                                $join[$i] = "{" . $i . "}" . $value;
                            } else {
                                $join[$i] .= $value;
                                $i++;
                            }
                        }
                        $replace = implode("", $join);
                    } else {
                        $allcontent = explode($defaults["section"]["tag"], $replace);
                        foreach ($allcontent as $key => $value) {
                            if ($key == 0) {
                                $join[] = $value;
                            } else {
                                $parts = explode("]", $value, 2);
                                $join[] = $parts[0] . "]{" . $key . "}" . $parts[1];
                            }
                        }
                        $replace = implode($defaults["section"]["tag"], $join);
                    }
                }
                // konvertieren ?
                if ($specialvars["wysiwyg"] == "" && $row[0] == -1) {
                    $convert = ",,tag";
                    $signal = "c";
                } elseif ($specialvars["wysiwyg"] != "" && $row[0] != -1) {
                    $convert = ",,html";
                    $signal = "c";
                } else {
                    $convert = "";
                    $signal = "e";
                }
                if ($specialvars["old_contented"] == True) {
                    $editurl = $pathvars["virtual"] . "/cms/edit," . $db->getDb() . "," . $dbtname . "," . $label;
                } else {
                    $editurl_key = $pathvars["virtual"] . "/admin/contented/edit," . $db->getDb() . "," . $dbtname . "," . $label;
                    $editurl = $pathvars["virtual"] . "/admin/contented/edit," . $db->getDb() . "," . $dbtname . "," . $label . ",,," . $version;
                }
                if ($defaults["cms-tag"]["link"] == "") {
                    $defaults["cms-tag"]["link"] = "<a href=\"##url##\"><img src=\"/images/default/cms-tag-##signal##.png\" width=\"4\" height=\"4\" alt=\"Bearbeiten\" /></a>";
                }
                // section verarbeitung
                if ($specialvars["nosections"] != True && $label == $defaults["section"]["label"]) {
                    foreach ($allcontent as $key => $value) {
                        $marken = array("##url##", "##signal##");
                        $ersatz = array($editurl_key . "," . $key . ",," . $version . ",.html", $signal);
                        $replace = str_replace("{" . $key . "}", str_replace($marken, $ersatz, $defaults["cms-tag"]["link"]), $replace);
                    }
                }
                // wenn es kein value, alt, title und status in der zeile gibt
                $vorher = substr($line, $labelbeg - 20, 20);
                if (!strpos($vorher, "value=\"") && !strpos($vorher, "alt=\"") && !strpos($vorher, "title=\"") && !strpos($vorher, "status='")) {
                    $marken = array("##url##", "##signal##");
                    $ersatz = array($editurl . $convert . ".html", $signal);
                    $replace .= str_replace($marken, $ersatz, $defaults["cms-tag"]["link"]);
                } else {
                    $ausgaben["inaccessible"] .= $bez . $label . ")&nbsp;" . $art . $label . ")<br />\n";
                }
            }
        }
        // wenn content nicht in html ist
        if ($row[0] != -1) {
            // intelligenten link tag bearbeiten
            $replace = intelilink($replace);
            // neues generelles tagreplace
            $replace = tagreplace($replace);
            // eWeBuKi tag schutz part 2
            $replace = str_replace($hide_l, $mark_l, $replace);
            // newlines nach br wandeln (muss zuletzt gemacht werden)
            if ($specialvars["newbrmode"] != True) {
                $replace = nlreplace($replace);
            }
        }
        // marke ersetzen
        if (strpos($line, $art) !== false) {
            $line = str_replace($art . $label . ")", $replace, $line);
        }
    }
    return $line;
}
コード例 #8
0
 // hier erfolgt der diff
 if ($old != "" && $new != "") {
     $sql = "SELECT content,version\n                      FROM site_text\n                     WHERE tname='" . $tname . "'\n                       AND label='" . $label . "'\n                       AND version=" . $old;
     $result = $db->query($sql);
     $data_old = $db->fetch_array($result, 1);
     $sql = "SELECT content,version\n                      FROM site_text\n                     WHERE tname='" . $tname . "'\n                       AND label='" . $label . "'\n                       AND version=" . $new;
     $result = $db->query($sql);
     $data_new = $db->fetch_array($result, 1);
     // tagreplace?
     if ($environment["parameter"][6] == "html") {
         if ($data_new["version"] > $data_old["version"]) {
             $first = tagreplace($data_new["content"]);
             $second = tagreplace($data_old["content"]);
         } else {
             $first = tagreplace($data_old["content"]);
             $second = tagreplace($data_new["content"]);
         }
     } else {
         if ($data_new["version"] > $data_old["version"]) {
             $first = $data_new["content"];
             $second = $data_old["content"];
         } else {
             $first = $data_old["content"];
             $second = $data_new["content"];
         }
         $old_array = explode("\n", $second);
         $new_array = explode("\n", $first);
     }
     $old_array = explode("\n", $second);
     $new_array = explode("\n", $first);
     // diff-methode festlegen
コード例 #9
0
 }
 // space killer
 if ($specialvars["denyspace"] == -1) {
     $pattern = "  +";
     while (preg_match("/" . $pattern . "/", $content, $tag)) {
         $content = str_replace($tag[0], " ", $content);
     }
 }
 // neuen content in session zwischenscheichern
 if ($_POST["ajax"] == "on") {
     //                     // experimentell: html in tag umwandeln
     //                     $content = html2tag($content,"none");
     if (file_exists($pathvars["moduleroot"] . "customer/" . $wizard_name . ".inc.php")) {
         include $pathvars["moduleroot"] . "customer/" . $wizard_name . ".inc.php";
     }
     $content = tagreplace($content);
     $content = tagremove($content);
     if (get_magic_quotes_gpc() == 1) {
         $content = stripslashes($content);
     }
     if ($cfg["wizard"]["utf8"] != TRUE) {
         $content = utf8_encode($content);
     }
     header("HTTP/1.0 200 OK");
     echo preg_replace(array("/#\\{.+\\}/U", "/g\\(.+\\)/U"), "", $content);
     die;
 }
 if (get_magic_quotes_gpc() == 1) {
     $content = stripslashes($content);
 }
 $_SESSION["wizard_content"][$identifier] = $content;
コード例 #10
0
// unzugaengliche #(marken) sichtbar machen
if (isset($_GET["edit"])) {
    $ausgaben["inaccessible"] = "inaccessible values:<br />";
} else {
    $ausgaben["inaccessible"] = "";
}
$ausgaben["faq"] = "";
if ($environment["parameter"][1]) {
    $ebe = make_ebene($environment["parameter"][1]);
    $tn = eCrc(substr($ebe, 0, strrpos($ebe, "/"))) . "." . substr($ebe, strrpos($ebe, "/") + 1);
    $sql = "Select * from site_text where tname = '" . $tn . "' and status = 1 and label = 'inhalt'";
    $result = $db->query($sql);
    $data = $db->fetch_array($result, 1);
    preg_match_all("/\\[LIST=DEF\\](.*)\\[\\/LIST\\]/Us", $data["content"], $match);
    foreach ($match[0] as $key => $value) {
        $buffer .= tagreplace($value);
    }
    $buffer = str_replace("<dl>", "", $buffer);
    $ausgaben["faq"] = str_replace("</dl>", "", $buffer);
}
// LISTE
$sql = "Select * from site_text where content like '%[LIST=DEF]%' and status = 1";
$result = $db->query($sql);
while ($data = $db->fetch_array($result, 1)) {
    $id = make_id(tname2path($data["tname"]));
    $name = "";
    foreach (url2Loop(tname2path($data["tname"])) as $value) {
        $name .= "|" . $value["label"];
    }
    $dataloop["faq_sites"][$id["mid"]]["id"] = $id["mid"];
    $dataloop["faq_sites"][$id["mid"]]["name"] = $name;
コード例 #11
0
}
$print = array("namen" => "iautor", "akkate" => "ikategorie", "schlagzeile" => "ititel", "edatum" => "ierstellt");
$sql = "SELECT * FROM " . $cfg["db"]["entries"] . " WHERE " . $cfg["db"]["key"] . "='" . $environment["parameter"][1] . "'";
$result = $db->query($sql);
$data = $db->fetch_array($result, $nop);
foreach ($print as $key => $value) {
    if ($key == "edatum") {
        $ausgaben[$key] = substr($data[$value], 8, 2) . "." . substr($data[$value], 5, 2) . "." . substr($data[$value], 0, 4);
    } else {
        $ausgaben[$key] = $data[$value];
    }
}
// intelligenten link tag bearbeiten
$replace = intelilink($data["itext"]);
// neues generelles tagreplace
$replace = tagreplace($replace);
// newlines nach br wandeln (muss zuletzt gemacht werden)
$ausgaben["output"] = nlreplace($replace);
$ausgaben["uebersicht"] = "<a href=" . $cfg["basis"] . "/" . $cfg["ebene"]["zwei"] . ".html>Zurück zur Übersicht</a>";
$ausgaben["versenden"] = "<a href=" . $cfg["basis"] . "/" . $cfg["ebene"]["zwei"] . "/email,form," . $data["iid"] . ".html>Artikel empfehlen</a>";
if ($rechte[$cfg["right"]["red"]] == -1 || $rechte[$cfg["right"]["chf"]] == -1) {
    $ausgaben["edit"] = "<a href=" . $cfg["basis"] . "/" . $cfg["ebene"]["zwei"] . "/modify,edit," . $environment["parameter"][1] . ".html>Artikel editieren</a>";
} else {
    $ausgaben["edit"] = "";
}
$mapping["navi"] = "leer";
$mapping["main"] = "1943315524.details";
if ($debugging["html_enable"]) {
    $debugging["ausgabe"] .= "<font color=\"#FF0000\">ATTENTION: template overwrite -> " . $mapping["main"] . ".tem.html</font>" . $debugging["char"];
}
if ($debugging["html_enable"]) {
コード例 #12
0
ファイル: news.inc.php プロジェクト: BackupTheBerlios/ewebuki
 $sql = "SELECT * FROM " . BEITRAG_INHALT . " where beitragid = '" . $environment[param][1] . "' AND seite='" . $environment[param][2] . "'";
 $result = $db->query($sql);
 $news_content = $db->fetch_array($result, 1);
 $news_content_columns = $db->show_columns(BEITRAG_INHALT);
 foreach ($news_content_columns as $key => $rows) {
     $fieldname = $news_content_columns[$key]["Field"];
     $ausgaben[$fieldname] = $news_content[$fieldname];
     // felder die nicht befuellt wurden, uebernehmen den inhalt der ersten seite
     if ($ausgaben[$fieldname] == "") {
         $sql = "SELECT " . $fieldname . " FROM " . BEITRAG_INHALT . " where beitragid = '" . $environment[param][1] . "' AND seite='1'";
         $result2 = $db->query($sql);
         $row = $db->fetch_row($result2);
         $ausgaben[$fieldname] = $row[0];
     }
     $ausgaben[$fieldname] = nlreplace($ausgaben[$fieldname]);
     $ausgaben[$fieldname] = tagreplace($ausgaben[$fieldname]);
     if ($environment[param][1] != "" && $rechte[news_edit] == -1) {
         $edit_link = $pathvars[virtual] . "/news/edit," . $news_content[inhaltid] . "," . $fieldname . ".html";
         $ausgaben[$fieldname] .= "<a target=\"_top\" href=\"" . $edit_link . "\">(E)</a>";
     }
 }
 //  inhalt selector erstellen
 $ausgaben[inh_select] = "";
 $sql = "SELECT seite FROM " . BEITRAG_INHALT . " where beitragid = '" . $environment[param][1] . "'";
 $result = $db->query($sql);
 $num = $db->num_rows($result);
 $neueseite = $num + 1;
 if ($debugging[html_enable]) {
     $debugging[ausgabe] .= "seitenanzahl: " . $num . $debugging[char];
 }
 if ($num > 1) {
コード例 #13
0
function tagreplace($replace)
{
    global $pathvars, $environment, $ausgaben, $defaults;
    // cariage return + linefeed fix
    $sear = array("\r\n[TA", "\r\n[RO", "\r\n[CO", "/H1]\r\n", "/H2]\r\n", "/H3]\r\n", "/H4]\r\n", "/H5]\r\n", "/H6]\r\n[", "/HR]\r\n", "AB]\r\n", "OW]\r\n", "OL]\r\n", "IV]\r\n");
    $repl = array("[TA", "[RO", "[CO", "/H1]", "/H2]", "/H3]", "/H4]", "/H5]", "/H6]", "/HR]", "AB]", "OW]", "OL]", "IV]");
    $replace = str_replace($sear, $repl, $replace);
    $preg = "\\[\\/[A-Z0-9]{1,6}\\]";
    while (preg_match("/{$preg}/", $replace, $match)) {
        $closetag = $match[0];
        if (strstr($replace, $closetag)) {
            // wo beginnt der closetag
            $closetagbeg = strpos($replace, $closetag);
            // wie sieht der opentag aus
            $opentag = str_replace(array("/", "]"), array("", ""), $closetag);
            // wie lang ist der opentag
            $opentaglen = strlen($opentag);
            // nur hier kann der opentag sein
            $haystack = substr($replace, 0, $closetagbeg);
            // fehlenden open tag abfangen
            if (strpos($haystack, $opentag . "]") === false && strpos($haystack, $opentag . "=") === false) {
                if ($defaults["tag"]["error"] == "") {
                    $error = " <font color=\"#FF0000\">" . $opentag . "]?</font> ";
                } else {
                    $error = $defaults["tag"]["error"] . $opentag . "]" . $defaults["tag"]["/error"];
                }
                $replace = $haystack . $error . substr($replace, $closetagbeg + $opentaglen + 2);
                continue;
            }
            // wie lautet der tagwert
            $tagwertbeg = strlen($haystack) - (strpos(strrev($haystack), strrev($opentag)) + strlen($opentag)) + $opentaglen + 1;
            $tagwert = substr($replace, $tagwertbeg, $closetagbeg - $tagwertbeg);
            // parameter?
            $sign = substr($replace, $tagwertbeg - 1, 1);
            // opentag komplettieren
            $opentag = $opentag . $sign;
            // kompletten tag mit tagwert ersetzen
            switch ($closetag) {
                case "[/B]":
                    $replace = str_replace($opentag . $tagwert . $closetag, "<b>" . $tagwert . "</b>", $replace);
                    break;
                case "[/STRONG]":
                    $replace = str_replace($opentag . $tagwert . $closetag, "<strong>" . $tagwert . "</strong>", $replace);
                    break;
                case "[/I]":
                    $replace = str_replace($opentag . $tagwert . $closetag, "<i>" . $tagwert . "</i>", $replace);
                    break;
                case "[/EM]":
                    $replace = str_replace($opentag . $tagwert . $closetag, "<em>" . $tagwert . "</em>", $replace);
                    break;
                case "[/TT]":
                    $replace = str_replace($opentag . $tagwert . $closetag, "<tt>" . $tagwert . "</tt>", $replace);
                    break;
                case "[/U]":
                    $replace = str_replace($opentag . $tagwert . $closetag, "<u>" . $tagwert . "</u>", $replace);
                    break;
                case "[/S]":
                    $replace = str_replace($opentag . $tagwert . $closetag, "<s>" . $tagwert . "</s>", $replace);
                    break;
                case "[/ST]":
                    $replace = str_replace($opentag . $tagwert . $closetag, "<strike>" . $tagwert . "</strike>", $replace);
                    break;
                case "[/BIG]":
                    $replace = str_replace($opentag . $tagwert . $closetag, "<big>" . $tagwert . "</big>", $replace);
                    break;
                case "[/SMALL]":
                    $replace = str_replace($opentag . $tagwert . $closetag, "<small>" . $tagwert . "</small>", $replace);
                    break;
                case "[/SUP]":
                    $replace = str_replace($opentag . $tagwert . $closetag, "<sup>" . $tagwert . "</sup>", $replace);
                    break;
                case "[/SUB]":
                    $replace = str_replace($opentag . $tagwert . $closetag, "<sub>" . $tagwert . "</sub>", $replace);
                    break;
                case "[/CENTER]":
                    $replace = str_replace($opentag . $tagwert . $closetag, "<center>" . $tagwert . "</center>", $replace);
                    break;
                case "[/QUOTE]":
                    $replace = str_replace($opentag . $tagwert . $closetag, "&quot;" . $tagwert . "&quot;", $replace);
                    break;
                case "[/CITE]":
                    $replace = str_replace($opentag . $tagwert . $closetag, "<blockquote>" . $tagwert . "</blockquote>", $replace);
                    break;
                case "[/PRE]":
                    $replace = str_replace($opentag . $tagwert . $closetag, "<pre>" . $tagwert . "</pre>", $replace);
                    break;
                case "[/P]":
                    if ($sign == "]") {
                        $ausgabewert = "<p>" . $tagwert . "</p>";
                        $replace = str_replace($opentag . $tagwert . $closetag, $ausgabewert, $replace);
                    } else {
                        $tagwerte = explode("]", $tagwert, 2);
                        $pwerte = explode(";", $tagwerte[0]);
                        $extrawerte = explode(":", $pwerte[0]);
                        if ($extrawerte[1] != "") {
                            $pwerte[0] = $extrawerte[1];
                        }
                        if ($extrawerte[0] == "id") {
                            $art = "id";
                        } else {
                            $art = "class";
                        }
                        $attrib = "";
                        if ($pwerte[0] != "") {
                            $attrib = " " . $art . "=\"" . $pwerte[0] . "\"";
                        }
                        $replace = str_replace($opentag . $tagwert . $closetag, "<p" . $attrib . ">" . $tagwerte[1] . "</p>", $replace);
                    }
                    break;
                case "[/BR]":
                    if ($sign == "]") {
                        $replace = str_replace($opentag . $tagwert . $closetag, "<br />", $replace);
                    } else {
                        $tagwerte = explode("]", $tagwert, 2);
                        $brwerte = explode(";", $tagwerte[0]);
                        if ($brwerte[0] == "a") {
                            $clear = "all";
                        } elseif ($brwerte[0] == "l") {
                            $clear = "left";
                        } elseif ($brwerte[0] == "r") {
                            $clear = "right";
                        } else {
                            $clear = "";
                        }
                        if ($clear != "") {
                            $clear = " clear=\"" . $clear . "\"";
                        }
                        $replace = str_replace($opentag . $tagwert . $closetag, "<br " . $clear . "/>", $replace);
                    }
                    break;
                case "[/SP]":
                    $replace = str_replace($opentag . $tagwert . $closetag, "&nbsp;", $replace);
                    break;
                case "[/LIST]":
                    if ($sign == "]") {
                        $tagwerte = explode("[*]", $tagwert);
                        $ausgabewert = "<ul>";
                        while (list($key, $punkt) = each($tagwerte)) {
                            $ausgabewert .= "<li><span>" . $punkt . "</span></li>";
                        }
                        $ausgabewert .= "</ul>";
                        $replace = str_replace($opentag . $tagwert . $closetag, $ausgabewert, $replace);
                    } else {
                        $tagrestbeg = strpos($tagwert, "]");
                        $listart = substr($tagwert, 0, $tagrestbeg);
                        $tagrest = substr($tagwert, $tagrestbeg + 1);
                        $tagwerte = explode("[*]", $tagrest);
                        if ($listart == 1) {
                            $ausgabewert = "<ol>";
                            while (list($key, $punkt) = each($tagwerte)) {
                                $ausgabewert .= "<li><span>" . $punkt . "</span></li>";
                            }
                            $ausgabewert .= "</ol>";
                        } elseif ($listart == "DEF") {
                            $ausgabewert = "<dl>";
                            while (list($key, $punkt) = each($tagwerte)) {
                                if ($key % 2 != 0) {
                                    $ausgabewert .= "<dd>" . $punkt . "</dd>";
                                } else {
                                    $ausgabewert .= "<dt>" . $punkt . "</dt>";
                                }
                            }
                            $ausgabewert .= "</dl>";
                        } else {
                            if (strlen($listart) > 1) {
                                $ausgabewert = "<ul type=\"" . $listart . "\">";
                            } else {
                                $ausgabewert = "<ol type=\"" . $listart . "\">";
                            }
                            while (list($key, $punkt) = each($tagwerte)) {
                                $ausgabewert .= "<li><span>" . $punkt . "</span></li>";
                            }
                            if (strlen($listart) > 1) {
                                $ausgabewert .= "</ul>";
                            } else {
                                $ausgabewert .= "</ol>";
                            }
                        }
                        $replace = str_replace($opentag . $tagwert . $closetag, $ausgabewert, $replace);
                    }
                    break;
                case "[/LINK]":
                    if ($sign == "]") {
                        $ausgabewert = "<a href=\"" . $tagwert . "\">" . $tagwert . "</a>";
                        $replace = str_replace($opentag . $tagwert . $closetag, $ausgabewert, $replace);
                    } else {
                        $tagwerte = explode("]", $tagwert, 2);
                        $pos = strrpos($tagwerte[0], ";");
                        if ($pos >= 1) {
                            $target = substr($tagwerte[0], $pos + 1);
                            $href = substr($tagwerte[0], 0, $pos);
                            $target = " target=\"" . $target . "\"";
                        } else {
                            $target = "";
                            $href = $tagwerte[0];
                        }
                        if ($tagwerte[1] == "") {
                            $beschriftung = $href;
                        } else {
                            $beschriftung = $tagwerte[1];
                        }
                        $ausgabewert = "<a href=\"" . $href . "\"" . $target . ">" . $beschriftung . "</a>";
                        $replace = str_replace($opentag . $tagwert . $closetag, $ausgabewert, $replace);
                    }
                    break;
                case "[/ANK]":
                    if ($sign == "]") {
                        $ausgabewert = "<a name=\"" . $tagwert . "\"></a>";
                        $replace = str_replace($opentag . $tagwert . $closetag, $ausgabewert, $replace);
                    } else {
                        $tagwerte = explode("]", $tagwert, 2);
                        $ausgabewert = "<a name=\"" . $tagwerte[0] . "\">" . $tagwerte[1] . "</a>";
                        $replace = str_replace($opentag . $tagwert . $closetag, $ausgabewert, $replace);
                    }
                    break;
                case "[/EMAIL]":
                    if ($sign == "]") {
                        $ausgabewert = "<a href=\"mailto:" . $tagwert . "\">" . $tagwert . "</a>";
                        $replace = str_replace($opentag . $tagwert . $closetag, $ausgabewert, $replace);
                    } else {
                        $tagwerte = explode("]", $tagwert, 2);
                        if ($tagwerte[1] == "") {
                            $beschriftung = $tagwerte[0];
                        } else {
                            $beschriftung = $tagwerte[1];
                        }
                        $ausgabewert = "<a href=\"mailto:" . $tagwerte[0] . "\">" . $beschriftung . "</a>";
                        $replace = str_replace($opentag . $tagwert . $closetag, $ausgabewert, $replace);
                    }
                    break;
                case "[/IMG]":
                    if ($sign == "]") {
                        if (!strstr($tagwert, "/")) {
                            $imgfile = $pathvars["fileroot"] . "images/" . $environment["design"] . "/" . $tagwert;
                            if (file_exists($imgfile)) {
                                $imgsize = getimagesize($imgfile);
                                $imgsize = " " . $imgsize[3];
                                $imgurl = $pathvars["images"] . $tagwert;
                            }
                        } else {
                            $imgurl = $tagwert;
                            if (!strstr($tagwert, "http")) {
                                if (strpos($tagwert, $pathvars["filebase"]["pic"]["root"]) === false) {
                                    $opt = explode("/", $tagwert);
                                    $imgfile = $pathvars["filebase"]["maindir"] . $pathvars["filebase"]["pic"]["root"] . $pathvars["filebase"]["pic"][$opt[4]] . "img_" . $opt[3] . "." . $opt[2];
                                } elseif (strstr($tagwert, $pathvars["filebase"]["webdir"])) {
                                    $imgfile = str_replace($pathvars["filebase"]["webdir"], "", $tagwert);
                                    $imgfile = $pathvars["filebase"]["maindir"] . $imgfile;
                                } else {
                                    $imgfile = $pathvars["fileroot"] . $tagwert;
                                }
                                if (file_exists($imgfile)) {
                                    $imgsize = getimagesize($imgfile);
                                    $imgsize = " " . $imgsize[3];
                                } else {
                                    $imgsize = "";
                                }
                            }
                        }
                        $ausgabewert = "<img src=\"" . $imgurl . "\" title=\"" . $tagwert . "\" alt=\"" . $tagwert . "\"" . $imgsize . " />";
                        $replace = str_replace($opentag . $tagwert . $closetag, $ausgabewert, $replace);
                    } else {
                        $tagwerte = explode("]", $tagwert, 2);
                        $imgwerte = explode(";", $tagwerte[0]);
                        $extrawerte = explode(":", $imgwerte[1]);
                        if ($extrawerte[1] != "") {
                            $imgwerte[1] = $extrawerte[1];
                        }
                        if ($extrawerte[0] == "id") {
                            $art = "id";
                        } else {
                            $art = "class";
                        }
                        $align = "";
                        $attrib = "";
                        if ($imgwerte[1] == "r") {
                            $align = " align=\"right\"";
                        } elseif ($imgwerte[1] == "l") {
                            $align = " align=\"left\"";
                        } elseif ($imgwerte[1] != "") {
                            $attrib = " " . $art . "=\"" . $imgwerte[1] . "\"";
                        }
                        if ($imgwerte[2] == "0") {
                            $border = " border=\"0\"";
                        } elseif ($imgwerte[2] > 0) {
                            $border = " border=\"" . $imgwerte[2] . "\"";
                        } else {
                            $border = "";
                        }
                        if ($imgwerte[4] == "") {
                            $vspace = "";
                        } else {
                            $vspace = " vspace=\"" . $imgwerte[4] . "\"";
                        }
                        if ($imgwerte[6] == "") {
                            $hspace = "";
                        } else {
                            $hspace = " hspace=\"" . $imgwerte[6] . "\"";
                        }
                        if ($tagwerte[1] == "") {
                            $beschriftung = $imgwerte[0];
                        } else {
                            $beschriftung = $tagwerte[1];
                        }
                        $linka = "";
                        $linkb = "";
                        if (!strstr($imgwerte[0], "/")) {
                            $imgfile = $pathvars["fileroot"] . "images/" . $environment["design"] . "/" . $imgwerte[0];
                            if (file_exists($imgfile)) {
                                $imgsize = getimagesize($imgfile);
                                $imgsize = " " . $imgsize[3];
                                $imgurl = $pathvars["images"] . $imgwerte[0];
                            } else {
                                $imgsize = "";
                            }
                        } else {
                            $imgurl = $imgwerte[0];
                            if (!strstr($imgwerte[0], "http")) {
                                if (strpos($imgwerte[0], $pathvars["filebase"]["pic"]["root"]) === false) {
                                    $opt = explode("/", $imgwerte[0]);
                                    $imgfile = $pathvars["filebase"]["maindir"] . $pathvars["filebase"]["pic"]["root"] . $pathvars["filebase"]["pic"][$opt[4]] . "img_" . $opt[3] . "." . $opt[2];
                                } elseif (strstr($imgwerte[0], $pathvars["filebase"]["webdir"])) {
                                    $imgfile = str_replace($pathvars["filebase"]["webdir"], "", $imgwerte[0]);
                                    $imgfile = $pathvars["filebase"]["maindir"] . $imgfile;
                                } else {
                                    $imgfile = $pathvars["fileroot"] . $imgwerte[0];
                                }
                                if (file_exists($imgfile)) {
                                    $imgsize = getimagesize($imgfile);
                                    $imgsize = " " . $imgsize[3];
                                }
                                if ($imgwerte[7] != "") {
                                    $bilderstrecke = "," . $imgwerte[7];
                                } else {
                                    $bilderstrecke = "";
                                }
                                if ($imgwerte[3] != "") {
                                    if (strpos($imgurl, $pathvars["filebase"]["pic"]["root"]) === false) {
                                        $opt = explode("/", $imgurl);
                                        $imgid = $opt[3];
                                    } else {
                                        $opt = split("[_.]", $imgurl);
                                        $imgid = $opt[1];
                                    }
                                    $path = dirname($pathvars["requested"]);
                                    if (substr($path, -1) != '/') {
                                        $path = $path . "/";
                                    }
                                    $imglnk = $path . basename($pathvars["requested"], ".html") . "/view," . $imgwerte[3] . "," . $imgid . $bilderstrecke . ".html";
                                    $linka = "<a href=\"" . $imglnk . "\">";
                                    $linkb = "</a>";
                                }
                            } else {
                                $imgsize = "";
                            }
                        }
                        $ausgabewert = $linka . "<img src=\"" . $imgurl . "\"" . $attrib . $vspace . $hspace . " title=\"" . $beschriftung . "\" alt=\"" . $beschriftung . "\"" . $align . $border . $imgsize . " />" . $linkb;
                        $replace = str_replace($opentag . $tagwert . $closetag, $ausgabewert, $replace);
                    }
                    break;
                case "[/IMGB]":
                    $tagwerte = explode("]", $tagwert, 2);
                    $imgwerte = explode(";", $tagwerte[0]);
                    $extrawerte = explode(":", $imgwerte[1]);
                    if ($extrawerte[1] != "") {
                        $imgwerte[1] = $extrawerte[1];
                    }
                    $ausgaben["align"] = "";
                    $lspace = "";
                    $rspace = "";
                    $ausgaben["imgstyle"] = "";
                    // "id" or "class" wird im template gesetzt (!#ausgaben_imgstyle)
                    if ($imgwerte[1] == "r") {
                        $ausgaben["align"] = "right";
                        if ($imgwerte[6] == "") {
                            $lspace = "10";
                        } else {
                            $lspace = $imgwerte[6];
                        }
                        $rspace = "0";
                    } elseif ($imgwerte[1] == "l") {
                        $ausgaben["align"] = "left";
                        $lspace = "0";
                        if ($imgwerte[6] == "") {
                            $rspace = "10";
                        } else {
                            $rspace = $imgwerte[6];
                        }
                    } elseif ($imgwerte[1] != "") {
                        $ausgaben["imgstyle"] = $imgwerte[1];
                    }
                    if ($imgwerte[2] == "0") {
                        $ausgaben["border"] = " border=\"0\"";
                    } elseif ($imgwerte[2] > 0) {
                        $ausgaben["border"] = " border=\"" . $imgwerte[2] . "\"";
                    } else {
                        $ausgaben["border"] = "";
                    }
                    if ($imgwerte[4] == "") {
                        $tspace = "0";
                    } else {
                        $tspace = $imgwerte[4];
                    }
                    if ($imgwerte[5] == "") {
                        $bspace = "0";
                    } else {
                        $bspace = $imgwerte[5];
                    }
                    if ($tagwerte[1] == "") {
                        $beschriftung = $imgwerte[0];
                    } else {
                        $beschriftung = $tagwerte[1];
                    }
                    $ausgaben["linka"] = "";
                    $ausgaben["linkb"] = "";
                    if (strpos($imgwerte[0], "/") === false) {
                        $imgfile = $pathvars["fileroot"] . "images/" . $environment["design"] . "/" . $imgwerte[0];
                        if (file_exists($imgfile)) {
                            $imgsize = getimagesize($imgfile);
                            $ausgaben["imgsize"] = " " . $imgsize[3];
                            $ausgaben["imgurl"] = $pathvars["images"] . $imgwerte[0];
                        }
                    } else {
                        $imgurl = $imgwerte[0];
                        if (strpos($imgurl, "http") === false) {
                            if (strpos($imgwerte[0], $pathvars["filebase"]["pic"]["root"]) === false) {
                                $opt = explode("/", $imgurl);
                                $imgfile = $pathvars["filebase"]["maindir"] . $pathvars["filebase"]["pic"]["root"] . $pathvars["filebase"]["pic"][$opt[4]] . "img_" . $opt[3] . "." . $opt[2];
                            } elseif (strpos($imgurl, $pathvars["filebase"]["webdir"]) !== false) {
                                $imgfile = $pathvars["filebase"]["maindir"] . str_replace($pathvars["filebase"]["webdir"], "", $imgurl);
                            } else {
                                $imgfile = $pathvars["fileroot"] . $imgwerte[0];
                            }
                            if (file_exists($imgfile)) {
                                $imgsize = getimagesize($imgfile);
                                $ausgaben["tabwidth"] = $imgsize[0];
                                $ausgaben["imgsize"] = " " . $imgsize[3];
                            } else {
                                $ausgaben["tabwidth"] = "";
                                $ausgaben["imgsize"] = "";
                            }
                            if ($imgwerte[7] != "") {
                                $bilderstrecke = "," . $imgwerte[7];
                            } else {
                                $bilderstrecke = "";
                            }
                            if ($imgwerte[3] != "") {
                                if (strpos($imgurl, $pathvars["filebase"]["pic"]["root"]) === false) {
                                    $opt = explode("/", $imgurl);
                                    $imgid = $opt[3];
                                } else {
                                    $opt = split("[_.]", $imgurl);
                                    $imgid = $opt[1];
                                }
                                if (substr($pathvars["requested"], 0, 1) == '/') {
                                    $path = substr($pathvars["requested"], 1);
                                }
                                $path = dirname($pathvars["requested"]);
                                if (substr($path, -1) != '/') {
                                    $path = $path . "/";
                                }
                                $imglnk = $path . basename($pathvars["requested"], ".html") . "/view," . $imgwerte[3] . "," . $imgid . $bilderstrecke . ".html";
                                $ausgaben["linka"] = "<a href=\"" . $imglnk . "\">";
                                $ausgaben["linkb"] = "</a>";
                            } else {
                                $ausgaben["linka"] = "";
                                $ausgaben["linkb"] = "";
                            }
                        }
                        $ausgaben["imgurl"] = $imgurl;
                    }
                    $ausgaben["alt"] = $beschriftung;
                    $ausgaben["beschriftung"] = $beschriftung;
                    $ausgaben["tspace"] = $tspace;
                    $ausgaben["lspace"] = $lspace;
                    $ausgaben["rspace"] = $rspace;
                    $ausgaben["bspace"] = $bspace;
                    $ausgabewert = str_replace(chr(13) . chr(10), "", parser("imgb", ""));
                    $replace = str_replace($opentag . $tagwert . $closetag, $ausgabewert, $replace);
                    break;
                case "[/DIV]":
                    if ($sign == "]") {
                        $ausgabewert = "<div>" . $tagwert . "</div>";
                        $replace = str_replace($opentag . $tagwert . $closetag, $ausgabewert, $replace);
                    } else {
                        $tagwerte = explode("]", $tagwert, 2);
                        $divwerte = explode(";", $tagwerte[0]);
                        $extrawerte = explode(":", $divwerte[0]);
                        if ($extrawerte[1] != "") {
                            $divwerte[0] = $extrawerte[1];
                        }
                        if ($extrawerte[0] == "id") {
                            $art = "id";
                        } else {
                            $art = "class";
                        }
                        $attrib = "";
                        if ($divwerte[0] != "") {
                            $attrib = " " . $art . "=\"" . $divwerte[0] . "\"";
                        }
                        $replace = str_replace($opentag . $tagwert . $closetag, "<div" . $attrib . ">" . $tagwerte[1] . "</div>", $replace);
                    }
                    break;
                case "[/TAB]":
                    if ($sign == "]") {
                        $replace = str_replace($opentag . $tagwert . $closetag, "<table cellspacing=\"0\" cellpadding=\"1\">" . $tagwert . "</table>", $replace);
                    } else {
                        $tagwerte = explode("]", $tagwert, 2);
                        $tabwerte = explode(";", $tagwerte[0]);
                        if ($tabwerte[0] == "l") {
                            $align = " align=\"left\"";
                        } elseif ($tabwerte[0] == "m") {
                            $align = " align=\"center\"";
                        } elseif ($tabwerte[0] == "r") {
                            $align = " align=\"right\"";
                        } else {
                            $align = "";
                        }
                        if ($tabwerte[1] != "") {
                            $width = " width=\"" . $tabwerte[1] . "\"";
                        }
                        if ($tabwerte[2] != "") {
                            $border = " border=\"" . $tabwerte[2] . "\"";
                        }
                        if ($tabwerte[3] != "") {
                            $cellspacing = " cellspacing=\"" . $tabwerte[3] . "\"";
                        } else {
                            $cellspacing = " cellspacing=\"0\"";
                        }
                        if ($tabwerte[4] != "") {
                            $cellpadding = " cellpadding=\"" . $tabwerte[4] . "\"";
                        } else {
                            $cellpadding = " cellpadding=\"1\"";
                        }
                        $replace = str_replace($opentag . $tagwert . $closetag, "<table" . $cellspacing . $cellpadding . $width . $align . $border . ">" . $tagwerte[1] . "</table>", $replace);
                        $replace = tagreplace($replace);
                    }
                    break;
                case "[/ROW]":
                    $replace = str_replace($opentag . $tagwert . $closetag, "<tr>" . $tagwert . "</tr>", $replace);
                    break;
                case "[/COL]":
                    if ($sign == "]") {
                        $replace = str_replace($opentag . $tagwert . $closetag, "<td valign=\"top\">" . $tagwert . "</td>", $replace);
                    } else {
                        $tagwerte = explode("]", $tagwert, 2);
                        $colwerte = explode(";", $tagwerte[0]);
                        if ($colwerte[0] == "l") {
                            $align = " align=\"left\"";
                        } elseif ($colwerte[0] == "m") {
                            $align = " align=\"center\"";
                        } elseif ($colwerte[0] == "r") {
                            $align = " align=\"right\"";
                        } else {
                            $align = "";
                        }
                        if ($colwerte[1] != "") {
                            $width = " width=\"" . $colwerte[1] . "\"";
                        }
                        if ($colwerte[2] == "o") {
                            $valign = " valign=\"top\"";
                        } elseif ($colwerte[2] == "m") {
                            $valign = " valign=\"middle\"";
                        } elseif ($colwerte[2] == "u") {
                            $valign = " valign=\"bottom\"";
                        } elseif ($colwerte[2] == "g") {
                            $valign = " valign=\"baseline\"";
                        } else {
                            $valign = " valign=\"top\"";
                        }
                        $replace = str_replace($opentag . $tagwert . $closetag, "<td" . $align . $width . $valign . ">" . $tagwerte[1] . "</td>", $replace);
                    }
                    break;
                case "[/H1]":
                    if ($defaults["tag"]["h1"] == "") {
                        $defaults["tag"]["h1"] = "<h1>";
                        $defaults["tag"]["/h1"] = "</h1>";
                    }
                    $replace = str_replace($opentag . $tagwert . $closetag, $defaults["tag"]["h1"] . $tagwert . $defaults["tag"]["/h1"], $replace);
                    break;
                case "[/H2]":
                    if ($defaults["tag"]["h2"] == "") {
                        $defaults["tag"]["h2"] = "<h2>";
                        $defaults["tag"]["/h2"] = "</h2>";
                    }
                    $replace = str_replace($opentag . $tagwert . $closetag, $defaults["tag"]["h2"] . $tagwert . $defaults["tag"]["/h2"], $replace);
                    break;
                case "[/H3]":
                    if ($defaults["tag"]["h3"] == "") {
                        $defaults["tag"]["h3"] = "<h3>";
                        $defaults["tag"]["/h3"] = "</h3>";
                    }
                    $replace = str_replace($opentag . $tagwert . $closetag, $defaults["tag"]["h3"] . $tagwert . $defaults["tag"]["/h3"], $replace);
                    break;
                case "[/H4]":
                    if ($defaults["tag"]["h4"] == "") {
                        $defaults["tag"]["h4"] = "<h4>";
                        $defaults["tag"]["/h4"] = "</h4>";
                    }
                    $replace = str_replace($opentag . $tagwert . $closetag, $defaults["tag"]["h4"] . $tagwert . $defaults["tag"]["/h4"], $replace);
                    break;
                case "[/H5]":
                    if ($defaults["tag"]["h5"] == "") {
                        $defaults["tag"]["h5"] = "<h5>";
                        $defaults["tag"]["/h5"] = "</h5>";
                    }
                    $replace = str_replace($opentag . $tagwert . $closetag, $defaults["tag"]["h5"] . $tagwert . $defaults["tag"]["/h5"], $replace);
                    break;
                case "[/H6]":
                    if ($defaults["tag"]["h6"] == "") {
                        $defaults["tag"]["h6"] = "<h6>";
                        $defaults["tag"]["/h6"] = "</h6>";
                    }
                    $replace = str_replace($opentag . $tagwert . $closetag, $defaults["tag"]["h6"] . $tagwert . $defaults["tag"]["/h6"], $replace);
                    break;
                case "[/HR]":
                    if ($defaults["tag"]["hr"] == "") {
                        $defaults["tag"]["hr"] = "<hr />";
                        $defaults["tag"]["/hr"] = "";
                    }
                    $replace = str_replace($opentag . $tagwert . $closetag, $defaults["tag"]["hr"] . $tagwert . $defaults["tag"]["/hr"], $replace);
                    break;
                case "[/HL]":
                    if ($defaults["tag"]["hl"] == "") {
                        $defaults["tag"]["hl"] = "<hr />";
                        $defaults["tag"]["/hl"] = "";
                    }
                    $replace = str_replace($opentag . $tagwert . $closetag, $defaults["tag"]["hl"] . $tagwert . $defaults["tag"]["/hl"], $replace);
                    break;
                case "[/IN]":
                    if ($defaults["tag"]["in"] == "") {
                        $defaults["tag"]["in"] = "<em>";
                        $defaults["tag"]["/in"] = "</em>";
                    }
                    $replace = str_replace($opentag . $tagwert . $closetag, $defaults["tag"]["in"] . $tagwert . $defaults["tag"]["/in"], $replace);
                case "[/M1]":
                    if ($sign == "]") {
                        if ($tagwert == "") {
                            $label = " .. ";
                        } else {
                            $label = $tagwert;
                        }
                        if ($ausgaben["M1"] != "") {
                            $trenner = $defaults["split"]["m1"];
                        } else {
                            $trenner = "";
                        }
                        $m1 = "<a class=\"menu_punkte\" href=\"" . $ausgaben["UP"] . "\">" . $label . "</a>" . $trenner . $ausgaben["M1"];
                        $replace = str_replace($opentag . $tagwert . $closetag, $m1, $replace);
                    } else {
                        $tagwerte = explode("]", $tagwert, 2);
                        $m1werte = explode(";", $tagwerte[0]);
                        if ($tagwerte[1] == "") {
                            $label = " .. ";
                        } else {
                            $label = $tagwerte[1];
                        }
                        if ($m1werte[0] == "l") {
                            $m1 = "";
                            if ($m1werte[1] == "b") {
                                $m1 = $defaults["split"]["l1"] . "<a class=\"menu_punkte\" href=\"" . $ausgaben["UP"] . "\">" . $label . "</a><br />";
                            }
                            $m1 .= $ausgaben["L1"];
                        } else {
                            $m1 = "";
                            if ($m1werte[1] == "b") {
                                if ($ausgaben["M1"] != "") {
                                    $trenner = $defaults["split"]["m1"];
                                } else {
                                    $trenner = "";
                                }
                                $m1 = "<a class=\"menu_punkte\" href=\"" . $ausgaben["UP"] . "\">" . $label . "</a>" . $trenner;
                            }
                            $m1 .= $ausgaben["M1"];
                        }
                        $replace = str_replace($opentag . $tagwert . $closetag, $m1, $replace);
                    }
                    break;
                case "[/M2]":
                    if ($sign == "]") {
                        if ($tagwert == "") {
                            $label = " .. ";
                        } else {
                            $label = $tagwert;
                        }
                        if ($ausgaben["M2"] != "") {
                            $trenner = $defaults["split"]["m2"];
                        } else {
                            $trenner = "";
                        }
                        $m2 = "<a class=\"menu_punkte\" href=\"" . $ausgaben["UP"] . "\">" . $label . "</a>" . $trenner . $ausgaben["M2"];
                        $replace = str_replace($opentag . $tagwert . $closetag, $m2, $replace);
                    } else {
                        $tagwerte = explode("]", $tagwert, 2);
                        $m2werte = explode(";", $tagwerte[0]);
                        if ($tagwerte[1] == "") {
                            $label = " .. ";
                        } else {
                            $label = $tagwerte[1];
                        }
                        if ($m2werte[0] == "l") {
                            $m2 = "";
                            if ($m2werte[1] == "b") {
                                $m2 = $defaults["split"]["l2"] . "<a class=\"menu_punkte\" href=\"" . $ausgaben["UP"] . "\">" . $label . "</a><br />";
                            }
                            $m2 .= $ausgaben["L2"];
                        } else {
                            $m2 = "";
                            if ($m2werte[1] == "b") {
                                if ($ausgaben["M2"] != "") {
                                    $trenner = $defaults["split"]["m2"];
                                } else {
                                    $trenner = "";
                                }
                                $m2 = "<a class=\"menu_punkte\" href=\"" . $ausgaben["UP"] . "\">" . $label . "</a>" . $trenner;
                            }
                            $m2 .= $ausgaben["M2"];
                        }
                        $replace = str_replace($opentag . $tagwert . $closetag, $m2, $replace);
                    }
                    break;
                case "[/UP]":
                    if ($tagwert == "") {
                        $label = " .. ";
                    } else {
                        $label = $tagwert;
                    }
                    $up = "<a class=\"menu_punkte\" href=\"" . $ausgaben["UP"] . "\">" . $label . "</a>";
                    $replace = str_replace($opentag . $tagwert . $closetag, $up, $replace);
                    break;
                case "[/M3]":
                    $replace = str_replace($opentag . $tagwert . $closetag, $ausgaben["M3"], $replace);
                    break;
                default:
                    // unbekannte tags verstecken
                    $replace = str_replace($closetag, "[##" . substr($closetag, 1), $replace);
            }
        }
    }
    // unbekannte tags wiederherstellen
    $replace = str_replace("[##/", "[/", $replace);
    return $replace;
}
コード例 #14
0
 / der extra parameter in der aktion url und
 / die if abfrage die den save verhindert
 / hat mir nicht gefallen!
 */
 if ($HTTP_POST_VARS["PREVIEW"]) {
     $hidedata["preview"]["content"] = "#(preview)";
     $preview = intelilink($HTTP_POST_VARS["content"]);
     $preview = tagreplace($preview);
     $hidedata["preview"]["content"] .= nlreplace($preview);
     $form_values["content"] = $HTTP_POST_VARS["content"];
 }
 // convert tag 2 html
 switch ($environment["parameter"][5]) {
     case "html":
         // content nach html wandeln
         $form_values["content"] = tagreplace($form_values["content"]);
         // intelligenten link tag bearbeiten
         $form_values["content"] = intelilink($form_values["content"]);
         // newlines nach br wandeln
         $form_values["content"] = nlreplace($form_values["content"]);
         // html db value aendern
         $form_values["html"] = -1;
         break;
     case "tag":
         // content nach cmstag wandeln
         ###
         // html db value aendern
         $form_values["html"] = 0;
         break;
     default:
         $form_values["html"] = 0;
コード例 #15
0
        }
    }
    //
    // Details anzeigen
    //
} elseif ($environment[kategorie] == "details") {
    $sql = "SELECT * FROM " . $logbuch_entries . " WHERE lid='" . $environment[parameter][1] . "'";
    $result = $db->query($sql);
    $field = $db->fetch_array($result, $nop);
    foreach ($field as $name => $value) {
        $ausgaben[$name] = $value;
    }
    $ldate = $ausgaben[ldate];
    $ausgaben[ldate] = substr($ldate, 8, 2) . "." . substr($ldate, 5, 2) . "." . substr($ldate, 0, 4) . " " . substr($ldate, 11, 9);
    $ausgaben[ldetail] = nlreplace($ausgaben[ldetail]);
    $ausgaben[ldetail] = tagreplace($ausgaben[ldetail]);
    $ausgaben[navigation] .= "<a href=\"" . $_SERVER["HTTP_REFERER"] . "\"><img src=\"" . $pathvars[images] . "/left.gif\" border=\"0\" alt=\"Zurück\" title=\"Zurück\" width=\"24\" height=\"18\"></a>";
    $ausgaben[navigation] .= "<a href=\"" . $environment[basis] . "/modify,edit," . $environment[parameter][1] . ".html\"><img src=\"" . $pathvars[images] . "/edit.gif\" border=\"0\" alt=\"Bearbeiten\" title=\"Bearbeiten\" width=\"24\" height=\"18\"></a>";
    $mapping[main] = crc32($environment[ebene]) . ".details";
    //
    // Liste anzeigen
    //
} elseif ($environment[kategorie] == "logbuch" || $environment[kategorie] == "list") {
    $position = $environment[parameter][1] + 0;
    // Suche
    $ausgaben[form_aktion] = $environment[basis] . "/list," . $position . ",search.html";
    if ($environment[parameter][2] == "search") {
        if ($HTTP_POST_VARS[search] != "") {
            $search_value = $HTTP_POST_VARS[search];
        } else {
            $search_value = $environment[parameter][3];
コード例 #16
0
    }
    //
    // Details anzeigen
    //
} elseif ($environment["kategorie"] == "details") {
    $sql = "SELECT * FROM " . $db_entries . " WHERE " . $db_entries_key . "='" . $environment["parameter"][1] . "'";
    $result = $db->query($sql);
    $field = $db->fetch_array($result, $nop);
    foreach ($field as $name => $value) {
        $ausgaben[$name] = $value;
    }
    // ausgaben erweitern
    $ndatum = $ausgaben["ndatum"];
    $ausgaben["ndatum"] = substr($ndatum, 8, 2) . "." . substr($ndatum, 5, 2) . "." . substr($ndatum, 0, 4) . " " . substr($ndatum, 11, 9);
    $ausgaben["nbeschreibung"] = nlreplace($ausgaben["nbeschreibung"]);
    $ausgaben["nbeschreibung"] = tagreplace($ausgaben["nbeschreibung"]);
    $ausgaben["navigation"] .= "<a href=\"" . $_SERVER["HTTP_REFERER"] . "\"><img src=\"" . $pathvars["images"] . "left.png\" border=\"0\" alt=\"Zurück\" title=\"Zurück\" width=\"24\" height=\"18\"></a>";
    if ($rechte["sti"] == -1) {
        $ausgaben["navigation"] .= "<a href=\"" . $environment["basis"] . "/modify,edit," . $environment["parameter"][1] . ".html\"><img src=\"" . $pathvars["images"] . "edit.png\" border=\"0\" alt=\"Bearbeiten\" title=\"Bearbeiten\" width=\"24\" height=\"18\"></a>";
    }
    $mapping["main"] = crc32($environment["ebene"]) . ".details";
    //
    // Liste anzeigen
    //
} elseif ($environment["kategorie"] == "list" || $environment["kategorie"] == $environment["name"]) {
    $position = $environment["parameter"][1] + 0;
    // Suche
    $ausgaben["form_aktion"] = $environment["basis"] . "/list," . $position . ",search.html";
    $ausgaben["search"] = $HTTP_POST_VARS["search"];
    if ($HTTP_POST_VARS["search"] != "") {
        $ausgaben["result"] = "Ihre Schnellsuche nach \"" . $HTTP_POST_VARS["search"] . "\" hat folgende Einträge gefunden:<br><br>";
コード例 #17
0
         $match[1] = $FinalSortArray[$data["fid"]];
     } else {
         preg_match("/#p" . $environment["parameter"][3] . "[,]*([0-9]*)#/i", $data["fhit"], $match);
     }
     $dataloop["thumbs"][] = array("id" => $data["fid"], "sort" => $match[1], "type" => $data["ffart"], "src" => $cfg["file"]["base"]["webdir"] . $data["ffart"] . "/" . $data["fid"] . "/tn/" . $data["ffname"], "link" => $pathvars["virtual"] . $environment["ebene"] . "/view," . $environment["parameter"][1] . "," . $data["fid"] . "," . $environment["parameter"][3] . "," . $environment["parameter"][4] . ".html", "title" => $data["funder"], "bg" => $color);
 }
 if ($data["fid"] == $environment["parameter"][2]) {
     // kontrolle, ob content vorhanden ist
     $ebene = $environment["ebene"] . "/view";
     $kategorie = "desc-" . $environment["parameter"][2];
     $tname = eCRC($ebene) . "." . $kategorie;
     $sql = "SELECT *\n                          FROM site_text\n                         WHERE lang='" . $environment["language"] . "'\n                           AND label='inhalt' AND tname='" . $tname . "'\n                      ORDER BY version DESC LIMIT 0,1";
     $res_content = $db->query($sql);
     $content = $db->fetch_array($res_content, 1);
     if ($content["content"] != "") {
         $ausgaben["beschreibung"] = tagreplace($content["content"]);
     } else {
         $ausgaben["beschreibung"] = $data["fdesc"];
     }
     // rechte-check
     $check = "";
     if ($specialvars["security"]["new"] == -1) {
         $check = $rechte[$specialvars["security"]["content"]];
     } elseif ($specialvars["security"]["enable"] == -1) {
         if ($katzugriff == -1 && $dbzugriff == -1) {
             $check = True;
         }
     } else {
         if ($rechte["cms_edit"] == -1) {
             $check = True;
         }