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.
<html>
<head>
<link rel="stylesheet" type="text/css" href="css/style.css">
<title>fastGaming - News</title>
<script type="text/javascript"><!--
function toggle2(obj)
{
if (obj.nextSibling)
{
obj.firstChild.src = (obj.nextSibling.style.display == 'none') ? 'images/catsnip/collapse.gif' : 'images/catsnip/expand.gif';
obj.firstChild.alt = (obj.nextSibling.style.display == 'none') ? 'Minimieren' : 'Maximieren';
obj.nextSibling.style.display = (obj.nextSibling.style.display == 'none') ? 'block' : 'none';
}
}
// --></script>
</head>
function bbcode($text) {
$text = nl2br($text);
$text = str_replace("[ B ]","<b>",$text);
$text = str_replace("[ /B ]","</b>",$text);
$text = str_replace("[ I ]","<i>",$text);
$text = str_replace("[ /I ]","</i>",$text);
$text = str_replace("[ U ]","<u>",$text);
$text = str_replace("[ /U ]","</u>",$text);
$text = eregi_replace("\\[url=([^\\[]*)\\]([^\\[]*)\\[/url\\]","<a href=\"\\1\" target=\"_blank\">\\2</a>",$text);
$text = eregi_replace("\\[url\\]([^\\[]*)\\[/url\\]","<a href=\"\\1\" target=\"_blank\">\\1</a>",$text);
$text = eregi_replace("\\[email=([^\\[]*)\\]([^\\[]*)\\[/email\\]","<a href=\"mailto:\\1\">\\2</a>",$text);
$text = eregi_replace("\\[ img]([^\\[]*)\\[ /img]","<img src=\"\\1\" border=0>",$text);
if (!function_exists(bbcode))
{
function bbcode($s)
{
$bbcode_search[] = "#\[toggle=(.*?)\](.*?)\[/toggle\]#sie";
$bbcode_replace[] = 'bbcode_toggle("$2", "$1")';
$bbcode_search[] = "#\[more=(.*?)\](.*?)\[/more\]#sie";
$bbcode_replace[] = 'bbcode_toggle("$2", "$1")';
$s = preg_replace($bbcode_search, $bbcode_replace, $s);
return $s;
}
}
if (!function_exists(bbcode_toggle))
{
function bbcode_toggle($s, $n = "Toggle")
{
$s = '<a id="toggle" onClick="toggle2(this);" onMouseOver="this.style.cursor=\'hand\';"><img src="images/catsnip/expand.gif" border="0" alt="Maximieren" align="middle" /> '.$n.'</a><div style="display: none">'.$s.'</div>';
return $s;
}
}
function bbcode($text)
function bbcode($s)
function bbcode($text) {
$text = nl2br($text);
$text = str_replace("[ B ]","<b>",$text);
$text = str_replace("[ /B ]","</b>",$text);
$text = str_replace("[ I ]","<i>",$text);
$text = str_replace("[ /I ]","</i>",$text);
$text = str_replace("[ U ]","<u>",$text);
$text = str_replace("[ /U ]","</u>",$text);
$text = eregi_replace("\\[url=([^\\[]*)\\]([^\\[]*)\\[/url\\]","<a href=\"\\1\" target=\"_blank\">\\2</a>",$text);
$text = eregi_replace("\\[url\\]([^\\[]*)\\[/url\\]","<a href=\"\\1\" target=\"_blank\">\\1</a>",$text);
$text = eregi_replace("\\[email=([^\\[]*)\\]([^\\[]*)\\[/email\\]","<a href=\"mailto:\\1\">\\2</a>",$text);
$text = eregi_replace("\\[ img]([^\\[]*)\\[ /img]","<img src=\"\\1\" border=0>",$text);
$bbcode_search[] = "#\[toggle=(.*?)\](.*?)\[/toggle\]#sie";
$bbcode_replace[] = 'bbcode_toggle("$2", "$1")';
$bbcode_search[] = "#\[more=(.*?)\](.*?)\[/more\]#sie";
$bbcode_replace[] = 'bbcode_toggle("$2", "$1")';
$text = preg_replace($bbcode_search, $bbcode_replace, $text);
return $text;
}
if (!function_exists(bbcode_toggle))
{
function bbcode_toggle($s, $n = "Toggle")
{
$s = '<a id="toggle" onClick="toggle2(this);" onMouseOver="this.style.cursor=\'hand\';"><img src="images/catsnip/expand.gif" border="0" alt="Maximieren" align="middle" /> '.$n.'</a><div style="display: none">'.$s.'</div>';
return $s;
}
}
<?php
function bbcode($text)
{
$text = nl2br($text);
$text = str_replace("[ B ]","<b>",$text);
$text = str_replace("[ /B ]","</b>",$text);
$text = str_replace("[ I ]","<i>",$text);
$text = str_replace("[ /I ]","</i>",$text);
$text = str_replace("[ U ]","<u>",$text);
$text = str_replace("[ /U ]","</u>",$text);
$text = eregi_replace("\\[url=([^\\[]*)\\]([^\\[]*)\\[/url\\]","<a href=\"\\1\" target=\"_blank\">\\2</a>",$text);
$text = eregi_replace("\\[url\\]([^\\[]*)\\[/url\\]","<a href=\"\\1\" target=\"_blank\">\\1</a>",$text);
$text = eregi_replace("\\[email=([^\\[]*)\\]([^\\[]*)\\[/email\\]","<a href=\"mailto:\\1\">\\2</a>",$text);
$text = eregi_replace("\\[ img]([^\\[]*)\\[ /img]","<img src=\"\\1\" border=0>",$text);
$text = eregi_replace("\\[toggle=(.*?)\](.*?)\[/toggle\]\sie", '<a id="toggle" onClick="toggle2(this);" onMouseOver="this.style.cursor=\'hand\';"><img src="images/catsnip/expand.gif" border="0" alt="Maximieren" align="middle" /> \\1</a><div style="display: none">\\2</div>', $text);
$text = eregi_replace("\\[more=(.*?)\](.*?)\[/more\]\sie", '<a id="toggle" onClick="toggle2(this);" onMouseOver="this.style.cursor=\'hand\';"><img src="images/catsnip/expand.gif" border="0" alt="Maximieren" align="middle" /> \\1</a><div style="display: none">\\2</div>', $text);
return $text;
}
?>
<html>
<head>
<link rel="stylesheet" type="text/css" href="css/style.css">
<title>fastGaming - News</title>
<script type="text/javascript"><!--
function toggle2(obj)
{
if (obj.nextSibling)
{
obj.firstChild.src = (obj.nextSibling.style.display == 'none') ? 'images/catsnip/collapse.gif' : 'images/catsnip/expand.gif';
obj.firstChild.alt = (obj.nextSibling.style.display == 'none') ? 'Minimieren' : 'Maximieren';
obj.nextSibling.style.display = (obj.nextSibling.style.display == 'none') ? 'block' : 'none';
}
}
// --></script>
</head>
<?php
function bbcode($text)
{
$text = nl2br($text);
$text = str_replace("[ B ]","<b>",$text);
$text = str_replace("[ /B ]","</b>",$text);
$text = str_replace("[ I ]","<i>",$text);
$text = str_replace("[ /I ]","</i>",$text);
$text = str_replace("[ U ]","<u>",$text);
$text = str_replace("[ /U ]","</u>",$text);
$text = eregi_replace("\\[url=([^\\[]*)\\]([^\\[]*)\\[/url\\]","<a href=\"\\1\" target=\"_blank\">\\2</a>",$text);
$text = eregi_replace("\\[url\\]([^\\[]*)\\[/url\\]","<a href=\"\\1\" target=\"_blank\">\\1</a>",$text);
$text = eregi_replace("\\[email=([^\\[]*)\\]([^\\[]*)\\[/email\\]","<a href=\"mailto:\\1\">\\2</a>",$text);
$text = eregi_replace("\\[ img]([^\\[]*)\\[ /img]","<img src=\"\\1\" border=0>",$text);
$text = preg_replace('#\[toggle=(.*?)\](.*?)\[/toggle\]#si', '<a onClick="toggle2(this)"><img src="images/catsnip/expand.gif" border="0" alt="Maximieren" align="middle" />\\1</a><div style="display: none">\\2</div>', $text);
$text = preg_replace('#\[more=(.*?)\](.*?)\[/more\]#si', '<a onClick="toggle2(this)"><img src="images/catsnip/expand.gif" border="0" alt="Maximieren" align="middle" />\\1</a><div style="display: none">\\2</div>', $text);
return $text;
}
echo bbcode('test
[more=xyt]bla[/more]');
?>
</html>
<?php
//deine abfrage
$news = $sql->fetch_array("SELECT * FROM `news` WHERE `id` = '".$_GET["id"]."'");
//deine ausgabe
echo $news["überschrift"].' von '.$news["autor"].'<br />';
//jetzt kommt der bbcode zum einsatz
echo bbcode($news["news"]);
?>
<?php
include ("inc/functions.php");
dbConnect();
checkLogin();
?>
<html>
<head>
<link rel="stylesheet" type="text/css" href="css/style.css">
<title>fastGaming - News</title>
<script type="text/javascript"><!--
function toggle2(obj)
{
if (obj.nextSibling)
{
obj.firstChild.src = (obj.nextSibling.style.display == 'none') ? 'images/catsnip/collapse.gif' : 'images/catsnip/expand.gif';
obj.firstChild.alt = (obj.nextSibling.style.display == 'none') ? 'Minimieren' : 'Maximieren';
obj.nextSibling.style.display = (obj.nextSibling.style.display == 'none') ? 'block' : 'none';
}
}
// --></script>
</head>
<body bgcolor="#CDD5D8">
<?php
// navi_left.php includen
include("inc/navi_left.php");
$sql = mysql_query("SELECT * FROM fastg_news ORDER BY id DESC LIMIT 5");
while ($row = mysql_fetch_array($sql)) {
echo " <table width=470 border=1 style=\"border-collapse: collapse\" cellpadding=2 cellspacing=0 bordercolor=#D5D7D6>\n";
echo " <tr>\n";
echo " <td>\n";
echo " <table width=460 border=0 cellpadding=3 cellspacing=2>\n";
echo " <tr>\n";
echo " <td colspan=2>".$row["title"]."</td>\n";
echo " </tr>\n";
echo " <tr valign=top>\n";
echo " <td width=331 bgcolor=#D5D7D6>".bbcode($row["text"])."<br><br><div id=\"bla\">
</div></td>\n";
echo " <td width=119 bgcolor=#D5D7D6 align=left><img src=\"images/news/".$row["image"]."\" width=119 height=58></td>\n";
echo " </tr>\n";
echo " <tr>\n";
echo " <td bgcolor=#E6E6E6 align=right colspan=2><font class=small>".$row["date"]."</font></td>\n";
echo " </tr>\n";
echo " <tr>\n";
echo " <td height=7 colspan=2></td>\n";
echo " </tr>\n";
echo " </table></td>\n";
echo " </tr>\n";
echo " </table><br>\n";
}
$new_pos_prev = $pos-$count;
if ($new_pos_prev <= 0) {
echo "<< zurück || ";
} else {
echo "<a href=news.php?pos=".$new_pos_prev."><< zurück</a> || ";
}
$new_pos_next = $pos+$count;
if ($new_pos_next >= $no_data) {
echo "weiter >>";
} else {
echo "<a href=news.php?pos=".$news_pos_next.">weiter >></a>";
}
echo "<br>";
// navi_right.php includen
include("inc/navi_right.php");
?>
</body>
</html>