Folge dem Video um zu sehen, wie unsere Website als Web-App auf dem Startbildschirm installiert werden kann.
Anmerkung: Diese Funktion ist in einigen Browsern möglicherweise nicht verfügbar.
//TEST///
function bb_decode($data) {
$data = htmlspecialchars($data);
$offset = 0;
while(($pos = strpos($data, '[ plain]', $offset)) !== false) {
$end = strpos($data, '[ /plain]', $pos);
if($end === false) break;
$noparse = substr($data, $pos + 9, $end - ($pos + 9));
$noparse = str_replace(array('[', ']'), array('[', ']'), $noparse);
$end += 10;
$data = substr_replace($data, $noparse, $pos, $end - $pos);
$offset = $end;
}
$search[] = '[ b]';
$search[] = '[ /b]';
$search[] = '[ i]';
$search[] = '[ /i]';
$search[] = '[ u]';
$search[] = '[ /u]';
$search[] = '[ /color]';
$search[] = '[ /size]';
$search[] = '[ /font]';
$search[] = '[ code]';
$search[] = '[ /code]';
$replace[] = '<strong>';
$replace[] = '</strong>';
$replace[] = '<i>';
$replace[] = '</i>';
$replace[] = '<u>';
$replace[] = '</u>';
$replace[] = '</font>';
$replace[] = '</font>';
$replace[] = '</font>';
$replace[] = '<span class="highlight">';
$replace[] = '</span>';
$data = str_replace($search, $replace, $data);
$search = array();
$replace = array();
$search[] = '/\[color=(.*?)\]/';
$search[] = '/\[size=(.*?)\]/';
$search[] = '/\[font=(.*?)\]/';
$search[] = '/\[email\](.*?)\[\/email\]/';
$search[] = '/\[email=(.*?)\](.*?)\[\/email\]/';
$search[] = '/\[url\](.*?)\[\/url\]/';
$search[] = '/\[url=(.*?)\](.*?)\[\/url\]/';
$search[] = '/\[img\](.*?)\[\/img\]/';
$replace[] = '<font color="${1}">';
$replace[] = '<font size="${1}">';
$replace[] = '<font face="${1}">';
$replace[] = '<a href="mailto:${1}">${1}</a>';
$replace[] = '<a href="mailto:${1}">${2}</a>';
$replace[] = '<a href="${1}">${1}</a>';
$replace[] = '<a href="${1}">${2}</a>';
$replace[] = '<img src="${1}" />';
$data = preg_replace($search, $replace, $data);
$offset = 0;
while(strpos($data, '[ list]', $offset) !== false) {
$pos = strpos($data, '[ list]', $offset);
$end = strpos($data, '[ /list]', $pos);
if($end === false) break;
$list = trim(substr($data, $pos + 6, $end - ($pos + 6)));
$elements = explode('[*]', $list);
$list = '<ul>';
for($i = 1; $i < count($elements); $i++) {
$list .= '<li>'.nl2br(rtrim($elements[$i])).'</li>';
}
$list .= '</ul>';
$end += 7;
$offset = $end;
$data = substr_replace($data, $list, $pos, $end - $pos);
}
$offset = 0;
while(strpos($data, '[ list=', $offset) !== false) {
$pos = strpos($data, '[list=', $offset);
$pos2 = strpos($data, ']', $pos + 6);
$type = substr($data, $pos + 6, $pos2 - ($pos + 6));
$end = strpos($data, '[ /list]', $pos2);
if($end === false) break;
$list = trim(substr($data, $pos2 + 1, $end - ($pos2 + 1)));
$elements = explode('[*]', $list);
$list = '<ol type="'.$type.'">';
for($i = 1; $i < count($elements); $i++) {
$list .= '<li>'.nl2br(rtrim($elements[$i])).'</li>';
}
$list .= '</ol>';
$end += 7;
$offset = $end;
$data = substr_replace($data, $list, $pos, $end - $pos);
}
$data = nl2br($data);
$offset = 0;
while(($pos = strpos($data, '[ code ]', $offset)) !== false) {
$end = strpos($data, '[ /code ]', $pos);
if($end === false) break;
$code = substr($data, $pos + 6, $end - ($pos + 6));
$strlen = strlen($code) + 13;
$code = '<pre>'.str_replace('', '', $code).'</pre>';
$end += 7;
$offset = $end - ($strlen - strlen($code));
$data = substr_replace($data, $code, $pos, $end - $pos);
}
return $data;
}
<?php
require_once($_SERVER["DOCUMENT_ROOT"] . "/vvvv/XXXX.php");
// require_once($_SERVER["DOCUMENT_ROOT"] . "vvvvv/XXXX.php");
//TEST///
function bb_decode($data) {
$data = htmlspecialchars($data);
$offset = 0;
while(($pos = strpos($data, '[ plain]', $offset)) !== false) {
$end = strpos($data, '[ /plain]', $pos);
if($end === false) break;
$noparse = substr($data, $pos + 9, $end - ($pos + 9));
$noparse = str_replace(array('[', ']'), array('[', ']'), $noparse);
$end += 10;
$data = substr_replace($data, $noparse, $pos, $end - $pos);
$offset = $end;
}
$search[] = '[ b]';
$search[] = '[ /b]';
$search[] = '[ i]';
$search[] = '[ /i]';
$search[] = '[ u]';
$search[] = '[ /u]';
$search[] = '[ /color]';
$search[] = '[ /size]';
$search[] = '[ /font]';
$search[] = '[ code]';
$search[] = '[ /code]';
$replace[] = '<strong>';
$replace[] = '</strong>';
$replace[] = '<i>';
$replace[] = '</i>';
$replace[] = '<u>';
$replace[] = '</u>';
$replace[] = '</font>';
$replace[] = '</font>';
$replace[] = '</font>';
$replace[] = '<span class="highlight">';
$replace[] = '</span>';
$data = str_replace($search, $replace, $data);
$search = array();
$replace = array();
$search[] = '/\[color=(.*?)\]/';
$search[] = '/\[size=(.*?)\]/';
$search[] = '/\[font=(.*?)\]/';
$search[] = '/\[email\](.*?)\[\/email\]/';
$search[] = '/\[email=(.*?)\](.*?)\[\/email\]/';
$search[] = '/\[url\](.*?)\[\/url\]/';
$search[] = '/\[url=(.*?)\](.*?)\[\/url\]/';
$search[] = '/\[img\](.*?)\[\/img\]/';
$replace[] = '<font color="${1}">';
$replace[] = '<font size="${1}">';
$replace[] = '<font face="${1}">';
$replace[] = '<a href="mailto:${1}">${1}</a>';
$replace[] = '<a href="mailto:${1}">${2}</a>';
$replace[] = '<a href="${1}">${1}</a>';
$replace[] = '<a href="${1}">${2}</a>';
$replace[] = '<img src="${1}" />';
$data = preg_replace($search, $replace, $data);
$offset = 0;
while(strpos($data, '[ list]', $offset) !== false) {
$pos = strpos($data, '[ list]', $offset);
$end = strpos($data, '[ /list]', $pos);
if($end === false) break;
$list = trim(substr($data, $pos + 6, $end - ($pos + 6)));
$elements = explode('[*]', $list);
$list = '<ul>';
for($i = 1; $i < count($elements); $i++) {
$list .= '<li>'.nl2br(rtrim($elements[$i])).'</li>';
}
$list .= '</ul>';
$end += 7;
$offset = $end;
$data = substr_replace($data, $list, $pos, $end - $pos);
}
$offset = 0;
while(strpos($data, '[list=', $offset) !== false) {
$pos = strpos($data, '[list=', $offset);
$pos2 = strpos($data, ']', $pos + 6);
$type = substr($data, $pos + 6, $pos2 - ($pos + 6));
$end = strpos($data, '[ /list]', $pos2);
if($end === false) break;
$list = trim(substr($data, $pos2 + 1, $end - ($pos2 + 1)));
$elements = explode('[*]', $list);
$list = '<ol type="'.$type.'">';
for($i = 1; $i < count($elements); $i++) {
$list .= '<li>'.nl2br(rtrim($elements[$i])).'</li>';
}
$list .= '</ol>';
$end += 7;
$offset = $end;
$data = substr_replace($data, $list, $pos, $end - $pos);
}
$data = nl2br($data);
$offset = 0;
while(($pos = strpos($data, '[ code ]', $offset)) !== false) {
$end = strpos($data, '[ /code ]', $pos);
if($end === false) break;
$code = substr($data, $pos + 6, $end - ($pos + 6));
$strlen = strlen($code) + 13;
$code = '<pre>'.str_replace('', '', $code).'</pre>';
$end += 7;
$offset = $end - ($strlen - strlen($code));
$data = substr_replace($data, $code, $pos, $end - $pos);
}
return $data;
}
echo bb_decode($text);
?>
//TEST//
<?
dbconn();
loggedinorreturn();
if ($_POST["a"] == "") $action = "view";
else $action = $_POST["a"];
//if (get_user_class() <= UC_USER)//
//{
// stderr("Error", "Zutritt Verboten ");
// exit;
//}
if (($action != "view") && (get_user_class() != UC_SYSOP))
{
stderr("<b><center><font color=\"red\">Was willst du!</font></center></b>", "<b><center><font color=\"red\">HE Das sind unserre Regel! Da hast du nicht rum zufuschen!!</font></center></b>");
exit;
}
function get_monat($mon)
{
switch($mon)
{
case "01" : return "Januar";
break;
case "02" : return "Februar";
break;
case "03" : return "März";
break;
case "04" : return "April";
break;
case "05" : return "Mai";
break;
case "06" : return "Juni";
break;
case "07" : return "Juli";
break;
case "08" : return "August";
break;
case "09" : return "September";
break;
case "10" : return "Oktober";
break;
case "11" : return "November";
break;
case "12" : return "Dezember";
break;
}
}
function tabelle_start($monat, $jahr)
{
print("<table style=\"width: 750px;\" class=\"tableinborder\" border=\"0\" cellpadding=\"4\" cellspacing=\"1\">\n");
print(" <tr>\n");
print(" <td colspan=\"2\" class=\"tabletitle\"><center><b>.: " . get_monat($monat) . " " . $jahr . " :.</b></center></td>\n");
print(" </tr>\n");
print(" <tr>\n");
print(" <td class=\"tablea\" width=\"100%\">\n");
print(" <table class=\"tableinborder\" style=\"width: 100%;\" cellpadding=\"4\" cellspacing=\"1\">\n");
}
function tab_zeile($datum, $text, $id)
{
$edit = "";
if (get_user_class() == UC_SYSOP)
{
$edit .= "<form action=\"" . $_SERVER[PHP_SELF] . "\" method=\"post\">\n";
$edit .= " <input type=\"hidden\" value=\"" . $id . "\" name=\"id\">\n";
$edit .= " <input type=\"hidden\" value=\"edit\" name=\"a\">\n";
$edit .= " <input type=\"submit\" value=\"Edit\" name=\"go\">\n";
$edit .= "</form>\n";
}
$delete = "";
if (get_user_class() == UC_SYSOP)
{
$delete .= "<form action=\"" . $_SERVER[PHP_SELF] . "\" method=\"post\">\n";
$delete .= " <input type=\"hidden\" value=\"" . $id . "\" name=\"id\">\n";
$delete .= " <input type=\"hidden\" value=\"delete\" name=\"a\">\n";
$delete .= " <input type=\"submit\" value=\"Del\" name=\"go\">\n";
$delete .= "</form>\n";
}
print(" <tr>\n");
print(" <td class=\"tableb\" valign=\"top\" width=\"90\"><b><u>" . $datum . "</u></b><br><br>\n" . $edit . " " . $delete . "</td>\n");
print(" <td class=\"tablea\" valign=\"top\">\n");
print($text . "\n");
print(" </td>\n");
print(" </tr>\n");
}
function tabelle_ende()
{
print(" </table>\n");
print(" </td>\n");
print(" </tr>\n");
print("</table>\n");
print("<br>\n");
}
function trenner($jahr)
{
print("<table style=\"width: 750px;\" class=\"tableinborder\" border=\"0\" cellpadding=\"4\" cellspacing=\"1\">\n");
print(" <tr>\n");
print(" <td class=\"tabletitle\" width=\"100%\"><center><font color=\"red\"><b>.: " . $jahr . " :.</b></font></center></td>\n");
print(" </tr>\n");
print("</table>\n");
print("<br>\n");
}
stdhead("Coder-Logbuch v2.0");
/////////////////////////////////////////
// neuen Eintrag erstellen //
/////////////////////////////////////////
if ($action == "new")
{
$tag = date(d);
$monat = date(m);
$jahr = date(Y);
print("<form action=\"" . $_SERVER[PHP_SELF] . "\" method=\"post\">\n");
print("<table style=\"width: 750px;\" class=\"tableinborder\" border=\"0\" cellpadding=\"4\" cellspacing=\"1\">\n");
print(" <tr>\n");
print(" <td colspan=\"3\" class=\"tabletitle\"><center><b>.: neuen Eintrag erstellen :.</b></center></td>\n");
print(" </tr>\n");
print(" <tr>\n");
print(" <td class=\"tablea\" width=\"33%\">Tag <input type=\"text\" value=\"" . $tag . "\" name=\"tag\"></td>\n");
print(" <td class=\"tablea\" width=\"33%\">Monat <input type=\"text\" value=\"" . $monat . "\" name=\"monat\"></td>\n");
print(" <td class=\"tablea\" width=\"33%\">Jahr <input type=\"text\" value=\"" . $jahr . "\" name=\"jahr\"></td>\n");
print(" </tr>\n");
print(" <tr>\n");
print(" <td class=\"tablea\" width=\"100%\" colspan=\"3\">\n");
print(" Beschreibung:<br><textarea name=\"arbeiten\" cols=\"120\" rows=\"10\"></textarea>\n");
print(" </td>\n");
print(" </tr>\n");
print(" <tr>\n");
print(" <td width=\"100%\" colspan=\"3\" class=\"tabletitle\">\n");
print(" <center>\n");
print(" <input type=\"hidden\" value=\"add\" name=\"a\">\n");
print(" <input type=\"submit\" value=\"hinzufügen\" name=\"go\">\n");
print(" </center>\n");
print(" </td>\n");
print(" </tr>\n");
print("</table>\n");
print("</form>\n");}
/////////////////////////////////////////
// neuen Eintrag einfügen //
/////////////////////////////////////////
if ($action == "add")
{
$tag = htmlentities($_POST["tag"]);
$monat = htmlentities($_POST["monat"]);
$jahr = htmlentities($_POST["jahr"]);
$text = nl2br(htmlentities($_POST["arbeiten"]));
$text = str_replace("'","′",$text);
$t_code = strtotime($tag.".".$monat.".".$jahr);
print("<table style=\"width: 750px;\" class=\"tableinborder\" border=\"0\" cellpadding=\"4\" cellspacing=\"1\">\n");
print(" <tr>\n");
print(" <td width=\"100%\" class=\"tabletitle\"><center><b>.: neuen Eintrag einfügen :.</b></center></td>\n");
print(" </tr>\n");
print(" <tr>\n");
print(" <td width=\"100%\" class=\"tablea\">\n");
$query = "INSERT INTO trackerlog (timecode, tag, monat, jahr, eintrag) VALUES ($t_code, '$tag', '$monat', '$jahr', '$text')";
if (mysql_query($query))
{
print("<font color=\"green\">Erfolgreich</font><br>\n");
print("TimeCode :" . $t_code . "<br>\n");
print("Datum :" . $tag . "." . $monat . "." . $jahr . "<br>\n");
print("Daten :<br>\n");
print($text . "\n");
}
else
{
print("<font color=\"red\">Fehler beim einfügen</font><br>\n");
print("TimeCode :" . $t_code . "<br>\n");
print("Datum :" . $tag . "." . $monat . "." . $jahr . "<br>\n");
print("Daten :<br>\n");
print($text . "\n");
}
print(" </td>\n");
print(" </tr>\n");
print(" <tr>\n");
print(" <td width=\"100%\" class=\"tabletitle\"><center><b><a href=\"" . $_SERVER[PHP_SELF] . "\">weiter ⇒</a></b></center></td>\n");
print(" </tr>\n");
print("</table>\n");
}
/////////////////////////////////
// Eintrag ändern //
/////////////////////////////////
if ($action == "update")
{
$id = intval($_POST["id"]);
$tag = htmlentities($_POST["tag"]);
$monat = htmlentities($_POST["monat"]);
$jahr = htmlentities($_POST["jahr"]);
$text = nl2br(htmlentities($_POST["text_edit"]));
$text = str_replace("'","′",$text);
print("<table style=\"width: 750px;\" class=\"tableinborder\" border=\"0\" cellpadding=\"4\" cellspacing=\"1\">\n");
print(" <tr>\n");
print(" <td width=\"100%\" class=\"tabletitle\"><center><b>.: Eintrag " . $id . " geändert :.</b></center></td>\n");
print(" </tr>\n");
print(" <tr>\n");
print(" <td width=\"100%\" class=\"tablea\">\n");
$query = "UPDATE trackerlog SET tag='$tag', monat='$monat', jahr='$jahr', eintrag='$text' WHERE id='$id'";
if (mysql_query($query))
{
print("<font color=\"green\">Erfolgreich</font><br>\n");
print("Datum :" . $tag . "." . $monat . "." . $jahr . "<br>\n");
print("Daten :<br>\n");
print($text . "\n");
}
else
{
print("<font color=\"red\">Fehler beim ädern der Daten</font><br>\n");
print("Datum :" . $tag . "." . $monat . "." . $jahr . "<br>\n");
print("Daten :<br>\n");
print($text . "\n");
}
print(" </td>\n");
print(" </tr>\n");
print(" <tr>\n");
print(" <td width=\"100%\" class=\"tabletitle\"><center><b><a href=\"" . $_SERVER[PHP_SELF] . "\">weiter ⇒</a></b></center></td>\n");
print(" </tr>\n");
print("</table>\n");
}
////////////////////////////////////
// Eintrag bearbeiten //
////////////////////////////////////
if ($action == "edit")
{
$id = intval($_POST["id"]);
$res = mysql_query("SELECT * FROM trackerlog WHERE id = '$id'");
if ($daten = mysql_fetch_array($res))
{
$text = str_replace("<br />","",$daten[eintrag]);
print("<form action=\"" . $_SERVER[PHP_SELF] . "\" method=\"post\">\n");
print("<table style=\"width: 750px;\" class=\"tableinborder\" border=\"0\" cellpadding=\"4\" cellspacing=\"1\">\n");
print(" <tr>\n");
print(" <td colspan=\"3\" class=\"tabletitle\"><center><b>.: Eintrag " . $id . " bearbeiten :.</b></center></td>\n");
print(" </tr>\n");
print(" <tr>\n");
print(" <td class=\"tablea\" width=\"33%\">Tag <input type=\"text\" value=\"" . $daten[tag] . "\" name=\"tag\"></td>\n");
print(" <td class=\"tablea\" width=\"33%\">Monat <input type=\"text\" value=\"" . $daten[monat] . "\" name=\"monat\"></td>\n");
print(" <td class=\"tablea\" width=\"33%\">Jahr <input type=\"text\" value=\"" . $daten[jahr] . "\" name=\"jahr\"></td>\n");
print(" </tr>\n");
print(" <tr>\n");
print(" <td class=\"tablea\" width=\"100%\" colspan=\"3\">\n");
print(" Beschreibung:<br><textarea name=\"text_edit\" cols=\"120\" rows=\"10\">" . $text . "</textarea>\n");
print(" </td>\n");
print(" </tr>\n");
print(" <tr>\n");
print(" <td width=\"100%\" colspan=\"3\" class=\"tabletitle\">\n");
print(" <center>\n");
print(" <input type=\"hidden\" value=\"" . $id . "\" name=\"id\">\n");
print(" <input type=\"hidden\" value=\"update\" name=\"a\">\n");
print(" <input type=\"submit\" value=\"Ändern\" name=\"go\">\n");
print(" </center>\n");
print(" </td>\n");
print(" </tr>\n");
print("</table>\n");
print("</form>\n");
}
}
/////////////////////////////////////////
// alle Einträge anzeigen //
/////////////////////////////////////////
if ($action == "view")
{
print("<table style=\"width: 750px;\" class=\"tableinborder\" border=\"0\" cellpadding=\"4\" cellspacing=\"1\">\n");
print(" <tr>\n");
print(" <td colspan=\"2\" class=\"tabletitle\"><center><b>.: Allgemeine Regeln :.</b></center></td>\n");
print(" </tr>\n");
print(" <tr>\n");
print(" <td width=\"100%\" class=\"tablea\">\n");
print(" <center>\n");
print(" <font color=\"blue\"><b>Grundlegende Regeln.</b><br>\n");
print(" <b>Hier werden immer die Aktuellsten Reglen stehen!</b><br /><br>\n");
print(" <b>Das Test Team</b>\n");
print(" </font>\n");
print(" </center>\n");
print(" </td>\n");
print(" </tr>\n");
print(" <tr>\n");
print(" <td width=\"100%\" class=\"tabletitle\">\n");
print(" <center>\n");
print(" <form action=\"" . $_SERVER[PHP_SELF] . "\" method=\"post\">\n");
print(" <input type=\"hidden\" value=\"new\" name=\"a\">\n");
print(" <input type=\"submit\" value=\"neuer Eintrag\" name=\"go\">\n");
print(" </form>\n");
print(" </center>\n");
print(" </td>\n");
print(" </tr>\n");
print("</table>\n");
print("<br>\n");
$m = "";
$y = "";
$res = mysql_query("SELECT * FROM trackerlog ORDER BY timecode DESC");
while($daten = mysql_fetch_array($res))
{
if (($y != '') && ($m != ''))
if (($daten[jahr] != $y) || ($daten[monat] != $m))
{
tabelle_ende();
}
$datum = $daten[tag] . "." . $daten[monat] . ".";
if (($daten[jahr] != $y) && ($y != ''))
trenner($y);
if (($daten[jahr] != $y) || ($daten[monat] != $m))
{
$m = $daten[monat];
$y = $daten[jahr];
tabelle_start($daten[monat], $daten[jahr]);
}
tab_zeile($datum, $daten[eintrag], $daten[id]);
}
tabelle_ende();
}
if ($action == "delete")
{
$id = intval($_POST["id"]);
mysql_query("DELETE FROM trackerlog WHERE id = '$id'")or sqlerr();
print("<table style=\"width: 750px;\" class=\"tableinborder\" border=\"0\" cellpadding=\"4\" cellspacing=\"1\">\n");
print(" <tr>\n");
print(" <td width=\"100%\" class=\"tabletitle\"><center><b>.: Gelöscht :.</b></center></td>\n");
print(" </tr>\n");
print(" <tr>\n");
print(" <td width=\"100%\" class=\"tablea\">\n");
print("<font color=\"green\">Erfolgreich</font><br>\n");
print(" </td>\n");
print(" </tr>\n");
print(" <tr>\n");
print(" <td width=\"100%\" class=\"tabletitle\"><center><b><a href=\"" . $_SERVER[PHP_SELF] . "\">weiter ⇒</a></b></center></td>\n");
print(" </tr>\n");
print("</table>\n");
}
stdfoot();
?>